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