Commit 8c8fb5b9 authored by dancer's avatar dancer

making ready for uploading to Debian archive, changing depends line to...

making ready for uploading to Debian archive, changing depends line to debootstrap with versioned depends. Re-tabbing, extactbuildplace function is created to move common code out from create and build. added an error message for unknown parameter option. added a TAGS target to the makefile to make ETAGS work.
parent 48a8e94a
clean:
rm -f *.bak *~
rm -f *.bak *~ TAGS
TAGS:
etags pbuider-* pbuilder
install:
install -d $(DESTDIR)/etc
......
pbuilder (0.2) unstable; urgency=low
* Initial upload to Debian archive. (closes: #110388)
* Add a versioned depends on debootstrap, because that version is the only
version I tested on ... 0.1.15.2
-- Junichi Uekawa <dancer@debian.org> Tue, 28 Aug 2001 19:07:29 +0900
pbuilder (0.1) unstable; urgency=low
* Initial Release.
......
......@@ -7,7 +7,7 @@ Standards-Version: 3.5.6
Package: pbuilder
Architecture: all
Depends: debootstrap, tar, shellutils, debianutils, ${shlibs:Depends}
Depends: debootstrap (>= 0.1.15.2), tar, shellutils, debianutils, ${shlibs:Depends}
Description: personal package builder for Debian packages
Constructs a chroot system, and builds a package inside the
chroot.
......
......@@ -12,17 +12,22 @@ function copydsc () {
$(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"
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"
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;
}
......@@ -31,22 +36,12 @@ function checkbuilddep () {
PACKAGENAME="$1"
CHROOTEXEC="chroot $BUILDPLACE "
if [ ! -f "$PACKAGENAME" ]; then
echo "Command line parameter [$PACKAGENAME] is not a valid .dsc file name" >&2
exit 1;
echo "Command line parameter [$PACKAGENAME] is not a valid .dsc file name" >&2
exit 1;
fi;
cleanbuildplace
echo "building the build env"
mkdir -p "$BUILDPLACE"
(
cd "$BUILDPLACE"
tar xfzp "$BASETGZ"
mkdir -p "$BUILDPLACE/tmp/buildd"
)
mountproc
extractbuildplace
echo Copying source file
copydsc "$PACKAGENAME" "$BUILDPLACE/tmp/buildd"
......@@ -56,15 +51,17 @@ echo Installing the build-deps
checkbuilddep
echo Building the package
$CHROOTEXEC /bin/sh -c "(cd tmp/buildd/*/; dpkg-buildpackage)"
umountproc
test -n "$BUILDRESULT" && (
mkdir -p "$BUILDRESULT"
if [ -d "$BUILDRESULT" ]; then
cp "$BUILDPLACE"/tmp/buildd/* "$BUILDRESULT"
else
echo "Error: BUILDRESULT=[$BUILDRESULT] and is not a directory." >&2
fi
mkdir -p "$BUILDRESULT"
if [ -d "$BUILDRESULT" ]; then
cp "$BUILDPLACE"/tmp/buildd/* "$BUILDRESULT"
else
echo "Error: BUILDRESULT=[$BUILDRESULT] and is not a directory." >&2
fi
)
cleanbuildplace
......@@ -7,34 +7,34 @@
BASEBUILDPLACE="$BUILDPLACE"
BUILDPLACE="$BUILDPLACE/$$"
while [ -n $1 ]; do
case "$1" in
--basetgz)
BASETGZ=$(readlink -f "$2");
shift; shift;
;;
--buildplace)
BUILDPLACE=$(readlink -f "$2");
shift; shift;
;;
--mirror)
MIRROR="$2";
shift; shift;
;;
--http-proxy)
export http_proxy="$2";
shift; shift;
;;
--distribution)
DISTRIBUTION="$2";
shift; shift;
;;
--buildresult)
BUILDRESULT=$(readlink -f "$2");
shift; shift;
;;
--help)
cat <<EOF
while [ -n "$1" ]; do
case "$1" in
--basetgz)
BASETGZ=$(readlink -f "$2");
shift; shift;
;;
--buildplace)
BUILDPLACE=$(readlink -f "$2");
shift; shift;
;;
--mirror)
MIRROR="$2";
shift; shift;
;;
--http-proxy)
export http_proxy="$2";
shift; shift;
;;
--distribution)
DISTRIBUTION="$2";
shift; shift;
;;
--buildresult)
BUILDRESULT=$(readlink -f "$2");
shift; shift;
;;
--help)
cat <<EOF
Command Line Options:
--basetgz [base.tgz location]
--buildplace [location of build]
......@@ -43,11 +43,15 @@ Command Line Options:
--distribution [distribution(woody/sid)]
--buildresult [location-to-copy-build-result]
EOF
exit 1;
;;
*)
break;
;;
exit 1;
;;
--*)
echo "Error: Unknown option [$1] was specified " >&2
exit 1;
;;
*)
break;
;;
esac
done
#! /bin/bash
#necessary for installs.
# Creating the build environment with debootstrap.
. /usr/lib/pbuilder/pbuilder-checkparams
. /usr/lib/pbuilder/pbuilder-modules
CHROOTEXEC="chroot $BUILDPLACE "
if [ -z "$DISTRIBUTION" ]; then
DISTRIBUTION=woody
DISTRIBUTION=woody
fi
echo "Distribution is $DISTRIBUTION."
cleanbuildplace
echo "building the build env"
echo "Building the build environment"
mkdir -p "$BUILDPLACE"
if [ ! -d "$BUILDPLACE" ]; then
echo "pbuilder: Could not make directory [$BUILDPLACE]" >&2
exit 1
fi
mountproc
echo " -> running debootstrap"
( cd "$BUILDPLACE"; debootstrap "$DISTRIBUTION" . )
( cd "$BUILDPLACE" && debootstrap "$DISTRIBUTION" . )
echo " -> debootstrap finished"
mkdir -p "$BUILDPLACE/tmp/buildd"
echo " -> copying local configuration"
for a in passwd hosts hostname resolv.conf apt; do
cp -r /etc/$a "$BUILDPLACE/etc/";
cp -r /etc/$a "$BUILDPLACE/etc/";
done
echo "Installing apt-lines"
echo " -> installing apt-lines"
cat > "$BUILDPLACE/etc/apt/sources.list" << EOF
deb $MIRRORSITE $DISTRIBUTION main contrib non-free
deb-src $MIRRORSITE $DISTRIBUTION main contrib non-free
......@@ -38,6 +43,6 @@ $CHROOTEXEC /usr/bin/apt-get -y install build-essential dpkg-dev apt $EXTRAPACKA
$CHROOTEXEC /usr/bin/apt-get clean
umountproc
echo " -> creating base.tgz"
( cd "$BUILDPLACE" ; tar cfz "$BASETGZ" * )
( cd "$BUILDPLACE" && tar cfz "$BASETGZ" * || echo " -> failed building base.tgz")
cleanbuildplace
......@@ -2,27 +2,51 @@
# common modules for pbuilder.
function umountproc () {
if [ "$USEPROC" = "yes" ]; then
echo " -> unmounting proc"
umount "$BUILDPLACE/proc"
fi
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
if [ "$USEPROC" = "yes" ]; then
echo " -> mounting proc"
mkdir -p $BUILDPLACE/proc
mount -t proc /proc "$BUILDPLACE/proc"
fi
}
function cleanbuildplace () {
if [ -d "$BUILDPLACE" ]; then
echo cleaning the build env
rm -rf "$BUILDPLACE"
echo cleaning the build env
rm -rf "$BUILDPLACE"
fi;
}
function extractbuildplace () {
# after calling this function, umountproc, and cleanbuildplace
# needs to be called.
cleanbuildplace
echo "building the build env"
echo " -> extracting base.tgz"
mkdir -p "$BUILDPLACE"
(cd "$BUILDPLACE" && tar xfzp "$BASETGZ")
mountproc
mkdir -p "$BUILDPLACE/tmp/buildd"
echo " -> copying local configuration"
for a in passwd hosts hostname resolv.conf; do
cp /etc/$a "$BUILDPLACE/etc/$a";
done
if [ -n "$DISTRIBUTION" ]; then
echo Installing apt-lines
cat > "$BUILDPLACE"/etc/apt/sources.list << EOF
deb $MIRRORSITE $DISTRIBUTION main contrib non-free
deb-src $MIRRORSITE debian $DISTRIBUTION main contrib non-free
EOF
fi
}
#required for some packages to install...
export LANG=C
export LC_ALL=C
......@@ -7,25 +7,7 @@ CHROOTEXEC="chroot $BUILDPLACE "
test -n "$DISTRIBUTION" && echo "Upgrading for distribution $DISTRIBUTION"
cleanbuildplace
echo "building the build env"
echo " -> extracting base.tgz"
mkdir -p "$BUILDPLACE"
(cd "$BUILDPLACE"; tar xfzp "$BASETGZ")
mountproc
mkdir -p "$BUILDPLACE/tmp/buildd"
echo " -> copying local configuration"
for a in passwd hosts hostname resolv.conf; do
cp /etc/$a "$BUILDPLACE/etc/$a";
done
if [ -n "$DISTRIBUTION" ]; then
echo Installing apt-lines
cat > $BUILDPLACE/etc/apt/sources.list << EOF
deb $MIRRORSITE $DISTRIBUTION main contrib non-free
deb-src $MIRRORSITE debian $DISTRIBUTION main contrib non-free
EOF
fi
extractbuildplace
echo "Refreshing the base.tgz "
echo " -> upgrading packages"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment