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
22 echo >&2 "usage: $0 [-n|--nightly] DISTRO"
25 break;; # terminate while loop
35 if [ -z ${distro} ] ; then
36 echo "Missing distribution name"
40 if [ ! -d ${distro} ] ; then
41 echo "Files for ${distro} not found. Most likely unsupported distribution. Aborting..."
45 echo "Preparing sources for ${distro}..."
47 # prepare debian directory
50 cp common
/* ..
/debian
/
51 cp ${distro}/* ..
/debian
/
54 if [ ${nightly_build} -gt 0 ] ; then
55 echo "Editing rules to set version suffix to \"${suffix}\""
56 sed -i "s/__VERSION_SUFFIX__/${suffix}/g" ..
/debian
/rules
57 echo "Setting nightly build flag"
58 sed -i "s/DALLOW_NIGHTLY_BUILDS=YES/DALLOW_NIGHTLY_BUILDS=YES/g" ..
/debian
/rules
60 sed -i "s/__VERSION_SUFFIX__//g" ..
/debian
/rules
61 sed -i "s/DALLOW_NIGHTLY_BUILDS=YES/DALLOW_NIGHTLY_BUILDS=NO/g" ..
/debian
/rules
64 # remove old package and prepare new one
66 rm -f ..
/opentx-companion22_
*${distro}*
67 debuild
-S -sa -I -Ijenkins -Ilaunchpad -Idoc -Ibuild -I*.luac
69 echo "Use this command to upload to launchpad (nightly builds):"
70 echo " dput ppa:opentx-test/ppa opentx-companion22_<version>.changes"
72 echo " dput ppa:opentx-test/rel opentx-companion22_<version>.changes"