Give MSVS project files DOS line endings.
[wxWidgets.git] / distrib / scripts / create_archives.sh
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 SPINMSW=0
13 SPINOS2=0
14 SPINDOCS=0
15 SPINALL=0
16 SPINWXALL=0
17 SPINBASE=0
18 GETMAKEFILES=0
19 VERBOSE=0
20 ZIPFLAGS=
21
22 PROGNAME=$0
23 SCRIPTDIR=$WXWIN/distrib/scripts
24 . $SCRIPTDIR/utils.inc
25
26 MANIFESTDIR=$SCRIPTDIR/manifests
27 WEBFILES=$WXWIN/../wxWebSite
28 if [ ! "$CYGPATH" = "" ]; then
29 WEBFILES=`$CYGPATH "$WEBFILES"`
30 fi
31
32 # Set this to the required version
33 if [ "$VERSION" = "" ]; then
34 VERSION=2.7.0
35 fi
36
37 getfilelist(){
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
79 filelist="$filelist palmos.rsp"
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
93 copyfilelist(){
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
107 doinit()
108 {
109 if [ "$VERBOSE" != "1" ]; then
110 ZIPFLAGS=-q
111 fi
112 }
113
114 dospinport(){
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
134
135 if [ $port = "msw" ] || [ $port = "all" ]; then
136 cp -f README-MSW.txt INSTALL-MSW.txt $TMPFILESDIR
137 fi
138
139 if [ $port = "os2" ] || [ $port = "all" ]; then
140 cp -f INSTALL-OS2.txt $TMPFILESDIR
141 fi
142
143 pushd /tmp/wx$port
144 echo "Creating wx$portname-$VERSION.zip..."
145 zip $ZIPFLAGS -r -9 $APPDIR/deliver/wx$portname-$VERSION.zip .
146 echo "Creating wx$portname-$VERSION.tar.gz..."
147 tar czvf $APPDIR/deliver/wx$portname-$VERSION.tar.gz wxWidgets-$VERSION
148 echo "Creating wx$portname-$VERSION.tar.bz2..."
149 tar ch wxWidgets-$VERSION | bzip2 -f9 > $APPDIR/deliver/wx$portname-$VERSION.tar.bz2
150 popd
151 rm -rf /tmp/wx$port
152 }
153
154 prepareforrelease()
155 {
156 pushd $APPDIR
157 echo Copying FAQ and other files from $WEBFILES
158 cp $WEBFILES/site/faq*.htm $APPDIR/docs/html
159 cp $WEBFILES/site/platform.htm $APPDIR/docs/html
160 cp $WEBFILES/site/i18n.htm $APPDIR/docs/html
161
162 echo Copying readme files...
163 cp $APPDIR/docs/msw/readme.txt README-MSW.txt
164 cp $APPDIR/docs/msw/install.txt INSTALL-MSW.txt
165 cp $APPDIR/docs/os2/install.txt INSTALL-OS2.txt
166 cp $APPDIR/docs/licence.txt LICENCE.txt
167 cp $APPDIR/docs/lgpl.txt COPYING.LIB
168 cp $APPDIR/docs/changes.txt CHANGES.txt
169 cp $APPDIR/docs/readme.txt README.txt
170
171 # Now delete a few files that are unnecessary
172 rm -f BuildCVS.txt descrip.mms
173 rm -f setup.h_vms
174 rm -f docs/html/wxbook.htm docs/html/roadmap.htm
175 rm -f -r contrib/docs/latex/ogl
176 rm -f src/mingegcs.bat
177 rm -f *.spec
178 rm -f src/gtk/descrip.mms src/motif/descrip.mms
179
180 # Copy setup0.h files to setup.h
181 # OS/2 always built with configure now
182 # cp $APPDIR/include/wx/os2/setup0.h $APPDIR/include/wx/os2/setup.h
183 cp $APPDIR/include/wx/msw/setup0.h $APPDIR/include/wx/msw/setup.h
184 cp $APPDIR/include/wx/univ/setup0.h $APPDIR/include/wx/univ/setup.h
185
186 # Make MSW project files have DOS line endings.
187 unix2dos `cat $MANIFESTDIR/vc.rsp`
188
189 popd
190 }
191
192 usage()
193 {
194 echo "Usage: $PROGNAME [ options ]" 1>&2
195 echo Options:
196 echo " --help Display this help message"
197 echo " --wxmac Build wxMac distribution"
198 echo " --wxmsw Build wxMSW distribution"
199 echo " --wxos2 Build wxOS2 distribution"
200 echo " --wxall Build wxAll zip distribution"
201 echo " --wxbase Build wxBase zip distribution"
202 echo " --all Build all distributions (the default)"
203 echo " --verbose Verbose zip operation"
204 exit 1
205 }
206
207 # Process command line options.
208
209 for i in "$@"; do
210
211 case "$i" in
212 --wxmac) SPINMAC=1; SPINALL=0 ;;
213 --wxmsw) SPINMSW=1; SPINALL=0 ;;
214 --wxos2) SPINOS2=1; SPINALL=0 ;;
215 --wxall) SPINWXALL=1; SPINALL=0 ;;
216 --wxbase) SPINBASE=1; SPINALL=0 ;;
217 --getmakefiles) GETMAKEFILES=1; SPINALL=0 ;;
218 --docs) SPINDOCS=1; SPINALL=0 ;;
219 --all) SPINALL=1 ;;
220 --verbose) VERBOSE=1 ;;
221 *)
222 usage
223 exit
224 ;;
225 esac
226 done
227
228
229 doinit
230 prepareforrelease
231
232 # Do OS/2 spin
233 if [ "$SPINOS2" = "1" ] || [ "$SPINALL" = "1" ]; then
234 dospinport "os2"
235 fi
236
237 # Do MSW spin
238 if [ "$SPINMSW" = "1" ] || [ "$SPINALL" = "1" ]; then
239 dospinport "msw"
240 fi
241
242 # Do wxBase spin
243 if [ "$SPINBASE" = "1" ] || [ "$SPINALL" = "1" ]; then
244 dospinport "base"
245 fi
246
247 # Do wxAll spin
248 if [ "$SPINWXALL" = "1" ] || [ "$SPINALL" = "1" ]; then
249 dospinport "all"
250 fi
251
252 if [ "$SPINALL" = "1" ]; then
253 dospinport "mgl"
254 dospinport "gtk"
255 dospinport "x11"
256 dospinport "motif"
257 dospinport "mac"
258 fi
259