--- /dev/null
+#!/bin/bash
+
+. /home/cowbuilder/bin/nd_cmdsettings.sh
+
+# common options
+opts="--distribution $dist --debootstrap debootstrap --aptcache $aptcache"
+
+
+for a in i386 amd64; do
+ echo "Building $a base path..."
+ if [ "${family:0:3}" = "nd+" ]; then
+ echo "Including NeuroDebian repository..."
+ cowbuilder --create --basepath /home/cowbuilder/cow/${family}-${dist}-${a}.cow $opts \
+ --components "$components" \
+ --mirror "$mirror" \
+ --debootstrapopts --arch --debootstrapopts $a \
+ --othermirror "deb http://neuro.debian.net/debian $dist main contrib non-free"
+ else
+ cowbuilder --create --basepath /home/cowbuilder/cow/${family}-${dist}-${a}.cow $opts \
+ --components "$components" \
+ --mirror "$mirror" \
+ --debootstrapopts --arch --debootstrapopts $a
+ fi
+done
--- /dev/null
+#!/bin/bash
+
+if [ -z "$1" ]; then
+cat << EOT
+Script to build a source package in one of the available cowbuilders.
+
+Synopsis
+--------
+
+ nd_build <family> <codename> [arch] <dsc file> [cowbuilder options]
+
+
+Examples
+--------
+
+Build for a single specific arch:
+
+ nd_build nd+debian lenny i386 someting.dsc
+
+
+Build for all archs (will just build once for arch 'all'):
+
+ nd_build ubuntu jaunty something.dsc
+
+
+Build the same way but don't put results in current dir:
+
+ nd_build debian sid something.dsc --buildresult to-upload/
+
+EOT
+exit 1
+fi
+
+. /home/cowbuilder/bin/nd_cmdsettings.sh
+
+# common options
+opts="--distribution $dist --aptcache $aptcache --buildplace $buildplace"
+
+if [ -z "$3" ]; then
+ echo "You need to provide a .dsc file"
+ exit 1
+fi
+
+if [ ! "$3" = "${3%*.dsc}" ]; then
+ dscfile=$3
+ # must already be the dsc file, hence no arch info given
+ if [ "$(grep '^Architecture' $dscfile | awk '{ print $2 }')" = "all" ]; then
+ echo "Arch 'all' package detected -- using amd64 system to build it"
+ arch="amd64"
+ else
+ arch="i386 amd64"
+ fi
+ shift; shift; shift
+else
+ # must be arch given and dsc as 4th
+ arch=$3
+ dscfile=$4
+ if [ -z "$dscfile" ]; then
+ echo "You need to provide a .dsc file"
+ exit 1
+ fi
+ shift; shift; shift; shift
+fi
+
+for a in $arch; do
+ echo "Building for $family $dist $a ..."
+ cowbuilder --build $dscfile \
+ --basepath ${cowbuilderroot}/cow/${family}-${dist}-${a}.cow \
+ --buildresult . \
+ $opts \
+ $*
+done
--- /dev/null
+#!/bin/bash
+
+if [ -z "$1" ]; then
+cat << EOT
+Script to build a source package for Debian Sid. The cowbuilder will be updated
+before the actual building takes place.
+
+Synopsis
+--------
+
+ nd_build <dsc file> [cowbuilder options]
+EOT
+exit 1
+fi
+
+# common options
+dscfile=$1
+shift;
+
+nd_updatedist debian sid amd64
+nd_build debian sid amd64 $dscfile $*
--- /dev/null
+family=$1
+dist=$2
+
+if [ -z "$family" ]; then
+ echo "You need to provide a distribution family ('debian', 'ubuntu'); prefix with 'nd+' to enable the NeuroDebian repository."
+ exit 1
+fi
+
+if [ -z "$dist" ]; then
+ echo "You need to provide a distribution codename (e.g. 'lenny', 'squeeze')."
+ exit 1
+fi
+
+# basic settings
+cowbuilderroot="/home/cowbuilder"
+buildplace="${cowbuilderroot}/build"
+
+# default is debian
+aptcache="${cowbuilderroot}/debian_aptcache"
+components="main contrib non-free"
+mirror="http://debian.lcs.mit.edu/debian"
+
+# overwrite necessary bits for ubuntu
+if [ "$family" = "ubuntu" ]; then
+ aptcache="${cowbuilderroot}/ubuntu_aptcache"
+ components="main universe"
+ mirror="http://ubuntu.media.mit.edu/ubuntu"
+fi
+
+if [ ! -d $aptcache ]; then mkdir $aptcache; fi
--- /dev/null
+#!/bin/bash
+
+. /home/cowbuilder/bin/nd_cmdsettings.sh
+
+# common options
+opts="--distribution $dist --aptcache $aptcache --buildplace $buildplace"
+
+if [ -n "$3" ]; then
+ arch=$3
+else
+ if [ "$(grep '^Architecture' debian/control | awk '{ print $2 }')" = "all" ]; then
+ echo "Arch 'all' package detected -- using amd64 system to build it"
+ arch="amd64"
+ else
+ arch="i386 amd64"
+ fi
+fi
+
+
+for a in $arch; do
+ echo "Building for $family $dist $a ..."
+ pdebuild --pbuilder cowbuilder --debbuildopts "-us -uc -i" \
+ --buildresult .. \
+ -- \
+ --basepath ${cowbuilderroot}/cow/${family}-${dist}-${a}.cow \
+ $opts
+done
--- /dev/null
+#!/bin/bash
+
+. /home/cowbuilder/bin/nd_cmdsettings.sh
+
+# common options
+opts="--distribution $dist --aptcache $aptcache --buildplace $buildplace"
+
+if [ -n "$3" ]; then
+ arch=$3
+else
+ arch="i386 amd64"
+fi
+
+for a in $arch; do
+ echo "Updating arch $a..."
+ cowbuilder --update --basepath /home/cowbuilder/cow/${family}-${dist}-${a}.cow $opts
+done