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