Fix build of 'make dist' generated tarballs
authorRicardo Mones <ricardo@mones.org>
Thu, 21 Mar 2013 00:32:39 +0000 (01:32 +0100)
committerRicardo Mones <ricardo@mones.org>
Thu, 21 Mar 2013 00:46:18 +0000 (01:46 +0100)
The version is set in stone before the 'make dist' run.
In the cases where no .git directory is found, like generated
tarballs, the stone is summoned instead.

.gitignore
Makefile.am
configure.ac
version.in [new file with mode: 0644]

index c5fd1e30e1e69ed02071206785f7b36ff829aada..ced542e1fd68970d709a759a49ce50837f9e5c3c 100644 (file)
 /TAGS
 /tools/Makefile
 /tools/Makefile.in
+/version
index 05788ec265447323bcbc805e821a00d9251aba41..fa09d872518758930e978d1f853ae77603962e3e 100644 (file)
@@ -15,7 +15,9 @@ EXTRA_DIST = \
        claws-mail.desktop \
        claws-mail.png \
        autogen.sh \
-       claws-features.h.in
+       claws-features.h.in \
+       version.in \
+       version
 
 # hicolor icon theme, base class of all icon themes
 pixmapdir=$(datadir)/icons/hicolor/48x48/apps
index 94b0ab2a2ff945e35f40ed7a13b2c89d6a7248c6..e129d9fceb274c6995423e0b1c97274c325def29 100644 (file)
@@ -12,7 +12,11 @@ BINARY_AGE=0
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
-GIT_VERSION=`git describe --abbrev=6 --dirty --always`
+if test \( -d .git \); then
+    GIT_VERSION=`git describe --abbrev=6 --dirty --always`
+else
+    GIT_VERSION=`sh -c '. ./version'`
+fi
 MAJOR_VERSION=`echo $GIT_VERSION | awk -F. '{print $1}'`
 MINOR_VERSION=`echo $GIT_VERSION | awk -F. '{print $2}'`
 MICRO_VERSION=`echo $GIT_VERSION | awk -F- '{print $1}' | awk -F. '{print $3}'`
@@ -1892,6 +1896,7 @@ manual/de/dist/ps/Makefile
 manual/de/dist/html/Makefile
 manual/de/dist/txt/Makefile
 claws-mail.pc
+version
 ])
 
 dnl Output the configuration summary
diff --git a/version.in b/version.in
new file mode 100644 (file)
index 0000000..141efac
--- /dev/null
@@ -0,0 +1 @@
+echo "@GIT_VERSION@"