kwo pushed a commit to branch master.

http://git.enlightenment.org/e16/e16.git/commit/?id=a35ea6198029999a7732b72f943cb65f9e6ddc88

commit a35ea6198029999a7732b72f943cb65f9e6ddc88
Author: Kim Woelders <k...@woelders.dk>
Date:   Sat Mar 7 10:36:12 2020 +0100

    Spec file: Add git tag to rpm file name (if built from git checkout)
---
 Makefile.am  | 17 +++++++++++++++++
 configure.ac |  4 +---
 e16.spec.in  |  2 +-
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 69cc4d69..bab81333 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,12 +10,29 @@ MAINTAINERCLEANFILES = aclocal.m4 config.* compile 
configure depcomp \
                       po/*.header po/*.sed po/*.sin po/e16.pot \
                       *~ */*~
 
+CLEANFILES = $(PACKAGE).spec
+
 SUBDIRS = dox eesh epp src lib config themes fonts scripts misc docs icons pix 
po
 
 EXTRA_DIST = \
+$(PACKAGE).spec.in \
 sample-scripts/bouncingball.pl \
 sample-scripts/lcdmover.sh \
 sample-scripts/testroller.pl \
 sample-scripts/shade-pagers.pl \
 sample-scripts/place-pagers.pl \
 AUTHORS COMPLIANCE COPYING ChangeLog
+
+if SRC_IS_GIT
+RPM_RELEASE=`echo -n "1.%(date '+%y%m%d').git"; git rev-parse --short=8 HEAD`
+else
+RPM_RELEASE=1
+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:
diff --git a/configure.ac b/configure.ac
index 098dee45..d4c70e91 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,6 @@
 m4_define([pkg_version],  [1.0.21])
 m4_define([pkg_revision], [000])
 m4_define([pkg_version],  m4_ifdef([pkg_revision], [pkg_version.pkg_revision], 
[pkg_version]))
-m4_define([rpm_revision], m4_ifdef([pkg_revision], ["0.%(date '+%y%m%d')"], 
[1]))
 
 AC_INIT([e16],[pkg_version],[enlightenment-de...@lists.sourceforge.net])
 AM_INIT_AUTOMAKE([foreign dist-xz])
@@ -9,7 +8,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 AC_CONFIG_MACRO_DIR([m4])
 
-AC_SUBST(E_RPM_REVISION, [rpm_revision])
+AM_CONDITIONAL(SRC_IS_GIT, m4_ifdef([pkg_revision], [test -d $srcdir/.git], 
[false]))
 
 AC_USE_SYSTEM_EXTENSIONS
 
@@ -460,7 +459,6 @@ scripts/Makefile
 misc/Makefile
 docs/Makefile
 po/Makefile.in
-e16.spec
 ])
 AC_OUTPUT
 
diff --git a/e16.spec.in b/e16.spec.in
index f11de399..355c3001 100644
--- a/e16.spec.in
+++ b/e16.spec.in
@@ -1,7 +1,7 @@
 Summary:       The Enlightenment window manager, DR16.
 Name:          @PACKAGE@
 Version:       @VERSION@
-Release:       
@E_RPM_REVISION@%{?_rpm_pkg_ext:%{_rpm_pkg_ext}}%{?_vendorsuffix:.%{_vendorsuffix}}
+Release:       
@RPM_RELEASE@%{?_rpm_pkg_ext:%{_rpm_pkg_ext}}%{?_vendorsuffix:.%{_vendorsuffix}}
 License:       BSD
 Group:         User Interface/Desktops
 URL:           http://www.enlightenment.org/

-- 


Reply via email to