Spec file: Add git tag to rpm file name (if built from git checkout)

This commit is contained in:
Kim Woelders 2019-10-13 21:30:09 +02:00
parent 407533ebdc
commit 240857af99
3 changed files with 22 additions and 5 deletions

View File

@ -4,6 +4,8 @@ ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src data doc
CLEANFILES = $(PACKAGE).spec
MAINTAINERCLEANFILES = aclocal.m4 compile \
config.guess config.h.in config.sub configure \
depcomp install-sh ltmain.sh missing Makefile.in \
@ -14,8 +16,22 @@ bin_SCRIPTS = imlib2-config
EXTRA_DIST = AUTHORS COPYING COPYING-PLAIN gendoc \
Doxyfile \
README.in README \
imlib2.pc.in \
imlib2.spec.in imlib2.spec
$(PACKAGE).pc.in \
$(PACKAGE).spec.in
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = imlib2.pc
pkgconfig_DATA = $(PACKAGE).pc
if SRC_IS_GIT
RPM_RELEASE=`echo -n "1.%(date '+%y%m%d').git"; git rev-parse --short=8 HEAD`
else
RPM_RELEASE=`echo -n "1.%(date '+%y%m%d')"`
endif
dist-hook: $(top_builddir)/$(PACKAGE).spec
$(top_builddir)/$(PACKAGE).spec: FORCE
sed "s/\@PACKAGE\@/@PACKAGE@/;s/\@VERSION\@/@VERSION@/;s/\@RPM_RELEASE\@/$(RPM_RELEASE)/" \
$(top_srcdir)/$(PACKAGE).spec.in > $@
FORCE:

View File

@ -7,6 +7,8 @@ AC_CANONICAL_HOST
AM_INIT_AUTOMAKE(1.6 dist-bzip2)
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_CONDITIONAL(SRC_IS_GIT, test -d $srcdir/.git)
AC_C_BIGENDIAN
AC_PROG_CC
AM_PROG_AS
@ -397,7 +399,6 @@ data/images/Makefile
doc/Makefile
imlib2-config
README
imlib2.spec
])
AC_CONFIG_COMMANDS([default],[
chmod +x imlib2-config

View File

@ -1,7 +1,7 @@
Summary: Powerful image loading and rendering library
Name: @PACKAGE@
Version: @VERSION@
Release: 1.%(date '+%y%m%d')
Release: @RPM_RELEASE@
License: BSD
Group: System Environment/Libraries
URL: http://www.enlightenment.org