#!/bin/sh # # Copyright (c) 02005 sense.lab # # License: This script is distributed under the terms of version 2 # of the GNU GPL. See the LICENSE file included with the package. # # $Id: cbox-build.sh 336 2005-11-29 22:28:28Z lars $ # # build a debian package # set -ue # include common functions and settings source $(dirname $0)/common.sh.inc ######### some settings ########### DEB_BUILD_DIR=/tmp/cryptobox-debian-$$ [ -e "$DEB_BUILD_DIR" ] && rm -rf "$DEB_BUILD_DIR" DEB_CONTROL_DIR=$ROOT_DIR/DEBIAN DEB_PACKAGE_DIR=$ROOT_DIR/packages ############# do it ############### ACTION=build [ $# -gt 0 ] && ACTION=$1 && shift case "$ACTION" in build ) svn export "$CBOX_DEVEL_DIR" "$DEB_BUILD_DIR" >/dev/null svn export "$DEB_CONTROL_DIR" "$DEB_BUILD_DIR/DEBIAN" >/dev/null fakeroot dpkg-deb --build "$DEB_BUILD_DIR" "$DEB_PACKAGE_DIR" rm -rf "$DEB_BUILD_DIR" ;; check ) PACKAGE_FILE=$(find "$DEB_PACKAGE_DIR" -type f -name "cryptobox*" | grep "\.deb$" | sort -n | tail -1) if [ -z "$PACKAGE_FILE" ] then echo "no debian package found in $DEB_PACKAGE_DIR" else lintian "$PACKAGE_FILE" fi ;; * ) echo "Syntax: $(basename $0) [ build | check help ]" echo ;; esac