Update by some strings from Gammu.
[wammu.git] / admin / make-release
blobfe7ca8da2d49783e0dfc33060067b445f8d59c95
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"
35 tmp=`mktemp -dt $repo-build-XXXXXX`
37 cd $tmp
38 echo Working in $tmp
39 if [ "x$1" = "xbranch" ] ; then
40 shift
41 rel=RELEASE_`echo -n $version|tr . _`
42 svn cp -m "Tag release $version" svn+ssh://mort/home/svn/$repo/trunk svn+ssh://mort/home/svn/$repo/tags/$rel
43 svn export svn+ssh://mort/home/svn/$repo/tags/$rel $repo-$version
44 elif [ "x$1" = "x" ] ; then
45 rel=trunk
46 svn export svn+ssh://mort/home/svn/$repo/trunk $repo-$version
47 else
48 version="$1"
49 shift
50 rel=RELEASE_`echo -n $version|tr . _`
51 svn export svn+ssh://mort/home/svn/$repo/tags/$rel $repo-$version
54 echo "Creating release $version from $rel"
56 cd $repo-$version
58 # Build source package
59 ./setup.py sdist --formats=gztar,bztar,zip
60 mv dist/* ../
62 # Submit to PyPi
63 if [ "x$1" = "xbranch" ] ; then
64 ./setup.py register
67 # Build Windows Python installer
68 wine c:\\python25\\python setup.py build --skip-deps bdist_wininst
69 mv dist/* ../
71 rm -rf dist
73 # Build py2exe module
74 wine c:\\python25\\python setup.py build --skip-deps py2exe
76 # py2exe does not catch these for some reason
77 cp ~/.wine/drive_c/windows/system32/python25.dll dist/
78 cp ~/.wine/drive_c/Python25/Lib/site-packages/wx-2.8-msw-unicode/wx/*.dll dist/
80 # Sign main binary
81 signexe dist/wammu.exe "Wammu"
83 # Build Windows installer
84 wine c:\\Program\ Files\\Inno\ Setup\ 5/\\ISCC.exe wammu.iss
85 mv Output/$repo-$version-setup.exe ../
87 # Sign binaries
88 for bin in $tmp/*-setup.exe ; do
89 signexe $bin "Wammu installer"
90 done
92 # We're done
93 echo "Release is in $tmp directory"
94 ls -lh $tmp