forked from ojwb/survex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_release
executable file
·125 lines (110 loc) · 3.47 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
#! /bin/sh
# This script automates most of the process on making a new release.
set -e
rel=yes
if test x"$1" = x-t ; then
rel=
shift
fi
if test x"$rel" = xyes ; then
cd src
perl -e 'while (<>) { if (m!(.*)//! && $1 !~ / \* /) {print "$ARGV:$.:// comment in C source\n"; exit 1}} continue { close ARGV if eof }' \
*.c \
cavern.h commands.h cmdline.h date.h datain.h debug.h\
filelist.h filename.h getopt.h hash.h img.c img.h img_hosted.h\
listpos.h matrix.h message.h namecmp.h netartic.h netbits.h\
netskel.h network.h osalloc.h osdepend.h ostypes.h out.h readval.h str.h\
useful.h validate.h whichos.h
cd ..
# Check there are no uncommitted changes.
if git commit -a --dry-run >/dev/null 2>/dev/null ; then
echo 'There are uncommitted changes - please rectify'
echo 'If you just want to test, run with option -t'
exit 1
fi
test ! -f Makefile || make distclean
cp -u /usr/share/misc/config.guess .
cp -u /usr/share/misc/config.sub .
mv INSTALL INSTALL.keep
autoreconf --force -i
mv INSTALL.keep INSTALL
./configure CC=gcc CXX=g++
# Don't error out on new GCC8 warning for now.
make CFLAGS='-Werror' CXXFLAGS='-Werror -Wno-error=cast-function-type'
VALGRIND=valgrind make distcheck VERBOSE=1
else
make dist
fi
# Perform mingw build on a clean unpacked source tree from the release tarball
# so that (a) we don't need to "make distclean" on the source tree and (b) we
# ensure that any files required to build the mingw version and installer
# package are actually shipped in the source tarball.
tarball=`ls -1t survex-1*.tar.gz|head -n1`
tardir=`basename "$tarball" .tar.gz`
rm -rf "$tardir"
tar xf "$tarball"
cd "$tardir"
test -n "$build_platform" || build_platform=`sh config.guess`
SAVE_PATH=$PATH
for wxc in \
/usr/i686-w64-mingw32/lib/wx/config/i686-w64-mingw32-msw-unicode-static-3.0 \
/usr/i586-mingw32msvc/lib/wx/config/i586-mingw32msvc-msw-unicode-static-3.0 \
"" ; do
if test -z "$wxc" ; then
echo "wx-config for mingw not found" >&2
exit 1
fi
if test -x "$wxc" ; then
CC=`$wxc --cc`
CXX=`$wxc --cxx`
break
fi
done
host=mingw
case $CC in
*i686-w64-mingw32-gcc)
# debian mingw package
host=i686-w64-mingw32
;;
*i586-mingw32msvc-gcc)
# debian mingw32 package
host=i586-mingw32msvc
;;
*i386-mingw32msvc-gcc)
# debian mingw32 package
host=i386-mingw32msvc
;;
esac
PATH=/usr/$host/bin:$PATH
# Passing -Werror to configure causes AC_CHECK_FUNCS to fail, so pass it to
# make instead.
cross_pkg_config_path=`echo "$wxc"|sed 's,/lib/.*,/lib/pkgconfig,'`
PKG_CONFIG_PATH=$cross_pkg_config_path \
PKG_CONFIG_LIBDIR=$cross_pkg_config_path \
./configure --host="$host" --build="$build_platform" WX_CONFIG="$wxc" \
CC="$CC" CXX="$CXX" CXXFLAGS="-g -O2 -fno-strict-aliasing -Werror" \
LDFLAGS='-s -static'
make CFLAGS='-g -O2 -Werror'
make mingw_iss
PATH=$SAVE_PATH
mv survex-win32-*.exe ..
cd ..
if test x"$rel" = xyes ; then
rm -rf "$tardir"
else
exit 0
fi
VERSION=`sed 's/^VERSION *= *//p;d' Makefile`
FILES="survex-$VERSION.tar.gz survex-win32-$VERSION.exe"
echo "SHA1 checksums:"
sha1sum $FILES
echo
for f in $FILES ; do
gpg --detach-sign --armour "$f"
FILES="$FILES $f.asc"
done
echo "To tag this release and upload it to the webserver, run:"
echo git tag -s -m"'Survex $VERSION'" "$VERSION"
HOST=atreus.tartarus.org
echo ssh "$HOST" mkdir /srv/www/survex.com/software/"$VERSION"
echo scp $FILES "$HOST":/srv/www/survex.com/software/"$VERSION"