Translation update done using Pootle.
[wammu.git] / admin / make-release
blob7798967634bbd524ad7b23217c947cd628d9e62a
1 #!/bin/sh
2 # vim: expandtab sw=4 ts=4 sts=4:
4 # Usage: make-release [branch]
6 set -e
8 repo=wammu
10 version=`python -c 'import Wammu; print Wammu.__version__' | tr -d '\n'`
12 srcdir=`pwd`
14 signexe() {
15 if [ ! -f ~/.id/codesigning.spc ] ; then
16 echo 'Skipping signing, no certificates!'
17 return 0
19 if [ "x$NO_SIGN" != "x" ] ; then
20 echo 'Skipping signing, disabled!'
21 return 0
23 gk-get --user=nijel --object=codesign | signcode \
24 -spc ~/.id/codesigning.spc \
25 -v ~/.id/codesigning.pvk \
26 -$ individual \
27 -n "$2" \
28 -t http://timestamp.verisign.com/scripts/timstamp.dll \
29 -i http://cihar.com/ \
30 "$1"
31 rm "$1.bak"
34 dotag=0
35 if [ "x$1" = "xbranch" ] ; then
36 checkout=HEAD
37 dotag=1
38 # Pre release checks
39 if grep -q '^20[0-9][0-9]-??-?? - ' ChangeLog ; then
40 echo 'ChangeLog does not seem to be finalised, aborting!'
41 exit 1
43 shift
44 elif [ "x$1" = "x" ] ; then
45 checkout=HEAD
46 else
47 checkout=$1
48 version=$1
49 shift
52 tmp=`mktemp -dt $repo-build-XXXXXX`
53 cd $tmp
54 echo Working in $tmp
55 echo "Creating release $version from $checkout"
56 git clone $srcdir $repo-$version
57 cd $repo-$version
58 git checkout $checkout
59 rm -rf .git
61 echo 'Creating source tarballs...'
64 # Build source package
65 ./setup.py sdist --formats=gztar,bztar,zip
66 mv dist/* ../
68 # Build Windows Python installer
69 wine c:\\python25\\python setup.py bdist_wininst
70 mv dist/* ../
72 rm -rf dist
74 # Build py2exe module
75 wine c:\\python25\\python setup.py py2exe
77 # py2exe does not catch these for some reason
78 cp ~/.wine/drive_c/windows/system32/python25.dll dist/
79 cp ~/.wine/drive_c/Python25/Lib/site-packages/wx-2.8-msw-unicode/wx/*.dll dist/
80 cp ~/.wine/drive_c/Python25/Lib/site-packages/gammu/*.dll dist/
82 # Sign main binary
83 signexe dist/wammu.exe "Wammu"
85 # Build Windows installer
86 wine c:\\Program\ Files\\Inno\ Setup\ 5/\\ISCC.exe wammu.iss
87 mv Output/$repo-$version-setup.exe ../
89 # Sign binaries
90 for bin in $tmp/*-setup.exe ; do
91 signexe $bin "Wammu installer"
92 done
94 # We're done
95 echo "Release is in $tmp directory"
96 ls -lh $tmp
98 cd "$srcdir"
100 if [ $dotag -eq 1 ] ; then
101 # Tag the release
102 git tag -s -m "Tag release $version" "$version"
103 # Submit to PyPi
104 $tmp/$repo-$version/setup.py register