debian/contrib/update.sh now accepts an upstream version as parameter
[conkeror.git] / contrib / debian / update.sh
blobb0ddbaab9259abd33dfed8e6a1257d246b397974
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 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=//'`+git`date +%y%m%d`
40 echo -n "Hit enter to rename directory from $olddir to conkeror-$version
41 and generate source tar ball or hit Ctrl-C to abort."
42 read line
44 # Clean up before renaming
45 rm -f spawn-process-helper conkeror-spawn-helper
46 make clean
48 # Do the rename
49 cd ..
50 mv -vi $olddir conkeror-$version
52 # Create source package out of the git working copy
53 tar cvzf conkeror_$version.orig.tar.gz \
54 --exclude=conkeror-$version/debian \
55 --exclude=.git \
56 --exclude=.gitignore \
57 --exclude=.pc \
58 --exclude=configure-stamp \
59 conkeror-$version
61 # Change back to the packaging directory
62 cd conkeror-$version