summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-08-09 13:07:14 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-08-09 13:07:14 (GMT)
commit6cf887fe6a3b1498d5e6bbda430e416c62d2c009 (patch)
treef23920261e7afc08742290eb6387f625c09f974a
parent9801ff66262387672112214de75d53e0871a7720 (diff)
downloadlibcalendaring-6cf887fe6a3b1498d5e6bbda430e416c62d2c009.tar.gz
Add autogen.sh
-rwxr-xr-xautogen.sh72
1 files changed, 72 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..f4999de
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+
+dobuild=0
+doprep=0
+dotest=0
+doinstall=0
+
+srcdir=$(pwd)
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ --build|-b)
+ dobuild=1
+ shift
+ ;;
+
+ --prep|-p)
+ doprep=1
+ shift
+ ;;
+
+ --test|-t)
+ dotest=1
+ shift
+ ;;
+
+ --install|-i)
+ doinstall=1
+ shift
+ ;;
+
+ esac
+done
+
+if [ ${dobuild} -eq 0 -a ${doprep} -eq 0 -a ${dotest} -eq 0 -a ${doinstall} -eq 0 ]; then
+ dobuild=1
+ doprep=1
+ dotest=1
+ doinstall=1
+fi
+
+# Rebuilds the entire foo in one go. One shot, one kill.
+rm -rf build/
+mkdir -p build
+cd build
+if [ ${doprep} -eq 1 ]; then
+ cmake \
+ -DCMAKE_VERBOSE_MAKEFILE=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DLIB_INSTALL_DIR=/usr/lib64 \
+ ..
+fi
+
+if [ ${dobuild} -eq 1 ]; then
+ make
+fi
+
+if [ ${dotest} -eq 1 ]; then
+ # Execute some tests?
+ echo "Executing tests"
+fi
+
+if [ ${doinstall} -eq 1 ]; then
+ make install DESTDIR=${TMPDIR:-/tmp}
+fi
+
+cd ..
+
+git archive --prefix=libcalendaring/ HEAD | gzip -c > libcalendaring.tar.gz
+
+cp libcalendaring.tar.gz `rpm --eval='%{_sourcedir}'`
+