summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-09-19 17:18:54 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-10-06 12:47:03 (GMT)
commit7304bbb2e43c80e242bc871f584f67bf58ccea80 (patch)
tree3e556b34ba452e0527931dc38e266b0f20710c73
parentd187326ee49950dbe7702471ebc7c58ce1bdfb60 (diff)
downloadiRony-7304bbb2e43c80e242bc871f584f67bf58ccea80.tar.gz
Add autogen.sh
-rw-r--r--autogen.sh71
1 files changed, 71 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh
new file mode 100644
index 0000000..5112e74
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+package="iRony"
+
+chwala_dir="../kolab-chwala.git/"
+roundcube_dir="../roundcubemail.git/"
+roundcube_plugins_dir="../roundcubemail-plugins-kolab.git/"
+
+if [ $# -ne 1 ]; then
+ echo "Usage: $0 <version>"
+ exit 1
+fi
+
+version=$1
+
+if [ ! -z "$(git tag -l | grep -E '${package}-${version}$')" ]; then
+ echo "Version ${version} already exists"
+ exit 1
+fi
+
+if [ ! -d "${chwala_dir}/lib" ]; then
+ echo "No directory ${chwala_dir}/lib/"
+ exit 1
+fi
+
+if [ ! -d "${roundcube_dir}/program/lib/Roundcube/" ]; then
+ echo "No directory ${roundcube_dir}/program/lib/Roundcube/"
+ exit 1
+fi
+
+if [ ! -d "${roundcube_plugins_dir}/plugins/" ]; then
+ echo "No directory ${roundcube_plugins_dir}/plugins/"
+ exit 1
+fi
+
+if [ -f "./composer.phar" ]; then
+ git clean -d -f -x
+ rm -rf vendor/
+fi
+
+cp -a ${chwala_dir}/lib lib/FileAPI
+cp -a ${roundcube_dir}/program/lib/Roundcube/ lib/Roundcube
+cp -a ${roundcube_plugins_dir}/plugins/ lib/plugins
+
+curl -sS https://getcomposer.org/installer | php
+
+if [ $? -ne 0 ]; then
+ echo "Getting composer failed... Bye!"
+ exit 1
+fi
+
+./composer.phar install
+
+if [ $? -ne 0 ]; then
+ echo "Running ./composer.phar install failed... Bye!"
+ exit 1
+fi
+
+if [ -d "../${package}-${version}/" ]; then
+ rm -rf ../${package}-${version}/
+fi
+
+mkdir -p ../${package}-${version}/
+cp -a * ../${package}-${version}/.
+find ../${package}-${version}/ -type d -name ".git" -exec rm -rf {} \; 2>/dev/null
+
+pwd=$(pwd)
+pushd ..
+tar czvf ${pwd}/${package}-${version}+dep.tar.gz ${package}-${version}/
+popd
+git archive --prefix=${package}-${version}/ HEAD | gzip -c > ${package}-${version}.tar.gz