diff options
| author | ruki <[email protected]> | 2017-04-07 09:53:29 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-04-07 09:53:29 +0800 |
| commit | 3085ff44c910916e6378982f14a9bbf2bcbe50ac (patch) | |
| tree | 44df0acc22951703b8ee9ff2861bbd14ac95bcbb /scripts/makeppa | |
| parent | 9f65a2f1b69d54a4d15d135f4b3058a989a57429 (diff) | |
add makeppa script and debian
Diffstat (limited to 'scripts/makeppa')
| -rwxr-xr-x | scripts/makeppa | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/scripts/makeppa b/scripts/makeppa new file mode 100755 index 000000000..1a7ddaacf --- /dev/null +++ b/scripts/makeppa @@ -0,0 +1,76 @@ +#!/bin/bash + +# check +if [ $# -lt 1 ]; then + echo "Usage: ./scripts/makeppa [version]" + exit +fi + +# workdir +workdir=./xmake-ppa +if [ ! -d $workdir ]; then + mkdir $workdir +fi + +# version +version=$1 + +# tarball +tarball=$workdir/xmake-$version.tar.gz +if [ ! -f $tarball ]; then + wget https://github.com/tboox/xmake/archive/v$version.tar.gz -O $workdir/xmake-$version.tar.gz +fi + +# extract tarball +cd $workdir +if [ ! -d xmake-$version ]; then + tar -xvf xmake-$version.tar.gz +fi + +# enter project directory +cd xmake-$version + +# make template +echo "making template .." +if [ -d debian ]; then + rm -rf debian +fi +dh_make -e [email protected] -c apache -y -s -f ../xmake-$version.tar.gz + +# copy debian +echo "instaling debian .." +if [ -d debian ]; then + rm -rf debian +fi +cp -r ../../scripts/debian . + +# build package +echo "building package .." +debuild -S -k8A0FFB63 + +# check package +echo "checking package .." +lintian ../xmake_$version-1.dsc + +# upload package +while true; do + read -p "Do you wish to upload this package? (y/n)" yn + case $yn in + [Yy]* ) dput ppa:waruqi/xmake ../xmake_$version-1_source.changes; break;; + [Nn]* ) exit;; + * ) echo "Please answer y or n.";; + esac +done + +# remove workdir +cd ../.. +while true; do + read -p "Do you wish to remove working directory? (y/n)" yn + case $yn in + [Yy]* ) rm -rf xmake-ppa; break;; + [Nn]* ) exit;; + * ) echo "Please answer y or n.";; + esac +done + + |
