]> git.saurik.com Git - wxWidgets.git/blob - distrib/msw/makerpm
Added build instructions, readme, and TODO
[wxWidgets.git] / distrib / msw / makerpm
1 #!/bin/sh
2 # Makes the wxWindows RPMs
3
4 doupdatecvs()
5 {
6 cd $WXSRC
7 echo Updating from CVS...
8 cvswx update -d -P
9 }
10
11 dospinwxgtk()
12 {
13 echo Making wxGTK RPMs...
14 RPM_ROOT=$WXDEST/wxgtk/rpm-root
15
16 if [ ! -d $WXDEST ]; then
17 mkdir $WXDEST
18 fi
19
20 rm -f -r $WXDEST/wxgtk
21 mkdir $WXDEST/wxgtk
22 mkdir $WXDEST/wxgtk/release
23 mkdir $RPM_ROOT
24
25 cd $WXSRC
26 cd locale
27 make allmo
28 cd $WXDEST/wxgtk/release
29 echo Configuring...
30 $WXSRC/configure --no-recursion
31 echo Making...
32 make -j1 dist bzip-dist-only
33
34 echo Setting up RPM build dir $RPM_ROOT...
35 rm -f -r $RPM_ROOT
36 mkdir $RPM_ROOT
37 mkdir $RPM_ROOT/BUILD
38 mkdir $RPM_ROOT/RPMS
39 mkdir $RPM_ROOT/RPMS/i386
40 mkdir $RPM_ROOT/RPMS/i686
41 mkdir $RPM_ROOT/RPMS/noarch
42 mkdir $RPM_ROOT/SOURCES
43 mkdir $RPM_ROOT/SPECS
44 mkdir $RPM_ROOT/SRPMS
45
46 echo %_topdir $RPM_ROOT > ~/.rpmmacros
47
48 echo Copying wxGTK-$WXVER.tar.bz2 to $RPM_ROOT/SOURCES...
49 cp wxGTK-$WXVER.tar.bz2 $RPM_ROOT/SOURCES
50 echo Copying wxGTK.spec to $RPM_ROOT/SPECS...
51 cp $WXSRC/wxGTK.spec $RPM_ROOT/SPECS
52
53 echo Starting wxGTK RPM build...
54 cd $RPM_ROOT
55 rpmbuild -ba SPECS/wxGTK.spec 2>&1 | tee wxGTK.out
56
57 echo Finished wxBase RPM build, in $RPM_ROOT.
58 echo "SRPMS:"
59 ls SRPMS
60 echo "RPMS/i386:"
61 ls RPMS/i386
62
63 cp $RPM_ROOT/SRPMS/*.rpm $WXDEST
64 cp $RPM_ROOT/RPMS/*.rpm $WXDEST
65 cp $WXDEST/wxgtk/release/*.tar.gz $WXDEST
66 cp $WXDEST/wxgtk/release/*.tar.bz2 $WXDEST
67
68 echo Now try the RPMs with rpm -i.
69 }
70
71 dospinwxbase()
72 {
73 echo Making wxBase RPMs...
74 RPM_ROOT=$WXDEST/wxbase/rpm-root
75
76 if [ ! -d $WXDEST ]; then
77 mkdir $WXDEST
78 fi
79
80 rm -f -r $WXDEST/wxbase
81 mkdir $WXDEST/wxbase
82 mkdir $WXDEST/wxbase/release
83 mkdir $RPM_ROOT
84
85 cd $WXSRC
86 cd locale
87 make allmo
88 cd $WXDEST/wxbase/release
89 echo Configuring...
90 $WXSRC/configure --disable-gui --no-recursion
91 echo Making...
92 make -j1 dist bzip-dist-only
93
94 echo Setting up RPM build dir $RPM_ROOT...
95 rm -f -r $RPM_ROOT
96 mkdir $RPM_ROOT
97 mkdir $RPM_ROOT/BUILD
98 mkdir $RPM_ROOT/RPMS
99 mkdir $RPM_ROOT/RPMS/i386
100 mkdir $RPM_ROOT/RPMS/i686
101 mkdir $RPM_ROOT/RPMS/noarch
102 mkdir $RPM_ROOT/SOURCES
103 mkdir $RPM_ROOT/SPECS
104 mkdir $RPM_ROOT/SRPMS
105
106 echo %_topdir $RPM_ROOT > ~/.rpmmacros
107
108 echo Copying wxBase-$WXVER.tar.bz2 to $RPM_ROOT/SOURCES...
109 cp wxBase-$WXVER.tar.bz2 $RPM_ROOT/SOURCES
110 echo Copying wxBase.spec to $RPM_ROOT/SPECS...
111 cp $WXSRC/wxBase.spec $RPM_ROOT/SPECS
112
113 echo Starting wxBase RPM build...
114 cd $RPM_ROOT
115 rpmbuild -ba SPECS/wxBase.spec 2>&1 | tee wxBase.out
116
117 echo Finished wxBase RPM build, in $RPM_ROOT.
118 echo "SRPMS:"
119 ls SRPMS
120 echo "RPMS/i386:"
121 ls RPMS/i386
122
123 cp $RPM_ROOT/SRPMS/*.rpm $WXDEST
124 cp $RPM_ROOT/RPMS/*.rpm $WXDEST
125 cp $WXDEST/wxbase/release/*.tar.gz $WXDEST
126 cp $WXDEST/wxbase/release/*.tar.bz2 $WXDEST
127
128 echo Now try the RPMs with rpm -i.
129 }
130
131 dospinwxx11()
132 {
133 echo Making wxX11 RPMs...
134 RPM_ROOT=$WXDEST/wxx11/rpm-root
135
136 if [ ! -d $WXDEST ]; then
137 mkdir $WXDEST
138 fi
139
140 rm -f -r $WXDEST/wxx11
141 mkdir $WXDEST/wxx11
142 mkdir $WXDEST/wxx11/release
143 mkdir $RPM_ROOT
144
145 cd $WXSRC
146 cd locale
147 make allmo
148 cd $WXDEST/wxx11/release
149 echo Configuring...
150 $WXSRC/configure --with-x11 --no-recursion
151 echo Making...
152 make -j1 dist bzip-dist-only
153
154 echo Setting up RPM build dir $RPM_ROOT...
155 rm -f -r $RPM_ROOT
156 mkdir $RPM_ROOT
157 mkdir $RPM_ROOT/BUILD
158 mkdir $RPM_ROOT/RPMS
159 mkdir $RPM_ROOT/RPMS/i386
160 mkdir $RPM_ROOT/RPMS/i686
161 mkdir $RPM_ROOT/RPMS/noarch
162 mkdir $RPM_ROOT/SOURCES
163 mkdir $RPM_ROOT/SPECS
164 mkdir $RPM_ROOT/SRPMS
165
166 echo %_topdir $RPM_ROOT > ~/.rpmmacros
167
168 echo Copying wxX11-$WXVER.tar.bz2 to $RPM_ROOT/SOURCES...
169 cp wxX11-$WXVER.tar.bz2 $RPM_ROOT/SOURCES
170 echo Copying wxX11.spec to $RPM_ROOT/SPECS...
171 cp $WXSRC/wxX11.spec $RPM_ROOT/SPECS
172
173 echo Starting wxX11 RPM build...
174 cd $RPM_ROOT
175 rpmbuild -ba SPECS/wxX11.spec 2>&1 | tee wxX11.out
176
177 echo Finished wxX11 RPM build, in $RPM_ROOT.
178 echo "SRPMS:"
179 ls SRPMS
180 echo "RPMS/i386:"
181 ls RPMS/i386
182
183 cp $RPM_ROOT/SRPMS/*.rpm $WXDEST
184 cp $RPM_ROOT/RPMS/*.rpm $WXDEST
185 cp $WXDEST/wxx11/release/*.tar.gz $WXDEST
186 cp $WXDEST/wxx11/release/*.tar.bz2 $WXDEST
187
188 echo Now try the RPMs with rpm -i.
189 }
190
191 PROGNAME=$0
192 WXSRC=$1
193 WXDEST=$2
194 WXVER=$3
195
196 SPINWXX11=0
197 SPINWXGTK=0
198 SPINWXBASE=0
199 SPINEVERYTHING=0
200 UPDATECVS=0
201
202 usage()
203 {
204 echo Usage: $PROGNAME "src-dir dest-dir version-number [ options ]"
205 echo Options:
206 echo " --help Display this help message"
207 echo " --wxgtk Spin wxGTK RPMs"
208 echo " --wxbase Spin wxBase RPMs"
209 echo " --wxx11 Spin wxX11 RPMs"
210 echo " --all Spin EVERYTHING"
211 echo " --updatecvs Update from CVS"
212
213 exit 1
214 }
215
216 init=""
217 if [ "$1" = "" ]
218 then
219 usage
220 exit
221 fi
222
223 if [ "$2" = "" ]
224 then
225 usage
226 exit
227 fi
228
229 if [ "$3" = "" ]
230 then
231 usage
232 exit
233 fi
234
235 # Process command line options.
236 shift 3
237 for i in "$@"; do
238 case "$i" in
239 --wxx11) SPINWXX11=1 ;;
240 --wxgtk) SPINWXGTK=1 ;;
241 --wxbase) SPINWXBASE=1 ;;
242 --all) SPINEVERYTHING=1 ;;
243 --updatecvs) UPDATECVS=1 ;;
244 *)
245 usage
246 exit
247 ;;
248 esac
249 done
250
251 echo About to make wxWindows RPMs:
252 echo From $WXSRC
253 echo To $WXDEST
254 echo Version $WXVER
255 echo CTRL-C if this is not correct.
256 read dummy
257
258 if [ "$UPDATECVS" = "1" ]; then
259 doupdatecvs
260 fi
261
262 if [ "$SPINWXX11" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
263 dospinwxx11
264 fi
265
266 if [ "$SPINWXGTK" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
267 dospinwxgtk
268 fi
269
270 if [ "$SPINWXBASE" = "1" ] || [ "$SPINEVERYTHING" = "1" ]; then
271 dospinwxbase
272 fi
273