From: Robin Dunn Date: Tue, 28 Nov 2006 23:24:06 +0000 (+0000) Subject: Added scripts to build debian packages X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/670717736fd928bf1a4709b4b94624c19e56f761?ds=inline Added scripts to build debian packages git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43712 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/distrib/all/build-all b/wxPython/distrib/all/build-all index 373d788a7c..aca8fbba8a 100755 --- a/wxPython/distrib/all/build-all +++ b/wxPython/distrib/all/build-all @@ -88,11 +88,16 @@ def getTasks(config_env): # Job("co-mdk2006.24","distrib/all/build-rpm", ["beast", "co-mdk2006", "mdk2006", "2.4"], env=config_env), ]) + xavierTask = Task([ + Job("xavier", "distrib/all/build-deb", ["xavier", "/work/chroot/dapper", "dapper"], env=config_env), + ]) + buildTasks = [ #jaguarTask, pantherTask, tigerTask, beastTask1, beastTask2, + xavierTask, ] # Finalization. This is for things that must wait until all the @@ -121,7 +126,8 @@ def usage(): print " skipdocs Don't rebuild the docs" print " skipwin Don't do the remote Windows build" print " skiposx Don't do the remote OSX build" - print " skiplinux Don't do the remote Linux (RPM) build" + print " skiprpm Don't do the remote Linux (RPM) build" + print " skipdeb Don't do the remote Linux (DEB) build" print " skipclean Don't do the cleanup step on the remote builds" print " skipupload Don't upload the builds to starship" print " ansi Also do the ansi builds" @@ -166,8 +172,11 @@ def main(args): elif flag == "skiposx": config.skiposx = "yes" - elif flag == "skiplinux": - config.skiplinux = "yes" + elif flag == "skipdeb": + config.skipdeb = "yes" + + elif flag == "skiprpm": + config.skiprpm = "yes" elif flag == "skipclean": config.skipclean = "yes" @@ -198,7 +207,8 @@ def main(args): file("DAILY_BUILD", "w").write(config.DAILY) sys.path.append('.') import setup - config.VERSION = setup.VERSION + v = config.VERSION = setup.VERSION + config.VER2 = '.'.join(v.split('.')[:2]) config_env = config.asDict() config_env.update(os.environ) diff --git a/wxPython/distrib/all/build-deb b/wxPython/distrib/all/build-deb new file mode 100755 index 0000000000..0686fb2879 --- /dev/null +++ b/wxPython/distrib/all/build-deb @@ -0,0 +1,53 @@ +#!/bin/bash +#---------------------------------------------------------------------- + +set -o errexit +#set -o xtrace + +host=$1 +chRootRoot=$2 +chRootName=$3 + + +function TestOnline { + local host=$1 + local message=$2 + + if ping -q -c1 -w1 $host > /dev/null; then + return 0 + else + return 1 + fi +} + + + +if [ $skipdeb != yes ]; then + # We use a chroot environment on th elocal machine for the debian + # builds, so this build is pretty simple. Just copy the tarball + # and a build script to /tmp, and then run do-build-deb in the + # chroot. + + if TestOnline $host; then + + echo "The $host machine is online, build continuing..." + + echo "Copying source files and build script..." + ssh root@$host "mkdir -p $chRootRoot/$LINUX_BUILD && rm -rf $chRootRoot/$LINUX_BUILD/*" + scp $STAGING_DIR/wxPython-src* distrib/all/do-build-deb \ + root@$host:$chRootRoot/$LINUX_BUILD + + ssh root@$host "dchroot --chroot $chRootName --directory $LINUX_BUILD \"do-build-deb $VERSION $VER2\"" + + echo "Fetching the results..." + mkdir -p $STAGING_DIR/$chRootName + ssh root@$host "rm $chRootRoot/$LINUX_BUILD/do-build-deb" + scp "root@$host:$chRootRoot/$LINUX_BUILD/*" $STAGING_DIR/$chRootName + ssh root@$host "rm $chRootRoot/$LINUX_BUILD/*" + echo "Done!" + else + echo "The $host machine is **OFFLINE**, skipping the binary DEB build." + exit 0 + fi +fi + diff --git a/wxPython/distrib/all/build-environ.cfg b/wxPython/distrib/all/build-environ.cfg index c0332e56f4..df59f673ea 100644 --- a/wxPython/distrib/all/build-environ.cfg +++ b/wxPython/distrib/all/build-environ.cfg @@ -43,7 +43,8 @@ onlysource = no skipdocs = no skipwin = no skiposx = no -skiplinux = no +skipdeb = no +skiprpm = no skipclean = no skipupload = no skipnewdocs = no diff --git a/wxPython/distrib/all/build-finalize b/wxPython/distrib/all/build-finalize index 2666b7f5d9..ba10bdfdc1 100755 --- a/wxPython/distrib/all/build-finalize +++ b/wxPython/distrib/all/build-finalize @@ -19,14 +19,14 @@ if [ $KIND = daily ]; then echo "Copying to the local file server..." destdir=/stuff/temp/$VERSION mkdir -p $destdir - cp $STAGING_DIR/* $destdir + cp -R $STAGING_DIR/* $destdir if [ $skipupload != yes ]; then destdir=$UPLOAD_PREVIEW_ROOT/$DAILY echo "Copying to $UPLOAD_HOST at $destdir..." if [ $UPLOAD_METHOD = ssh ]; then ssh $UPLOAD_HOST "mkdir -p $destdir" - scp -p $STAGING_DIR/* $UPLOAD_HOST:/$destdir + scp -pr $STAGING_DIR/* $UPLOAD_HOST:/$destdir fi if [ $UPLOAD_METHOD = ftp ]; then lftp -c "open $UPLOAD_HOST; mkdir $destdir" @@ -61,7 +61,7 @@ EOF fi echo "Cleaning up staging dir..." - rm $STAGING_DIR/* + rm -r $STAGING_DIR/* rmdir $STAGING_DIR exit 0 @@ -73,14 +73,14 @@ if [ $KIND = release ]; then echo "Copying to the local file server..." destdir=/stuff/Development/wxPython/dist/$VERSION mkdir -p $destdir - cp $STAGING_DIR/* $destdir + cp -R $STAGING_DIR/* $destdir if [ $skipupload != yes ]; then echo "Copying to $UPLOAD_HOST..." destdir=$UPLOAD_RELEASE_ROOT/$VERSION if [ $UPLOAD_METHOD = ssh ]; then ssh $UPLOAD_HOST "mkdir -p $destdir" - scp -p $STAGING_DIR/* $UPLOAD_HOST:/$destdir + scp -pr $STAGING_DIR/* $UPLOAD_HOST:/$destdir fi if [ $UPLOAD_METHOD = ftp ]; then lftp -c "open $UPLOAD_HOST; mkdir $destdir" diff --git a/wxPython/distrib/all/build-rpm b/wxPython/distrib/all/build-rpm index d04f25ba70..4542dd7e3d 100755 --- a/wxPython/distrib/all/build-rpm +++ b/wxPython/distrib/all/build-rpm @@ -28,7 +28,7 @@ function TestOnline { } -if [ $skiplinux != yes ]; then +if [ $skiprpm != yes ]; then startedCoHost=no hostAvailable=no diff --git a/wxPython/distrib/all/do-build-deb b/wxPython/distrib/all/do-build-deb new file mode 100755 index 0000000000..6c9c37058d --- /dev/null +++ b/wxPython/distrib/all/do-build-deb @@ -0,0 +1,31 @@ +#!/bin/bash +# --------------------------------------------------------------------------- + +set -o errexit +set -o xtrace + +echo "-=-=-=- Hello from $HOSTNAME -=-=-=-" + +VERSION=$1 +VER2=$2 + + +tar xjf wxPython-src-$VERSION.tar.bz2 +rm wxPython-src-$VERSION.tar.bz2 + +mv wxPython-src-$VERSION wxwidgets$VER2-$VERSION +cd wxwidgets$VER2-$VERSION + +CLVERSION=`dpkg-parsechangelog | sed -n 's/Version: //p' | sed 's/-.*//'` +if [ $CLVERSION != $VERSION ]; then + dch --newversion $VERSION-0 "automated build" +fi + +debian/rules debian/control +dpkg-buildpackage -rfakeroot -us -uc + +cd .. +rm -r wxwidgets$VER2-$VERSION + +echo "-=-=-=- Goodbye! -=-=-=-" +exit 0