2006-11-28 14:15:45 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
PRJ_ROOT=$(dirname $(cd "$(dirname $0)"; pwd))
|
|
|
|
PREFIX=cryptobox
|
|
|
|
|
|
|
|
[ $# -lt 1 -o $# -gt 2 ] && echo "Syntax: `basename $0` VERSION" && echo && exit 1
|
|
|
|
REL_SRC_DIR=${PREFIX}-${1}
|
|
|
|
[ $# -eq 2 ] && REL_SRC_DIR=$2
|
|
|
|
SRC_DIR=$(cd "$(pwd)/$REL_SRC_DIR"; pwd)
|
|
|
|
[ ! -d "$SRC_DIR" ] && echo "the directory '$REL_SRC_DIR' does not exist!" && exit 2
|
|
|
|
|
|
|
|
# create the tar file
|
|
|
|
"$(dirname $0)/make-tar.sh" "$@"
|
|
|
|
|
|
|
|
TAR_FILE=$PRJ_ROOT/tags/packages/${PREFIX}-${1}.tar.gz
|
|
|
|
DEB_DIR=$(dirname "$TAR_FILE")/debian
|
|
|
|
|
|
|
|
TMP_DIR=/tmp/builddir-$PREFIX-$$
|
|
|
|
|
|
|
|
mkdir -p "$TMP_DIR"
|
|
|
|
cd "$TMP_DIR"
|
|
|
|
NEW_TAR_FILE=${PREFIX}_${1}.orig.tar.gz
|
|
|
|
cp "$TAR_FILE" "$NEW_TAR_FILE"
|
|
|
|
tar xzf "$TAR_FILE"
|
|
|
|
cd "$PREFIX-$1"
|
|
|
|
svn export "$SRC_DIR/debian" debian
|
|
|
|
debuild -us -uc
|
|
|
|
mkdir -p "$DEB_DIR"
|
2006-11-30 15:56:05 +01:00
|
|
|
for a in "$TMP_DIR"/${PREFIX}*
|
|
|
|
do test -f "$a" && mv "$a" "$DEB_DIR"
|
|
|
|
done
|
2006-11-28 14:15:45 +01:00
|
|
|
|