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 (limited to '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 From 3816f2cfdfdb8a4f0dbb90a8c5b554f0b3a7e463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Tue, 11 May 2010 18:41:30 +0200 Subject: Add a README message to the release --- release.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'release.sh') diff --git a/release.sh b/release.sh index c2c5b62..254a3bb 100755 --- a/release.sh +++ b/release.sh @@ -14,7 +14,7 @@ replace_by () || fail "Failure replacing $1" 1 } -ver=$(git describe --tags) +ver=$(git describe --tags | sed -e "s/^v//") name=portato-$ver echo ">>> Cloning..." @@ -35,6 +35,19 @@ 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 +echo ">>> Creating README" +cat << EOF > README +This package is intended solely for being used system-wide (normally installed via Portage). + +If you want to have a packed version (for whatever reason), please use one of the following sources: + +* Packed snapshot: http://git.necoro.eu/portato.git/snapshot/portato-v${ver}.tar.gz +* Git Tree: git clone git://necoro.eu/portato.git --> cd portato --> git checkout -b v${ver} v${ver} + +In both cases you should read: http://necoro.eu/portato/development + +EOF + popd > /dev/null echo ">>> Packing" -- cgit v1.2.3 From 8c016e8ace989e3e1d0dadd7e54e61849341168f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Tue, 11 May 2010 19:33:22 +0200 Subject: Fix release script pathes --- release.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'release.sh') diff --git a/release.sh b/release.sh index 254a3bb..9a3936f 100755 --- a/release.sh +++ b/release.sh @@ -28,7 +28,8 @@ 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 LOCALE_DIR "pjoin(ROOT_DIR, '/usr/share/locale')" +replace_by TEMPLATE_DIR "pjoin(ROOT_DIR, DATA_DIR, 'templates')" replace_by DATA_DIR "'/usr/share/portato/'" echo ">>> Patching setup.py." -- cgit v1.2.3