summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2019-10-13 21:30:09 +0200
committerKim Woelders <kim@woelders.dk>2021-07-10 15:44:17 +0200
commit240857af990a621d64eeaa1c15672a8a167520cf (patch)
tree1422da7d9dab24a794885cc506d5ec044436ef16 /Makefile.am
parent407533ebdc9882e8567dd309154c9c3881c31027 (diff)
downloadimlib2-240857af990a621d64eeaa1c15672a8a167520cf.tar.gz
Spec file: Add git tag to rpm file name (if built from git checkout)
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am22
1 files changed, 19 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index 8e4421d..47b2c0e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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: