source: git/make_release @ 19871bb

RELEASE/1.2debug-cidebug-ci-sanitisersfaster-cavernloglog-selectstereostereo-2025walls-datawalls-data-hanging-as-warningwarn-only-for-hanging-survey
Last change on this file since 19871bb was 6fabfc0, checked in by Olly Betts <olly@…>, 10 years ago

make_release: Tag releases with message "Survex $VERSION".

  • Property mode set to 100755
File size: 3.3 KB
RevLine 
[d7acd89]1#! /bin/sh
[ae1309f]2
[088d34f]3# This script automates most of the process on making a new release.
4
[098acb1]5set -e
6
[ae1309f]7rel=yes
[e66be9a]8if test x"$1" = x-t ; then
[ae1309f]9   rel=
[f30265a0]10   shift
[d7acd89]11fi
[dd7674d]12
[ae1309f]13if test x"$rel" = xyes ; then
[e6312c0]14  cd src
[c0556bf]15  perl -e 'while (<>) { if (m!(.*)//! && $1 !~ / \* /) {print "$ARGV:$.:// comment in C source\n"; exit 1}} continue { close ARGV if eof }' \
[e6312c0]16      *.c \
17      cavern.h commands.h cmdline.h date.h datain.h debug.h\
[8bef4c6]18      filelist.h filename.h getopt.h hash.h img.c img.h img_hosted.h\
[e6312c0]19      listpos.h matrix.h message.h namecmp.h netartic.h netbits.h\
20      netskel.h network.h osalloc.h osdepend.h ostypes.h out.h readval.h str.h\
21      useful.h validate.h whichos.h
22  cd ..
23
[9d5aa63]24  # Check there are no uncommitted changes.
25  if git commit -a --dry-run >/dev/null 2>/dev/null ; then
26    echo 'There are uncommitted changes - please rectify'
[d2980d2]27    echo 'If you just want to test, run with option -t'
28    exit 1
29  fi
[098acb1]30
[d2980d2]31  test ! -f Makefile || make distclean
32  cp -u /usr/share/misc/config.guess .
33  cp -u /usr/share/misc/config.sub .
[f5baa8c]34  mv INSTALL INSTALL.keep
[d2980d2]35  autoreconf --force -i
[f5baa8c]36  mv INSTALL.keep INSTALL
[d2980d2]37  ./configure CC=gcc CXX=g++
[e6312c0]38  make CFLAGS='-Werror' CXXFLAGS='-Werror'
[f2dc821c]39  VALGRIND=valgrind make distcheck
[f78ad72]40else
[d2980d2]41  make dist
[e719df1]42fi
[098acb1]43
[d2980d2]44# Perform mingw build on a clean unpacked source tree from the release tarball
45# so that (a) we don't need to "make distclean" on the source tree and (b) we
46# ensure that any files required to build the mingw version and installer
47# package are actually shipped in the source tarball.
[a6bb1fa6]48tarball=`ls -1t survex-1*.tar.gz|head -n1`
[d2980d2]49tardir=`basename "$tarball" .tar.gz`
50rm -rf "$tardir"
51tar xf "$tarball"
52cd "$tardir"
[098acb1]53
[0fd6750]54test -n "$build_platform" || build_platform=`sh config.guess`
55SAVE_PATH=$PATH
[d380cd6]56for wxc in \
[bd285e5a]57  /usr/i686-w64-mingw32/lib/wx/config/i686-w64-mingw32-msw-unicode-static-3.0 \
[a989777]58  /usr/i586-mingw32msvc/lib/wx/config/i586-mingw32msvc-msw-unicode-static-3.0 \
[d380cd6]59  /usr/lib/wx/config/i586-mingw32msvc-msw-unicode-release-static-2.8 \
60  /usr/lib/wx/config/i686-w64-mingw32-msw-unicode-release-static-2.8 \
61  "" ; do
62  if test -z "$wxc" ; then
63    echo "wx-config for mingw not found" >&2
64    exit 1
65  fi
66  if test -x "$wxc" ; then
67    CC=`$wxc --cc`
68    CXX=`$wxc --cxx`
69    break
70  fi
71done
[bd285e5a]72host=mingw
[d380cd6]73case $CC in
[bd285e5a]74  *i686-w64-mingw32-gcc)
75    # debian mingw package
76    host=i686-w64-mingw32
77    ;;
[d380cd6]78  *i586-mingw32msvc-gcc)
79    # debian mingw32 package
[bd285e5a]80    host=i586-mingw32msvc
[d380cd6]81    ;;
82  *i386-mingw32msvc-gcc)
83    # debian mingw32 package
[bd285e5a]84    host=i386-mingw32msvc
[d380cd6]85    ;;
86esac
[bd285e5a]87PATH=/usr/$host/bin:$PATH
[d380cd6]88
[d2980d2]89# Passing -Werror to configure causes AC_CHECK_FUNCS to fail, so pass it to
90# make instead.
[bd285e5a]91./configure --host="$host" --build="$build_platform" CC="$CC" CXX="$CXX" CXXFLAGS="-g -O2 -fno-strict-aliasing -Werror" WX_CONFIG="$wxc" LDFLAGS='-s -static'
[79b271b]92make CFLAGS='-g -O2 -Werror'
[0fd6750]93make mingw_iss
94PATH=$SAVE_PATH
95
[d2980d2]96mv survex-win32-*.exe ..
97cd ..
98
99if test x"$rel" = xyes ; then
100  rm -rf "$tardir"
101fi
[7b12c6d]102
[9c9fd6b]103VERSION=`sed 's/^VERSION *= *//p;d' Makefile`
[8430216]104FILES="survex-$VERSION.tar.gz survex-win32-$VERSION.exe"
105echo "SHA1 checksums:"
106sha1sum $FILES
107echo
108
[179a57b]109for f in $FILES ; do
[201310c]110    gpg --detach-sign --armour "$f"
[179a57b]111    FILES="$FILES $f.asc"
112done
113
[8430216]114echo "To tag this release and upload it to the webserver, run:"
[6fabfc0]115echo git tag -s -m"'Survex $VERSION'" "$VERSION"
[e11c235]116
117HOST=atreus.tartarus.org
118echo ssh "$HOST" mkdir /srv/www/survex.com/software/"$VERSION"
[8430216]119echo scp $FILES "$HOST":/srv/www/survex.com/software/"$VERSION"
Note: See TracBrowser for help on using the repository browser.