aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-createbuildenv
diff options
context:
space:
mode:
Diffstat (limited to 'pbuilder-createbuildenv')
-rwxr-xr-xpbuilder-createbuildenv47
1 files changed, 47 insertions, 0 deletions
diff --git a/pbuilder-createbuildenv b/pbuilder-createbuildenv
new file mode 100755
index 0000000..bc5d560
--- /dev/null
+++ b/pbuilder-createbuildenv
@@ -0,0 +1,47 @@
+#!/bin/bash
+#necessary for installs.
+export LANG=C
+export LC_ALL=C
+
+DISTRIBUTION=$1
+. /etc/pbuilderrc
+CHROOTEXEC="chroot $BUILDPLACE "
+if [ -z "$DISTRIBUTION" ]; then
+ DISTRIBUTION=woody
+fi
+echo Distribution is $DISTRIBUTION.
+
+cd $MYREPOSITORY
+echo Initializing repository
+dpkg-scanpackages . . | gzip > Packages.gz
+dpkg-scansources . . | gzip > Sources.gz
+
+echo cleaning the build env
+rm -rf $BUILDPLACE
+
+echo building the build env
+mkdir -p $BUILDPLACE
+cd $BUILDPLACE
+debootstrap $DISTRIBUTION .
+mkdir -p $BUILDPLACE/tmp/buildd
+for a in passwd hosts hostname resolv.conf apt; do
+ cp -r /etc/$a $BUILDPLACE/etc/;
+done
+
+echo Installing apt-lines
+cat > $BUILDPLACE/etc/apt/sources.list << EOF
+deb $MYREPOSITORYHTTP ./
+deb-src $MYREPOSITORYHTTP ./
+deb http://www.jp.debian.org/debian $DISTRIBUTION main contrib non-free
+deb-src http://www.jp.debian.org/debian $DISTRIBUTION main contrib non-free
+EOF
+
+echo Refreshing the base.tgz
+$CHROOTEXEC /usr/bin/apt-get update
+$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
+cd $BUILDPLACE
+tar cfz $BASETGZ *
+