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
/
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
60 sed -i "s/DALLOW_NIGHTLY_BUILDS=YES/DALLOW_NIGHTLY_BUILDS=NO/g" ..
/debian
/rules
63 # remove old package and prepare new one
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"
71 echo " dput ppa:opentx-test/rel opentx-companion22_<version>.changes"