Commit 8b7bbd0a4ce08a390c68bda25198be1e053d5965

Authored by Cyril Brulebois
1 parent a8eeea4e
Exists in master

Add support for the ARCH env var.

With this, one can set ARCH=i386 to get an i386 build on amd64.
Showing 1 changed file with 9 additions and 4 deletions   Show diff stats
build
... ... @@ -98,19 +98,24 @@ dch -r -D $dist ""
98 98  
99 99 dh_quilt_patch
100 100  
  101 +if [ -n "$ARCH" ]; then
  102 + architecture_option="--architecture $ARCH"
  103 + architecture_suffix="-$ARCH"
  104 +fi
  105 +
101 106 # create or update pbuilder chroot
102   -basetgz=/var/cache/pbuilder/base-$builddist.tgz
  107 +basetgz=/var/cache/pbuilder/base-${builddist}${architecture_suffix}.tgz
103 108 if [ ! -f $basetgz ]
104 109 then
105   - if ! sudo pbuilder create --distribution $builddist --basetgz $basetgz --othermirror "deb http://security.debian.org/debian-security $builddist/updates main" ; then
  110 + if ! sudo pbuilder create $architecture_option --distribution $builddist --basetgz $basetgz --othermirror "deb http://security.debian.org/debian-security $builddist/updates main" ; then
106 111 echo "couldn't create chroot"
107 112 exit 1
108 113 fi
109 114 else
110   - if ! sudo pbuilder update --basetgz $basetgz ; then
  115 + if ! sudo pbuilder update $architecture_option --basetgz $basetgz ; then
111 116 echo "couldn't update chroot"
112 117 exit 1
113 118 fi
114 119 fi
115 120  
116   -DEB_BUILD_OPTIONS="nocheck noddebs $DEB_BUILD_OPTIONS" pdebuild --debbuildopts -B -- --basetgz "$basetgz"
  121 +DEB_BUILD_OPTIONS="nocheck noddebs $DEB_BUILD_OPTIONS" pdebuild $architecture_option --debbuildopts -B -- --basetgz "$basetgz"
... ...