2006-11-28 14:15:45 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
PRJ_ROOT=$(dirname $(cd "$(dirname $0)"; pwd))
|
|
|
|
PREFIX=cryptobox
|
|
|
|
|
2006-12-05 20:48:15 +01:00
|
|
|
|
|
|
|
get_debian_version()
|
|
|
|
# compare the given version with the one from debian/changelog
|
|
|
|
{
|
2007-05-23 02:13:00 +02:00
|
|
|
head -1 "$SRC_DIR/debian/changelog" | cut -f 2 -d "(" | cut -f 1 -d ")"
|
2006-12-05 20:48:15 +01:00
|
|
|
}
|
|
|
|
|
2006-12-07 13:20:43 +01:00
|
|
|
set_cryptobox_package_version()
|
|
|
|
# set the version attribute in scr/cryptobox/__init__.py
|
|
|
|
{
|
|
|
|
sed -i "s/^__version__.*$/__version__ = \"$1\"/" "$SRC_DIR/src/cryptobox/__init__.py"
|
|
|
|
}
|
2006-12-05 20:48:15 +01:00
|
|
|
|
2006-12-05 17:21:29 +01:00
|
|
|
[ $# -lt 1 -o $# -gt 2 ] && echo "Syntax: `basename $0` VERSION {PATH}" && echo && exit 1
|
2006-11-28 14:15:45 +01:00
|
|
|
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
|
|
|
|
|
2006-12-05 20:48:15 +01:00
|
|
|
deb_version=$(get_debian_version)
|
|
|
|
if test "$1" = "$deb_version"
|
|
|
|
then true
|
|
|
|
else echo "The version number you specified ($1) was not equal to the current debian changelog version ($deb_version)!"
|
|
|
|
echo "Run 'debchange -i' to create a new changelog entry."
|
|
|
|
echo
|
|
|
|
exit 3
|
|
|
|
fi
|
|
|
|
|
2006-12-07 13:20:43 +01:00
|
|
|
set_cryptobox_package_version "$1"
|
2006-12-05 20:48:15 +01:00
|
|
|
|
2006-11-28 14:15:45 +01:00
|
|
|
# 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
|
2007-05-10 11:14:03 +02:00
|
|
|
# build i386 binary package
|
|
|
|
debuild -us -uc
|
|
|
|
# build arm binary package
|
|
|
|
debuild -us -uc -aarm
|
2006-11-28 14:15:45 +01:00
|
|
|
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
|
|
|
|