summaryrefslogtreecommitdiffstats
path: root/autogen.sh
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-10-01 10:47:54 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-10-01 10:47:54 +0100
commitf307fa060929335312827b55fa2edd524167cc1b (patch)
treeff8e5e08c769b26ec46939718bb28a5952cf5596 /autogen.sh
parent566d75bd4080ac507ec20f4ba001c2866358ae5a (diff)
downloadlibkolab-f307fa060929335312827b55fa2edd524167cc1b.tar.gz
Fix autogen.sh to use the major, minor and teeny (if set) from CMakeLists.txt
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/autogen.sh b/autogen.sh
index 7ff2efc..c5cce51 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -39,6 +39,16 @@ if [ ${dobuild} -eq 0 -a ${doprep} -eq 0 -a ${dotest} -eq 0 -a ${doinstall} -eq
doinstall=1
fi
+version_major=`grep -E "^set\s*\(Libkolab_VERSION_MAJOR [0-9]+\)" CMakeLists.txt | sed -r -e 's/^set\s*\(Libkolab_VERSION_MAJOR ([0-9]+)\)/\1/g'`
+version_minor=`grep -E "^set\s*\(Libkolab_VERSION_MINOR [0-9]+\)" CMakeLists.txt | sed -r -e 's/^set\s*\(Libkolab_VERSION_MINOR ([0-9]+)\)/\1/g'`
+version_patch=`grep -E "^set\s*\(Libkolab_VERSION_PATCH [0-9]+\)" CMakeLists.txt | sed -r -e 's/^set\s*\(Libkolab_VERSION_PATCH ([0-9]+)\)/\1/g'`
+
+if [ -z "${version_patch}" ]; then
+ version="${version_major}.${version_minor}"
+else
+ version="${version_major}.${version_minor}.${version_patch}"
+fi
+
# Rebuilds the entire foo in one go. One shot, one kill.
rm -rf build/
mkdir -p build
@@ -62,6 +72,7 @@ fi
if [ ${dotest} -eq 1 ]; then
# Execute some tests?
pushd tests
+ unset DISPLAY
./benchmarktest
./calendaringtest
./formattest
@@ -78,7 +89,10 @@ fi
cd ..
-git archive --prefix=libkolab-0.3.1/ HEAD | gzip -c > libkolab-0.3.1.tar.gz
+rm -rf libkolab-${version}.tar.gz
+git archive --prefix=libkolab-${version}/ HEAD | gzip -c > libkolab-${version}.tar.gz
+
+rm -rf `rpm --eval='%{_sourcedir}'`/libkolab-${version}.tar.gz
+cp libkolab-${version}.tar.gz `rpm --eval='%{_sourcedir}'`
-cp libkolab-0.3.1.tar.gz `rpm --eval='%{_sourcedir}'`