Update CREDITS.txt
[opentx.git] / launchpad / prepare.sh
blob786ed6dbfcac76874569d285528fbd133925d71a
1 #!/bin/sh
2 set -e
3 set -x
5 # $1 is distribution "trusty" OR "yakkety"
7 # Option "-n" or "--nightly" can be used to configure build script to produce a Companion with DALLOW_NIGHTLY_BUILDS=YES flag
10 cd `dirname ${0}`
12 nightly_build=0
14 while [ $# -gt 0 ]
16 case "$1" in
17 --nightly*)
18 nightly_build=1;;
19 -n*)
20 nightly_build=1;;
21 -*)
22 echo >&2 "usage: $0 [-n|--nightly] DISTRO"
23 exit 1;;
25 break;; # terminate while loop
26 esac
27 shift
28 done
31 distro=${1%/}
33 . common/suffix
35 if [ -z ${distro} ] ; then
36 echo "Missing distribution name"
37 exit 1
40 if [ ! -d ${distro} ] ; then
41 echo "Files for ${distro} not found. Most likely unsupported distribution. Aborting..."
42 exit 1
45 echo "Preparing sources for ${distro}..."
47 # prepare debian directory
48 rm -f ../debian/*
49 mkdir -p ../debian/
50 cp common/* ../debian/
51 cp ${distro}/* ../debian/
53 echo "Editing rules to set version suffix to \"${suffix}\""
54 sed -i "s/__VERSION_SUFFIX__/${suffix}/g" ../debian/rules
56 if [ ${nightly_build} -gt 0 ] ; then
57 echo "Setting nightly build flag"
58 sed -i "s/DALLOW_NIGHTLY_BUILDS=YES/DALLOW_NIGHTLY_BUILDS=YES/g" ../debian/rules
59 else
60 sed -i "s/DALLOW_NIGHTLY_BUILDS=YES/DALLOW_NIGHTLY_BUILDS=NO/g" ../debian/rules
63 # remove old package and prepare new one
64 cd ..
65 rm -f ../opentx-companion22_*${distro}*
66 debuild -S -sa -I -Ijenkins -Ilaunchpad -Idoc -Ibuild -I*.luac
68 echo "Use this command to upload to launchpad (nightly builds):"
69 echo " dput ppa:opentx-test/ppa opentx-companion22_<version>.changes"
70 echo "OR releases:"
71 echo " dput ppa:opentx-test/rel opentx-companion22_<version>.changes"