summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorranke <ranke@f247ebf9-aa24-0410-a698-f940e971ad2b>2015-12-14 12:57:12 +0000
committerranke <ranke@f247ebf9-aa24-0410-a698-f940e971ad2b>2015-12-14 12:57:12 +0000
commitf82c9449951c75bd5d9f7083c8683ddd15121738 (patch)
treeba88f6c289d0bcf56c1676983a13809cf00fe1ca /build
parentd7b5493f488e7c7f696bc6815fea06a9f7a6695f (diff)
Various improvements
- Don't remove r-base-*.deb files when cleaning sources - Use ./build [options] sourcepackage instead of build*.sh - Use ./build_others [options] instead of build_others.sh - Use ./clean [squeeze|wheezy|jessie] instead of clean.sh - Improve comment in backport_others script - Use ./move_debs instead of move_*.sh git-svn-id: svn+ssh://stiller/home/schatz/reps/r-backports@117 f247ebf9-aa24-0410-a698-f940e971ad2b
Diffstat (limited to 'build')
-rwxr-xr-xbuild68
1 files changed, 68 insertions, 0 deletions
diff --git a/build b/build
new file mode 100755
index 0000000..053a167
--- /dev/null
+++ b/build
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+# Script to facilitate building r-base binaries for CRAN in a chroot
+# Matching CRAN sources must be in /etc/apt/sources.list of the chroot
+
+usage()
+{
+echo "Usage: ./build [options] sourcepackage"
+echo "Options:"
+echo " -s, --skip Skip apt-get update/upgrade and pbuilder update"
+}
+
+DIST=`lsb_release -cs`
+
+skip=false
+while test -n "${1}"; do
+ case "$1" in
+ -s | --skip)
+ skip=true
+ shift
+ ;;
+ -*)
+ echo "Error: Unknown option: $1" >&2
+ usage
+ exit 1
+ ;;
+ *) # No more options
+ break
+ ;;
+ esac
+done
+
+# Positional argument
+if [ $# -lt 1 ]; then usage; exit 1; fi
+pkg=$1
+
+if ls $pkg-* 1> /dev/null 2>&1
+then
+ echo "Please check if sources from previous backport or build need to be cleaned up"
+ exit 1
+fi
+
+if [ "$skip" = false ]
+then
+ apt-get update
+ apt-get upgrade
+fi
+apt-get build-dep $pkg
+apt-get source $pkg
+
+# Move sources to $DIST directory to enable parallel builds
+mkdir -p $DIST
+mv $pkg\_* $DIST
+mv $pkg-* $DIST
+
+cd $DIST/$pkg-*
+
+dpkg-buildpackage -B
+
+cd ../..
+
+keep=false # We do not want to keep local sources for binary builds
+# Clean sources from $DIST directory
+if [ "$keep" = false ]
+then
+ rm -f $DIST/$pkg\_*.{dsc,changes,diff.gz,tgz,tar.gz,tar.xz}
+ #rm -rf $DIST/$pkg-* # This removes e.g. r-base-core* debs which is not intended
+fi

Contact - Imprint