]> git.donarmstrong.com Git - neurodebian.git/blobdiff - tools/nd_build
Merge remote branch 'neurolego/master'
[neurodebian.git] / tools / nd_build
index 6bd6d88a2ffae9b59e54bda18caa994be5f49134..ca50a6c1270361978e60c483b22295a37fd80c81 100755 (executable)
@@ -31,7 +31,22 @@ EOT
 exit 1
 fi
 
-. /home/cowbuilder/bin/nd_cmdsettings.sh
+family=$1
+dist=$2
+
+set -e
+
+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
+
+. /etc/neurodebian/cmdsettings.sh
 
 # common options
 opts="--distribution $dist --aptcache $aptcache --buildplace $buildplace"
@@ -63,10 +78,21 @@ else
 fi
 
 for a in $arch; do
+  # default
+  options="$opts"
+  if [ "$a" = "amd64" ]; then
+    # only force source into the upload for NeuroDebian
+    if [ ! "$family" = "${family#nd+*}" ]; then
+      options="$opts --debbuildopts -sa"
+    fi
+  else
+    options="$opts --debbuildopts -B"
+  fi
   echo "Building for $family $dist $a ..."
   cowbuilder --build $dscfile \
              --basepath ${cowbuilderroot}/cow/${family}-${dist}-${a}.cow \
              --buildresult . \
-             $opts \
+             --logfile ${dscfile%.dsc}_${a}.build \
+             $options \
              $*
 done