.lpbuild2: local builds capability

git-svn-id: svn://ultimatepp.org/upp/trunk@4478 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
dolik 2012-01-27 22:41:17 +00:00
parent 8b479deeb9
commit fa96f6679a
4 changed files with 100 additions and 6 deletions

View file

@ -12,16 +12,13 @@ ARCH="`dpkg-architecture -qDEB_HOST_ARCH`"
ide:
sed -i -e 's/IDE_VERSION[ \t]*"\([0-9]*\)[^"]*"/IDE_VERSION "\1-'$(SERIES)-$(ARCH)'"/' $(CURDIR)/uppsrc/ide/version.h
$(MAKE) -f mkfile $(JOBS) PKG=ide $(compiler) "NESTS=uppsrc" "FLAGS=GUI MT GCC SHARED" BINEXT= "BINPREFIX="
#cp /usr/bin/theide $@
ide-nogtk:
sed -i -e 's/IDE_VERSION[ \t]*"\([0-9]*\)[^"]*"/IDE_VERSION "\1-'$(SERIES)-$(ARCH)'-nogtk"/' $(CURDIR)/uppsrc/ide/version.h
$(MAKE) -f mkfile $(JOBS) PKG=ide $(compiler) "NESTS=uppsrc" "FLAGS=GUI MT NOGTK GCC SHARED" BINEXT=-nogtk "BINPREFIX="
#cp /usr/bin/theide $@
umk:
$(MAKE) -f mkfile $(JOBS) PKG=umk $(compiler) "NESTS=uppsrc" "FLAGS=GCC SHARED" BINEXT= "BINPREFIX="
#cp /usr/bin/theide $@
install:
# this is just a trick to rename files

28
uppbox/lpbuild2/localbuild.sh Executable file
View file

@ -0,0 +1,28 @@
#!/bin/sh
set -e
# This scripts is meant to create deb packages for stable releases. It will best
# work with ubuntu, but it should work on debian and even other distros, as long
# as pbuilder, debootstrap and devscripts packages are available.
# set desired architectures and distributions
archs="i386 amd64"
dists="karmic lucid maverick natty oneiric squeeze wheezy sid"
# prepare source packages
stable=1
noupload=1
scriptpath="$(cd ${0%/*} 2>/dev/null || true; echo $PWD/${0##*/})"
. "$(dirname $scriptpath)/lpbuild.sh"
for dist in $dists; do
for arch in $archs; do
# create the chroot if it doesn't exist yet
if [ ! -f "/var/cache/pbuilder/$NAME-base.tgz" ]; then
DIST=$dist ARCH=$arch pbuilder --create --configfile "$scriptdir/pbuilderrc" --distribution $dist --architecture $arch
fi;
# build the binary packages
DIST=$dist ARCH=$arch pbuilder --build --configfile "$scriptdir/pbuilderrc" --distribution $dist --architecture $arch "$TMP/upp_${version}-0~${dist}0.dsc"
done
done
echo "Done!"

View file

@ -26,7 +26,7 @@ elif [ -d "$tmp" ]; then
exit 1
fi
dists="karmic lucid maverick natty oneiric"
[ -z "$dists" ] && dists="karmic lucid maverick natty oneiric"
scriptpath="$(cd ${0%/*} 2>/dev/null || true; echo $PWD/${0##*/})"
scriptdir="$(dirname $scriptpath)"
src="$SRCDIR/upp-x11-src-$version.tar.gz"
@ -38,7 +38,7 @@ cp -r "$scriptdir/debian" "$tmp/debian"
for f in Makefile mkfile copyright theide.1 theide.desktop; do
cp "$scriptdir/$f" "$tmp/$f"
done
[ "$1" = "stable" ] && sed -i '/code.google/s/^/#/;/sf.net/s/^#//;' "$tmp/debian/watch"
[ "$stable" = 1 ] && sed -i '/code.google/s/^/#/;/sf.net/s/^#//;' "$tmp/debian/watch"
ln -s "$src" "$TMP/upp_$version.orig.tar.gz"
cd $tmp
@ -62,6 +62,7 @@ EOF
[ "$skiporig" ] || dpkg-source --commit . packaging packaging.patch
dpkg-buildpackage -d -S -k$GPG_KEY -m'Jan Dolinar <dolik.rce@seznam.cz>' -sgpg -p$GPG_PROG $skiporig
dput -c "$scriptdir/dput.cfg" "upp-$dist" "../upp_"$distver"_source.changes"
[ "$noupload" = 1 ] || dput -c "$scriptdir/dput.cfg" "upp-$dist" "../upp_"$distver"_source.changes"
skiporig="-sd"
done
set -e

View file

@ -0,0 +1,68 @@
# Codenames for Debian suites according to their alias. Update these when
# needed.
UNSTABLE_CODENAME="sid"
TESTING_CODENAME="wheezy"
STABLE_CODENAME="squeeze"
STABLE_BACKPORTS_SUITE="$STABLE_CODENAME-backports"
# List of Debian suites.
DEBIAN_SUITES=($UNSTABLE_CODENAME $TESTING_CODENAME $STABLE_CODENAME
"unstable" "testing" "stable")
# List of Ubuntu suites. Update these when needed.
UBUNTU_SUITES=("precise" "oneiric" "natty" "maverick" "lucid" "karmic" "jaunty" "hardy")
# Mirrors to use. Update these to your preferred mirror.
DEBIAN_MIRROR="ftp.de.debian.org"
UBUNTU_MIRROR="ftp.ubuntu.com"
# Optionally use the changelog of a package to determine the suite to use if
# none set.
if [ -z "${DIST}" ] && [ -r "debian/changelog" ]; then
DIST=$(dpkg-parsechangelog | awk '/^Distribution: / {print $2}')
DIST="${DIST%%-*}"
# Use the unstable suite for certain suite values.
if $(echo "experimental UNRELEASED" | grep -q $DIST); then
DIST="$UNSTABLE_CODENAME"
fi
fi
# Optionally change Debian release states in $DIST to their names.
case "$DIST" in
unstable)
DIST="$UNSTABLE_CODENAME"
;;
testing)
DIST="$TESTING_CODENAME"
;;
stable)
DIST="$STABLE_CODENAME"
;;
esac
NAME="$DIST"
if [ -n "${ARCH}" ]; then
NAME="$NAME-$ARCH"
DEBOOTSTRAPOPTS=("--arch" "$ARCH" "${DEBOOTSTRAPOPTS[@]}")
fi
BASETGZ="/var/cache/pbuilder/$NAME-base.tgz"
DISTRIBUTION="$DIST"
BUILDRESULT="/var/cache/pbuilder/$NAME/result/"
APTCACHE="/var/cache/pbuilder/$NAME/aptcache/"
BUILDPLACE="/var/cache/pbuilder/build/"
if $(echo ${DEBIAN_SUITES[@]} | grep -q $DIST); then
# Debian configuration
MIRRORSITE="http://$DEBIAN_MIRROR/debian/"
COMPONENTS="main contrib non-free"
DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" "--keyring=/usr/share/keyrings/debian-archive-keyring.gpg")
elif $(echo ${UBUNTU_SUITES[@]} | grep -q $DIST); then
# Ubuntu configuration
MIRRORSITE="http://$UBUNTU_MIRROR/ubuntu/"
COMPONENTS="main restricted universe multiverse"
DEBOOTSTRAPOPTS=("${DEBOOTSTRAPOPTS[@]}" "--keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg")
else
echo "Unknown distribution: $DIST"
exit 1
fi