2 # vim: expandtab sw=4 ts=4 sts=4:
4 # Usage: make-release [branch]
9 #toolchain=cmake/Toolchain-mingw32msvc.cmake
10 toolchain
=cmake
/Toolchain-mingw32.cmake
11 toolchain64
=cmake
/Toolchain-mingw64.cmake
13 version
=`sed -n 's/set (GAMMU_VERSION "\([^"]*\)".*)/\1/p' CMakeLists.txt`
16 if [ -f ~
/.id
/codesigning.spc
-a "x$NO_SIGN" = "x" ] ; then
17 sign_passwd
=`gk-get --user=nijel --object=codesign || true`
18 if [ -z "$sign_passwd" ] ; then
19 echo -n "Enter sign password: "
25 if [ ! -f ~
/.id
/codesigning.spc
] ; then
26 echo 'Skipping signing, no certificates!'
29 if [ "x$NO_SIGN" != "x" ] ; then
30 echo 'Skipping signing, disabled!'
33 echo "$sign_passwd" | signcode \
34 -spc ~
/.id
/codesigning.spc \
35 -v ~
/.id
/codesigning.pvk \
39 -t http
://timestamp.verisign.com
/scripts
/timstamp.dll \
40 -i http
://cihar.com
/ \
46 # Disabled for now because we don't build Python binaries
48 if /usr
/i
*mingw
*/bin
/objdump
-x "$1" |
grep -qi 'DLL Name.*msvcrt.dll' ; then
49 echo "Program $1 is linked to msvcrt.dll!"
56 if [ "x$1" = "x--debug" ] ; then
58 CMAKE_EXTRA
="$CMAKE_EXTRA -DCMAKE_BUILD_TYPE=Debug"
62 if [ "x$1" = "xbranch" ] ; then
66 if grep -q '^20[0-9][0-9]???? - ' ChangeLog
; then
67 echo 'ChangeLog does not seem to be finalised, aborting!'
71 elif [ "x$1" = "x" ] ; then
79 tmp
=`mktemp -dt $repo-build-XXXXXX`
82 echo "Creating release $version from $checkout"
83 git clone
$srcdir $repo-$version
85 git checkout
$checkout
86 git submodule update
--init
87 find .
-type d
-name .git |
xargs -r rm -rf
88 find .
-type f
-name .gitignore |
xargs -r rm -f
91 echo 'Creating source tarballs...'
92 tar cfz
$repo-$version.
tar.gz
$repo-$version
93 tar cfj
$repo-$version.
tar.bz2
$repo-$version
94 tar cfJ
$repo-$version.
tar.xz
$repo-$version
96 echo 'Building Windows version...'
97 mkdir build-win-shared
99 cmake ..
/$repo-$version \
100 -DCMAKE_TOOLCHAIN_FILE=..
/$repo-$version/$toolchain \
101 -DBUILD_SHARED_LIBS=ON \
102 -DDLL_LIBMYSQL.DLL
=~
/win-cross
/mysql
/bin
/libmysql.dll \
103 -DMYSQL_INCLUDE_DIR=~
/win-cross
/mysql
/include \
104 -DMYSQL_LIBRARIES=~
/win-cross
/mysql
/lib
/libmysql.a \
106 -DINSTALL_BASH_COMPLETION=OFF \
110 checkexe gammu
/gammu.exe
111 signexe gammu
/gammu.exe
"Gammu"
114 mv Gammu-
*-Windows.
* $tmp/
117 mkdir build-win-minimal
118 echo "Building minimal Windows version..."
119 cd $tmp/build-win-minimal
120 cmake ..
/$repo-$version \
121 -DCMAKE_TOOLCHAIN_FILE=..
/$repo-$version/$toolchain \
122 -DBUILD_SHARED_LIBS=ON \
124 -DCPACK_SYSTEM_NAME=Windows-Minimal \
125 -DWITH_Postgres=OFF \
132 -DINSTALL_BASH_COMPLETION=OFF \
135 checkexe gammu
/gammu.exe
136 signexe gammu
/gammu.exe
"Gammu"
139 mv Gammu-
*-Windows-Minimal.
* $tmp/
143 echo "Building 64-bit Windows version..."
145 cmake ..
/$repo-$version \
146 -DCMAKE_TOOLCHAIN_FILE=..
/$repo-$version/$toolchain64 \
147 -DBUILD_SHARED_LIBS=ON \
149 -DCPACK_SYSTEM_NAME=Windows-64bit \
150 -DWITH_Postgres=OFF \
153 -DINSTALL_BASH_COMPLETION=OFF \
156 checkexe gammu
/gammu.exe
157 signexe gammu
/gammu.exe
"Gammu"
160 mv Gammu-
*-Windows-64bit.
* $tmp/
164 mkdir build-win-python
166 pynodot
=`echo $py | tr -d '.'`
167 echo "Building minimal Windows version with Python $py..."
168 cd $tmp/build-win-python
169 cmake ..
/$repo-$version \
170 -DCMAKE_TOOLCHAIN_FILE=..
/$repo-$version/$toolchain \
171 -DBUILD_SHARED_LIBS=OFF \
173 -DCPACK_SYSTEM_NAME=Windows-Minimal \
174 -DWITH_Postgres=OFF \
176 -DWITH_GettextLibs=OFF \
180 -DPYTHON_LIBRARY=~
/.wine
/drive_c
/Python
$pynodot/libs
/libpython
$pynodot.a \
181 -DPYTHON_INCLUDE_PATH=~
/.wine
/drive_c
/Python
$pynodot/include
/ \
182 -DPYTHON_EXECUTABLE=~
/.wine
/drive_c
/Python
$pynodot/python.exe \
183 -DINSTALL_BASH_COMPLETION=OFF \
186 mkdir
-p $tmp/$repo-$version/python
/build
/lib.win32-
$py/gammu
/
187 cp python
/gammu
/*.py
$tmp/$repo-$version/python
/build
/lib.win32-
$py/gammu
/
188 cp python
/gammu
/*.pyd
$tmp/$repo-$version/python
/build
/lib.win32-
$py/gammu
/
189 cp python
/gammu
/*.dll
$tmp/$repo-$version/python
/build
/lib.win32-
$py/gammu
/
191 cd $repo-$version/python
192 rm -rf gammu
/CMakeFiles
194 ~
/.wine
/drive_c
/Python
$pynodot/python.exe setup.py \
195 bdist_wininst
--skip-build --target-version $py
197 if [ $py != "2.4" ] ; then
199 ~
/.wine
/drive_c
/Python
$pynodot/python.exe setup.py \
200 bdist_msi
--skip-build --target-version $py
207 # Sign binaries (not for python-gammu, it breaks some code underneath)
208 for bin
in $tmp/Gammu
*.exe
; do
209 signexe
$bin "Gammu installer"
213 echo "Release is in $tmp directory"
218 if [ $dotag -eq 1 ] ; then
220 git tag
-s -m "Tag release $version" "$version"
222 $tmp/$repo-$version/python
/setup.py register
224 .
/admin
/upload-release
$version $tmp