1#!/bin/bash
2# $Id: dist-gpv.sh,v 1.20 2011/02/26 23:01:21 stas_degteff Exp $
3# Create a archive 'gpwin-*.zip' (gpvYMMDD.zip) with Win32 (MS Visual C)
4# build of the Golded+.
5
6srcdatefile=srcdate.h
7build=`sed -n 's/.*"\([[:digit:]]\{8\}\)".*/\1/p' $srcdatefile`
8date="$build"
9name=../gpwin-115-${date}.zip
10shortdate=${date/???/}
11shortname=../gpv${shortdate}.zip
12binesdir="windows/bin/release/win32"
13binsuffix="win.exe"
14dizfile="$binesdir/file_id.diz"
15
16echo Build a Golded+/w32mvc binary package:  ${name} and ${shortname}
17
18if [ ! -f golded3/mygolded.h ]; then
19  cp golded3/mygolded.__h golded3/mygolded.h
20  echo "golded3/mygolded.h is created now. Please edit this file"
21  exit 1
22fi
23
24bines="${binesdir}/ged${binsuffix} ${binesdir}/gn${binsuffix} ${binesdir}/rddt${binsuffix}"
25files="${bines} docs/copying docs/copying.lib golded.bat"
26files="${files} docs/golded.html docs/golded.txt docs/goldnode.html"
27files="${files} docs/goldnode.txt docs/license.txt docs/notework.txt"
28files="${files} docs/rddt.html docs/rddt.txt docs/readme.txt docs/notework.rus"
29files="${files} docs/rusfaq.txt docs/tips.txt docs/todowork.txt"
30files="${files} docs/tokencfg.txt docs/tokentpl.txt"
31
32VSver=`nmake /v 2>&1 | sed -ne 's/.*Version \([0-9]\{1,\}\.[0-9]\{1,\}\).*/\1/p'`
33printf 'GoldED+1.1.5 beta at %8.8s\r\n' $build  >${dizfile}
34printf 'Win32 binaries compiled using\r\n' >>${dizfile}
35printf 'Microsoft Visual Studio %5.5s\r\n' $VSver >>${dizfile}
36printf 'This is  unstable release and\r\n' >>${dizfile}
37printf 'it should be used for testing\r\n' >>${dizfile}
38printf -- '------------------------------\r\n' >>${dizfile}
39printf ' *http://golded-plus.sf.net*  \r\n' >>${dizfile}
40
41#for f in ${bines}; do rm $f; done
42#nmake /f gedwin.mak CFG="Release" clean
43#nmake /f gedwin.mak CFG="Release"
44
45make docs
46
47for i in ${bines} ; do
48  if [ ! -f ${i} ] ; then echo "File ${i} not exists, stop!"; exit 1 ; fi
49done
50
51zip -9DXj ${name} ${dizfile} $files
52ln ${name} ${shortname} || cp ${name} ${shortname}
53