From 557e0e8c28a77b423a3746168a3be8e8a8d5462d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Wed, 17 Aug 2016 21:08:23 +0200 Subject: [PATCH 22/39] BUILD: Clean up prerelease targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clean up the pre-release targets in order to avoid lines exceeding 80 characters. Signed-off-by: Fabiano Fidêncio Reviewed-by: Lukáš Slebodník (cherry picked from commit 01d970a8afa6ffed82b3e8dda96e08118222e16e) --- Makefile.am | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6299ac7a7bf1c2ed41dfeeda7063c8901214941a..4a56d8b0a3ea49c9fae35bf5717871ea515813b8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4202,6 +4202,14 @@ rpmroot: $(MKDIR_P) $(RPMBUILD)/SPECS $(MKDIR_P) $(RPMBUILD)/SRPMS +# pre-release related vars + +PR_VERSION_DATE := $(shell date +%Y%m%d.%H%M) +PR_VERSION_COMMIT_HASH := $(shell git log -1 --pretty=format:%h) +PR_VERSION_NUMBER = $(PR_VERSION_DATE).git$(PR_VERSION_COMMIT_HASH) +PR_VERSION_REGEX = m4_define(\[PRERELEASE_VERSION_NUMBER\], \[.*\]) +PR_VERSION_REPL = m4_define(\[PRERELEASE_VERSION_NUMBER\], \[.$(PR_VERSION_NUMBER)\]) + rpmbrprep: dist-gzip rpmroot if GIT_CHECKOUT # When we're building RPMs from a git checkout, @@ -4219,7 +4227,8 @@ rpms: rpmbrprep if GIT_CHECKOUT prerelease-rpms: cp $(srcdir)/version.m4 $(srcdir)/version.m4.orig - sed -e "s/m4_define(\[PRERELEASE_VERSION_NUMBER\], \[.*\])/m4_define(\[PRERELEASE_VERSION_NUMBER\], \[.`date +%Y%m%d.%H%M`.git`git log -1 --pretty=format:%h`\])/" < $(srcdir)/version.m4.orig > $(srcdir)/version.m4 + sed -e "s/$(PR_VERSION_REGEX)/$(PR_VERSION_REPL)/" \ + < $(srcdir)/version.m4.orig > $(srcdir)/version.m4 $(MAKE) rpms mv $(srcdir)/version.m4.orig $(srcdir)/version.m4 endif @@ -4234,7 +4243,8 @@ srpm: rpmbrprep if GIT_CHECKOUT prerelease-srpm: cp $(srcdir)/version.m4 $(srcdir)/version.m4.orig - sed -e "s/m4_define(\[PRERELEASE_VERSION_NUMBER\], \[.*\])/m4_define(\[PRERELEASE_VERSION_NUMBER\], \[.`date +%Y%m%d.%H%M`.git`git log -1 --pretty=format:%h`\])/" < $(srcdir)/version.m4.orig > $(srcdir)/version.m4 + sed -e "s/$(PR_VERSION_REGEX)/$(PR_VERSION_REPL)/" \ + < $(srcdir)/version.m4.orig > $(srcdir)/version.m4 $(MAKE) srpm mv $(srcdir)/version.m4.orig $(srcdir)/version.m4 endif -- 2.9.3