fix daily builds
[wxWidgets.git] / build / script / rebuild-makefiles.sh
1 #!/bin/sh
2
3 CURDATE=`date -I`
4 WORKDIR=/home/bake/bkl-cronjob
5 WINSRCDIR=/mnt/daily
6 FTPDIR=/home/ftp/pub
7 LD_LIBRARY_PATH=/usr/local/lib
8
9 update_from_cvs()
10 {
11 (
12 cd ${WORKDIR}/wxWidgets && cvs -z3 update -P -d
13 )
14
15 }
16
17
18 regenerate_makefiles()
19 {
20 (cd ${WORKDIR}/wxWidgets/build/bakefiles && nice python -O ${WORKDIR}/bakefile/bin/bakefile_gen)
21 }
22
23
24 do_package()
25 {
26 archtype=$1
27 format=$2
28 shift ; shift
29
30 rm -f ${WORKDIR}/archives/wx-mk-${format}-*
31
32 cd ${WORKDIR}/wxWidgets
33
34 files=""
35 for i in $* ; do
36 files="$files `find -name "$i"`"
37 done
38
39 if test $archtype = tar ; then
40 tar czf ../archives/wx-mk-${format}-${CURDATE}.tar.gz $files
41 elif test $archtype = zip ; then
42 zip -l -q -9 ../archives/wx-mk-${format}-${CURDATE}.zip $files
43 fi
44
45 cd ..
46 }
47
48
49
50
51 package_makefiles()
52 {
53 do_package tar autoconf Makefile.in autoconf_inc.m4
54 do_package zip gnu makefile.unx
55 do_package tar gnu makefile.unx
56 do_package zip mingw makefile.gcc config.gcc
57 do_package zip dmars makefile.dmc config.dmc makefile.dms config.dms
58 do_package zip watcom makefile.wat config.wat
59 do_package zip msvc makefile.vc config.vc
60 do_package zip msvc6prj '*.dsp' '*.dsw'
61 do_package zip evcprj '*.vcp' '*.vcw'
62 }
63
64 copy_files ()
65 {
66 ##delete old files and then copy new ones, add a symlink
67
68 ## Makefiles
69 find ${FTPDIR}/CVS_Makefiles/files -type f -name wx-mk\* -mtime +3 | xargs rm -rf
70 cp ${WORKDIR}/archives/wx-mk-* ${FTPDIR}/CVS_Makefiles/files
71
72 rm -f ${FTPDIR}/CVS_Makefiles/wx* ${FTPDIR}/CVS_Makefiles/MD5SUM
73 ##there must be an easier way of doing these links...
74 for f in `find ${FTPDIR}/CVS_Makefiles/files -type f -name wx-mk\* -mmin -601` ; do
75 ln -s $f `echo $f | sed -e "s/-${CURDATE}//" | sed -e "s|/files||" `
76 done
77 md5sum ${FTPDIR}/CVS_Makefiles/wx* > ${FTPDIR}/CVS_Makefiles/MD5SUM
78 sleep 10
79 echo CVS Makefiles generated from bakefiles last updated at `date -u` > ${FTPDIR}/CVS_Makefiles/updated_at.txt
80
81 ## Setup.exe
82 find ${FTPDIR}/CVS_HEAD/v1/files -type f -name wx\* -mtime +3 | xargs rm -rf
83 cp ${WORKDIR}/archives/win/*.exe ${FTPDIR}/CVS_HEAD/v1/files
84
85 rm -f ${FTPDIR}/CVS_HEAD/v1/*.exe ${FTPDIR}/CVS_Makefiles/MD5SUM
86 ##there must be an easier way of doing these links...
87 for f in `find ${FTPDIR}/CVS_HEAD/v1/files -type f -name wx\*.exe -mmin -601` ; do
88 ln -s $f `echo $f | sed -e "s/-${CURDATE}//" | sed -e "s|/files||" `
89 done
90 md5sum ${FTPDIR}/CVS_HEAD/v1/wx* > ${FTPDIR}/CVS_Makefiles/MD5SUM
91 sleep 10
92 echo CVS HEAD last updated at `date -u` > ${FTPDIR}/CVS_HEAD/v1/updated_at.txt
93
94
95 ## Docs...
96 find ${FTPDIR}/CVS_Docs/files -type f -name wx\* -mtime +3 | xargs rm -rf
97 cp ${WORKDIR}/archives/wx-doc* ${FTPDIR}/CVS_Docs/files
98 cp ${WORKDIR}/archives/win/wxW* ${FTPDIR}/CVS_Docs/files
99
100 rm -f ${FTPDIR}/CVS_Docs/wx* ${FTPDIR}/CVS_Docs/MD5SUM
101 ##there must be an easier way of doing these links...
102 for f in `find ${FTPDIR}/CVS_Docs/files -type f -name wx\* -mmin -601` ; do
103 ln -s $f `echo $f | sed -e "s/-${CURDATE}//" | sed -e "s|/files||" `
104 done
105 md5sum ${FTPDIR}/CVS_Docs/wx* > ${FTPDIR}/CVS_Docs/MD5SUM
106 sleep 10
107 echo CVS Documentation generated from bakefiles last updated at `date -u` > ${FTPDIR}/CVS_Docs/updated_at.txt
108 }
109
110 do_texrtf ()
111 {
112
113 ##parameters : subdir_of_tex index.tex dir_under_wxWidgets
114 # need this first time only
115 if [ ! -e ${WORKDIR}/archives/html/$1 ] ; then
116 mkdir ${WORKDIR}/archives/html/$1
117 fi
118
119 rm -f ${WORKDIR}/archives/html/$1/*
120 /usr/local/bin/tex2rtf ${WORKDIR}/wxWidgets/$3/docs/latex/$1/$2 ${WORKDIR}/archives/html/$1/$1 -twice -html -macros ${WORKDIR}/wxWidgets/docs/latex/wx/tex2rtf_css.ini
121 cp ${WORKDIR}/wxWidgets/$3/docs/latex/$1/*.gif ${WORKDIR}/archives/html/$1
122 cp ${WORKDIR}/wxWidgets/$3/docs/latex/$1/*.css ${WORKDIR}/archives/html/$1
123 cd ${WORKDIR}/archives/html/$1
124 zip -l -q -9 ${WORKDIR}/archives/htb/$1.htb *.html *.css wx.hhc wx.hhp wx.hhk
125 zip -q -9 ${WORKDIR}/archives/htb/$1.htb *.gif
126 }
127
128 ##this one for tex2rtf as its latex docs aren't in latex...
129 do_util_texrtf ()
130 {
131 ##parameters : subdir_of_tex index.tex
132 # need this first time only
133 if [ ! -e ${WORKDIR}/archives/html/$1 ] ; then
134 mkdir ${WORKDIR}/archives/html/$1
135 fi
136
137 rm -f ${WORKDIR}/archives/html/$1/*
138 /usr/local/bin/tex2rtf ${WORKDIR}/wxWidgets/utils/$1/docs/$2 ${WORKDIR}/archives/html/$1/$1 -twice -html -macros ${WORKDIR}/wxWidgets/docs/latex/wx/tex2rtf_css.ini
139 cp ${WORKDIR}/wxWidgets/utils/$1/docs/*.gif ${WORKDIR}/archives/html/$1
140 cp ${WORKDIR}/wxWidgets/utils/$1/docs/*.css ${WORKDIR}/archives/html/$1
141 cd ${WORKDIR}/archives/html/$1
142 zip -l -q -9 ${WORKDIR}/archives/htb/$1.htb *.html *.css wx.hhc wx.hhp wx.hhk
143 zip -q -9 ${WORKDIR}/archives/htb/$1.htb *.gif
144 }
145
146 do_docs ()
147 {
148 ##remove files, then regenerate
149 rm ${WORKDIR}/archives/wx-do*
150 rm ${WORKDIR}/archives/win/wx*
151 rm ${WORKDIR}/archives/htb/*.*
152
153 ######### dir index.tex rootdir
154 do_texrtf wx manual.tex
155 do_texrtf book book.tex
156 do_texrtf svg dcsvg.tex contrib
157 do_texrtf ogl ogl.tex contrib
158 do_texrtf mmedia mmedia.tex contrib
159 do_texrtf gizmos manual.tex contrib
160 do_texrtf fl fl.tex contrib
161 do_util_texrtf tex2rtf tex2rtf.tex
162
163 cd ${WORKDIR}/archives/
164 tar zcvf ${WORKDIR}/archives/wx-docs-html-${CURDATE}.tar.gz html/wx/*.html html/wx/*.gif html/wx/*.css
165 tar zcvf ${WORKDIR}/archives/wx-docs-extra-html-${CURDATE}.tar.gz `find . -name 'wx' -prune -o -name '*.html' -print`
166
167 tar zcvf ${WORKDIR}/archives/wx-docs-htb-${CURDATE}.tar.gz htb/wx.htb
168 tar zcvf ${WORKDIR}/archives/wx-docs-extra-htb-${CURDATE}.tar.gz --exclude wx.htb htb/*.htb
169 zip -q -9 ${WORKDIR}/archives/wx-docs-htb-${CURDATE}.zip htb/wx.htb
170
171 ##remove .con files
172 rm ${WORKDIR}/*.con
173
174 }
175
176
177 add_win_files ()
178 {
179 ### starts with wx***.zip
180
181 for f in `find ${WINSRCDIR}/ -name wx\*.zip ` ; do
182 cp $f ${WORKDIR}/archives/win/`basename $f | sed -e "s/.zip//"`-${CURDATE}.zip
183 done
184
185 for f in `find ${WINSRCDIR}/ -name wx\*.exe ` ; do
186 cp $f ${WORKDIR}/archives/win/`basename $f | sed -e "s/.exe//"`-${CURDATE}.exe
187 done
188
189 }
190
191 update_from_cvs
192 regenerate_makefiles
193 package_makefiles
194
195 do_docs
196 add_win_files
197
198 copy_files
199
200 exit 0