diff --git a/make-deb.sh b/make-deb.sh new file mode 100755 index 0000000..1592d67 --- /dev/null +++ b/make-deb.sh @@ -0,0 +1,32 @@ +#!/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" +mv "$TMP_DIR"/${PREFIX}*.deb "$DEB_DIR" + diff --git a/make-tar.sh b/make-tar.sh index 638161e..c24c75b 100755 --- a/make-tar.sh +++ b/make-tar.sh @@ -3,13 +3,15 @@ set -eu PRJ_ROOT=$(dirname $(cd "$(dirname $0)"; pwd)) - PREFIX=cryptobox [ $# -lt 1 -o $# -gt 2 ] && echo "Syntax: `basename $0` VERSION" && echo && exit 1 -SRC_DIR=${PREFIX}-${1} -[ $# -eq 2 ] && SRC_DIR=$2 -[ ! -d "$SRC_DIR" ] && echo "the directory '$SRC_DIR' does not exist!" && exit 2 +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 + +TAR_FILE=$PRJ_ROOT/tags/packages/${PREFIX}-${1}.tar.gz TMP_DIR=/tmp/${PREFIX}-${1} [ -e "$TMP_DIR" ] && rm -rf "$TMP_DIR"