-
-
Notifications
You must be signed in to change notification settings - Fork 153
/
Copy pathmake-release
executable file
·170 lines (148 loc) · 4.63 KB
/
make-release
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#!/bin/sh
# vim: expandtab sw=4 ts=4 sts=4:
# Usage: make-release [branch]
set -e
repo=gammu
version=`sed -n 's/set (VERSION "\([^"]*\)".*)/\1/p' CMakeLists.txt`
srcdir=`pwd`
signexe() {
if [ ! -f ~/.id/codesigning.spc ] ; then
echo 'Skipping signing, no certificates!'
return 0
fi
if [ "x$NO_SIGN" != "x" ] ; then
echo 'Skipping signing, disabled!'
return 0
fi
gk-get --user=nijel --object=codesign | signcode \
-spc ~/.id/codesigning.spc \
-v ~/.id/codesigning.pvk \
-$ individual \
-n "$2" \
-t http://timestamp.verisign.com/scripts/timstamp.dll \
-i http://cihar.com/ \
"$1"
rm "$1.bak"
}
checkexe() {
if i586-mingw32msvc-objdump -x "$1" | grep -qi 'DLL Name.*msvcrt.dll' ; then
echo "Program $1 is linked to msvcrt.dll!"
exit 1
fi
}
# Pre release checks
if [ "x$1" = "xbranch" ] ; then
if grep -q '^200[0-9]???? - ' ChangeLog ; then
echo 'ChangeLog does not seem to be finalised, aborting!'
exit 1
fi
fi
tmp=`mktemp -dt $repo-build-XXXXXX`
CMAKE_EXTRA=""
if [ "x$1" = "x--debug" ] ; then
shift
CMAKE_EXTRA="$CMAKE_EXTRA -DCMAKE_BUILD_TYPE=Debug"
fi
cd $tmp
echo Working in $tmp
if [ "x$1" = "xbranch" ] ; then
shift
rel=RELEASE_`echo -n $version|tr . _`
svn cp -m "Tag release $version" svn+ssh://mort/home/svn/$repo/trunk svn+ssh://mort/home/svn/$repo/tags/$rel
svn export svn+ssh://mort/home/svn/$repo/tags/$rel $repo-$version
# Submit to PyPi
$tmp/$repo-$version/python/setup.py register
elif [ "x$1" = "x" ] ; then
rel=trunk
svn export svn+ssh://mort/home/svn/$repo/trunk $repo-$version
else
version="$1"
shift
rel=RELEASE_`echo -n $version|tr . _`
svn export svn+ssh://mort/home/svn/$repo/tags/$rel $repo-$version
fi
echo "Creating release $version from $rel"
echo 'Creating source tarballs...'
tar cfz $repo-$version.tar.gz $repo-$version
tar cfj $repo-$version.tar.bz2 $repo-$version
echo 'Building Windows version...'
mkdir build-win-shared
cd build-win-shared
cmake ../$repo-$version \
-DCMAKE_TOOLCHAIN_FILE=../$repo-$version/cmake/Toolchain-mingw32.cmake \
-DBUILD_SHARED_LIBS=ON \
-DDLL_LIBMYSQL.DLL=~/win-cross/mysql/bin/libmysql.dll \
-DMYSQL_INCLUDE_DIR=~/win-cross/mysql/include \
-DMYSQL_LIBRARIES=~/win-cross/mysql/lib/libmysql.a \
$CMAKE_EXTRA \
make -j2
checkexe gammu/gammu.exe
signexe gammu/gammu.exe "Gammu"
cpack
mv Gammu-*-Windows.* $tmp/
cd ..
mkdir build-win-minimal
echo "Building minimal Windows version..."
cd $tmp/build-win-minimal
cmake ../$repo-$version \
-DCMAKE_TOOLCHAIN_FILE=../$repo-$version/cmake/Toolchain-mingw32.cmake \
-DBUILD_SHARED_LIBS=OFF \
$CMAKE_EXTRA \
-DCPACK_SYSTEM_NAME=Windows-Minimal \
-DWITH_Postgres=OFF \
-DWITH_MySQL=OFF \
-DWITH_GettextLibs=OFF \
-DWITH_Iconv=OFF \
-DWITH_CURL=OFF \
make -j2
checkexe gammu/gammu.exe
signexe gammu/gammu.exe "Gammu"
cpack
mv Gammu-*-Windows-Minimal.* $tmp/
cd $tmp
mkdir build-win-python
for py in 2.4 2.5 ; do
pynodot=`echo $py | tr -d '.'`
echo "Building minimal Windows version with Python $py..."
cd $tmp/build-win-python
cmake ../$repo-$version \
-DCMAKE_TOOLCHAIN_FILE=../$repo-$version/cmake/Toolchain-mingw32.cmake \
-DBUILD_SHARED_LIBS=OFF \
$CMAKE_EXTRA \
-DCPACK_SYSTEM_NAME=Windows-Minimal \
-DWITH_Postgres=OFF \
-DWITH_MySQL=OFF \
-DWITH_GettextLibs=OFF \
-DWITH_Iconv=ON \
-DWITH_CURL=OFF \
-DPYTHON_LIBRARY=~/.wine/drive_c/Python$pynodot/libs/libpython$pynodot.a \
-DPYTHON_INCLUDE_PATH=~/.wine/drive_c/Python$pynodot/include/ \
-DPYTHON_EXECUTABLE=~/.wine/drive_c/Python$pynodot/python.exe \
make -j2
mkdir -p $tmp/$repo-$version/python/build/lib.win32-$py
cp -r python/gammu $tmp/$repo-$version/python/build/lib.win32-$py/
cp gammu/*.dll $tmp/$repo-$version/python/build/lib.win32-$py/gammu/
cd ..
cd $repo-$version/python
wine \
~/.wine/drive_c/Python$pynodot/python.exe setup.py \
bdist_wininst --skip-build --target-version $py
mv dist/*.exe $tmp/
if [ $py != "2.4" ] ; then
wine \
~/.wine/drive_c/Python$pynodot/python.exe setup.py \
bdist_msi --skip-build --target-version $py
mv dist/*.msi $tmp/
fi
cd $tmp
done
# Sign binaries (not for python-gammu, it breaks some code underneath)
for bin in $tmp/Gammu*.exe ; do
signexe $bin "Gammu installer"
done
for bin in $tmp/python-gammu*.msi ; do
signexe $bin "python-gammu installer"
done
# We're done
echo "Release is in $tmp directory"
ls -lh $tmp