3 # Script for nightly builds of conkeror .debs
5 # Inspired by an idea of Nicholas A. Zigarovich <nick@servo.cc>
6 # Code by Axel Beckert <abe@deuxchevaux.org>
8 # Copyright (C) 2009 Axel Beckert <abe@deuxchevaux.org>
10 # Needs the following Debian packages and their dependencies installed
11 # (besides "required" packages like coreutils and conkeror build
12 # dependencies) to work: devscripts, git-core
14 # If you want to use all features of this script, you need also the
15 # following packages: gnupg, openssh-client
17 # And on the machine hosting the APT repository, you'll need the
22 # Create the file ~/.conkeror-nightlybuildrc and write at least a line
23 # like the following into it:
25 # WORKDIR=/path/to/the/directory/where/the/builds/should/happen
27 # Example ~/.conkeror-nightlybuildrc similar to the one used for
28 # http://noone.org/conkeror-nightly-debs/:
31 # WORKDIR=$HOME/conkeror.nightly
34 # UPLOAD_SSH_KEY=~/.ssh/id_rsa.conkeror-nightly
35 # UPLOAD_SSH_HOST=noone.org
37 # UPLOAD_SSH_DIR=http/htdocs/conkeror-nightly
40 # I think the remaining variable names are quite self-explaining. If
41 # not, look at this script's source code (you're doing that already
42 # ;-) and see where they're used. It's not too hard, the script is
43 # fairly small and straight forward. ;-)
45 # Bail out on any error.
48 # Check for the the config file and read it
49 RCFILE
=$HOME/.conkeror-nightlybuildrc
50 if [ ! -s $RCFILE ]; then
51 echo "$RCFILE does not exist or is empty"
56 # Check if a working directory is defined. Bail out if not.
57 if [ -z "$WORKDIR" ]; then
58 echo '$WORKDIR must be defined in '$RCFILE
62 # Check if $WORKDIR exists, otherwise create it.
63 if [ ! -d "$WORKDIR" ]; then
67 # Define places and version number
68 MASTERDIR
=$WORKDIR/MASTER
69 BUILDDIR
=$WORKDIR/BUILD
73 # Check if MASTER directory exists, if not, create it (untested code!)
75 if [ ! -d $MASTERDIR ]; then
76 git clone git
://repo.or.cz
/conkeror.git
$MASTERDIR
79 # Set the right options for debuild (signed vs unsigned packages)
80 DEBUILDOPTIONS
='-uc -us'
81 if [ ! -z "$SIGNKEY" ]; then
82 DEBUILDOPTIONS
="-k$SIGNKEY"
89 # Determine the correct version
90 VERSION
=`grep ^Version= $MASTERDIR/application.ini | \
91 sed -e 's/^Version=//'`+git
`date +%y%m%d`
92 RELEASE
=$VERSION-~nightlybuild
$UNIXTIME
93 DATEDIR
=$BUILDDIR/conkeror-
$VERSION
101 # Copy tree into build environment
102 cp -priv $MASTERDIR $DATEDIR
106 tar cvzf conkeror_
$VERSION.orig.
tar.gz
--exclude=.git conkeror-
$VERSION
108 # Add an appropriate changelog entry
110 mv changelog changelog.tmp
111 echo "conkeror ($RELEASE) UNRELEASED; urgency=low
113 * Automatically built package based on the state of
114 http://repo.or.cz/w/conkeror.git at $DATE
116 -- Conkeror Nightly Build <abe+conkeror-nightly@deuxchevaux.org> $DATE
118 cat changelog.tmp
>> changelog
123 debuild
$DEBUILDOPTIONS -i'(?:^|/).*~$|(?:^|/)\.#.*$|(?:^|/)\..*\.swp$|(?:^|/),,.*(?:$|/.*$)|(?:^|/)(?:DEADJOE|\.cvsignore|\.arch-inventory|\.bzrignore|\.gitignore|\.hgignore)$|(?:^|/)(?:CVS|RCS|\.deps|\{arch\}|\.arch-ids|\.svn|\.hg|_darcs|\.git|\.shelf|_MTN|\.bzr(?:\.backup|tags)|update\.sh)(?:$|/.*$)'
128 if [ "$UPLOAD" = "yes" ]; then
129 scp
-i $UPLOAD_SSH_KEY -p *build
*deb
*changes
*dsc
*gz \
130 $UPLOAD_SSH_USER@
$UPLOAD_SSH_HOST:$UPLOAD_SSH_DIR
132 if [ "$USE_REPREPRO" = "yes" ]; then
133 ssh -i $UPLOAD_SSH_KEY $UPLOAD_SSH_USER@
$UPLOAD_SSH_HOST \
134 "cd $UPLOAD_SSH_DIR; reprepro -v includedeb lenny" *.deb
"; reprepro -v includedeb sid" *.deb
"; reprepro -v includedsc lenny " *.dsc
"; reprepro -v includedsc sid " *.dsc
";"