Created
April 18, 2012 15:48
-
-
Save stefanbirkner/2414463 to your computer and use it in GitHub Desktop.
Playdeb builds a debian package of the play framework.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# playdeb builds a debian package of the play framework. playdeb downloads | |
# the playframework by itself. You run it by | |
# playdeb.sh <version> <maintainer> | |
# Example: | |
# playdeb.sh 1.2.3 "Denny Colt <[email protected]>" | |
# | |
# The script has been tested with version 1.2.3. | |
if [ -z $1 ] | |
then | |
echo "Usage: playdeb.sh <Version> <Maintainer>" | |
echo -e "Example: playdeb.sh 1.2.3 \"Denny Colt <[email protected]>\"" | |
exit 1 | |
fi | |
if [ -z $2 ] | |
then | |
echo "The maintainer is missing. Please provide it as second argument." | |
exit 1 | |
fi | |
export DEBEMAIL=$2 | |
set -e | |
wget http://download.playframework.org/releases/play-${1}.zip | |
unzip play-${1}.zip | |
tar -czf play_${1}.orig.tar.gz play-${1} | |
cd play-${1} | |
mkdir debian | |
export QUILT_PATCHES=debian/patches | |
export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index" | |
quilt new modifystartscript.diff | |
quilt add play | |
sed -i "s:sys.path.append.*:sys.path.append('/usr/share/play/framework/pym'):g" play | |
sed -i "s: play_env\[.basedir.\].*: play_env['basedir']='/usr/share/play':g" play | |
quilt refresh | |
quilt pop -a | |
dch --create -v ${1} --package play "Created from play-${1}.zip via playdeb.sh" | |
echo 8 > debian/compat | |
echo "Source: play" > debian/control | |
echo "Maintainer: $2" >> debian/control | |
echo "Section: misc" >> debian/control | |
echo "Priority: optional" >> debian/control | |
echo "Standards-Version: 3.9.2" >> debian/control | |
echo "Build-Depends: debhelper (>= 8)" >> debian/control | |
echo "Homepage: http://www.playframework.org" >> debian/control | |
echo "" >> debian/control | |
echo "Package: play" >> debian/control | |
echo "Architecture: any" >> debian/control | |
echo "Description: A framework to build web applications with Java & Scala." >> debian/control | |
echo " It is a web framework based on a lightweight, stateless, web-friendly architecture." >> debian/control | |
cp COPYING debian/copyright | |
echo "documentation/*" >> debian/play.docs | |
echo "README.textile" >> debian/play.docs | |
echo "framework usr/share/play" >> debian/play.install | |
echo "modules usr/share/play" >> debian/play.install | |
echo "python usr/share/play" >> debian/play.install | |
echo "resources usr/share/play" >> debian/play.install | |
echo "play usr/bin" >> debian/play.install | |
echo "samples-and-tests usr/share/play" >> debian/play.install | |
echo "support usr/share/play" >> debian/play.install | |
echo "#!/usr/bin/make -f" >> debian/rules | |
echo "%:" >> debian/rules | |
echo -e "\tdh \$@" >> debian/rules | |
mkdir -p debian/source | |
echo "3.0 (quilt)" > debian/source/format | |
debuild -us -uc | |
#clean up | |
cd .. | |
rm -rf play-${1} | |
rm *.build | |
rm *.changes | |
rm *.tar.gz | |
rm *.dsc | |
rm *.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment