Translated using Weblate.
[wammu.git] / admin / make-release
blob30c746fb69d0dce0174e29e93b560447e3dfffee
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`
13 if false ; then
14 if [ -f ~/.id/codesigning.spc -a "x$NO_SIGN" = "x" ] ; then
15 sign_passwd=`gk-get --user=nijel --object=codesign || true`
16 if [ -z "$sign_passwd" ] ; then
17 echo -n "Enter sign password: "
18 read sign_passwd
23 signexe() {
24 if [ ! -f ~/.id/codesigning.spc ] ; then
25 echo 'Skipping signing, no certificates!'
26 return 0
28 if [ "x$NO_SIGN" != "x" ] ; then
29 echo 'Skipping signing, disabled!'
30 return 0
32 echo "$sign_passwd" | signcode \
33 -spc ~/.id/codesigning.spc \
34 -v ~/.id/codesigning.pvk \
35 -a sha1 \
36 -$ individual \
37 -n "$2" \
38 -t http://timestamp.verisign.com/scripts/timstamp.dll \
39 -i http://cihar.com/ \
40 "$1"
41 rm "$1.bak"
44 dotag=0
45 if [ "x$1" = "xbranch" ] ; then
46 checkout=HEAD
47 dotag=1
48 # Pre release checks
49 if grep -q '^20[0-9][0-9]-??-?? - ' ChangeLog ; then
50 echo 'ChangeLog does not seem to be finalised, aborting!'
51 exit 1
53 shift
54 elif [ "x$1" = "x" ] ; then
55 checkout=HEAD
56 else
57 checkout=$1
58 version=$1
59 shift
62 tmp=`mktemp -dt $repo-build-XXXXXX`
63 cd $tmp
64 echo Working in $tmp
65 echo "Creating release $version from $checkout"
66 git clone $srcdir $repo-$version
67 cd $repo-$version
68 git checkout $checkout
69 rm -rf .git
71 echo 'Creating source tarballs...'
74 # Build source package
75 ./setup.py sdist --formats=gztar,bztar,zip
76 mv dist/* ../
78 if false ; then
80 # Build Windows Python installer
81 wine c:\\python25\\python setup.py bdist_wininst
82 mv dist/* ../
84 rm -rf dist
86 # Build py2exe module
87 wine c:\\python25\\python setup.py py2exe
89 # py2exe does not catch these for some reason
90 cp ~/.wine/drive_c/windows/system32/python25.dll dist/
91 cp ~/.wine/drive_c/Python25/Lib/site-packages/wx-2.8-msw-unicode/wx/*.dll dist/
92 cp ~/.wine/drive_c/Python25/Lib/site-packages/gammu/*.dll dist/
94 # Sign main binary
95 signexe dist/wammu.exe "Wammu"
97 # Build Windows installer
98 wine c:\\Program\ Files\\Inno\ Setup\ 5/\\ISCC.exe wammu.iss
99 mv Output/$repo-$version-setup.exe ../
101 # Sign binaries
102 for bin in $tmp/*-setup.exe ; do
103 signexe $bin "Wammu installer"
104 done
108 # We're done
109 echo "Release is in $tmp directory"
110 ls -lh $tmp
112 cd "$srcdir"
114 if [ $dotag -eq 1 ] ; then
115 # Tag the release
116 git tag -s -m "Tag release $version" "$version"
117 # Submit to PyPi
118 $tmp/$repo-$version/setup.py register
119 # Upload to sf.net
120 ./admin/upload-release $version $tmp