]>
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 | |
84b4e2b6 | 363 | mkdir -p `dirname $line` |
d20e98ab KO |
364 | cp -r $line /tmp/wx$port/wxWidgets-$VERSION |
365 | done | |
366 | ||
367 | cd /tmp/wxWidgets-$VERSION | |
368 | ||
369 | echo Copying readme files... | |
370 | cp $APPDIR/docs/msw/readme.txt README-MSW.txt | |
371 | cp $APPDIR/docs/msw/install.txt INSTALL-MSW.txt | |
372 | cp $APPDIR/docs/licence.txt LICENCE.txt | |
373 | cp $APPDIR/docs/lgpl.txt COPYING.LIB | |
374 | cp $APPDIR/docs/changes.txt CHANGES.txt | |
375 | cp $APPDIR/docs/readme.txt README.txt | |
376 | ||
377 | zip $ZIPFLAGS -r -@ $DESTDIR/wx$upperport-$VERSION.zip /tmp/wx$port/wxWidgets-$VERSION | |
378 | } | |
379 | ||
03a2668f KO |
380 | dospininstaller() |
381 | { | |
382 | cd $DESTDIR | |
383 | ||
384 | # Put all archives for transit to Linux in a zip file | |
385 | echo Creating $DESTDIR/wxWidgets-$VERSION-LinuxTransit.zip | |
386 | rm -f $DESTDIR/wxWidgets-$VERSION-LinuxTransit.zip | |
4387847f | 387 | zip $ZIPFLAGS $DESTDIR/wxWidgets-$VERSION-LinuxTransit.zip wxWidgets-$VERSION-LinuxDocs.zip wxWidgets-$VERSION-DMC.zip |
03a2668f KO |
388 | |
389 | rm -f -r wxWidgets-$VERSION | |
390 | ||
391 | echo Unzipping the Windows files into wxWidgets-$VERSION | |
392 | ||
393 | mkdir -p wxWidgets-$VERSION | |
394 | ||
f87584b5 | 395 | unzip $ZIPFLAGS -o wxWidgets-$VERSION-win.zip -d wxWidgets-$VERSION |
f87584b5 KO |
396 | unzip $ZIPFLAGS -o wxWidgets-$VERSION-DMC.zip -d wxWidgets-$VERSION |
397 | unzip $ZIPFLAGS -o wxWidgets-$VERSION-BC.zip -d wxWidgets-$VERSION | |
03a2668f KO |
398 | |
399 | unzip $ZIPFLAGS -o wxWidgets-$VERSION-HTMLHelp.zip | |
400 | unzip $ZIPFLAGS -o wxWidgets-$VERSION-ExtraDoc.zip | |
401 | ||
402 | # After this change of directory, we're in the | |
403 | # temporary 'wx' directory and not acting on | |
404 | # the source wxWidgets directory. | |
405 | cd $DESTDIR/wxWidgets-$VERSION | |
406 | ||
407 | # Now delete a few files that are unnecessary | |
408 | #attrib -R * | |
409 | rm -f BuildCVS.txt descrip.mms | |
410 | rm -f setup.h_vms | |
411 | rm -f docs/html/wxbook.htm docs/html/roadmap.htm | |
412 | rm -f -r contrib/docs/latex/ogl | |
413 | rm -f src/mingegcs.bat | |
414 | rm -f -r distrib | |
415 | rm -f *.spec | |
416 | rm -f src/gtk/descrip.mms src/motif/descrip.mms | |
417 | ||
418 | echo Copying readme files... | |
419 | cp $APPDIR/docs/msw/readme.txt README-MSW.txt | |
420 | cp $APPDIR/docs/msw/install.txt INSTALL-MSW.txt | |
421 | cp $APPDIR/docs/licence.txt LICENCE.txt | |
422 | cp $APPDIR/docs/lgpl.txt COPYING.LIB | |
423 | cp $APPDIR/docs/changes.txt CHANGES.txt | |
424 | cp $APPDIR/docs/readme.txt README.txt | |
425 | ||
426 | # Disabled for now - Now cp some binary files to 'bin' | |
427 | if [ ! -d bin ]; then | |
428 | mkdir bin | |
429 | fi | |
430 | ||
431 | cp $APPDIR/bin/tex2rtf.exe bin | |
432 | cp $APPDIR/bin/tex2rtf.chm bin | |
433 | cp $APPDIR/bin/widgets.exe bin | |
434 | cp $APPDIR/bin/life.exe bin | |
435 | cp $APPDIR/demos/life/breeder.lif bin | |
436 | cp $APPDIR/docs/htmlhelp/tex2rtf.chm bin | |
437 | ||
438 | if [ ! -d docs/pdf ]; then | |
439 | mkdir docs/pdf | |
440 | fi | |
441 | #cp $APPDIR/docs/pdf/wxTutorial.pdf docs/pdf | |
442 | ||
443 | # Make wxMSW-xxx.zip | |
444 | cd $DESTDIR | |
445 | zip $ZIPFLAGS -r wxMSW-$VERSION.zip wxWidgets-$VERSION/* | |
446 | cd wxWidgets-$VERSION | |
447 | ||
49089236 | 448 | if [ "$INNO" != "0" ]; then |
615c15f9 KO |
449 | echo Generating $SETUPSCRIPTNAME |
450 | rm -f $SETUPSCRIPTNAME | |
03a2668f | 451 | |
615c15f9 KO |
452 | sh $SCRIPTDIR/msw/makeinno.sh $SETUPIMAGEDIR $INNOTOP $INNOBOTTOM $SETUPSCRIPTNAME |
453 | ||
454 | if [ ! -f $SETUPSCRIPTNAME ]; then | |
455 | echo "*** Error - something went wrong with the script file generation." | |
456 | exit 1 | |
457 | fi | |
458 | ||
459 | # Now replace %VERSION% with the real application version, and other | |
460 | # variables | |
461 | echo Replacing variables in the setup script | |
462 | doreplace $SETUPSCRIPTNAME "s/%VERSION%/$VERSION/g" | |
463 | doreplace $SETUPSCRIPTNAME "s/%COPYRIGHTHOLDER%/$AUTHOR/g" | |
464 | doreplace $SETUPSCRIPTNAME "s/%VENDOR%/$VENDOR/g" | |
465 | ||
466 | unix2dosname $READMEFILE | |
467 | doreplace $SETUPSCRIPTNAME "s;%READMEFILE%;$RETVALUE;g" | |
468 | ||
469 | unix2dosname $READMEAFTERFILE | |
470 | doreplace $SETUPSCRIPTNAME "s;%READMEAFTERFILE%;$RETVALUE;g" | |
471 | ||
472 | unix2dosname $LICENSEFILE | |
473 | doreplace $SETUPSCRIPTNAME "s;%LICENSEFILE%;$RETVALUE;g" | |
474 | ||
475 | doreplace $SETUPSCRIPTNAME "s/%APPNAME%/$APPNAME/g" | |
476 | doreplace $SETUPSCRIPTNAME "s/%APPTITLE%/$APPTITLE/g" | |
477 | ||
478 | unix2dosname $SETUPIMAGEDIR | |
479 | doreplace $SETUPSCRIPTNAME "s;%SOURCEDIR%;$RETVALUE;g" | |
480 | ||
481 | unix2dosname $DESTDIR | |
482 | doreplace $SETUPSCRIPTNAME "s;%OUTPUTDIR%;$RETVALUE;g" | |
483 | ||
484 | doreplace $SETUPSCRIPTNAME "s/%APPEXTENSION%/$APPEXTENSION/g" | |
485 | ||
486 | # FIXME: how do we get the first name in the list? | |
487 | if [ "$MANUALFILES" != "" ]; then | |
488 | HELPFILE=`basename $MANUALFILES` | |
489 | unix2dosname $HELPFILE | |
490 | doreplace $SETUPSCRIPTNAME "s;%HELPFILE%;$RETVALUE;g" | |
491 | fi | |
492 | ||
493 | rm -f $DESTDIR/setup*.* $DESTDIR/wxMSW-$VERSION-Setup.exe | |
494 | ||
495 | # Inno Setup complains if this step is not done | |
496 | unix2dos --unix2dos $SETUPSCRIPTNAME | |
497 | ||
498 | # Now invoke INNO compiler on the new ISS file | |
499 | # First, make a DOS filename or Inno Setup will get confused. | |
500 | ||
501 | unix2dosname2 $SETUPSCRIPTNAME | |
502 | DOSFILENAME=$RETVALUE | |
503 | ||
504 | # Note: the double slash is Mingw32/MSYS convention for | |
505 | # denoting a switch, that must not be converted into | |
506 | # a path (otherwise /c = c:/) | |
507 | ||
508 | cd `dirname $SETUPSCRIPTNAME` | |
509 | BASESCRIPTNAME=`basename $SETUPSCRIPTNAME` | |
510 | echo Invoking Inno Setup compiler on $BASESCRIPTNAME | |
511 | ||
512 | "$SETUPCOMPILER" //cc $BASESCRIPTNAME | |
513 | ||
514 | if [ ! -f $DESTDIR/setup.exe ]; then | |
515 | echo "*** Error - the setup.exe was not generated." | |
516 | exit | |
517 | fi | |
518 | ||
519 | cd $DESTDIR | |
520 | mv setup.exe wxMSW-$VERSION-Setup.exe | |
03a2668f | 521 | |
03a2668f | 522 | fi |
03a2668f KO |
523 | # echo Putting all the setup files into a single zip archive |
524 | # zip wxMSW-$VERSION-setup.zip readme-$VERSION.txt setup*.* | |
525 | ||
526 | rm -f wxWidgets-$VERSION-win.zip | |
527 | rm -f wxWidgets-$VERSION-ExtraDoc.zip | |
528 | rm -f wxWidgets-$VERSION-DMC.zip | |
03a2668f | 529 | rm -f wxWidgets-$VERSION-Univ.zip |
03a2668f KO |
530 | rm -f wxWidgets-$VERSION-DocSource.zip |
531 | rm -f wxWidgets-$VERSION-LinuxDocs.zip | |
532 | ||
533 | echo If you saw no warnings or errors, $APPTITLE was successfully spun. | |
534 | echo | |
535 | } | |
536 | ||
537 | makesetup() | |
538 | { | |
539 | # if [ -d $SETUPIMAGEDIR ]; then | |
540 | # echo Removing contents of existing $SETUPIMAGEDIR | |
541 | # rm -f -r $SETUPIMAGEDIR/* | |
542 | # fi | |
543 | ||
544 | if [ ! -d $SETUPIMAGEDIR ]; then | |
545 | echo Making the $SETUPIMAGEDIR for preparing the setup | |
546 | mkdir -p $SETUPIMAGEDIR | |
547 | fi | |
548 | ||
549 | # Copying readmes | |
550 | if [ "$READMEFILE" != "" ] && [ -f $READMEFILE ]; then | |
551 | echo Copying readme.txt | |
552 | cp $READMEFILE $SETUPIMAGEDIR | |
553 | # else | |
554 | # echo "*** Warning - $READMEFILE not found" | |
555 | fi | |
556 | ||
557 | if [ "$LICENSEFILE" != "" ] && [ -f $LICENSEFILE ]; then | |
558 | echo Copying licence.txt | |
559 | cp $LICENSEFILE $SETUPIMAGEDIR | |
560 | # else | |
561 | # echo "*** Warning - $LICENSEFILE not found" | |
562 | fi | |
563 | ||
564 | if [ "$MAKEMANUAL" != "0" ]; then | |
565 | if [ -d $MANUALDIR ]; then | |
566 | cd $MANUALDIR | |
567 | make | |
568 | else | |
569 | echo "*** Warning - $MANUALDIR not found" | |
570 | fi | |
571 | fi | |
572 | ||
573 | rm -f $DESTDIR/wx*.zip | |
574 | rm -f $DESTDIR/*.htb | |
575 | rm -f $DESTDIR/ogl3*.zip | |
576 | rm -f $DESTDIR/contrib*.zip | |
577 | rm -f $DESTDIR/tex2rtf2*.zip | |
578 | rm -f $DESTDIR/mmedia*.zip | |
579 | rm -f $DESTDIR/jpeg*.zip | |
580 | rm -f $DESTDIR/tiff*.zip | |
581 | rm -f $DESTDIR/utils*.zip | |
582 | rm -f $DESTDIR/extradoc*.zip | |
583 | rm -f $DESTDIR/stc*.zip | |
584 | rm -f $DESTDIR/*-win32*.zip | |
585 | rm -f $DESTDIR/setup*.* | |
586 | rm -f $DESTDIR/*.txt | |
587 | rm -f $DESTDIR/make* | |
588 | ||
589 | if [ -d $DESTDIR/wx ]; then | |
590 | rm -f -r $DESTDIR/wx | |
591 | fi | |
592 | ||
593 | if [ ! -d $DESTDIR ]; then | |
594 | mkdir $DESTDIR | |
595 | fi | |
596 | if [ -d $DESTDIR/wxWidgets-$VERSION ]; then | |
597 | rm -f -r $DESTDIR/wxWidgets-$VERSION | |
598 | fi | |
599 | ||
600 | # Copy FAQ from wxWebSite CVS | |
601 | #if [ ! -d $WEBFILES ]; then | |
602 | # echo Error - $WEBFILES does not exist | |
603 | # exit | |
604 | #fi | |
605 | ||
606 | echo Copying FAQ and other files from $WEBFILES | |
607 | cp $WEBFILES/site/faq*.htm $APPDIR/docs/html | |
608 | cp $WEBFILES/site/platform.htm $APPDIR/docs/html | |
609 | cp $WEBFILES/site/i18n.htm $APPDIR/docs/html | |
610 | ||
611 | # Copy setup0.h files to setup.h | |
612 | # OS/2 always built with configure now | |
613 | # cp $APPDIR/include/wx/os2/setup0.h $APPDIR/include/wx/os2/setup.h | |
614 | cp $APPDIR/include/wx/msw/setup0.h $APPDIR/include/wx/msw/setup.h | |
615 | cp $APPDIR/include/wx/univ/setup0.h $APPDIR/include/wx/univ/setup.h | |
616 | ||
617 | # Do OS/2 spin | |
618 | if [ "$SPINOS2" = "1" ] || [ "$SPINALL" = "1" ]; then | |
d20e98ab | 619 | dospinport "os2" #dospinos2 |
03a2668f KO |
620 | fi |
621 | ||
622 | # Do Mac spin | |
623 | if [ "$SPINMAC" = "1" ] || [ "$SPINALL" = "1" ]; then | |
624 | dospinmac | |
625 | fi | |
626 | ||
627 | # Do MSW spin | |
628 | if [ "$SPINMSW" = "1" ] || [ "$SPINALL" = "1" ]; then | |
d20e98ab | 629 | dospinport "msw" #dospinmsw |
03a2668f KO |
630 | fi |
631 | ||
632 | # Do wxBase spin | |
633 | if [ "$SPINBASE" = "1" ] || [ "$SPINALL" = "1" ]; then | |
d20e98ab | 634 | dospinport "base" #dospinbase |
03a2668f KO |
635 | fi |
636 | ||
637 | # Do wxAll spin | |
638 | if [ "$SPINWXALL" = "1" ] || [ "$SPINALL" = "1" ]; then | |
d20e98ab | 639 | dospinport "all" #dospinwxall |
03a2668f KO |
640 | fi |
641 | ||
642 | # Do docs spin | |
643 | if [ "$SPINDOCS" = "1" ] || [ "$SPINALL" = "1" ]; then | |
644 | dospindocs | |
645 | fi | |
646 | ||
647 | # Do misc files spin | |
648 | dospinmisc | |
649 | ||
615c15f9 | 650 | docopydocs $APPDIR $DESTDIR |
03a2668f KO |
651 | |
652 | # Time to regenerate the Inno Install script | |
615c15f9 | 653 | dospininstaller |
03a2668f KO |
654 | } |
655 | ||
656 | # Get the makefiles that aren't in CVS and unarchive them | |
657 | getmakefiles() | |
658 | { | |
659 | echo Getting eVC++ project files... | |
660 | curl http://biolpc22.york.ac.uk/pub/CVS_Makefiles/wx-mk-evcprj.zip --output /c/transit/wx-mk-evcprj.zip | |
661 | echo Getting Digital Mars makefiles... | |
662 | curl http://biolpc22.york.ac.uk/pub/CVS_Makefiles/wx-mk-dmars.zip --output /c/transit/wx-mk-dmars.zip | |
663 | echo Getting VC++ makefiles... | |
664 | curl http://biolpc22.york.ac.uk/pub/CVS_Makefiles/wx-mk-msvc.zip --output /c/transit/wx-mk-msvc.zip | |
665 | ||
666 | cd $APPDIR | |
667 | echo Unarchiving makefiles and project files... | |
668 | unzip -o -a /c/transit/wx-mk-evcprj.zip | |
669 | unzip -o -a /c/transit/wx-mk-dmars.zip | |
670 | unzip -o -a /c/transit/wx-mk-msvc.zip | |
671 | echo Done getting makefiles and project files. | |
672 | } | |
673 | ||
674 | usage() | |
675 | { | |
676 | echo "Usage: $PROGNAME [ options ]" 1>&2 | |
677 | echo Options: | |
678 | echo " --help Display this help message" | |
679 | echo " --upx Compress executable with UPX" | |
680 | echo " --no-upx Do not compress executable with UPX" | |
681 | echo " --inno Build the setup.exe" | |
682 | echo " --no-inno Do not build the setup.exe" | |
683 | echo " --wxmac Build wxMac distribution" | |
684 | echo " --wxmsw Build wxMSW distribution" | |
685 | echo " --wxos2 Build wxOS2 distribution" | |
686 | echo " --wxall Build wxAll zip distribution" | |
687 | echo " --wxbase Build wxBase zip distribution" | |
688 | echo " --docs Build docs archives" | |
689 | echo " --all Build all distributions (the default)" | |
690 | echo " --getmakefiles Get out-of-CVS makefiles and unarchive into the wxWidgets source tree" | |
691 | echo " --verbose Verbose zip operation" | |
692 | echo. | |
693 | echo Note that options only override settings in $SCRIPTDIR/msw/setup.var. | |
694 | exit 1 | |
695 | } | |
696 | ||
697 | # Process command line options. | |
698 | ||
699 | for i in "$@"; do | |
615c15f9 | 700 | |
03a2668f KO |
701 | case "$i" in |
702 | --inno) INNO=1 ;; | |
703 | --no-inno) INNO=0 ;; | |
704 | --upx) UPX=1 ;; | |
705 | --no-upx) UPX=0 ;; | |
706 | --wxmac) SPINMAC=1; SPINALL=0 ;; | |
707 | --wxmsw) SPINMSW=1; SPINALL=0 ;; | |
708 | --wxos2) SPINOS2=1; SPINALL=0 ;; | |
709 | --wxall) SPINWXALL=1; SPINALL=0 ;; | |
710 | --wxbase) SPINBASE=1; SPINALL=0 ;; | |
711 | --getmakefiles) GETMAKEFILES=1; SPINALL=0 ;; | |
712 | --docs) SPINDOCS=1; SPINALL=0 ;; | |
713 | --all) SPINALL=1 ;; | |
714 | --verbose) VERBOSE=1 ;; | |
715 | *) | |
716 | usage | |
717 | exit | |
718 | ;; | |
719 | esac | |
720 | done | |
721 | ||
722 | ||
723 | doinit | |
724 | ||
725 | if [ "$GETMAKEFILES" = "1" ]; then | |
726 | getmakefiles | |
727 | exit | |
728 | fi | |
729 | ||
730 | # findversion | |
731 | makesetup | |
732 |