summaryrefslogtreecommitdiff
path: root/release.sh
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2010-05-11 18:02:37 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2010-05-11 18:04:49 +0200
commitcd6bfb92c8cf8bb18a77d84e3592002123f3407e (patch)
treecd6cf2a15cfd4583884f57c56100cd62bf1e56e2 /release.sh
parente87628fae9c1277e96be51fadb223b4605717437 (diff)
downloadportato-cd6bfb92c8cf8bb18a77d84e3592002123f3407e.tar.gz
portato-cd6bfb92c8cf8bb18a77d84e3592002123f3407e.tar.bz2
portato-cd6bfb92c8cf8bb18a77d84e3592002123f3407e.zip
Add a release file
Diffstat (limited to 'release.sh')
-rwxr-xr-xrelease.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/release.sh b/release.sh
new file mode 100755
index 0000000..c2c5b62
--- /dev/null
+++ b/release.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+fail ()
+{
+ echo ERROR: $1
+ exit $2
+}
+
+replace_by ()
+{
+ echo ">>> ** Replace $1 by $2"
+
+ sed -i -e "s#^\($1\s*=\s*\).*#\1$2#" portato/constants.py \
+ || fail "Failure replacing $1" 1
+}
+
+ver=$(git describe --tags)
+name=portato-$ver
+
+echo ">>> Cloning..."
+git clone . $name || fail "Cloning" 1
+
+pushd $name > /dev/null
+
+echo ">>> Compiling Cython sources"
+find -name '*.pyx' | xargs cython || fail "Cython" 1
+
+echo ">>> Patching constants.py"
+replace_by VERSION "'$ver'"
+replace_by ROOT_DIR "'/'"
+replace_by TEMPLATE_DIR "pjoin(ROOT_DIR, '/usr/share/locale')"
+replace_by DATA_DIR "'/usr/share/portato/'"
+
+echo ">>> Patching setup.py."
+sed -i -e "s/^.*#!REMOVE\$//" setup.py || fail "Failure removing lines" 1
+sed -i -e "s/^\(\s*\)#!INSERT \(.*\)/\1\2/" setup.py || fail "Failure inserting lines" 1
+
+popd > /dev/null
+
+echo ">>> Packing"
+tar -zcvf ${name}.tar.gz $name --exclude ".git*" || fail "Packing" 1
+
+echo ">>> Removing temp dir"
+rm -rf $name || fail "Removing" 1