From 2f0ac9d57c0e681fba398c4645c239a13fb2292b Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Fri, 21 Mar 2008 19:21:07 -0400 Subject: [PATCH] Ubuntu binary package support (maintainer scripts) --- ChangeLog | 2 ++ maintainer/make-deb.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++++ maintainer/release-root.sh | 2 ++ 3 files changed, 52 insertions(+) create mode 100755 maintainer/make-deb.sh diff --git a/ChangeLog b/ChangeLog index 8bb65e24..d5dd86a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ Release: version 0.12 - 2008/03/?? - added support for building Debian source packages with proper diff.gz and dsc files - fixed find warning in maintainer/make-rpm.sh + - added support for Ubuntu binary packages to the maintainer build + scripts 2008/03/13 - renamed all vformat_ and VFormat symbols in opensync plugin's copy of vformat code, so they don't conflict with the diff --git a/maintainer/make-deb.sh b/maintainer/make-deb.sh new file mode 100755 index 00000000..f0653c9c --- /dev/null +++ b/maintainer/make-deb.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +CHROOT="/var/chroot" +CHOWNUSER="cdfrey:cdfrey" +CHROOTUSER="cdfrey" + +if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then + echo + echo "Usage: ./make-rpm.sh tarball chroot_target short_form" + echo + echo "Copies the tarball to the chroot target's /home/$CHROOTUSER/binarybuild dir," + echo "then enters the chroot system and runs the build." + echo + echo "short_form is the tag to rename the resulting DEB's with," + echo "such as ubuntu710, etc." + echo + echo "Available chroot targets:" + find $CHROOT -maxdepth 1 -type d -print | sed "s/^.*\// /" + echo + exit 1 +fi + +TARPATH="$1" +TARNAME=`basename "$TARPATH"` +TARGET="$2" +TAG="$3" + +set -e + +cp "$TARPATH" "$CHROOT/$TARGET/home/$CHROOTUSER" + +chroot "$CHROOT/$TARGET" su - "$CHROOTUSER" -c /bin/sh -lc "rm -rf binarybuild && mkdir binarybuild && cd binarybuild && tar xjvf ../$TARNAME && cd * && fakeroot -- debian/rules binary" + +mkdir -p "build/$TARGET" +cp "$CHROOT/$TARGET/home/$CHROOTUSER/binarybuild/"*.deb "build/$TARGET" +rm "$CHROOT/$TARGET/home/$CHROOTUSER/$TARNAME" + +# We do this manually in a for loop, since the rename command is +# not the same across various linux distros... +( + cd "build/$TARGET" + for f in *_i386.deb ; do + mv "$f" "$(echo $f | sed "s/_i386.deb$/_${TAG}_i386.deb/")" + done +) + +chown -R $CHOWNUSER "build/$TARGET" + diff --git a/maintainer/release-root.sh b/maintainer/release-root.sh index d75a9eb5..5128602b 100755 --- a/maintainer/release-root.sh +++ b/maintainer/release-root.sh @@ -9,6 +9,8 @@ fi set -e +# Build the DEB's +./make-deb.sh build/barry-$1.$2.tar.bz2 ubuntu710 ubuntu710 # Build the RPM's ./make-rpm.sh build/barry-$1.$2.tar.bz2 ../rpm/barry.spec fedora7 fc7 sed "s/libusb-devel/libusb/g;s/gtkmm24/gtkmm2/g;s/libglademm24/libglademm/g" < ../rpm/barry.spec > barry-opensuse.spec -- 2.11.4.GIT