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