aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-buildpackage
diff options
context:
space:
mode:
authordancer <dancer>2002-02-15 13:49:49 +0000
committerdancer <dancer>2002-02-15 13:49:49 +0000
commit19947091bfd4b910fd42e6db329fc4e074ff854a (patch)
treeb1235ed95ebd6dd3f729ea6e88bf92a70ae6baa2 /pbuilder-buildpackage
parentb87a01e5191e522be5f3dc7113c7f889c53004c1 (diff)
downloadpbuilder-19947091bfd4b910fd42e6db329fc4e074ff854a.tar
pbuilder-19947091bfd4b910fd42e6db329fc4e074ff854a.tar.gz
updates, some potential changes.
Diffstat (limited to 'pbuilder-buildpackage')
-rwxr-xr-xpbuilder-buildpackage25
1 files changed, 20 insertions, 5 deletions
diff --git a/pbuilder-buildpackage b/pbuilder-buildpackage
index 5dd0e94..65fcb86 100755
--- a/pbuilder-buildpackage
+++ b/pbuilder-buildpackage
@@ -171,6 +171,8 @@ function checkbuilddep_internal () {
function checkbuilddep () {
checkbuilddep_internal
+ # install extra packages to the chroot
+ $CHROOTEXEC usr/bin/apt-get -y install ${EXTRAPACKAGES}
}
function echobacktime () {
@@ -190,12 +192,25 @@ function saveaptcache_umountproc_cleanbuildplace () {
umountproc_cleanbuildplace
}
+function createbuilduser () {
+ # create the build user
+ echo "$BUILDUSERNAME:x:$BUILDUSERID::/tmp/buildd:/bin/sh" >> $BUILDPLACE/etc/passwd
+ echo "$BUILDUSERNAME:x:$BUILDUSERID:" >> $BUILDPLACE/etc/group
+}
. /usr/lib/pbuilder/pbuilder-checkparams
PACKAGENAME="$1"
CHROOTEXEC="chroot $BUILDPLACE "
-
+if [ -n "$BUILDUSERNAME" -a -n "$BUILDUSERID" ]; then
+ SUTOUSER="su - $BUILDUSERNAME -- "
+ echo "I: using fakeroot in build."
+else
+ # run the build in root
+ SUTOUSER=""
+ BUILDUSERID=0
+ BUILDUSERNAME=root
+fi
if [ ! -f "$PACKAGENAME" ]; then
echo "Command line parameter [$PACKAGENAME] is not a valid .dsc file name" >&2
exit 1;
@@ -203,14 +218,14 @@ fi;
showbuildbanner
echobacktime
-
+createbuilduser
extractbuildplace
echo Copying source file
copydsc "$PACKAGENAME" "$BUILDPLACE/tmp/buildd"
echo Extracting source
-if ! $CHROOTEXEC /bin/bash -c "( cd tmp/buildd; /usr/bin/dpkg-source -x $(basename $PACKAGENAME) )"; then
- echo pbuilder: Failed extracting the source >&2
+if ! $CHROOTEXEC /bin/bash -c "( cd tmp/buildd; chown $BUILDUSERNAME:$BUILDUSERNAME *; $SUTOUSER /usr/bin/dpkg-source -x $(basename $PACKAGENAME) )"; then
+ echo "pbuilder: Failed extracting the source" >&2
umountproc_cleanbuildplace
exit 1;
fi
@@ -224,7 +239,7 @@ echo " -> Building the package"
export PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin"
if [ -z "$DEBEMAIL" ]; then
- if ! $CHROOTEXEC /bin/bash -c "cd tmp/buildd/*/; dpkg-buildpackage -us -uc $DEBBUILDOPTS"; then
+ if ! $CHROOTEXEC /bin/bash -c "cd tmp/buildd/*/; $SUTOUSER dpkg-buildpackage -us -uc $DEBBUILDOPTS"; then
echo "pbuilder: Failed autobuilding of package" >&2
umountproc_cleanbuildplace
exit 1;