summaryrefslogtreecommitdiffstats
path: root/VERSION.m4
diff options
context:
space:
mode:
authorPetr Spacek <pspacek@redhat.com>2016-11-09 16:16:45 +0100
committerMartin Basti <mbasti@redhat.com>2016-11-11 10:41:38 +0100
commita691b7d1837595fecd37bf88a875cb0753f7e698 (patch)
tree948ffaa6e404de8add3dea4d9729a82fcc935b84 /VERSION.m4
parent3dc5d2c6f9a0fc134616c615634ae505ef753f77 (diff)
downloadfreeipa-a691b7d1837595fecd37bf88a875cb0753f7e698.tar.gz
freeipa-a691b7d1837595fecd37bf88a875cb0753f7e698.tar.xz
freeipa-a691b7d1837595fecd37bf88a875cb0753f7e698.zip
Build: IPA_VERSION_IS_GIT_SNAPSHOT re-generates version number on RPM build
This is a huge hack. rpms target will touch VERSION.m4 file. This change is then detected by automake Makefiles which subsequently re-execute configure and make. We have to workaround fact that variables in new make targets (executed after new configure) are different than original ones. Also, we have to 'bake-in' precise snapshot version from Git to VERSION.m4 inside of RPM tarball so the RPM does not depend on git anymore. All this magic slows build down a bit. Do not enable IPA_VERSION_IS_GIT_SNAPSHOT if you want fastest possible builds. The option IPA_VERSION_IS_GIT_SNAPSHOT is now enabled by default as it was before we started the build system refactoring effort. https://fedorahosted.org/freeipa/ticket/6418 Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
Diffstat (limited to 'VERSION.m4')
-rw-r--r--VERSION.m424
1 files changed, 14 insertions, 10 deletions
diff --git a/VERSION.m4 b/VERSION.m4
index 236a40635..75326fb25 100644
--- a/VERSION.m4
+++ b/VERSION.m4
@@ -46,7 +46,7 @@ define(IPA_VERSION_PRE_RELEASE, )
# This option works only with GNU m4: #
# it requires esyscmd m4 macro. #
########################################################
-define(IPA_VERSION_IS_GIT_SNAPSHOT, no)
+define(IPA_VERSION_IS_GIT_SNAPSHOT, yes)
########################################################
# The version of IPA data. This is used to identify #
@@ -105,24 +105,28 @@ dnl helper for translit in IPA_VERSION
define(NEWLINE,`
')
-define(IPA_VERSION, translit(dnl remove new lines from version (from esyscmd)
+dnl Git snapshot: 20170102030405.GITabcdefg
+define(IPA_GIT_VERSION, translit(dnl remove new lines from version (from esyscmd)
ifelse(IPA_VERSION_IS_GIT_SNAPSHOT, yes,dnl
-dnl Git snapshot: 1.0.0.20170102030405.GITabcdefg
-IPA_VERSION_MAJOR.IPA_VERSION_MINOR.IPA_VERSION_RELEASE.dnl 1.0.0
esyscmd(date -u +'%Y%m%d%H%M')dnl 20170102030405
.GIT
esyscmd(git log -1 --format="%h" HEAD),dnl abcdefg
-dnl Git end
-ifelse(IPA_VERSION_PRE_RELEASE, ,
-dnl Release version: 1.0.0
-IPA_VERSION_MAJOR.IPA_VERSION_MINOR.IPA_VERSION_RELEASE,
-dnl Pre-release: 1.0.0rc1; newline separates m4 tokens
+), NEWLINE))
+dnl IPA_GIT_VERSION end
+
+define(IPA_VERSION, translit(dnl remove new lines from version (from esyscmd)
+dnl 1.0.0
IPA_VERSION_MAJOR.IPA_VERSION_MINOR.IPA_VERSION_RELEASE
-IPA_VERSION_PRE_RELEASE)),
+IPA_VERSION_PRE_RELEASE
+dnl version with Git snapshot: 1.0.0.20170102030405.GITabcdefg
+ifelse(IPA_VERSION_IS_GIT_SNAPSHOT, yes,
+.
+IPA_GIT_VERSION),
NEWLINE)) dnl IPA_VERSION end
dnl DEBUG: uncomment following lines and run command m4 VERSION.m4
dnl `IPA_VERSION: ''IPA_VERSION'
+dnl `IPA_GIT_VERSION: ''IPA_GIT_VERSION'
dnl `IPA_API_VERSION: ''IPA_API_VERSION'
dnl `IPA_DATA_VERSION: ''IPA_DATA_VERSION'
dnl `IPA_NUM_VERSION: ''IPA_NUM_VERSION'