1 | #! /bin/sh |
---|
2 | |
---|
3 | set -e |
---|
4 | |
---|
5 | rel=yes |
---|
6 | if test x"$1" = x-t ; then |
---|
7 | rel= |
---|
8 | shift |
---|
9 | fi |
---|
10 | |
---|
11 | if test x"$rel" = xyes ; then |
---|
12 | # Check there are no uncommitted changes. |
---|
13 | if git commit -a --dry-run >/dev/null 2>/dev/null ; then |
---|
14 | echo 'There are uncommitted changes - please rectify' |
---|
15 | echo 'If you just want to test, run with option -t' |
---|
16 | exit 1 |
---|
17 | fi |
---|
18 | |
---|
19 | test ! -f Makefile || make distclean |
---|
20 | cp -u /usr/share/misc/config.guess . |
---|
21 | cp -u /usr/share/misc/config.sub . |
---|
22 | mv INSTALL INSTALL.keep |
---|
23 | autoreconf --force -i |
---|
24 | mv INSTALL.keep INSTALL |
---|
25 | ./configure CC=gcc CXX=g++ |
---|
26 | make distcheck |
---|
27 | # FIXME: setting c89 doesn't define unix and suppresses getc_unlocked(). |
---|
28 | # Tell the preprocessor to be C89 - this makes it reject // comments |
---|
29 | # FIXME -Werror makes configure explode CFLAGS="-Werror -Wp,-std=c89" |
---|
30 | # FIXME CXXFLAGS="-Werror" |
---|
31 | else |
---|
32 | make dist |
---|
33 | fi |
---|
34 | |
---|
35 | # Perform mingw build on a clean unpacked source tree from the release tarball |
---|
36 | # so that (a) we don't need to "make distclean" on the source tree and (b) we |
---|
37 | # ensure that any files required to build the mingw version and installer |
---|
38 | # package are actually shipped in the source tarball. |
---|
39 | tarball=`ls -1t survex-1*.tar.gz|head -n1` |
---|
40 | tardir=`basename "$tarball" .tar.gz` |
---|
41 | rm -rf "$tardir" |
---|
42 | tar xf "$tarball" |
---|
43 | cd "$tardir" |
---|
44 | |
---|
45 | test -n "$build_platform" || build_platform=`sh config.guess` |
---|
46 | SAVE_PATH=$PATH |
---|
47 | for wxc in \ |
---|
48 | /usr/i586-mingw32msvc/lib/wx/config/i586-mingw32msvc-msw-unicode-static-3.0 \ |
---|
49 | /usr/lib/wx/config/i586-mingw32msvc-msw-unicode-release-static-2.8 \ |
---|
50 | /usr/lib/wx/config/i686-w64-mingw32-msw-unicode-release-static-2.8 \ |
---|
51 | "" ; do |
---|
52 | if test -z "$wxc" ; then |
---|
53 | echo "wx-config for mingw not found" >&2 |
---|
54 | exit 1 |
---|
55 | fi |
---|
56 | if test -x "$wxc" ; then |
---|
57 | CC=`$wxc --cc` |
---|
58 | CXX=`$wxc --cxx` |
---|
59 | break |
---|
60 | fi |
---|
61 | done |
---|
62 | case $CC in |
---|
63 | *i586-mingw32msvc-gcc) |
---|
64 | # debian mingw32 package |
---|
65 | PATH=/usr/i586-mingw32msvc/bin:$PATH |
---|
66 | ;; |
---|
67 | *i386-mingw32msvc-gcc) |
---|
68 | # debian mingw32 package |
---|
69 | PATH=/usr/i386-mingw32msvc/bin:$PATH |
---|
70 | ;; |
---|
71 | esac |
---|
72 | |
---|
73 | # Passing -Werror to configure causes AC_CHECK_FUNCS to fail, so pass it to |
---|
74 | # make instead. |
---|
75 | ./configure --host=mingw32 --build="$build_platform" CC="$CC" CXX="$CXX" CXXFLAGS="-g -O2 -fno-strict-aliasing -Werror" WX_CONFIG="$wxc" LDFLAGS='-s -static' |
---|
76 | make CFLAGS=-Werror |
---|
77 | make mingw_iss |
---|
78 | PATH=$SAVE_PATH |
---|
79 | |
---|
80 | mv survex-win32-*.exe .. |
---|
81 | cd .. |
---|
82 | |
---|
83 | if test x"$rel" = xyes ; then |
---|
84 | rm -rf "$tardir" |
---|
85 | fi |
---|
86 | |
---|
87 | VERSION=`sed 's/^VERSION *= *//p;d' Makefile` |
---|
88 | FILES="survex-$VERSION.tar.gz survex-win32-$VERSION.exe" |
---|
89 | echo "SHA1 checksums:" |
---|
90 | sha1sum $FILES |
---|
91 | echo |
---|
92 | |
---|
93 | gpg --detach-sign --armour $FILES |
---|
94 | for f in $FILES ; do |
---|
95 | FILES="$FILES $f.asc" |
---|
96 | done |
---|
97 | |
---|
98 | echo "To tag this release and upload it to the webserver, run:" |
---|
99 | echo git tag -m"'Tagging $VERSION'" "$VERSION" |
---|
100 | |
---|
101 | HOST=atreus.tartarus.org |
---|
102 | echo ssh "$HOST" mkdir /srv/www/survex.com/software/"$VERSION" |
---|
103 | echo scp $FILES "$HOST":/srv/www/survex.com/software/"$VERSION" |
---|