tvheadend/support/launchpad-ppa
2012-10-12 13:29:36 +01:00

60 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
#
# Upload packages to launchpad. Note: you must configure dput for tvh-X
# as target PPA, and you should also define DEBFULLNAME and DEBEMAIL
# environment variables
#
# CMD
CMD=$(basename $0)
echo $CMD
# Configuration
TVH_ROOT=$(cd $(dirname $0)/..; pwd)
[ -z "$TVH_DIST" ] && TVH_DIST="hardy lucid natty oneiric precise wheezy"
[ -z "$TVH_ARCH" ] && TVH_ARCH="i386 amd64"
# Options
[ ! -z "$1" ] && REL=$1 || REL=master
[ ! -z "$2" ] && PPA=$2 || PPA=unstable
# Setup
cd $TVH_ROOT || exit 1
git checkout $1 && git checkout . || exit 1
NOW=`date -R`
CHANGELOG=$TVH_ROOT/debian/changelog
VERFILE=$TVH_ROOT/src/version.c
# Create version file
VER=$($TVH_ROOT/support/version $VERFILE)
# Fetch scan files
./support/getmuxlist
# For each distro
for d in $TVH_DIST; do
V=${VER}~${d}
echo $V
# Create changelog
$TVH_ROOT/support/changelog "$CHANGELOG" "$d" "$VER"
# Build source package
dpkg-buildpackage -I.git* -S -sgpg -pgpg || exit 1
# Build
if [ "$CMD" == "pbuilder" ]; then
for a in $TVH_ARCH; do
pbuilder-dist $d $a ../tvheadend_${V}.dsc
done
# Upload
else
dput tvh-$PPA ../tvheadend_${V}_source.changes || exit 1
fi
done
# Cleanup
git checkout .