#!/bin/sh DISTRO="gutsy" VERSION="~${DISTRO}1" BUILD=false SOURCE=false if ! [ -f debian/changelog ]; then echo "Can't find debian/changelog" echo "Are you sure you're in the source directory?" exit 1 fi if [ $# -gt 1 ]; then while [ "$#" != "1" ]; do case "$1" in "-ppa") VERSION="${VERSION}~ppa1" shift ;; "-b") if [ "$SOURCE" = "false" ]; then BUILD=true shift; else echo "Only one of '-s' or '-b' can be given" exit 1; fi ;; "-s") if [ "$BUILD" = "false" ]; then SOURCE=true shift; else echo "Only one of '-s' or '-b' can be given" exit 1; fi ;; *) echo "'$1' is an unknown option" exit 1 ;; esac done fi dch -D $DISTRO -b --newversion "$(dpkg-parsechangelog|grep "^Version: "|sed 's/Version: //')${VERSION}" "$@" if [ "$BUILD" = "true" ]; then echo "Building a binary package." debuild fi if [ "$SOURCE" = "true" ]; then echo "Building a source package." debuild -S fi