~ubuntu-branches/ubuntu/utopic/keychain/utopic

« back to all changes in this revision

Viewing changes to release.sh

  • Committer: Bazaar Package Importer
  • Author(s): Cesar Mendoza
  • Date: 2011-10-11 19:01:34 UTC
  • mfrom: (1.5.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20111011190134-xregcfs9h18wbx3r
Tags: 2.7.1-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
# This script is used by the keychain maintainer to generate new keychain releases.
 
4
 
 
5
PKG=keychain
 
6
VERSION=`cat VERSION`
 
7
 
 
8
versionsub() {
 
9
        # For keychain, this substitution stuff is done by the Makefile...
 
10
        cat $1 | sed -e "s/##VERSION##/$VERSION/g"
 
11
}
 
12
 
 
13
die() {
 
14
        echo $*
 
15
        exit 1
 
16
}
 
17
 
 
18
prep() {
 
19
        rm -rf dist/$PKG-$VERSION*
 
20
        install -d dist/$PKG-$VERSION
 
21
}
 
22
 
 
23
commit() {
 
24
        
 
25
        # Last step of a release is for the maintainer to update Changelog, README.rst and VERSIOn,
 
26
        # and then run "./release.sh all", which will run the following to make the release commit
 
27
        # and generate a release tarball. The release tarball is the current git tarball with "make"
 
28
        # run inside it, so that keychain, keychain.1 and keychain.spec are pre-generated for the
 
29
        # end-user. Since keychain is a script and the automated Makefile exists as a convenience
 
30
        # for the maintainer, we don't want to pass this complexity on to the consumers of this
 
31
        # package.
 
32
 
 
33
        git commit -a -m "$VERSION distribution release" || die "commit failed"
 
34
        git archive --format=tar --prefix=${PKG}-${VERSION}/ HEAD | tar xf - -C dist || die "git archive fail"
 
35
        git push || die "keychain git push failed"
 
36
        cd dist/$PKG-$VERSION || die "pkg cd fail"
 
37
        # tmpclean target cleans up temporary intermediate files that were produced.
 
38
        make clean all || die "make dist failed"
 
39
        make tmpclean || die "make tmpclean failed"
 
40
        cd .. || die "pkg cd .. fail"
 
41
        tar cjf $PKG-$VERSION.tar.bz2 $PKG-$VERSION || die "release tarball failed"
 
42
        cd .. || die "pkg cd .. again fail"
 
43
}
 
44
 
 
45
web() {
 
46
        cp dist/$PKG-$VERSION.tar.bz2 /root/git/website/archive/$PKG/ || die "web cp failed"
 
47
        cd /root/git/website || die "cd failed"
 
48
        git add archive/$PKG/* || die "git add failed"
 
49
        git commit -a -m "new $PKG $VERSION" || die "git commit failed"
 
50
        git push || die "git push failed"
 
51
        ./install.sh || die "web update failed"
 
52
}
 
53
 
 
54
if [ "$1" = "prep" ]
 
55
then
 
56
        prep
 
57
elif [ "$1" = "commit" ]
 
58
then
 
59
        commit
 
60
elif [ "$1" = "web" ]
 
61
then
 
62
        web
 
63
elif [ "$1" = "all" ]
 
64
then
 
65
        prep
 
66
        commit
 
67
        web
 
68
fi