2 # This script builds Debian packages for one or more distributions
3 # in i386/amd64 architectures. It uses pbuilder. pbuilder requires root
4 # privilege and is invoked with sudo.
6 # In order to avoid having to type-in the password for it, you might
7 # use something like this in sudoers
8 # user ALL=NOPASSWD,SETENV: /usr/sbin/pbuilder
9 # where user is your username.
14 Usage: id-pbuild-all.sh [OPTIONS]
24 # things that might be set by options
29 if test -f IDMETA; then
32 while test $# -gt 0; do
34 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
58 if test "$do_help" = "yes"; then
62 if test -d deb-src; then
70 if test -z "$PKG"; then
71 echo "Specify .dsc file"
74 if test ! -e "$PKG"; then
75 echo "${PKG} does not exist"
78 PBUILDER=/usr/sbin/pbuilder
79 PRODUCT=`echo *.dsc|sed 's/_.*//g'`
81 echo "Dsc $PKG . Product $PRODUCT"
82 echo "Ubuntu distros: $UBUNTU_DIST"
83 echo "Debian distros: $DEBIAN_DIST"
85 for dist in ${UBUNTU_DIST}; do
86 scp ${dist}-*/* ftp.indexdata.dk:/home/ftp/pub/${PRODUCT}/ubuntu/${dist}
88 for dist in ${DEBIAN_DIST}; do
89 scp ${dist}-*/* ftp.indexdata.dk:/home/ftp/pub/${PRODUCT}/debian/${dist}
91 echo "Remember to update APT on ftp.indexdata.dk"
92 echo "cd git-tools/update-archive"
94 echo "./update-archive.sh"
99 for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do
100 for arch in ${ARCHS}; do
101 rm -fr ${dist}-${arch}
103 if test ! -f /var/cache/pbuilder/${dist}-${arch}-base.tgz; then
104 sudo DIST=$dist ARCH=$arch $PBUILDER create
106 for f in `find /var/cache/pbuilder/${dist}-${arch}-base.tgz -ctime +7`; do
107 sudo DIST=$dist ARCH=$arch $PBUILDER update --override-config
109 sudo DIST=$dist ARCH=$arch $PBUILDER --build $PKG
110 ) >${dist}-${arch}.log 2>&1 &
112 if test $i -eq $concurrency; then
119 for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do
120 for arch in ${ARCHS}; do
121 if test -f ${dist}-${arch}/*.dsc; then
124 echo "No .dsc file for ${dist}-${arch}"