#!/bin/sh
+# This script builds Debian packages for one or more distributions
+# in i386/amd64 architectures. It uses pbuilder. pbuilder requires root
+# privilege and is invoked with sudo.
+#
+# In order to avoid having to type-in the password for it, you might
+# use something like this in sudoers
+# user ALL=NOPASSWD,SETENV: /usr/sbin/pbuilder
+# where user is your username.
usage()
{
echo "${PKG} does not exist"
exit 1
fi
+PBUILDER=/usr/sbin/pbuilder
PRODUCT=`echo *.dsc|sed 's/_.*//g'`
-
+ARCHS="i386 amd64"
echo "Dsc $PKG . Product $PRODUCT"
echo "Ubuntu distros: $UBUNTU_DIST"
echo "Debian distros: $DEBIAN_DIST"
i=0
date
for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do
- for arch in i386 amd64; do
+ for arch in ${ARCHS}; do
rm -fr ${dist}-${arch}
(
if test ! -f /var/cache/pbuilder/${dist}-${arch}-base.tgz; then
- DIST=$dist ARCH=$arch pbuilder create
+ sudo DIST=$dist ARCH=$arch $PBUILDER create
fi
if $update; then
- DIST=$dist ARCH=$arch pbuilder update --override-config
+ sudo DIST=$dist ARCH=$arch $PBUILDER update --override-config
fi
- DIST=$dist ARCH=$arch pbuilder --build $PKG
+ sudo DIST=$dist ARCH=$arch $PBUILDER --build $PKG
) >${dist}-${arch}.log 2>&1 &
i=`expr $i + 1`
if test $i -eq $concurrency; then
done
wait
for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do
- for arch in i386 amd64; do
-
+ for arch in ${ARCHS}; do
if test -f ${dist}-${arch}/*.dsc; then
:
else