From cd6bfb92c8cf8bb18a77d84e3592002123f3407e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Tue, 11 May 2010 18:02:37 +0200 Subject: Add a release file --- release.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 release.sh 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 -- cgit v1.2.3