]> git.donarmstrong.com Git - neurodebian.git/commitdiff
Add the cowbuilder tools to the repos.
authorMichael Hanke <michael.hanke@gmail.com>
Tue, 1 Sep 2009 19:05:45 +0000 (15:05 -0400)
committerMichael Hanke <michael.hanke@gmail.com>
Tue, 1 Sep 2009 19:05:45 +0000 (15:05 -0400)
tools/nd_adddist [new file with mode: 0755]
tools/nd_build [new file with mode: 0755]
tools/nd_build4debianmain [new file with mode: 0755]
tools/nd_cmdsettings.sh [new file with mode: 0755]
tools/nd_gitbuild [new file with mode: 0755]
tools/nd_updatedist [new file with mode: 0755]

diff --git a/tools/nd_adddist b/tools/nd_adddist
new file mode 100755 (executable)
index 0000000..f0d8f6f
--- /dev/null
@@ -0,0 +1,24 @@
+#!/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
diff --git a/tools/nd_build b/tools/nd_build
new file mode 100755 (executable)
index 0000000..6bd6d88
--- /dev/null
@@ -0,0 +1,72 @@
+#!/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
diff --git a/tools/nd_build4debianmain b/tools/nd_build4debianmain
new file mode 100755 (executable)
index 0000000..065cfa6
--- /dev/null
@@ -0,0 +1,21 @@
+#!/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 $*
diff --git a/tools/nd_cmdsettings.sh b/tools/nd_cmdsettings.sh
new file mode 100755 (executable)
index 0000000..9fe51fa
--- /dev/null
@@ -0,0 +1,30 @@
+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
diff --git a/tools/nd_gitbuild b/tools/nd_gitbuild
new file mode 100755 (executable)
index 0000000..f891e5f
--- /dev/null
@@ -0,0 +1,27 @@
+#!/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
diff --git a/tools/nd_updatedist b/tools/nd_updatedist
new file mode 100755 (executable)
index 0000000..fc2dedd
--- /dev/null
@@ -0,0 +1,17 @@
+#!/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