This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository e16.

View the commit online.

commit de0dcfadb937098d194ad1989cadc518f4f0e9fd
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Sat Oct 22 08:12:46 2022 +0200

    autofoo: Rework git tag/release stuff
    
    - Add 'release' target to make dist without git tag in rpm name and
      version string.
    - Use .git-src (not .git) to test if we are building from git.
---
 .git-src     |  0
 Makefile.am  | 32 +++++++++++++++++++-------------
 configure.ac |  2 --
 3 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/.git-src b/.git-src
new file mode 100644
index 00000000..e69de29b
diff --git a/Makefile.am b/Makefile.am
index e0ef1d5a..b7f868cf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,24 +25,30 @@ sample-scripts/shade-pagers.pl \
 sample-scripts/place-pagers.pl \
 AUTHORS COMPLIANCE COPYING ChangeLog
 
-if SRC_IS_GIT
 version.h: FORCE
-	@echo '#define E16_VERSION "'`git describe --dirty`'"' > $@.tmp
+	@if [ -f $(top_srcdir)/.git-src -a -z "$(release)" ]; then \
+	  echo '#define E16_VERSION "'`git describe --dirty`'"' > $@.tmp; \
+	else \
+	  echo '#define E16_VERSION "@VERSION@"' > $@.tmp; \
+	fi
 	@if cmp -s $@.tmp $@; then rm $@.tmp; else mv $@.tmp $@; fi
 
-RPM_RELEASE=`echo -n "1.%(date '+%y%m%d').git"; git rev-parse --short=8 HEAD`
-else
-version.h: FORCE
-	@echo '#define E16_VERSION "@VERSION@"' > $@.tmp
-	@if cmp -s $@.tmp $@; then rm $@.tmp; else mv $@.tmp $@; fi
-
-RPM_RELEASE=1
-endif
-
 dist-hook: $(top_builddir)/$(PACKAGE).spec
 
+RPR_DEV = `echo -n "1.%(date '+%y%m%d').git"; git rev-parse --short=8 HEAD`
+RPR_REL = 1
+SED_DEV = "s/\@PACKAGE\@/@PACKAGE@/;s/\@VERSION\@/@VERSION@/;s/\@RPM_RELEASE\@/$(RPR_DEV)/"
+SED_REL = "s/\@PACKAGE\@/@PACKAGE@/;s/\@VERSION\@/@VERSION@/;s/\@RPM_RELEASE\@/$(RPR_REL)/"
+
 $(top_builddir)/$(PACKAGE).spec: FORCE
-	sed "s/\@PACKAGE\@/@PACKAGE@/;s/\@VERSION\@/@VERSION@/;s/\@RPM_RELEASE\@/$(RPM_RELEASE)/" \
-		$(top_srcdir)/$(PACKAGE).spec.in > $@
+	@if [ -f $(top_srcdir)/.git-src -a -z "$(release)" ]; then \
+	  sed $(SED_DEV) $(top_srcdir)/$(PACKAGE).spec.in > $@; \
+	else \
+	  sed $(SED_REL) $(top_srcdir)/$(PACKAGE).spec.in > $@; \
+	fi
+
+.PHONY: release
+release:
+	$(MAKE) dist release=y
 
 FORCE:
diff --git a/configure.ac b/configure.ac
index f573f27d..2d010824 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,8 +4,6 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 AC_CONFIG_MACRO_DIR([m4])
 
-AM_CONDITIONAL(SRC_IS_GIT, test -d $srcdir/.git)
-
 AC_USE_SYSTEM_EXTENSIONS
 
 AC_PROG_CC

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to