]> git.saurik.com Git - wxWidgets.git/blame - distrib/scripts/create_archives.sh
allow absolute path
[wxWidgets.git] / distrib / scripts / create_archives.sh
CommitLineData
2dfa1180
KO
1#!/bin/sh
2
3# Make a distribution of an application on MSW.
4# Example:
5# ../distrib/msw/makesetup.sh --wxmsw --verbose &> log
6
7# If your zip accepts Cygwin-style paths, then
8# use cygpath, else substitute echo
9CYGPATHPROG=cygpath
10#CYGPATHPROG=echo
11
12SPINMSW=0
13SPINOS2=0
14SPINDOCS=0
15SPINALL=0
16SPINWXALL=0
17SPINBASE=0
18GETMAKEFILES=0
19VERBOSE=0
20ZIPFLAGS=
21
22PROGNAME=$0
8afb1dca 23##SCRIPTDIR=$WXWIN/distrib/scripts
2dfa1180
KO
24. $SCRIPTDIR/utils.inc
25
8afb1dca 26MANIFESTDIR=$WXWIN/distrib/scripts/manifests
2dfa1180
KO
27WEBFILES=$WXWIN/../wxWebSite
28if [ ! "$CYGPATH" = "" ]; then
29 WEBFILES=`$CYGPATH "$WEBFILES"`
30fi
31
32# Set this to the required version
33if [ "$VERSION" = "" ]; then
34 VERSION=2.7.0
35fi
36
37getfilelist(){
38 port=$1
39 outfile=$2
e019c642 40
2dfa1180
KO
41 filelist="base.rsp"
42 contribfiles="stc.rsp contrib.rsp ogl.rsp"
43 utilsfiles="tex2rtf.rsp utils.rsp utilmake.rsp"
ca152e4c 44 commonfiles="generic.rsp generic_samples.rsp jpeg.rsp tiff.rsp xml.rsp deprecated.rsp makefile.rsp $utilsfiles $contribfiles"
e019c642 45
2dfa1180 46 if [ ! $port = "base" ]; then
e019c642
VZ
47 filelist="$filelist $commonfiles"
48 fi
49
2dfa1180
KO
50 if [ $port = "msw" ] || [ $port = "all" ]; then
51 filelist="$filelist msw.rsp univ.rsp vc.rsp mmedia.rsp wince.rsp dmc.rsp"
52 fi
e019c642 53
2dfa1180
KO
54 if [ $port = "os2" ] || [ $port = "all" ]; then
55 filelist="$filelist os2.rsp"
56 fi
e019c642 57
2dfa1180 58 if [ $port = "x11" ] || [ $port = "all" ]; then
e019c642 59 filelist="$filelist univ.rsp x11.rsp"
2dfa1180 60 fi
e019c642 61
2dfa1180 62 if [ $port = "mgl" ] || [ $port = "all" ]; then
e019c642 63 filelist="$filelist mgl.rsp"
2dfa1180 64 fi
c640dfa5
VS
65
66 if [ $port = "dfb" ] || [ $port = "all" ]; then
01078b2b 67 filelist="$filelist univ.rsp dfb.rsp"
c640dfa5
VS
68 fi
69
2dfa1180
KO
70 if [ $port = "gtk" ] || [ $port = "all" ]; then
71 filelist="$filelist gtk.rsp"
72 fi
e019c642 73
2dfa1180
KO
74 if [ $port = "motif" ] || [ $port = "all" ]; then
75 filelist="$filelist motif.rsp"
76 fi
e019c642 77
2dfa1180
KO
78 if [ $port = "mac" ] || [ $port = "all" ]; then
79 filelist="$filelist mac.rsp cocoa.rsp"
80 fi
e019c642 81
2dfa1180 82 if [ $port = "all" ]; then
47351e25 83 filelist="$filelist gtk1.rsp palmos.rsp docsrc.rsp"
2dfa1180 84 fi
e019c642 85
2dfa1180
KO
86 tempfile="/tmp/wx$port.files.in"
87 rm -f $outfile
e019c642 88
2dfa1180
KO
89 olddir=$PWD
90 cd $MANIFESTDIR
e019c642 91
2dfa1180 92 cat $filelist > $outfile
e019c642 93
2dfa1180
KO
94 cd $olddir
95}
96
97copyfilelist(){
98 FILELIST=$1
99 APPDIR=$2
100 DESTDIR=$3
e019c642 101
2dfa1180
KO
102 for line in `cat $FILELIST` ; do
103 if [ "$line" != "" ]; then
104 subdir=`dirname $line`
105 mkdir -p $DESTDIR/$subdir
e019c642 106 cp -rf $APPDIR/$line $DESTDIR/$subdir
2dfa1180
KO
107 fi
108 done
109}
110
111doinit()
112{
113 if [ "$VERBOSE" != "1" ]; then
114 ZIPFLAGS=-q
115 fi
116}
117
118dospinport(){
119 port=$1
e019c642 120
6ff2b437 121 case "$port" in
c6606883
VZ
122 all)
123 portname="Widgets";;
124 base)
125 portname="Base";;
126 motif)
127 portname="Motif";;
128 mac)
129 portname="Mac";;
130 *)
c640dfa5 131 # for all the others (DFB, GTK, MGL, DFB, MSW, X11) just use the
c6606883
VZ
132 # upper-case version as they are abbreviations
133 portname=`echo $port | tr '[a-z]' '[A-Z]'`;;
6ff2b437 134 esac
e019c642 135
2dfa1180
KO
136 echo "Creating wx$portname distribution..."
137
138 cd $APPDIR
139 portfiles="/tmp/wx$port.files"
140 getfilelist "$port" "$portfiles"
e019c642 141
e87f080a 142 TMPFILESDIR=/tmp/wx$port/wx$portname-$VERSION
2dfa1180
KO
143 rm -rf $TMPFILESDIR
144 mkdir -p $TMPFILESDIR
145
146 copyfilelist $portfiles $APPDIR $TMPFILESDIR
571c8c8a
KO
147
148 if [ $port = "msw" ]; then
8afb1dca 149 FILES=`find . -type f \( -path '*/CVS/*' -prune -o -exec ${SCRIPTDIR}/is_text.sh {} \; -print \)`
571c8c8a
KO
150 echo "$FILES" > /tmp/textfiles
151 fi
152
2dfa1180 153 pushd /tmp/wx$port
2a1243f4 154 # use DOS line endings for text files for MSW archives.
de6fbe75 155 if [ $port = "msw" ]; then
e87f080a 156 pushd /tmp/wx$port/wx$portname-$VERSION
571c8c8a 157 for file in `cat /tmp/textfiles`; do
6224df04 158 unix2dos $file
571c8c8a
KO
159 done
160 popd
de6fbe75 161 fi
2dfa1180
KO
162 echo "Creating wx$portname-$VERSION.zip..."
163 zip $ZIPFLAGS -r -9 $APPDIR/deliver/wx$portname-$VERSION.zip .
164 echo "Creating wx$portname-$VERSION.tar.gz..."
e87f080a 165 tar czf $APPDIR/deliver/wx$portname-$VERSION.tar.gz wx$portname-$VERSION
2dfa1180 166 echo "Creating wx$portname-$VERSION.tar.bz2..."
52c636e0 167 tar ch wx$portname-$VERSION | bzip2 -f9 > $APPDIR/deliver/wx$portname-$VERSION.tar.bz2
2dfa1180
KO
168 popd
169 rm -rf /tmp/wx$port
f21467d8 170 rm ${portfiles}
0ecdaebb 171 rm /tmp/textfiles
2dfa1180
KO
172}
173
174prepareforrelease()
175{
176 pushd $APPDIR
177 echo Copying FAQ and other files from $WEBFILES
178 cp $WEBFILES/site/faq*.htm $APPDIR/docs/html
179 cp $WEBFILES/site/platform.htm $APPDIR/docs/html
180 cp $WEBFILES/site/i18n.htm $APPDIR/docs/html
e019c642 181
2dfa1180
KO
182 echo Copying readme files...
183 cp $APPDIR/docs/msw/readme.txt README-MSW.txt
184 cp $APPDIR/docs/msw/install.txt INSTALL-MSW.txt
185 cp $APPDIR/docs/os2/install.txt INSTALL-OS2.txt
186 cp $APPDIR/docs/licence.txt LICENCE.txt
187 cp $APPDIR/docs/lgpl.txt COPYING.LIB
188 cp $APPDIR/docs/changes.txt CHANGES.txt
189 cp $APPDIR/docs/readme.txt README.txt
de6fbe75
KO
190
191 cp $APPDIR/docs/mgl/readme.txt $APPDIR/readme-mgl.txt
192 cp $APPDIR/docs/mgl/install.txt $APPDIR/install-mgl.txt
c640dfa5
VS
193
194 cp $APPDIR/docs/dfb/install.txt $APPDIR/install-dfb.txt
de6fbe75
KO
195
196 cp $APPDIR/docs/x11/readme.txt $APPDIR/readme-x11.txt
197 cp $APPDIR/docs/x11/install.txt $APPDIR/install-x11.txt
198
199 cp $APPDIR/docs/motif/readme.txt $APPDIR/readme-motif.txt
200 cp $APPDIR/docs/motif/install.txt $APPDIR/install-motif.txt
201
202 cp $APPDIR/docs/gtk/readme.txt $APPDIR/readme-gtk.txt
203 cp $APPDIR/docs/gtk/install.txt $APPDIR/install-gtk.txt
204
205 cp $APPDIR/docs/mac/readme.txt $APPDIR/readme-mac.txt
206 cp $APPDIR/docs/mac/install.txt $APPDIR/install-mac.txt
207
208 cp $APPDIR/docs/cocoa/readme.txt $APPDIR/readme-cocoa.txt
209 cp $APPDIR/docs/cocoa/install.txt $APPDIR/install-cocoa.txt
e019c642 210
2dfa1180
KO
211 # Now delete a few files that are unnecessary
212 rm -f BuildCVS.txt descrip.mms
213 rm -f setup.h_vms
214 rm -f docs/html/wxbook.htm docs/html/roadmap.htm
215 rm -f -r contrib/docs/latex/ogl
216 rm -f src/mingegcs.bat
0b70d74c 217# rm -f *.spec
2dfa1180 218 rm -f src/gtk/descrip.mms src/motif/descrip.mms
e019c642 219
2dfa1180
KO
220 # Copy setup0.h files to setup.h
221 # OS/2 always built with configure now
222 # cp $APPDIR/include/wx/os2/setup0.h $APPDIR/include/wx/os2/setup.h
223 cp $APPDIR/include/wx/msw/setup0.h $APPDIR/include/wx/msw/setup.h
224 cp $APPDIR/include/wx/univ/setup0.h $APPDIR/include/wx/univ/setup.h
e019c642 225
de6fbe75 226 # Make MSW project files always have DOS line endings.
e019c642
VZ
227 unix2dos `cat $MANIFESTDIR/vc.rsp`
228
2dfa1180
KO
229 popd
230}
231
232usage()
233{
234 echo "Usage: $PROGNAME [ options ]" 1>&2
235 echo Options:
236 echo " --help Display this help message"
237 echo " --wxmac Build wxMac distribution"
238 echo " --wxmsw Build wxMSW distribution"
239 echo " --wxos2 Build wxOS2 distribution"
240 echo " --wxall Build wxAll zip distribution"
241 echo " --wxbase Build wxBase zip distribution"
242 echo " --all Build all distributions (the default)"
243 echo " --verbose Verbose zip operation"
244 exit 1
245}
246
247# Process command line options.
248
249for i in "$@"; do
250
251 case "$i" in
252 --wxmac) SPINMAC=1; SPINALL=0 ;;
253 --wxmsw) SPINMSW=1; SPINALL=0 ;;
254 --wxos2) SPINOS2=1; SPINALL=0 ;;
255 --wxall) SPINWXALL=1; SPINALL=0 ;;
256 --wxbase) SPINBASE=1; SPINALL=0 ;;
257 --getmakefiles) GETMAKEFILES=1; SPINALL=0 ;;
258 --docs) SPINDOCS=1; SPINALL=0 ;;
259 --all) SPINALL=1 ;;
260 --verbose) VERBOSE=1 ;;
261 *)
262 usage
263 exit
264 ;;
265 esac
266done
267
268
269doinit
270prepareforrelease
271
272# Do OS/2 spin
273if [ "$SPINOS2" = "1" ] || [ "$SPINALL" = "1" ]; then
274 dospinport "os2"
275fi
276
277# Do MSW spin
278if [ "$SPINMSW" = "1" ] || [ "$SPINALL" = "1" ]; then
279 dospinport "msw"
280fi
281
282# Do wxBase spin
283if [ "$SPINBASE" = "1" ] || [ "$SPINALL" = "1" ]; then
284 dospinport "base"
285fi
286
287# Do wxAll spin
288if [ "$SPINWXALL" = "1" ] || [ "$SPINALL" = "1" ]; then
e019c642 289 dospinport "all"
2dfa1180
KO
290fi
291
292if [ "$SPINALL" = "1" ]; then
293 dospinport "mgl"
c640dfa5 294 dospinport "dfb"
2dfa1180
KO
295 dospinport "gtk"
296 dospinport "x11"
297 dospinport "motif"
298 dospinport "mac"
299fi
300