added missing textfile test
[wxWidgets.git] / distrib / msw / zipmac.sh
1 #!/bin/sh
2
3 # Zip up an external, generic + Windows distribution of wxWidgets 2
4 # Usage: zipmac.sh dest-dir
5 # (set the WXWIN variable first so it knows where to take the sources from)
6
7 if [ "$OS" = "Windows_NT" ]; then
8 echo NT
9 CYGPATHPROGW="cygpath -w"
10 CYGPATHPROGU="cygpath -u"
11 else
12 echo Not NT
13 CYGPATHPROGW=echo
14 CYGPATHPROGU=echo
15 fi
16
17 SRC=`$CYGPATHPROGU $WXWIN`
18 DEST=$1
19
20 # Set this to the required version
21 VERSION=2.3.0
22
23 expandlines()
24 {
25 toexpand=$1
26 outputfile=$2
27
28 rm -f $outputfile
29 touch $outputfile
30 for line in `cat $toexpand` ; do
31 if [ $line != "" ]; then
32 ls $line >> $outputfile
33 fi
34 done
35 }
36
37 if [ ! -d "$SRC" ]; then
38 echo $SRC not found.
39 exit 1
40 fi
41
42 if [ ! -d "$DEST" ]; then
43 echo $DEST not found.
44 exit 1
45 fi
46
47 echo Creating distribution in $DEST. Press return to continue.
48 read dummy
49
50 # Remove all existing files
51 rm -f $DEST/wx*.zip
52
53 if [ ! -d "$DEST/wx" ]; then
54 rm -f -r $DEST/wx
55 fi
56
57
58 cd $SRC
59 echo Zipping...
60
61 expandlines $SRC/distrib/msw/generic.rsp temp.txt
62 zip -@ `$CYGPATHPROGW $DEST/wxMac-$VERSION.zip` < temp.txt
63
64 expandlines $SRC/distrib/msw/mac.rsp temp.txt
65 zip -u -@ `$CYGPATHPROGW $DEST/wxMac-$VERSION.zip` < temp.txt
66
67 expandlines $SRC/distrib/msw/cocoa.rsp temp.txt
68 zip -u -@ `$CYGPATHPROGW $DEST/wxMac-$VERSION.zip` < temp.txt
69
70 expandlines $SRC/distrib/msw/cw.rsp temp.txt
71 zip -u -@ `$CYGPATHPROGW $DEST/wxMac-$VERSION.zip` < temp.txt
72
73 expandlines $SRC/distrib/msw/tiff.rsp temp.txt
74 zip -u -@ `$CYGPATHPROGW $DEST/wxMac-$VERSION.zip` < temp.txt
75
76 expandlines $SRC/distrib/msw/jpeg.rsp temp.txt
77 zip -u -@ `$CYGPATHPROGW $DEST/wxMac-$VERSION.zip` < temp.txt
78
79 expandlines $SRC/distrib/msw/tex2rtf.rsp temp.txt
80 zip -u -@ `$CYGPATHPROGW $DEST/wxMac-$VERSION.zip` < temp.txt
81
82 expandlines $SRC/distrib/msw/ogl.rsp temp.txt
83 zip -u -@ `$CYGPATHPROGW $DEST/wxMac-$VERSION.zip` < temp.txt
84
85 expandlines $SRC/distrib/msw/xml.rsp temp.txt
86 zip -u -@ `$CYGPATHPROGW $DEST/wxMac-$VERSION.zip` < temp.txt
87
88 expandlines $SRC/distrib/msw/wx_html.rsp temp.txt
89 zip -@ `$CYGPATHPROGW $DEST/wxWidgets-$VERSION-HTML.zip` < temp.txt
90
91 rm -f temp.txt
92
93 echo wxWidgets archived.
94