]> git.donarmstrong.com Git - neurodebian.git/blob - tools/nd_gitbuild
Also for stats report which repo and which job number use our setup
[neurodebian.git] / tools / nd_gitbuild
1 #!/bin/bash
2
3 family=$1
4 dist=$2
5
6 set -e
7
8 if [ -z "$family" ]; then
9   echo "You need to provide a distribution family ('debian', 'ubuntu'); prefix with 'nd+' to enable the NeuroDebian repository."
10   exit 1
11 fi
12
13 if [ -z "$dist" ]; then
14   echo "You need to provide a distribution codename (e.g. 'lenny', 'squeeze')."
15   exit 1
16 fi
17
18 . /etc/neurodebian/cmdsettings.sh
19
20 # common options
21 opts="--distribution $dist --aptcache $aptcache --buildplace $buildplace"
22
23 if [ -n "$3" ]; then
24   arch=$3
25 else
26   if [ "$(grep '^Architecture' debian/control | awk '{ print $2 }')" = "all" ]; then
27     echo "Arch 'all' package detected -- using amd64 system to build it"
28     arch="amd64"
29   else
30     arch="i386 amd64"
31   fi
32 fi
33
34
35 for a in $arch; do
36   echo "Building for $family $dist $a ..."
37   pdebuild --pbuilder cowbuilder --debbuildopts "-us -uc -i" \
38            --buildresult .. \
39            -- \
40            --basepath ${cowbuilderroot}/cow/${family}-${dist}-${a}.cow \
41            $opts
42 done