debian packaging script

master
lars 16 years ago
parent 78ed498483
commit bbf222212a
  1. 32
      make-deb.sh
  2. 10
      make-tar.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"

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

Loading…
Cancel
Save