#! /bin/sh set -e rel=yes if test x"$1" = x-t ; then rel= shift fi if test x"$rel" = xyes ; then # 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++ make distcheck # FIXME: setting c89 doesn't define unix and suppresses getc_unlocked(). # Tell the preprocessor to be C89 - this makes it reject // comments # FIXME -Werror makes configure explode CFLAGS="-Werror -Wp,-std=c89" # FIXME CXXFLAGS="-Werror" 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/i586-mingw32msvc/lib/wx/config/i586-mingw32msvc-msw-unicode-static-3.0 \ /usr/lib/wx/config/i586-mingw32msvc-msw-unicode-release-static-2.8 \ /usr/lib/wx/config/i686-w64-mingw32-msw-unicode-release-static-2.8 \ "" ; 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 case $CC in *i586-mingw32msvc-gcc) # debian mingw32 package PATH=/usr/i586-mingw32msvc/bin:$PATH ;; *i386-mingw32msvc-gcc) # debian mingw32 package PATH=/usr/i386-mingw32msvc/bin:$PATH ;; esac # Passing -Werror to configure causes AC_CHECK_FUNCS to fail, so pass it to # make instead. ./configure --host=mingw32 --build="$build_platform" CC="$CC" CXX="$CXX" CXXFLAGS="-g -O2 -fno-strict-aliasing -Werror" WX_CONFIG="$wxc" LDFLAGS='-s -static' make CFLAGS=-Werror make mingw_iss PATH=$SAVE_PATH mv survex-win32-*.exe .. cd .. if test x"$rel" = xyes ; then rm -rf "$tardir" fi VERSION=`sed 's/^VERSION *= *//p;d' Makefile` FILES="survex-$VERSION.tar.gz survex-win32-$VERSION.exe" echo "SHA1 checksums:" sha1sum $FILES echo gpg --detach-sign --armour $FILES for f in $FILES ; do FILES="$FILES $f.asc" done echo "To tag this release and upload it to the webserver, run:" echo git tag -m"'Tagging $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"