debian packaging script

This commit is contained in:
lars 2006-11-28 13:15:45 +00:00
parent 78ed498483
commit bbf222212a
2 changed files with 38 additions and 4 deletions

32
make-deb.sh Executable file
View file

@ -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"

View file

@ -3,13 +3,15 @@
set -eu set -eu
PRJ_ROOT=$(dirname $(cd "$(dirname $0)"; pwd)) PRJ_ROOT=$(dirname $(cd "$(dirname $0)"; pwd))
PREFIX=cryptobox PREFIX=cryptobox
[ $# -lt 1 -o $# -gt 2 ] && echo "Syntax: `basename $0` VERSION" && echo && exit 1 [ $# -lt 1 -o $# -gt 2 ] && echo "Syntax: `basename $0` VERSION" && echo && exit 1
SRC_DIR=${PREFIX}-${1} REL_SRC_DIR=${PREFIX}-${1}
[ $# -eq 2 ] && SRC_DIR=$2 [ $# -eq 2 ] && REL_SRC_DIR=$2
[ ! -d "$SRC_DIR" ] && echo "the directory '$SRC_DIR' does not exist!" && exit 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} TMP_DIR=/tmp/${PREFIX}-${1}
[ -e "$TMP_DIR" ] && rm -rf "$TMP_DIR" [ -e "$TMP_DIR" ] && rm -rf "$TMP_DIR"