diff options
-rw-r--r-- | Makefile | 1 | ||||
-rwxr-xr-x | pbuilder-buildpackage | 7 | ||||
-rwxr-xr-x | pbuilder-createbuildenv | 16 | ||||
-rw-r--r-- | pbuilder-modules | 22 | ||||
-rwxr-xr-x | pbuilder-updatebuildenv | 11 | ||||
-rwxr-xr-x | pbuilderrc | 2 |
6 files changed, 37 insertions, 22 deletions
@@ -9,6 +9,7 @@ install: install -m 755 pbuilder-createbuildenv $(DESTDIR)/usr/lib/pbuilder/ install -m 755 pbuilder-updatebuildenv $(DESTDIR)/usr/lib/pbuilder/ install -m 755 pbuilder-checkparams $(DESTDIR)/usr/lib/pbuilder/ + install -m 755 pbuilder-modules $(DESTDIR)/usr/lib/pbuilder/ install -m 755 pbuilder $(DESTDIR)/usr/sbin install -m 644 pbuilderrc $(DESTDIR)/etc diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage index 74b890d..060c88e 100755 --- a/pbuilder-buildpackage +++ b/pbuilder-buildpackage @@ -27,6 +27,7 @@ function checkbuilddep () { } . /usr/lib/pbuilder/pbuilder-checkparams +. /usr/lib/pbuilder/pbuilder-modules PACKAGENAME="$1" CHROOTEXEC="chroot $BUILDPLACE " @@ -42,7 +43,7 @@ mkdir -p "$BUILDPLACE" ) echo " -> mounting proc" mkdir -p "$BUILDPLACE/proc" -mount -t proc /proc "$BUILDPLACE/proc" +mountproc echo Copying source file copydsc "$PACKAGENAME" "$BUILDPLACE/tmp/buildd" @@ -52,6 +53,4 @@ echo Installing the build-deps checkbuilddep echo Building the package $CHROOTEXEC /bin/sh -c "(cd tmp/buildd/*/; dpkg-buildpackage)" - -echo " -> unmounting proc" -umount "$BUILDPLACE/proc"
\ No newline at end of file +umountproc diff --git a/pbuilder-createbuildenv b/pbuilder-createbuildenv index 87990be..cb512f5 100755 --- a/pbuilder-createbuildenv +++ b/pbuilder-createbuildenv @@ -1,9 +1,8 @@ #! /bin/bash #necessary for installs. -export LANG=C -export LC_ALL=C . /usr/lib/pbuilder/pbuilder-checkparams +. /usr/lib/pbuilder/pbuilder-modules CHROOTEXEC="chroot $BUILDPLACE " if [ -z "$DISTRIBUTION" ]; then @@ -16,12 +15,9 @@ rm -rf $BUILDPLACE echo "building the build env" mkdir -p $BUILDPLACE -echo " -> mounting proc" -mkdir -p $BUILDPLACE/proc -mount -t proc /proc $BUILDPLACE/proc +mountproc echo " -> running debootstrap" -cd $BUILDPLACE -debootstrap $DISTRIBUTION . +(cd $BUILDPLACE; debootstrap $DISTRIBUTION .) mkdir -p $BUILDPLACE/tmp/buildd echo " -> copying local configuration" for a in passwd hosts hostname resolv.conf apt; do @@ -41,8 +37,6 @@ $CHROOTEXEC /usr/bin/dpkg --purge lilo $CHROOTEXEC /usr/bin/apt-get -y dist-upgrade $CHROOTEXEC /usr/bin/apt-get -y install build-essential dpkg-dev apt $EXTRAPACKAGES $CHROOTEXEC /usr/bin/apt-get clean -echo " -> unmounting proc" -umount $BUILDPLACE/proc +umountproc echo " -> creating base.tgz" -cd $BUILDPLACE -tar cfz $BASETGZ * +( cd $BUILDPLACE ; tar cfz $BASETGZ * ) diff --git a/pbuilder-modules b/pbuilder-modules new file mode 100644 index 0000000..7601738 --- /dev/null +++ b/pbuilder-modules @@ -0,0 +1,22 @@ +#! /bin/bash +# common modules for pbuilder. + +function umountproc () { + if [ "$USEPROC" = "yes" ]; then + echo " -> unmounting proc" + umount "$BUILDPLACE/proc" + fi +} + +function mountproc () { + if [ "$USEPROC" = "yes" ]; then + echo " -> mounting proc" + mkdir -p $BUILDPLACE/proc + mount -t proc /proc "$BUILDPLACE/proc" + fi +} + + +#required for some packages to install... +export LANG=C +export LC_ALL=C diff --git a/pbuilder-updatebuildenv b/pbuilder-updatebuildenv index 02eb238..f3e21ce 100755 --- a/pbuilder-updatebuildenv +++ b/pbuilder-updatebuildenv @@ -1,8 +1,8 @@ #! /bin/bash -export LANG=C -export LC_ALL=C . /usr/lib/pbuilder/pbuilder-checkparams +. /usr/lib/pbuilder/pbuilder-modules + CHROOTEXEC="chroot $BUILDPLACE " test -n "$DISTRIBUTION" && echo "Upgrading for distribution $DISTRIBUTION" @@ -15,9 +15,7 @@ echo " -> extracting base.tgz" mkdir -p $BUILDPLACE cd $BUILDPLACE tar xfzp $BASETGZ -echo " -> mounting proc" -mkdir -p "$BUILDPLACE/proc" -mount -t proc /proc $BUILDPLACE/proc +mountproc mkdir -p $BUILDPLACE/tmp/buildd echo " -> copying local configuration" for a in passwd hosts hostname resolv.conf; do @@ -39,8 +37,7 @@ $CHROOTEXEC /usr/bin/dpkg --purge lilo $CHROOTEXEC /usr/bin/apt-get -y dist-upgrade $CHROOTEXEC /usr/bin/apt-get -y install build-essential dpkg-dev apt $EXTRAPACKAGES $CHROOTEXEC /usr/bin/apt-get clean -echo " -> unmounting proc" -umount $BUILDPLACE/proc +umountproc echo " -> creating base.tgz" cd $BUILDPLACE tar cfz $BASETGZ * @@ -5,3 +5,5 @@ BASETGZ=/var/cache/pbuilder/base.tgz BUILDPLACE=/var/cache/pbuilder/build/ MIRRORSITE=http://www.jp.debian.org/debian #export http_proxy=http://your-proxy:8080/ +USEPROC=yes + |