add helper script to build busybox-power
authorDennis Groenen <dennis_groenen@hotmail.com>
Wed, 6 Jul 2011 12:43:01 +0000 (14:43 +0200)
committerDennis Groenen <dennis_groenen@hotmail.com>
Wed, 6 Jul 2011 12:43:01 +0000 (14:43 +0200)
build.sh [new file with mode: 0755]

diff --git a/build.sh b/build.sh
new file mode 100755 (executable)
index 0000000..f68e035
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+# Helper script to build busybox-power
+# Please run me from within Scratchbox
+
+BBVERSION="1.18.5"
+MAKETHREADS="8"
+SCRIPTDIR=`dirname $(readlink -f $0)`
+BUILDDIR="$SCRIPTDIR/../busybox-power-build"
+
+hash wget 2>&- || { 
+  echo >&2 "this script requires wget, exiting now"
+  exit 1 
+}
+
+mkdir -p $BUILDDIR
+cd $BUILDDIR
+
+if ! test -e busybox-$BBVERSION.tar.bz2; then
+  wget http://busybox.net/downloads/busybox-$BBVERSION.tar.bz2
+fi;
+
+if test -d busybox-$BBVERSION/; then
+  echo "`pwd`/busybox-$BBVERSION already exists,"
+  echo "please (re)move it before rerunning this script"
+  exit 1
+fi
+
+tar -jxvf busybox-$BBVERSION.tar.bz2
+cp -af $SCRIPTDIR/debian/ busybox-$BBVERSION/
+
+# Build
+cd busybox-$BBVERSION/ && DEB_BUILD_OPTIONS="parallel=$MAKETHREADS" dpkg-buildpackage -r"fakeroot -u" -uc -us -nc