]>
Commit | Line | Data |
---|---|---|
03a2668f 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 | |
9 | CYGPATHPROG=cygpath | |
10 | #CYGPATHPROG=echo | |
11 | ||
12 | INNO=1 | |
13 | SPINMSW=0 | |
14 | SPINOS2=0 | |
15 | SPINDOCS=0 | |
16 | SPINALL=0 | |
17 | SPINWXALL=0 | |
18 | SPINBASE=0 | |
19 | GETMAKEFILES=0 | |
20 | VERBOSE=0 | |
21 | ZIPFLAGS= | |
22 | ||
23 | PROGNAME=$0 | |
24 | SCRIPTDIR=$WXWIN/distrib/scripts | |
25 | . $SCRIPTDIR/msw/setup.var | |
26 | . $SCRIPTDIR/utils.inc | |
27 | ||
28 | MANIFESTDIR=$SCRIPTDIR/manifests | |
29 | WEBFILES=c:/wx2dev/wxWebSite | |
30 | if [ ! "$CYGPATH" = "" ]; then | |
31 | WEBFILES=`$CYGPATH "$WEBFILES"` | |
32 | fi | |
33 | ||
34 | # Set this to the required version | |
35 | if [ "$VERSION" = "" ]; then | |
36 | VERSION=2.6.2 | |
37 | fi | |
38 | ||
d20e98ab KO |
39 | getfilelist(){ |
40 | port=$1 | |
41 | outfile=$2 | |
42 | ||
43 | filelist="base.rsp" | |
44 | contribfiles="stc.rsp contrib.rsp ogl.rsp" | |
45 | utilsfiles="tex2rtf.rsp utils.rsp utilmake.rsp" | |
46 | commonfiles="generic.rsp jpeg.rsp tiff.rsp xml.rsp deprecated.rsp makefile.rsp $utilsfiles $contribfiles" | |
47 | ||
48 | if [ ! $port = "base" ]; then | |
49 | filelist="$filelist $commonfiles" | |
50 | fi | |
51 | ||
52 | if [ $port = "msw" || $port = "all" ]; then | |
53 | filelist="$filelist msw.rsp univ.rsp vc.rsp mmedia.rsp wince.rsp palmos.rsp" | |
54 | fi | |
55 | ||
56 | if [ $port = "os2" || $port = "all" ]; then | |
57 | filelist="$filelist os2.rsp" | |
58 | fi | |
59 | ||
60 | if [ $port = "all" ]; then | |
61 | filelist="$filelist x11.rsp gtk.rsp cocoa.rsp motif.rsp mac.rsp mgl.rsp" | |
62 | fi | |
63 | ||
64 | tempfile="/tmp/$portfiles.in" | |
65 | rm -f $tempfile | |
66 | rm -f $outfile | |
67 | ||
68 | olddir=$PWD | |
69 | cd $MANIFESTDIR | |
70 | ||
71 | cat $filelist > $tempfile | |
72 | ||
73 | cd $APPDIR | |
74 | expandlines $tempfile $outfile | |
75 | ||
76 | cd $olddir | |
77 | } | |
78 | ||
03a2668f KO |
79 | doreplace() |
80 | { | |
81 | thefile=$1 | |
82 | theexpr=$2 | |
83 | ||
84 | if [ -f $thefile ]; then | |
85 | sed -e "$theexpr" < $thefile > $thefile.tmp | |
86 | mv $thefile.tmp $thefile | |
87 | else | |
88 | echo "*** $thefile not found." | |
89 | fi | |
90 | } | |
91 | ||
92 | unix2dosname() | |
93 | { | |
94 | echo $1 | sed -e "s/\//\\\\\\\/g" > /tmp/filename.tmp | |
95 | RETVALUE=`cat /tmp/filename.tmp` | |
96 | rm -f /tmp/filename.tmp | |
97 | } | |
98 | ||
99 | unix2dosname2() | |
100 | { | |
101 | echo $1 | sed -e "s/\//\\\\/g" > /tmp/filename.tmp | |
102 | RETVALUE=`cat /tmp/filename.tmp` | |
103 | rm -f /tmp/filename.tmp | |
104 | } | |
105 | ||
106 | doinit() | |
107 | { | |
108 | if [ "$VERBOSE" != "1" ]; then | |
109 | ZIPFLAGS=-q | |
110 | fi | |
111 | } | |
112 | ||
113 | rearchive() | |
114 | { | |
115 | archive=$1 | |
116 | dirname=$2 | |
117 | changeto=$3 | |
118 | ||
119 | echo Re-archiving $archive as $dirname | |
120 | ||
121 | pushd $changeto | |
122 | ||
123 | if [ -d $dirname ]; then | |
124 | rm -f -r $dirname | |
125 | fi | |
126 | mkdir $dirname | |
127 | cd $dirname | |
128 | unzip $ZIPFLAGS ../$archive | |
129 | cd .. | |
130 | rm -f $archive | |
131 | zip $ZIPFLAGS -r $archive $dirname/* | |
132 | ||
133 | popd | |
134 | } | |
135 | ||
136 | rearchivetar() | |
137 | { | |
138 | archive=$1 | |
139 | dirname=$2 | |
140 | changeto=$3 | |
141 | ||
142 | echo Re-tarring $archive as $dirname | |
143 | ||
144 | pushd $changeto | |
145 | ||
146 | if [ -d $dirname ]; then | |
147 | rm -f -r $dirname | |
148 | fi | |
149 | mkdir $dirname | |
150 | cd $dirname | |
151 | tar xfz ../$archive | |
152 | cd .. | |
153 | rm -f $archive | |
154 | tar cfz $archive $dirname/* | |
155 | ||
156 | popd | |
157 | } | |
158 | ||
159 | # Find the version from wx/version.h | |
160 | # Not yet used | |
161 | findversion() | |
162 | { | |
163 | echo "#include <stdio.h>" > /tmp/appver.c | |
164 | echo "#include \"$VERSIONSYMBOLFILE\"" >> /tmp/appver.c | |
165 | echo "int main() { printf(\"%.2f\", $VERSIONSYMBOL); }" >> /tmp/appver.c | |
166 | gcc /tmp/appver.c -I$APPDIR -o /tmp/appver | |
167 | VERSION=`/tmp/appver` | |
168 | rm -f /tmp/appver /tmp/appver.c | |
169 | } | |
170 | ||
171 | dospinos2() | |
172 | { | |
173 | echo Zipping OS/2... | |
174 | ||
03a2668f | 175 | cd $APPDIR |
d20e98ab | 176 | getfilelist "os2" /tmp/os2files |
03a2668f KO |
177 | |
178 | # Zip up the complete wxOS2-xxx.zip file | |
179 | zip $ZIPFLAGS -@ $DESTDIR/wxOS2-$VERSION.zip < /tmp/os2files | |
180 | ||
181 | # Rearchive under wxWidgets-$VERSION | |
182 | if [ -d $DESTDIR/wxWidgets-$VERSION ]; then | |
183 | rm -f -r $DESTDIR/wxWidgets-$VERSION | |
184 | fi | |
185 | ||
186 | mkdir $DESTDIR/wxWidgets-$VERSION | |
187 | cd $DESTDIR/wxWidgets-$VERSION | |
188 | unzip $ZIPFLAGS ../wxOS2-$VERSION.zip | |
03a2668f KO |
189 | |
190 | echo Copying readme files... | |
191 | cp $APPDIR/docs/os2/install.txt INSTALL-OS2.txt | |
192 | ||
193 | cd $DESTDIR | |
194 | ||
195 | rm -f wxOS2-$VERSION.zip | |
196 | zip $ZIPFLAGS -r wxOS2-$VERSION.zip wxWidgets-$VERSION/* | |
197 | } | |
198 | ||
199 | dospinmsw() | |
200 | { | |
201 | echo Zipping wxMSW... | |
202 | ||
03a2668f KO |
203 | cd $APPDIR |
204 | ||
205 | # now expand the wildcards to actual file names | |
d20e98ab | 206 | getfilelist "msw" /tmp/mswfiles |
03a2668f KO |
207 | |
208 | # Create wxWidgets-$VERSION-win.zip which is used to create wxMSW | |
209 | echo Zipping individual components | |
210 | rm -f $DESTDIR/wxWidgets-$VERSION-win.zip | |
211 | zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-win.zip < /tmp/mswfiles | |
212 | } | |
213 | ||
214 | dospinwxall() | |
215 | { | |
216 | echo Zipping wxAll... | |
217 | cd $APPDIR | |
218 | ||
219 | echo Zipping individual components | |
220 | rm -f $DESTDIR/wxWidgets-$VERSION-all.zip | |
221 | ||
222 | # Save adding all the wxMSW files again | |
223 | if [ ! -f $DESTDIR/wxWidgets-$VERSION-win.zip ]; then | |
224 | dospinmsw | |
225 | fi | |
226 | cp $DESTDIR/wxWidgets-$VERSION-win.zip $DESTDIR/wxWidgets-$VERSION-all.zip | |
227 | ||
228 | cat $MANIFESTDIR/cw_mac.rsp $MANIFESTDIR/vc.rsp $MANIFESTDIR/x11.rsp $MANIFESTDIR/gtk.rsp $MANIFESTDIR/cocoa.rsp $MANIFESTDIR/motif.rsp $MANIFESTDIR/mac.rsp $MANIFESTDIR/mgl.rsp $MANIFESTDIR/os2.rsp $MANIFESTDIR/palmos.rsp | sort | uniq > /tmp/all.txt | |
229 | zip $ZIPFLAGS -@ -u $DESTDIR/wxWidgets-$VERSION-all.zip < /tmp/all.txt | |
230 | ||
231 | if [ -d $DESTDIR/wxWidgets-$VERSION ]; then | |
232 | rm -f -r $DESTDIR/wxWidgets-$VERSION | |
233 | fi | |
234 | ||
235 | mkdir $DESTDIR/wxWidgets-$VERSION | |
236 | cd $DESTDIR/wxWidgets-$VERSION | |
237 | unzip $ZIPFLAGS ../wxWidgets-$VERSION-all.zip | |
238 | ||
239 | cd $DESTDIR | |
240 | ||
241 | rm -f $DESTDIR/wxWidgets-$VERSION-all.zip | |
242 | zip $ZIPFLAGS -r wxWidgets-$VERSION.zip wxWidgets-$VERSION/* | |
243 | } | |
244 | ||
245 | dospinbase() | |
246 | { | |
247 | cd $APPDIR | |
248 | ||
249 | echo Zipping wxBase... | |
250 | rm -f $DESTDIR/wxBase-$VERSION.zip | |
251 | expandlines $MANIFESTDIR/base.rsp /tmp/basefiles | |
252 | zip $ZIPFLAGS -@ $DESTDIR/wxBase-$VERSION.zip < /tmp/basefiles | |
253 | ||
254 | if [ -d $DESTDIR/wxWidgets-$VERSION ]; then | |
255 | rm -f -r $DESTDIR/wxWidgets-$VERSION | |
256 | fi | |
257 | ||
258 | mkdir $DESTDIR/wxWidgets-$VERSION | |
259 | cd $DESTDIR/wxWidgets-$VERSION | |
260 | unzip $ZIPFLAGS ../wxBase-$VERSION.zip | |
261 | ||
262 | echo Copying readme files... | |
263 | cp $APPDIR/docs/base/readme.txt README.txt | |
264 | ||
265 | cd $DESTDIR | |
266 | ||
267 | rm -f wxBase-$VERSION.zip | |
268 | zip $ZIPFLAGS -r wxBase-$VERSION.zip wxWidgets-$VERSION/* | |
269 | } | |
270 | ||
271 | dospindocs() | |
272 | { | |
273 | cd $APPDIR | |
274 | ||
275 | echo Creating $DESTDIR/wxWidgets-$VERSION-DocSource.zip | |
276 | expandlines $MANIFESTDIR/docsrc.rsp /tmp/docsources | |
277 | zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-DocSource.zip < /tmp/docsources | |
278 | rearchive wxWidgets-$VERSION-DocSource.zip wxWidgets-$VERSION $DESTDIR | |
279 | ||
280 | echo Creating $DESTDIR/wxWidgets-$VERSION-WinHelp.zip | |
281 | expandlines $MANIFESTDIR/wx_hlp.rsp /tmp/winhelp | |
282 | zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-WinHelp.zip < /tmp/winhelp | |
283 | rearchive wxWidgets-$VERSION-WinHelp.zip wxWidgets-$VERSION $DESTDIR | |
284 | ||
285 | echo Creating $DESTDIR/wxWidgets-$VERSION-HTML.zip | |
286 | expandlines $MANIFESTDIR/wx_html.rsp /tmp/htmldocs | |
287 | zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-HTML.zip < /tmp/htmldocs | |
288 | rearchive wxWidgets-$VERSION-HTML.zip wxWidgets-$VERSION $DESTDIR | |
289 | ||
290 | echo Creating $DESTDIR/wxWidgets-$VERSION-PDF.zip | |
291 | expandlines $MANIFESTDIR/wx_pdf.rsp /tmp/pdfdocs | |
292 | zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-PDF.zip < /tmp/pdfdocs | |
293 | rearchive wxWidgets-$VERSION-PDF.zip wxWidgets-$VERSION $DESTDIR | |
294 | ||
295 | echo Creating $DESTDIR/wxWidgets-$VERSION-PDF.tar.gz | |
296 | tar zcf /c/wx2dev/wxWindows/deliver/wxWidgets-$VERSION-PDF.tar.gz docs/pdf/*.pdf | |
297 | rearchivetar wxWidgets-$VERSION-PDF.tar.gz wxWidgets-$VERSION /c/wx2dev/wxWindows/deliver | |
298 | ||
299 | echo Creating $DESTDIR/wxWidgets-$VERSION-HTB.zip | |
300 | expandlines $MANIFESTDIR/wx_htb.rsp /tmp/htbdocs | |
301 | zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-HTB.zip < /tmp/htbdocs | |
302 | rearchive wxWidgets-$VERSION-HTB.zip wxWidgets-$VERSION $DESTDIR | |
303 | ||
304 | echo Creating $DESTDIR/wxWidgets-$VERSION-HTMLHelp.zip | |
305 | expandlines $MANIFESTDIR/wx_chm.rsp /tmp/chmdocs | |
306 | zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-HTMLHelp.zip < /tmp/chmdocs | |
307 | rearchive wxWidgets-$VERSION-HTMLHelp.zip wxWidgets-$VERSION $DESTDIR | |
308 | ||
309 | # Add Linuxy docs to a separate archive to be transported to Linux for the | |
310 | # Linux-based releases | |
311 | echo Creating $DESTDIR/wxWidgets-$VERSION-LinuxDocs.zip | |
312 | ||
313 | cat $MANIFESTDIR/wx_html.rsp $MANIFESTDIR/wx_pdf.rsp $MANIFESTDIR/wx_htb.rsp > /tmp/linuxdocs.in | |
314 | expandlines /tmp/linuxdocs.in /tmp/linuxdocs | |
315 | ||
316 | zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-LinuxDocs.zip < /tmp/linuxdocs | |
317 | ||
318 | # PDF/HTML docs that should go into the Windows setup because | |
319 | # there are no WinHelp equivalents | |
320 | echo Creating $DESTDIR/wxWidgets-$VERSION-ExtraDoc.zip | |
77b14ee2 KO |
321 | expandlines $SCRIPT/extradoc.rsp /tmp/extradocs |
322 | zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-ExtraDoc.zip < /tmp/extradocs | |
03a2668f KO |
323 | rearchive wxWidgets-$VERSION-ExtraDoc.zip wxWidgets-$VERSION $DESTDIR |
324 | } | |
325 | ||
326 | dospinmisc() | |
327 | { | |
328 | cd $APPDIR | |
329 | ||
330 | # zip up Univ-specific files | |
331 | echo Creating $DESTDIR/wxWidgets-$VERSION-Univ.zip | |
332 | expandlines $MANIFESTDIR/univ.rsp /tmp/univfiles | |
333 | zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-Univ.zip < /tmp/univfiles | |
334 | rearchive wxWidgets-$VERSION-Univ.zip wxWidgets-$VERSION $DESTDIR | |
335 | ||
03a2668f KO |
336 | # DMC project files |
337 | echo Creating $DESTDIR/wxWidgets-$VERSION-DMC.zip | |
338 | expandlines $MANIFESTDIR/dmc.rsp /tmp/dmcfiles | |
339 | zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-DMC.zip < /tmp/dmcfiles | |
340 | rearchive wxWidgets-$VERSION-DMC.zip wxWidgets-$VERSION $DESTDIR | |
341 | ||
342 | # BC++ project files | |
343 | echo Creating $DESTDIR/wxWidgets-$VERSION-BC.zip | |
344 | expandlines $MANIFESTDIR/bc.rsp /tmp/bcfiles | |
345 | zip $ZIPFLAGS -@ $DESTDIR/wxWidgets-$VERSION-BC.zip < /tmp/bcfiles | |
346 | rearchive wxWidgets-$VERSION-BC.zip wxWidgets-$VERSION $DESTDIR | |
347 | ||
03a2668f KO |
348 | } |
349 | ||
d20e98ab KO |
350 | |
351 | dospinport(){ | |
352 | port=$1 | |
353 | ||
354 | upperport="`echo $port|tr '[a-z]' '[A-Z]'`" | |
355 | echo "Zipping wx$upperport..." | |
356 | ||
357 | cd $APPDIR | |
358 | getfilelist "$port" "/tmp/$port_filelist" | |
359 | ||
360 | mkdir -p /tmp/wx$port/wxWidgets-$VERSION | |
361 | ||
362 | for line in `cat /tmp/$port_filelist` ; do | |
363 | cp -r $line /tmp/wx$port/wxWidgets-$VERSION | |
364 | done | |
365 | ||
366 | cd /tmp/wxWidgets-$VERSION | |
367 | ||
368 | echo Copying readme files... | |
369 | cp $APPDIR/docs/msw/readme.txt README-MSW.txt | |
370 | cp $APPDIR/docs/msw/install.txt INSTALL-MSW.txt | |
371 | cp $APPDIR/docs/licence.txt LICENCE.txt | |
372 | cp $APPDIR/docs/lgpl.txt COPYING.LIB | |
373 | cp $APPDIR/docs/changes.txt CHANGES.txt | |
374 | cp $APPDIR/docs/readme.txt README.txt | |
375 | ||
376 | zip $ZIPFLAGS -r -@ $DESTDIR/wx$upperport-$VERSION.zip /tmp/wx$port/wxWidgets-$VERSION | |
377 | } | |
378 | ||
03a2668f KO |
379 | dospininstaller() |
380 | { | |
381 | cd $DESTDIR | |
382 | ||
383 | # Put all archives for transit to Linux in a zip file | |
384 | echo Creating $DESTDIR/wxWidgets-$VERSION-LinuxTransit.zip | |
385 | rm -f $DESTDIR/wxWidgets-$VERSION-LinuxTransit.zip | |
4387847f | 386 | zip $ZIPFLAGS $DESTDIR/wxWidgets-$VERSION-LinuxTransit.zip wxWidgets-$VERSION-LinuxDocs.zip wxWidgets-$VERSION-DMC.zip |
03a2668f KO |
387 | |
388 | rm -f -r wxWidgets-$VERSION | |
389 | ||
390 | echo Unzipping the Windows files into wxWidgets-$VERSION | |
391 | ||
392 | mkdir -p wxWidgets-$VERSION | |
393 | ||
f87584b5 | 394 | unzip $ZIPFLAGS -o wxWidgets-$VERSION-win.zip -d wxWidgets-$VERSION |
f87584b5 KO |
395 | unzip $ZIPFLAGS -o wxWidgets-$VERSION-DMC.zip -d wxWidgets-$VERSION |
396 | unzip $ZIPFLAGS -o wxWidgets-$VERSION-BC.zip -d wxWidgets-$VERSION | |
03a2668f KO |
397 | |
398 | unzip $ZIPFLAGS -o wxWidgets-$VERSION-HTMLHelp.zip | |
399 | unzip $ZIPFLAGS -o wxWidgets-$VERSION-ExtraDoc.zip | |
400 | ||
401 | # After this change of directory, we're in the | |
402 | # temporary 'wx' directory and not acting on | |
403 | # the source wxWidgets directory. | |
404 | cd $DESTDIR/wxWidgets-$VERSION | |
405 | ||
406 | # Now delete a few files that are unnecessary | |
407 | #attrib -R * | |
408 | rm -f BuildCVS.txt descrip.mms | |
409 | rm -f setup.h_vms | |
410 | rm -f docs/html/wxbook.htm docs/html/roadmap.htm | |
411 | rm -f -r contrib/docs/latex/ogl | |
412 | rm -f src/mingegcs.bat | |
413 | rm -f -r distrib | |
414 | rm -f *.spec | |
415 | rm -f src/gtk/descrip.mms src/motif/descrip.mms | |
416 | ||
417 | echo Copying readme files... | |
418 | cp $APPDIR/docs/msw/readme.txt README-MSW.txt | |
419 | cp $APPDIR/docs/msw/install.txt INSTALL-MSW.txt | |
420 | cp $APPDIR/docs/licence.txt LICENCE.txt | |
421 | cp $APPDIR/docs/lgpl.txt COPYING.LIB | |
422 | cp $APPDIR/docs/changes.txt CHANGES.txt | |
423 | cp $APPDIR/docs/readme.txt README.txt | |
424 | ||
425 | # Disabled for now - Now cp some binary files to 'bin' | |
426 | if [ ! -d bin ]; then | |
427 | mkdir bin | |
428 | fi | |
429 | ||
430 | cp $APPDIR/bin/tex2rtf.exe bin | |
431 | cp $APPDIR/bin/tex2rtf.chm bin | |
432 | cp $APPDIR/bin/widgets.exe bin | |
433 | cp $APPDIR/bin/life.exe bin | |
434 | cp $APPDIR/demos/life/breeder.lif bin | |
435 | cp $APPDIR/docs/htmlhelp/tex2rtf.chm bin | |
436 | ||
437 | if [ ! -d docs/pdf ]; then | |
438 | mkdir docs/pdf | |
439 | fi | |
440 | #cp $APPDIR/docs/pdf/wxTutorial.pdf docs/pdf | |
441 | ||
442 | # Make wxMSW-xxx.zip | |
443 | cd $DESTDIR | |
444 | zip $ZIPFLAGS -r wxMSW-$VERSION.zip wxWidgets-$VERSION/* | |
445 | cd wxWidgets-$VERSION | |
446 | ||
49089236 | 447 | if [ "$INNO" != "0" ]; then |
615c15f9 KO |
448 | echo Generating $SETUPSCRIPTNAME |
449 | rm -f $SETUPSCRIPTNAME | |
03a2668f | 450 | |
615c15f9 KO |
451 | sh $SCRIPTDIR/msw/makeinno.sh $SETUPIMAGEDIR $INNOTOP $INNOBOTTOM $SETUPSCRIPTNAME |
452 | ||
453 | if [ ! -f $SETUPSCRIPTNAME ]; then | |
454 | echo "*** Error - something went wrong with the script file generation." | |
455 | exit 1 | |
456 | fi | |
457 | ||
458 | # Now replace %VERSION% with the real application version, and other | |
459 | # variables | |
460 | echo Replacing variables in the setup script | |
461 | doreplace $SETUPSCRIPTNAME "s/%VERSION%/$VERSION/g" | |
462 | doreplace $SETUPSCRIPTNAME "s/%COPYRIGHTHOLDER%/$AUTHOR/g" | |
463 | doreplace $SETUPSCRIPTNAME "s/%VENDOR%/$VENDOR/g" | |
464 | ||
465 | unix2dosname $READMEFILE | |
466 | doreplace $SETUPSCRIPTNAME "s;%READMEFILE%;$RETVALUE;g" | |
467 | ||
468 | unix2dosname $READMEAFTERFILE | |
469 | doreplace $SETUPSCRIPTNAME "s;%READMEAFTERFILE%;$RETVALUE;g" | |
470 | ||
471 | unix2dosname $LICENSEFILE | |
472 | doreplace $SETUPSCRIPTNAME "s;%LICENSEFILE%;$RETVALUE;g" | |
473 | ||
474 | doreplace $SETUPSCRIPTNAME "s/%APPNAME%/$APPNAME/g" | |
475 | doreplace $SETUPSCRIPTNAME "s/%APPTITLE%/$APPTITLE/g" | |
476 | ||
477 | unix2dosname $SETUPIMAGEDIR | |
478 | doreplace $SETUPSCRIPTNAME "s;%SOURCEDIR%;$RETVALUE;g" | |
479 | ||
480 | unix2dosname $DESTDIR | |
481 | doreplace $SETUPSCRIPTNAME "s;%OUTPUTDIR%;$RETVALUE;g" | |
482 | ||
483 | doreplace $SETUPSCRIPTNAME "s/%APPEXTENSION%/$APPEXTENSION/g" | |
484 | ||
485 | # FIXME: how do we get the first name in the list? | |
486 | if [ "$MANUALFILES" != "" ]; then | |
487 | HELPFILE=`basename $MANUALFILES` | |
488 | unix2dosname $HELPFILE | |
489 | doreplace $SETUPSCRIPTNAME "s;%HELPFILE%;$RETVALUE;g" | |
490 | fi | |
491 | ||
492 | rm -f $DESTDIR/setup*.* $DESTDIR/wxMSW-$VERSION-Setup.exe | |
493 | ||
494 | # Inno Setup complains if this step is not done | |
495 | unix2dos --unix2dos $SETUPSCRIPTNAME | |
496 | ||
497 | # Now invoke INNO compiler on the new ISS file | |
498 | # First, make a DOS filename or Inno Setup will get confused. | |
499 | ||
500 | unix2dosname2 $SETUPSCRIPTNAME | |
501 | DOSFILENAME=$RETVALUE | |
502 | ||
503 | # Note: the double slash is Mingw32/MSYS convention for | |
504 | # denoting a switch, that must not be converted into | |
505 | # a path (otherwise /c = c:/) | |
506 | ||
507 | cd `dirname $SETUPSCRIPTNAME` | |
508 | BASESCRIPTNAME=`basename $SETUPSCRIPTNAME` | |
509 | echo Invoking Inno Setup compiler on $BASESCRIPTNAME | |
510 | ||
511 | "$SETUPCOMPILER" //cc $BASESCRIPTNAME | |
512 | ||
513 | if [ ! -f $DESTDIR/setup.exe ]; then | |
514 | echo "*** Error - the setup.exe was not generated." | |
515 | exit | |
516 | fi | |
517 | ||
518 | cd $DESTDIR | |
519 | mv setup.exe wxMSW-$VERSION-Setup.exe | |
03a2668f | 520 | |
03a2668f | 521 | fi |
03a2668f KO |
522 | # echo Putting all the setup files into a single zip archive |
523 | # zip wxMSW-$VERSION-setup.zip readme-$VERSION.txt setup*.* | |
524 | ||
525 | rm -f wxWidgets-$VERSION-win.zip | |
526 | rm -f wxWidgets-$VERSION-ExtraDoc.zip | |
527 | rm -f wxWidgets-$VERSION-DMC.zip | |
03a2668f | 528 | rm -f wxWidgets-$VERSION-Univ.zip |
03a2668f KO |
529 | rm -f wxWidgets-$VERSION-DocSource.zip |
530 | rm -f wxWidgets-$VERSION-LinuxDocs.zip | |
531 | ||
532 | echo If you saw no warnings or errors, $APPTITLE was successfully spun. | |
533 | echo | |
534 | } | |
535 | ||
536 | makesetup() | |
537 | { | |
538 | # if [ -d $SETUPIMAGEDIR ]; then | |
539 | # echo Removing contents of existing $SETUPIMAGEDIR | |
540 | # rm -f -r $SETUPIMAGEDIR/* | |
541 | # fi | |
542 | ||
543 | if [ ! -d $SETUPIMAGEDIR ]; then | |
544 | echo Making the $SETUPIMAGEDIR for preparing the setup | |
545 | mkdir -p $SETUPIMAGEDIR | |
546 | fi | |
547 | ||
548 | # Copying readmes | |
549 | if [ "$READMEFILE" != "" ] && [ -f $READMEFILE ]; then | |
550 | echo Copying readme.txt | |
551 | cp $READMEFILE $SETUPIMAGEDIR | |
552 | # else | |
553 | # echo "*** Warning - $READMEFILE not found" | |
554 | fi | |
555 | ||
556 | if [ "$LICENSEFILE" != "" ] && [ -f $LICENSEFILE ]; then | |
557 | echo Copying licence.txt | |
558 | cp $LICENSEFILE $SETUPIMAGEDIR | |
559 | # else | |
560 | # echo "*** Warning - $LICENSEFILE not found" | |
561 | fi | |
562 | ||
563 | if [ "$MAKEMANUAL" != "0" ]; then | |
564 | if [ -d $MANUALDIR ]; then | |
565 | cd $MANUALDIR | |
566 | make | |
567 | else | |
568 | echo "*** Warning - $MANUALDIR not found" | |
569 | fi | |
570 | fi | |
571 | ||
572 | rm -f $DESTDIR/wx*.zip | |
573 | rm -f $DESTDIR/*.htb | |
574 | rm -f $DESTDIR/ogl3*.zip | |
575 | rm -f $DESTDIR/contrib*.zip | |
576 | rm -f $DESTDIR/tex2rtf2*.zip | |
577 | rm -f $DESTDIR/mmedia*.zip | |
578 | rm -f $DESTDIR/jpeg*.zip | |
579 | rm -f $DESTDIR/tiff*.zip | |
580 | rm -f $DESTDIR/utils*.zip | |
581 | rm -f $DESTDIR/extradoc*.zip | |
582 | rm -f $DESTDIR/stc*.zip | |
583 | rm -f $DESTDIR/*-win32*.zip | |
584 | rm -f $DESTDIR/setup*.* | |
585 | rm -f $DESTDIR/*.txt | |
586 | rm -f $DESTDIR/make* | |
587 | ||
588 | if [ -d $DESTDIR/wx ]; then | |
589 | rm -f -r $DESTDIR/wx | |
590 | fi | |
591 | ||
592 | if [ ! -d $DESTDIR ]; then | |
593 | mkdir $DESTDIR | |
594 | fi | |
595 | if [ -d $DESTDIR/wxWidgets-$VERSION ]; then | |
596 | rm -f -r $DESTDIR/wxWidgets-$VERSION | |
597 | fi | |
598 | ||
599 | # Copy FAQ from wxWebSite CVS | |
600 | #if [ ! -d $WEBFILES ]; then | |
601 | # echo Error - $WEBFILES does not exist | |
602 | # exit | |
603 | #fi | |
604 | ||
605 | echo Copying FAQ and other files from $WEBFILES | |
606 | cp $WEBFILES/site/faq*.htm $APPDIR/docs/html | |
607 | cp $WEBFILES/site/platform.htm $APPDIR/docs/html | |
608 | cp $WEBFILES/site/i18n.htm $APPDIR/docs/html | |
609 | ||
610 | # Copy setup0.h files to setup.h | |
611 | # OS/2 always built with configure now | |
612 | # cp $APPDIR/include/wx/os2/setup0.h $APPDIR/include/wx/os2/setup.h | |
613 | cp $APPDIR/include/wx/msw/setup0.h $APPDIR/include/wx/msw/setup.h | |
614 | cp $APPDIR/include/wx/univ/setup0.h $APPDIR/include/wx/univ/setup.h | |
615 | ||
616 | # Do OS/2 spin | |
617 | if [ "$SPINOS2" = "1" ] || [ "$SPINALL" = "1" ]; then | |
d20e98ab | 618 | dospinport "os2" #dospinos2 |
03a2668f KO |
619 | fi |
620 | ||
621 | # Do Mac spin | |
622 | if [ "$SPINMAC" = "1" ] || [ "$SPINALL" = "1" ]; then | |
623 | dospinmac | |
624 | fi | |
625 | ||
626 | # Do MSW spin | |
627 | if [ "$SPINMSW" = "1" ] || [ "$SPINALL" = "1" ]; then | |
d20e98ab | 628 | dospinport "msw" #dospinmsw |
03a2668f KO |
629 | fi |
630 | ||
631 | # Do wxBase spin | |
632 | if [ "$SPINBASE" = "1" ] || [ "$SPINALL" = "1" ]; then | |
d20e98ab | 633 | dospinport "base" #dospinbase |
03a2668f KO |
634 | fi |
635 | ||
636 | # Do wxAll spin | |
637 | if [ "$SPINWXALL" = "1" ] || [ "$SPINALL" = "1" ]; then | |
d20e98ab | 638 | dospinport "all" #dospinwxall |
03a2668f KO |
639 | fi |
640 | ||
641 | # Do docs spin | |
642 | if [ "$SPINDOCS" = "1" ] || [ "$SPINALL" = "1" ]; then | |
643 | dospindocs | |
644 | fi | |
645 | ||
646 | # Do misc files spin | |
647 | dospinmisc | |
648 | ||
615c15f9 | 649 | docopydocs $APPDIR $DESTDIR |
03a2668f KO |
650 | |
651 | # Time to regenerate the Inno Install script | |
615c15f9 | 652 | dospininstaller |
03a2668f KO |
653 | } |
654 | ||
655 | # Get the makefiles that aren't in CVS and unarchive them | |
656 | getmakefiles() | |
657 | { | |
658 | echo Getting eVC++ project files... | |
659 | curl http://biolpc22.york.ac.uk/pub/CVS_Makefiles/wx-mk-evcprj.zip --output /c/transit/wx-mk-evcprj.zip | |
660 | echo Getting Digital Mars makefiles... | |
661 | curl http://biolpc22.york.ac.uk/pub/CVS_Makefiles/wx-mk-dmars.zip --output /c/transit/wx-mk-dmars.zip | |
662 | echo Getting VC++ makefiles... | |
663 | curl http://biolpc22.york.ac.uk/pub/CVS_Makefiles/wx-mk-msvc.zip --output /c/transit/wx-mk-msvc.zip | |
664 | ||
665 | cd $APPDIR | |
666 | echo Unarchiving makefiles and project files... | |
667 | unzip -o -a /c/transit/wx-mk-evcprj.zip | |
668 | unzip -o -a /c/transit/wx-mk-dmars.zip | |
669 | unzip -o -a /c/transit/wx-mk-msvc.zip | |
670 | echo Done getting makefiles and project files. | |
671 | } | |
672 | ||
673 | usage() | |
674 | { | |
675 | echo "Usage: $PROGNAME [ options ]" 1>&2 | |
676 | echo Options: | |
677 | echo " --help Display this help message" | |
678 | echo " --upx Compress executable with UPX" | |
679 | echo " --no-upx Do not compress executable with UPX" | |
680 | echo " --inno Build the setup.exe" | |
681 | echo " --no-inno Do not build the setup.exe" | |
682 | echo " --wxmac Build wxMac distribution" | |
683 | echo " --wxmsw Build wxMSW distribution" | |
684 | echo " --wxos2 Build wxOS2 distribution" | |
685 | echo " --wxall Build wxAll zip distribution" | |
686 | echo " --wxbase Build wxBase zip distribution" | |
687 | echo " --docs Build docs archives" | |
688 | echo " --all Build all distributions (the default)" | |
689 | echo " --getmakefiles Get out-of-CVS makefiles and unarchive into the wxWidgets source tree" | |
690 | echo " --verbose Verbose zip operation" | |
691 | echo. | |
692 | echo Note that options only override settings in $SCRIPTDIR/msw/setup.var. | |
693 | exit 1 | |
694 | } | |
695 | ||
696 | # Process command line options. | |
697 | ||
698 | for i in "$@"; do | |
615c15f9 | 699 | |
03a2668f KO |
700 | case "$i" in |
701 | --inno) INNO=1 ;; | |
702 | --no-inno) INNO=0 ;; | |
703 | --upx) UPX=1 ;; | |
704 | --no-upx) UPX=0 ;; | |
705 | --wxmac) SPINMAC=1; SPINALL=0 ;; | |
706 | --wxmsw) SPINMSW=1; SPINALL=0 ;; | |
707 | --wxos2) SPINOS2=1; SPINALL=0 ;; | |
708 | --wxall) SPINWXALL=1; SPINALL=0 ;; | |
709 | --wxbase) SPINBASE=1; SPINALL=0 ;; | |
710 | --getmakefiles) GETMAKEFILES=1; SPINALL=0 ;; | |
711 | --docs) SPINDOCS=1; SPINALL=0 ;; | |
712 | --all) SPINALL=1 ;; | |
713 | --verbose) VERBOSE=1 ;; | |
714 | *) | |
715 | usage | |
716 | exit | |
717 | ;; | |
718 | esac | |
719 | done | |
720 | ||
721 | ||
722 | doinit | |
723 | ||
724 | if [ "$GETMAKEFILES" = "1" ]; then | |
725 | getmakefiles | |
726 | exit | |
727 | fi | |
728 | ||
729 | # findversion | |
730 | makesetup | |
731 |