Optify. Improve build script.
[dorian] / pkg / maemo / build-scratchbox.sh
index fcd0de1..3adcec9 100755 (executable)
@@ -1,16 +1,18 @@
 #!/bin/bash
 
 # Creates .deb package for Maemo, using scratchbox.
-# Assumes all source files are copied to $BUILD_DIR.
+# Assumes all source files are copied to $BUILD_DIR and build preparations
+# were done in $AUTO_DIR.
 
 set -x
 
-BUILD_DIR=/home/user/dorian-auto
+BUILD_DIR=/home/user/dorian-build
+AUTO_DIR=/home/user/dorian-auto
 
 [ `id -u` != "0" ] && { echo "Run as root"; exit 1; }
+[ ! -d ${AUTO_DIR} ] && { echo "Missing $AUTO_DIR"; exit 1; }
 [ ! -d ${BUILD_DIR} ] && { echo "Missing $BUILD_DIR"; exit 1; }
 
-# VERSION=`cat ${BUILD_DIR}/pkg/version.txt`
-VERSION=0.0.7
-cd ${BUILD_DIR}/dorian-${VERSION} || exit 1
+VERSION=`cat ${BUILD_DIR}/pkg/version.txt`
+cd ${AUTO_DIR}/dorian-${VERSION} || exit 1
 dpkg-buildpackage -rfakeroot