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
71 VERSION
=0.9~git
`date +%y%m%d`
72 RELEASE
=$VERSION-~nightlybuild
$UNIXTIME
73 DATEDIR
=$BUILDDIR/conkeror-
$VERSION
76 # Check if MASTER directory exists, if not, create it (untested code!)
78 if [ ! -d $MASTERDIR ]; then
79 git clone git
://repo.or.cz
/conkeror.git
$MASTERDIR
82 # Set the right options for debuild (signed vs unsigned packages)
83 DEBUILDOPTIONS
='-uc -us'
84 if [ ! -z "$SIGNKEY" ]; then
85 DEBUILDOPTIONS
="-k$SIGNKEY"
98 # Copy tree into build environment
99 cp -priv $MASTERDIR $DATEDIR
103 tar cvzf conkeror_
$VERSION.orig.
tar.gz
--exclude=.git conkeror-
$VERSION
105 # Add an appropriate commit.id (probably obsolete soon)
107 git log |
head -1 |
awk '{print $2}' > debian
/commit.id
109 # Add an appropriate changelog entry
111 mv changelog changelog.tmp
112 echo "conkeror ($RELEASE) UNRELEASED; urgency=low
114 * Automatically built package based on the state of
115 http://repo.or.cz/w/conkeror.git at $DATE
117 -- Conkeror Nightly Build <abe+conkeror-nightly@deuxchevaux.org> $DATE
119 cat changelog.tmp
>> changelog
124 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)(?:$|/.*$)'
129 if [ "$UPLOAD" = "yes" ]; then
130 scp
-i $UPLOAD_SSH_KEY -p *build
*deb
*changes
*dsc
*gz \
131 $UPLOAD_SSH_USER@
$UPLOAD_SSH_HOST:$UPLOAD_SSH_DIR
133 if [ "$USE_REPREPRO" = "yes" ]; then
134 ssh -i $UPLOAD_SSH_KEY $UPLOAD_SSH_USER@
$UPLOAD_SSH_HOST \
135 "cd $UPLOAD_SSH_DIR; reprepro -v includedeb lenny" *.deb
"; reprepro -v includedeb sid" *.deb
"; reprepro -v includedsc lenny " *.dsc
"; reprepro -v includedsc sid " *.dsc
";"