From 2bbf398bd829c5d0a191cf585ae41478118cd032 Mon Sep 17 00:00:00 2001 From: dancer Date: Sat, 25 Aug 2001 09:12:12 +0000 Subject: renaming pbuilder-buildpackage.sh to pbuilder-buildpackage --- Makefile | 2 +- pbuilder-buildpackage | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ pbuilder-buildpackage.sh | 53 ------------------------------------------------ 3 files changed, 54 insertions(+), 54 deletions(-) create mode 100755 pbuilder-buildpackage delete mode 100755 pbuilder-buildpackage.sh diff --git a/Makefile b/Makefile index a6a39bf..3c2c8b3 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ clean: install: install -d $(DESTDIR)/etc install -d $(DESTDIR)/usr/sbin - install -m 755 pbuilder-buildpackage.sh $(DESTDIR)/usr/sbin + install -m 755 pbuilder-buildpackage $(DESTDIR)/usr/sbin install -m 755 pbuilder-createbuildenv $(DESTDIR)/usr/sbin install -m 755 pbuilder-updatebuildenv $(DESTDIR)/usr/sbin install -m 755 pbuilder-checkparams $(DESTDIR)/usr/lib/pbuilder/ diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage new file mode 100755 index 0000000..13b1bc6 --- /dev/null +++ b/pbuilder-buildpackage @@ -0,0 +1,53 @@ +#! /bin/bash +export LANG=C +export LC_ALL=C + +function copydsc () { + local DSCFILE="$1" + local TARGET="$2" + for FILE in \ + "$DSCFILE" \ + $(echo "$DSCFILE" | sed 's/^\(.*\)\.dsc$/\1/' ).diff.gz \ + $(echo "$DSCFILE" | sed 's/^\(.*\)\.dsc$/\1/').tar.gz \ + $(echo "$DSCFILE" | sed 's/\(.*\)-[^-.]*\.dsc$/\1/').orig.tar.gz ; do + cp "$FILE" "$TARGET" ; + done + +} + +function checkbuilddep () { + for INSTALLPKG in $($CHROOTEXEC bin/sh -c "(cd tmp/buildd/*/; dpkg-checkbuilddeps)" 2>&1 |grep "^dpkg-checkbuilddeps: Unmet build dependencies: " | sed 's/^[^:]*:[^:]*: \(.*\)$/\1/' | awk 'BEGIN{RS=", "} /^([^([]*)/{print $1}'); do + echo " -> Installing $INSTALLPKG" + $CHROOTEXEC usr/bin/apt-get -y install "$INSTALLPKG" + done; + for REMOVEPKG in $($CHROOTEXEC bin/sh -c "(cd tmp/buildd/*/; dpkg-checkbuilddeps)" 2>&1 |grep "^dpkg-checkbuilddeps: Build conflicts: " | sed 's/^[^:]*:[^:]*: \(.*\)$/\1/' | awk 'BEGIN{RS=", "} /^([^([]*)/{print $1}'); do + echo " -> Removing $REMOVEPKG" + $CHROOTEXEC usr/bin/apt-get -y remove "$REMOVEPKG" + done; +} + + +. /etc/pbuilderrc +. /usr/lib/pbuilder/pbuilder-checkparams +PACKAGENAME="$1" +CHROOTEXEC="chroot $BUILDPLACE " + +echo cleaning the build env +rm -rf "$BUILDPLACE" + +echo building the build env +mkdir -p "$BUILDPLACE" +( + cd "$BUILDPLACE" + tar xfzp "$BASETGZ" + mkdir -p "$BUILDPLACE/tmp/buildd" +) +echo Copying source file +copydsc "$PACKAGENAME" "$BUILDPLACE/tmp/buildd" +echo Extracting source +$CHROOTEXEC /bin/bash -c "( cd tmp/buildd; /usr/bin/dpkg-source -x $(basename $PACKAGENAME) )" +echo Installing the build-deps +checkbuilddep +echo Building the package +$CHROOTEXEC /bin/sh -c "(cd tmp/buildd/*/; dpkg-buildpackage)" + diff --git a/pbuilder-buildpackage.sh b/pbuilder-buildpackage.sh deleted file mode 100755 index 13b1bc6..0000000 --- a/pbuilder-buildpackage.sh +++ /dev/null @@ -1,53 +0,0 @@ -#! /bin/bash -export LANG=C -export LC_ALL=C - -function copydsc () { - local DSCFILE="$1" - local TARGET="$2" - for FILE in \ - "$DSCFILE" \ - $(echo "$DSCFILE" | sed 's/^\(.*\)\.dsc$/\1/' ).diff.gz \ - $(echo "$DSCFILE" | sed 's/^\(.*\)\.dsc$/\1/').tar.gz \ - $(echo "$DSCFILE" | sed 's/\(.*\)-[^-.]*\.dsc$/\1/').orig.tar.gz ; do - cp "$FILE" "$TARGET" ; - done - -} - -function checkbuilddep () { - for INSTALLPKG in $($CHROOTEXEC bin/sh -c "(cd tmp/buildd/*/; dpkg-checkbuilddeps)" 2>&1 |grep "^dpkg-checkbuilddeps: Unmet build dependencies: " | sed 's/^[^:]*:[^:]*: \(.*\)$/\1/' | awk 'BEGIN{RS=", "} /^([^([]*)/{print $1}'); do - echo " -> Installing $INSTALLPKG" - $CHROOTEXEC usr/bin/apt-get -y install "$INSTALLPKG" - done; - for REMOVEPKG in $($CHROOTEXEC bin/sh -c "(cd tmp/buildd/*/; dpkg-checkbuilddeps)" 2>&1 |grep "^dpkg-checkbuilddeps: Build conflicts: " | sed 's/^[^:]*:[^:]*: \(.*\)$/\1/' | awk 'BEGIN{RS=", "} /^([^([]*)/{print $1}'); do - echo " -> Removing $REMOVEPKG" - $CHROOTEXEC usr/bin/apt-get -y remove "$REMOVEPKG" - done; -} - - -. /etc/pbuilderrc -. /usr/lib/pbuilder/pbuilder-checkparams -PACKAGENAME="$1" -CHROOTEXEC="chroot $BUILDPLACE " - -echo cleaning the build env -rm -rf "$BUILDPLACE" - -echo building the build env -mkdir -p "$BUILDPLACE" -( - cd "$BUILDPLACE" - tar xfzp "$BASETGZ" - mkdir -p "$BUILDPLACE/tmp/buildd" -) -echo Copying source file -copydsc "$PACKAGENAME" "$BUILDPLACE/tmp/buildd" -echo Extracting source -$CHROOTEXEC /bin/bash -c "( cd tmp/buildd; /usr/bin/dpkg-source -x $(basename $PACKAGENAME) )" -echo Installing the build-deps -checkbuilddep -echo Building the package -$CHROOTEXEC /bin/sh -c "(cd tmp/buildd/*/; dpkg-buildpackage)" - -- cgit v1.2.3