]> git.saurik.com Git - wxWidgets.git/blob - distrib/scripts/mac/tardist
restore cvs up
[wxWidgets.git] / distrib / scripts / mac / tardist
1 #!/bin/sh
2 # tardist: make up a tar.gz distribution of wxWidgets 2
3 # Supply a source (e.g. ~/wx2) and destination (e.g. ~/wx2/deliver)
4
5 # We can't use e.g. this:
6 # ls `cat $SRC/distrib/msw/makefile.rsp` zip -@ -u $DEST/wxWidgets-$VERSION-gen.zip
7 # because there's not enough space on the command line, plus we need to ignore the
8 # blank lines.
9
10 PROGNAME=$0
11 WXSRC=$1
12 WXDEST=$2
13 WXVER=$3
14
15 # for docopyreadmefiles and docopysetup_h
16 SCRIPTDIR=$WXSRC/distrib/scripts
17 . $SCRIPTDIR/utils.inc
18
19 TAR=tar
20 ARCH=`arch`
21 if [ "$ARCH" = "ppc" ]; then
22 TAR=gnutar
23 fi
24
25 expandlines()
26 {
27 toexpand=$1
28 outputfile=$2
29
30 rm -f $outputfile
31 touch $outputfile
32 for line in `cat $toexpand` ; do
33 if [ "$line" != "" ]; then
34 ls $line >> $outputfile
35 fi
36 uniq < $outputfile > /tmp/uniqtemp.txt
37 mv /tmp/uniqtemp.txt $outputfile
38 done
39 }
40
41 doinit()
42 {
43 cd $WXSRC
44 echo Removing backup files...
45 rm *~ */*~ */*/*~ */*/*/*~ */*/*/*/*~
46
47 rm -f $WXDEST/wx*-${WXVER}*.tar.gz
48 # Copy setup files
49 cp $WXSRC/include/wx/msw/setup0.h $WXSRC/include/wx/msw/setup.h
50 cp $WXSRC/include/wx/univ/setup0.h $WXSRC/include/wx/univ/setup.h
51
52 # Copy readme and other files
53 docopydocs $WXSRC $WXDEST
54
55 # Make .mo files
56 cd $WXSRC/locale
57 make allmo
58 }
59
60 dospinwxmac()
61 {
62 echo Tarring wxMac...
63 ### wxMac
64 cp $WXSRC/include/wx/mac/setup0.h $WXSRC/include/wx/setup.h
65 cp $WXSRC/include/wx/mac/setup0.h $WXSRC/include/wx/mac/setup.h
66 cd $WXSRC
67 cat $SCRIPTDIR/manifests/mac.rsp \
68 $SCRIPTDIR/manifests/cocoa.rsp \
69 $SCRIPTDIR/manifests/generic.rsp \
70 $SCRIPTDIR/manifests/generic_samples.rsp \
71 $SCRIPTDIR/manifests/cw_mac.rsp \
72 $SCRIPTDIR/manifests/tex2rtf.rsp \
73 $SCRIPTDIR/manifests/utils.rsp \
74 $SCRIPTDIR/manifests/ogl.rsp \
75 $SCRIPTDIR/manifests/stc.rsp \
76 $SCRIPTDIR/manifests/xml.rsp \
77 $SCRIPTDIR/manifests/contrib.rsp \
78 $SCRIPTDIR/manifests/deprecated.rsp \
79 $SCRIPTDIR/manifests/makefile.rsp \
80 $SCRIPTDIR/manifests/tiff.rsp \
81 $SCRIPTDIR/manifests/jpeg.rsp \
82 > /tmp/wxmac_in.txt
83 expandlines /tmp/wxmac_in.txt /tmp/wxmac.txt
84 $TAR cf $WXDEST/wxMac-${WXVER}.tar -T /tmp/wxmac.txt
85
86 rm -f $WXSRC/include/wx/setup.h
87
88 echo Re-tarring wxMac in a subdirectory...
89 cd $WXDEST
90 mkdir wxMac-${WXVER}
91 cd wxMac-${WXVER}
92
93 $TAR xf ../wxMac-${WXVER}.tar
94 rm -f -r contrib/src/mmedia contrib/samples/mmedia
95 echo Copying readme files...
96 cp $WXSRC/docs/mac/readme.txt README-MAC.txt
97 cp $WXSRC/docs/mac/install.txt INSTALL-MAC.txt
98
99 cd ..
100 rm -f wxMac-${WXVER}.tar
101 $TAR cf $WXDEST/wxMac-${WXVER}.tar wxMac-${WXVER}/*
102 rm -f -r wxMac-${WXVER}
103 gzip $WXDEST/wxMac-${WXVER}.tar
104 }
105
106 ### wxUniv: universal-specific files
107 #cd $WXSRC
108 #cat $SCRIPTDIR/manifests/univ.rsp > /tmp/wxuniv_in.txt
109 #expandlines /tmp/wxuniv_in.txt /tmp/wxuniv.txt
110 #$TAR cf $WXDEST/wxWidgets-${WXVER}-Univ.tar -T /tmp/wxuniv.txt
111 #
112 #echo Re-tarring wxUniversal in a subdirectory...
113 #cd $WXDEST
114 #mkdir wxWidgets-${WXVER}
115 #cd wxWidgets-${WXVER}
116 #$TAR xf ../wxWidgets-${WXVER}-Univ.tar
117 #cd ..
118 #rm -f wxWidgets-${WXVER}-Univ.tar
119 #$TAR cf $WXDEST/wxWidgets-${WXVER}-Univ.tar wxWidgets-${WXVER}/*
120 #rm -f -r wxWidgets-${WXVER}
121 #gzip $WXDEST/wxWidgets-${WXVER}-Univ.tar
122
123 dospinwxall()
124 {
125 echo Tarring wxAll...
126
127 ### wxAll: all distributions in one giant archive
128 cd $WXSRC
129 cat $SCRIPTDIR/manifests/generic.rsp \
130 $SCRIPTDIR/manifests/generic_samples.rsp \
131 $SCRIPTDIR/manifests/msw.rsp \
132 $SCRIPTDIR/manifests/wince.rsp \
133 $SCRIPTDIR/manifests/vc.rsp \
134 $SCRIPTDIR/manifests/cw.rsp \
135 $SCRIPTDIR/manifests/cw_mac.rsp \
136 $SCRIPTDIR/manifests/gtk.rsp \
137 $SCRIPTDIR/manifests/x11.rsp \
138 $SCRIPTDIR/manifests/motif.rsp \
139 $SCRIPTDIR/manifests/mac.rsp \
140 $SCRIPTDIR/manifests/cocoa.rsp \
141 $SCRIPTDIR/manifests/os2.rsp \
142 $SCRIPTDIR/manifests/palmos.rsp \
143 $SCRIPTDIR/manifests/x11.rsp \
144 $SCRIPTDIR/manifests/univ.rsp \
145 $SCRIPTDIR/manifests/mgl.rsp \
146 $SCRIPTDIR/manifests/dfb.rsp \
147 $SCRIPTDIR/manifests/contrib.rsp \
148 $SCRIPTDIR/manifests/deprecated.rsp \
149 $SCRIPTDIR/manifests/utilmake.rsp \
150 $SCRIPTDIR/manifests/utils.rsp \
151 $SCRIPTDIR/manifests/mmedia.rsp \
152 $SCRIPTDIR/manifests/tex2rtf.rsp \
153 $SCRIPTDIR/manifests/stc.rsp \
154 $SCRIPTDIR/manifests/xml.rsp \
155 $SCRIPTDIR/manifests/ogl.rsp \
156 $SCRIPTDIR/manifests/makefile.rsp \
157 $SCRIPTDIR/manifests/tiff.rsp \
158 $SCRIPTDIR/manifests/jpeg.rsp \
159 $SCRIPTDIR/manifests/docsrc.rsp \
160 | uniq > /tmp/wxall_in.txt
161 expandlines /tmp/wxall_in.txt /tmp/wxall.txt
162 $TAR cf $WXDEST/wxWidgets-${WXVER}.tar -T /tmp/wxall.txt
163
164 echo Re-tarring wxAll in a subdirectory...
165 cd $WXDEST
166 mkdir wxWidgets-${WXVER}
167
168 cd wxWidgets-${WXVER}
169
170 # If we have the full set of VC++ project files,
171 # get them
172 if [ -f $WXDEST/extra/wxWidgets-${WXVER}-VC.zip ]; then
173 unzip -o $WXDEST/extra/wxWidgets-${WXVER}-VC.zip
174 else
175 echo "Warning - did not find $WXDEST/deliver/extra/wxWidgets-${WXVER}-VC.zip"
176 fi
177
178 # If we have the full set of eVC++ project files,
179 # get them
180 if [ -f $WXDEST/extra/wxWidgets-${WXVER}-eVC.zip ]; then
181 unzip -o $WXDEST/extra/wxWidgets-${WXVER}-eVC.zip
182 else
183 echo "Warning - did not find $WXDEST/deliver/extra/wxWidgets-${WXVER}-eVC.zip"
184 fi
185
186 # If we have the full set of DMC project files,
187 # get them
188 if [ -f $WXDEST/extra/wxWidgets-${WXVER}-DMC.zip ]; then
189 unzip -o $WXDEST/extra/wxWidgets-${WXVER}-DMC.zip
190 else
191 echo "Warning - did not find $WXDEST/deliver/extra/wxWidgets-${WXVER}-DMC.zip"
192 fi
193
194 $TAR xf ../wxWidgets-${WXVER}.tar
195
196 # Translate all .dsp and .dsw files to DOS format
197 unix2dos --unix2dos `cat $SCRIPTDIR/manifests/vc.rsp`
198
199 cd ..
200 rm -f wxWidgets-${WXVER}.tar
201 $TAR cf $WXDEST/wxWidgets-${WXVER}.tar wxWidgets-${WXVER}/*
202 rm -f -r wxWidgets-${WXVER}
203 gzip -c $WXDEST/wxWidgets-${WXVER}.tar > $WXDEST/wxWidgets-${WXVER}.tar.gz
204 bzip2 $WXDEST/wxWidgets-${WXVER}.tar
205 }
206
207 domakedocs()
208 {
209 mkdir -p $WXSRC/docs/html/wx
210 mkdir -p $WXSRC/docs/html/tex2rtf
211 mkdir -p $WXSRC/docs/html/fl
212 mkdir -p $WXSRC/docs/html/ogl
213 mkdir -p $WXSRC/docs/htb
214
215 rm -f -r $WXSRC/docs/html/wx/*.htm*
216 rm -f -r $WXSRC/docs/htb/wx.htb
217
218 echo Making HTML wxWidgets manual...
219 cd $WXSRC/docs/latex/wx
220 cp *.gif $WXSRC/docs/html/wx
221 tex2rtf manual.tex $WXSRC/docs/html/wx/wx.htm -twice -html
222
223 echo Making HTB wxWidgets manual...
224 cd $WXSRC/docs/html/wx
225 zip -q $WXSRC/docs/htb/wx.htb *.html *.gif *.hhp *.hhc *.hhk
226
227 echo Done making manuals.
228 }
229
230 init=""
231 if [ "$1" = "" ]
232 then
233 echo Usage: tardist wx-dir output-dir version
234 exit
235 fi
236
237 if [ "$2" = "" ]
238 then
239 echo Usage: tardist wx-dir output-dir version
240 exit
241 fi
242
243 if [ "$3" = "" ]
244 then
245 echo Usage: tardist wx-dir output-dir version
246 exit
247 fi
248
249 SPINWXALL=0
250 SPINWXMAC=0
251 SPINEVERYTHING=0
252 SILENT=0
253
254 usage()
255 {
256 echo Usage: $PROGNAME "src-dir dest-dir version-number [ options ]"
257 echo Options:
258 echo " --help Display this help message"
259 echo " --wxall Spin wxAll"
260 echo " --wxmac Spin wxMac"
261 echo " --all Spin EVERYTHING"
262 echo " --silent Don't ask for confirmation before running"
263
264 exit 1
265 }
266
267 # Process command line options.
268 shift 3
269 for i in "$@"; do
270 case "$i" in
271 --wxall) SPINWXALL=1 ;;
272 --wxmac) SPINWXMAC=1 ;;
273 --all) SPINEVERYTHING=1 ;;
274 --silent) SILENT=1 ;;
275 *)
276 usage
277 exit
278 ;;
279 esac
280 done
281
282 if [ "$SILENT" = "0" ]; then
283 echo About to archive wxWidgets:
284 echo From $WXSRC
285 echo To $WXDEST
286 echo Version $WXVER
287 echo CTRL-C if this is not correct.
288 read dummy
289 fi
290
291 doinit
292
293 if [ "$SPINWXMAC" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
294 dospinwxmac
295 fi
296
297 if [ "$SPINWXALL" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
298 dospinwxall
299 fi
300