Debian package: Use more debhelper magic
[conkeror.git] / contrib / debian / update.sh
blob485c56e5a296254167a02deef896f738056dd681
1 #!/bin/sh
3 # Script to prepare Debian packages of conkeror including the creation
4 # of the so called source package. Do not move away from its current
5 # location -- it depends on it.
7 # It accepts one optional parameter: an upstream version number,
8 # e.g. "0.9.1". If a parameter is given, no date based snapshot
9 # version number is generated.
11 # Copyright (C) 2008-2009, 2012 Axel Beckert <abe@deuxchevaux.org>
13 # Find the full path of the current packaging directory and cd to it
14 currdir=`dirname $0`/../..
15 cd $currdir
16 olddir=$(basename $(pwd -P))
17 echo currdir=$currdir olddir=$olddir
19 # Unapply all patches if there are any
20 quilt pop -a
22 # Update the code from the git repository
23 git fetch
25 # Display the changes and ask if we should continue
26 git log HEAD..origin
27 echo -n "Hit enter to continue and merge changes or hit Ctrl-C to abort."
28 read line
30 # Merge in the fetched changes
31 git rebase origin/master
33 # Rename the packaging directory to reflect the new version number
34 if [ -n "$1" ]; then
35 version="$1"
36 else
37 version=`grep ^Version= application.ini | \
38 sed -e 's/^Version=//;
39 s/\([0-9]\)pre/\1~~pre/;
40 s/\([0-9]\)\([ab][0-9]\|rc\|beta\|alpha\)/\1~\2/' \
41 `+git`date +%y%m%d`
43 echo -n "Hit enter to rename directory from $olddir to conkeror-$version
44 and generate source tar ball or hit Ctrl-C to abort."
45 read line
47 # Clean up before renaming
48 rm -f spawn-process-helper conkeror-spawn-helper
49 make clean
51 # Do the rename
52 cd ..
53 mv -vi $olddir conkeror-$version
55 # Create source package out of the git working copy
56 tar cvzf conkeror_$version.orig.tar.gz \
57 --exclude=conkeror-$version/debian \
58 --exclude=.git \
59 --exclude=.gitignore \
60 --exclude=.pc \
61 --exclude=configure-stamp \
62 conkeror-$version
64 # Change back to the packaging directory
65 cd conkeror-$version