* Tagged the 0.8.0 release.
[vlc.git] / toolbox
blobb02808268cf0fa3c83881b4183c442ab1dab49f2
1 #! /bin/sh
3 ## toolbox for the VLC media player
4 ## $Id$
5 ##
6 ## Authors: Samuel Hocevar <sam@zoy.org>
8 ###
9 ### Get a sane environment, just in case
10 ###
11 LC_ALL=C
12 export LC_ALL
13 LANG=C
14 export LANG
15 CYGWIN=binmode
16 export CYGWIN
19 ## Give help
21 help()
23 cat << EOF
24 recognized flags are:
25 --update-vc update Microsoft Visual Studio files
26 --update-po update translation files
27 --update-includes generate various include files
28 --update-glade generate and fix Glade code
29 --update-glade2 generate and fix Glade 2 code
30 --update-flexml generate and fix flexml and flex code
31 --distclean "make distclean" on steroids
32 --make-woody <dir> change distdir <dir> to a woody distdir
33 EOF
34 exit 1
38 ## Extract stuff from Makefile.am
40 getfiles()
42 awk 'BEGIN{a=0}{if(!a&&$0~/^'"$1"'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if($0~/^[a-zA-Z]/){exit;}print $0}}' < "${srcdir}/Makefile.am" | \
43 tr '\\ ' '\n\n' | \
44 sed -ne 's/[^-$()_a-zA-Z0-9][^-$()_a-zA-Z0-9]*\([a-zA-Z]\)/\1/p' | \
45 sed -e "s,^,${srcdir}/,"
48 ###
49 ### argument check
50 ###
52 if test "$1" = ""
53 then
54 help
57 case "$1" in
58 --changelog|--update-changelog)
59 action=changelog
61 --update-vc)
62 action=vc
64 --update-po)
65 action=po
67 --update-includes)
68 action=includes
70 --update-flexml)
71 action=flexml
73 --update-glade|--fix-glade)
74 action=glade
76 --update-glade2|--update-glade-2|--fix-glade2)
77 action=glade2
79 --distclean)
80 action=distclean
82 --make-woody)
83 action=woody
85 --add-include)
86 action=include
88 --help)
89 help
92 echo "$0: unknown option $1"
93 help
95 esac
96 shift
99 ## Add includes to help doxygen
101 if test "${action}" = "include"
102 then
103 case "$1" in
104 */vlc_common.h|*/include/vlc/*);;
105 */include/*.h) echo "#include <vlc_common.h>" ;;
106 esac
107 cat $1
108 exit 0
112 ## Update the CVS changelog
114 if test "${action}" = "changelog"
115 then
116 YEAR="`date +%Y`"
117 echo "toolbox --changelog no longer required. use this instead:"
118 echo " svn log -v -r '{$YEAR-12-31}:{$YEAR-01-01}' > ChangeLog"
119 exit 0
123 ## Update the MSVC project files
125 if test "${action}" = "vc"
126 then
127 echo "generating Visual Studio files"
129 if test -z "${srcdir}"; then
130 srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
133 # The evil ^M. printf '\r' does not work in Cygwin.
134 M=' '
136 # Variables we get from configure.ac
137 LIBVLC_VERSION=`sed -ne '/AC_INIT/s/.*,\(.*\))/\1/p' < configure.ac`
138 LIBVLC_CODENAME=`sed -ne '/CODENAME=/s/.*"\(.*\)"/\1/p' < configure.ac`
139 LIBVLC_SYMBOL=`echo $LIBVLC_VERSION | sed -e 'y/.-/__/'`
141 # Sources that get built under Win32 - FIXME: anyone wanna deuglify this? :)
142 LIBVLC_SOURCES=`getfiles SOURCES_libvlc_common; getfiles SOURCES_libvlc_win32; getfiles SOURCES_libvlc_dirent; getfiles SOURCES_libvlc_getopt; getfiles SOURCES_libvlc_libc`
144 LIBVLC_HEADERS=`getfiles HEADERS_include; getfiles HEADERS_include_built`
146 LIBVLC_PKG_HEADERS=`getfiles dist_pkginclude_HEADERS`
148 # Clean up
149 rm -f evc/*.vcp msvc/*.dsp msvc/*.vcproj msvc/*.sln msvc/*.ncb
151 # config files
152 for target in evc/config.h msvc/config.h
154 printf "."
155 rm -f ${target}
156 sed -e "s/@CODENAME@/${LIBVLC_CODENAME}/" \
157 -e "s/@VERSION@/${LIBVLC_VERSION}/" \
158 -e "s/@SYMBOL@/${LIBVLC_SYMBOL}/" < ${target}.in > ${target}
159 done
161 # libvlc files
162 for target in evc/libvlc.vcp msvc/libvlc.dsp
164 printf "."
165 # Top of the project file
166 perl -pe 'if(/§SOURCES§/){last;}' < ${target}.in > ${target}
167 # The source files
168 for file in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep -v "/.*/"`
170 cat >> ${target} << EOF
171 # Begin Source File${M}
172 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
173 # ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\".\\" /D DATA_PATH=\\"share\\"${M}
174 # End Source File${M}
176 done
177 for subdir in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep "/.*/" | cut -f2 -d/ | sort | uniq`
179 cat >> ${target} << EOF
180 # Begin Group "${subdir}"${M}
182 for file in `for i in ${LIBVLC_SOURCES} ; do echo $i ; done | grep "/${subdir}/"`
184 subdir="`echo ${file} | sed -e 's%/[^/]*$%/%' | sed -e 's%/%\\\\%g'`"
185 if test "${target}" = "evc/libvlc.vcp"
186 then
187 cat >> ${target} << EOF
188 # Begin Source File${M}
189 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
190 # ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\".\\" /D DATA_PATH=\\"share\\"${M}
191 !IF "\$(CFG)" == "libvlc - Win32 (WCE MIPS) Release"${M}
192 # PROP Output_Dir "MIPSRel\\${subdir}"${M}
193 # PROP Intermediate_Dir "MIPSRel\\${subdir}"${M}
194 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE MIPS) Debug"${M}
195 # PROP Output_Dir "MIPSDbg\\${subdir}"${M}
196 # PROP Intermediate_Dir "MIPSDbg\\${subdir}"${M}
197 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE SH4) Release"${M}
198 # PROP Output_Dir "SH4Rel\\${subdir}"${M}
199 # PROP Intermediate_Dir "SH4Rel\\${subdir}"${M}
200 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE SH4) Debug"${M}
201 # PROP Output_Dir "SH4Dbg\\${subdir}"${M}
202 # PROP Intermediate_Dir "SH4Dbg\\${subdir}"${M}
203 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE SH3) Release"${M}
204 # PROP Output_Dir "SH3Rel\\${subdir}"${M}
205 # PROP Intermediate_Dir "SH3Rel\\${subdir}"${M}
206 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE SH3) Debug"${M}
207 # PROP Output_Dir "SH3Dbg\\${subdir}"${M}
208 # PROP Intermediate_Dir "SH3Dbg\\${subdir}"${M}
209 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE ARM) Release"${M}
210 # PROP Output_Dir "ARMRel\\${subdir}"${M}
211 # PROP Intermediate_Dir "ARMRel\\${subdir}"${M}
212 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE ARM) Debug"${M}
213 # PROP Output_Dir "ARMDbg\\${subdir}"${M}
214 # PROP Intermediate_Dir "ARMDbg\\${subdir}"${M}
215 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE x86em) Release"${M}
216 # PROP Output_Dir "X86EMRel\\${subdir}"${M}
217 # PROP Intermediate_Dir "X86EMRel\\${subdir}"${M}
218 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE x86em) Debug"${M}
219 # PROP Output_Dir "X86EMDbg\\${subdir}"${M}
220 # PROP Intermediate_Dir "X86EMDbg\\${subdir}"${M}
221 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE emulator) Debug"${M}
222 # PROP Output_Dir "emulatorDbg\\${subdir}"${M}
223 # PROP Intermediate_Dir "emulatorDbg\\${subdir}"${M}
224 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE emulator) Release"${M}
225 # PROP Output_Dir "emulatorRel\\${subdir}"${M}
226 # PROP Intermediate_Dir "emulatorRel\\${subdir}"${M}
227 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE x86) Debug"${M}
228 # PROP Output_Dir "X86Dbg\\${subdir}"${M}
229 # PROP Intermediate_Dir "X86Dbg\\${subdir}"${M}
230 !ELSEIF "\$(CFG)" == "libvlc - Win32 (WCE x86) Release"${M}
231 # PROP Output_Dir "X86Rel\\${subdir}"${M}
232 # PROP Intermediate_Dir "X86Rel\\${subdir}"${M}
233 !ENDIF${M}
234 # End Source File${M}
236 else
237 cat >> ${target} << EOF
238 # Begin Source File${M}
239 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
240 # ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\".\\" /D DATA_PATH=\\"share\\"${M}
241 !IF "\$(CFG)" == "libvlc - Win32 Release"${M}
242 # PROP Output_Dir "Release\\${subdir}"${M}
243 # PROP Intermediate_Dir "Release\\${subdir}"${M}
244 !ELSEIF "\$(CFG)" == "libvlc - Win32 Debug"${M}
245 # PROP Output_Dir "Debug\\${subdir}"${M}
246 # PROP Intermediate_Dir "Debug\\${subdir}"${M}
247 !ENDIF${M}
248 # End Source File${M}
251 done
252 cat >> ${target} << EOF
253 # End Group${M}
255 done
256 # The headers
257 perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){if(/§HEADERS§/){last;}print $_}' < ${target}.in >> ${target}
258 for file in ${LIBVLC_HEADERS}
260 cat >> ${target} << EOF
261 # Begin Source File${M}
262 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
263 # End Source File${M}
265 done
266 cat >> ${target} << EOF
267 # Begin Group "vlc"${M}
269 for file in ${LIBVLC_PKG_HEADERS}
271 cat >> ${target} << EOF
272 # Begin Source File${M}
273 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
274 # End Source File${M}
276 done
277 cat >> ${target} << EOF
278 # End Group${M}
280 perl -e 'while(<>){if(/§HEADERS§/){last;}}while(<>){print $_}' < ${target}.in >> ${target}
281 done
283 # plugins files
284 for dir in `sed -ne 's,modules/\(.*\)/Makefile,\1,p' ${srcdir}/configure.ac`
286 mf="${srcdir}/modules/${dir}/Modules.am"
287 for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf}`
289 # this is an attempt at getting a list of plugin sources... we take the
290 # production and remove everything that does not contain "module", which
291 # means you miss $(NULL), but other variables too.
292 allfiles=`grep -v '[^-_a-zA-Z0-9]*#' ${mf} | awk 'BEGIN{a=0}{if(!a&&$0~/^SOURCES_'${mod}'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if($0~/^[a-zA-Z]/){exit;}print $0}}' | tr '\\ ' '\n\n' | grep '\.'`
293 hfiles=`for i in ${allfiles} ; do echo "$i" ; done | grep '\.h$'`
294 cfiles=`for i in ${allfiles} ; do echo "$i" ; done | grep -v '\.h$'`
295 for msdir in evc msvc
297 test "${msdir}" = "evc" && suf="vcp" || suf="dsp"
298 source="${msdir}/plugins.${suf}.in"
299 target="${msdir}/plugin_${mod}.${suf}"
300 printf "."
301 perl -pe 'if(/§SOURCES§/){last;} s/§PLUGIN§/'${mod}'/g' < ${source} > ${target}
302 for cfile in ${cfiles}
304 cat >> ${target} << EOF
305 # Begin Source File${M}
306 SOURCE="..\\modules\\`echo ${dir}/${cfile} | sed 's,/,\\\\,g'`"${M}
307 # ADD CPP /D "__VLC__" /D "__PLUGIN__" /D "MODULE_NAME=${mod}" /D "MODULE_NAME_IS_${mod}" ${M}
308 !IF "\$(CFG)" == "plugin_${mod} - Win32 Release"${M}
309 # PROP Output_Dir "Release\\modules\\`echo ${dir} | sed 's,/,\\\\,g'`"${M}
310 # PROP Intermediate_Dir "Release\\modules\\`echo ${dir} | sed 's,/,\\\\,g'`"${M}
311 !ELSEIF "\$(CFG)" == "plugin_${mod} - Win32 Debug"${M}
312 # PROP Output_Dir "Debug\\modules\\`echo ${dir} | sed 's,/,\\\\,g'`"${M}
313 # PROP Intermediate_Dir "Debug\\modules\\`echo ${dir} | sed 's,/,\\\\,g'`"${M}
314 # End Source File${M}
316 done
317 # sed is really nicer for this... unfortunately it's broken under cygwin
318 # sed -ne '1,/§SOURCES§/d; /§HEADERS§/,$d; p' < ${source} >> ${target}
319 perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){if(/§HEADERS§/){last;}print $_}' < ${source} >> ${target}
320 for hfile in ${hfiles}
322 cat >> ${target} << EOF
323 # Begin Source File${M}
324 SOURCE="..\\modules\\`echo ${dir}/${hfile} | sed 's,/,\\\\,g'`"${M}
325 # End Source File${M}
327 done
328 # sed -ne '1,/§HEADERS§/d; p' < ${source} >> ${target}
329 perl -e 'while(<>){if(/§HEADERS§/){last;}}while(<>){print $_}' < ${source} >> ${target}
330 done
331 done
332 done
334 # vlc files
335 for target in evc/vlc.vcp msvc/vlc.dsp
337 printf "."
338 # Top of the project file
339 perl -pe 'if(/§SOURCES§/){last;}' < ${target}.in > ${target}
340 # The source files
341 if test "${target}" = "evc/vlc.vcp"
342 then
343 cat >> ${target} << EOF
344 # Begin Source File${M}
345 SOURCE="..\\evc\\vlc.c"${M}
346 # End Source File${M}
348 else
349 cat >> ${target} << EOF
350 # Begin Source File${M}
351 SOURCE="..\\src\\vlc.c"${M}
352 # End Source File${M}
355 # Bottom of the project file - handles resource files too
356 perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){print $_}' < ${target}.in >> ${target}
357 done
359 echo " done."
360 exit 0
364 ## Update the potfiles because no one ever does it
366 if test "${action}" = "po"
367 then
368 # create a fake file containing win32 strings
369 rm -f modules/gui/win32/strings.cpp
370 #printf "/* Automatically generated by 'toolbox --update-po', please don't compile */\n" > modules/gui/win32/strings.cpp
371 #find modules/gui/win32 -name '*.dfm' | while read file
373 # printf "\n/*\n * from $file:\n */\n\n" >> modules/gui/win32/strings.cpp
374 # perl -ne 'chop; chop; if( / (Caption|Text|Hint) / || $buffer =~ /[+=] *$/ ) { $buffer =~ s/\+ *$//; $buffer .= $_; } if( $buffer =~ /'"'"' *$/) { $buffer =~ s/'"'"'/"/g; $buffer =~ s/\\/\\\\/g; $buffer =~ s/=/= _(/; print $buffer." );\n"; $buffer = "";}' < $file | grep -v '"-*"' | grep -v '"http://' | grep -v '"vlcs"' >> modules/gui/win32/strings.cpp || exit 1
375 #done
376 # find out the source files
377 rm -f po/POTFILES.in
378 echo "# automatically created by toolbox --update-po" > po/POTFILES.in
379 echo "" >> po/POTFILES.in
380 echo "# main sources" >> po/POTFILES.in
381 find include src -name '*.[chm]' -o -name '*.[ch]pp' \
382 | grep -v '\(vlc_symbols\|misc/modules_\)' \
383 | sort >> po/POTFILES.in
384 echo "" >> po/POTFILES.in
385 echo "# modules" >> po/POTFILES.in
386 find modules -name '*.[chm]' -o -name '*.[ch]pp' \
387 | grep -v '\(\.moc\.\|gui/gtk2/\)' \
388 | sort >> po/POTFILES.in
389 # clean old potfiles
390 cd po
391 rm -f vlc.pot
392 # update
393 make vlc.pot || exit 1
394 make update-po || exit 1
395 cd ..
397 exit 0
401 ## Create include files
403 if test "${action}" = "includes"
404 then
405 #set -x
407 if test -z "${srcdir}"; then
408 srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
410 LIBVLC_HEADERS=`getfiles HEADERS_include`
411 BUILTINS=`sed -ne 's/.*builtins *= *" *\([^"]*\)".*/\1/p' vlc-config`
413 file="${srcdir}/include/vlc_symbols.h"
415 rm -f ${file}.in
416 echo '/* DO NOT EDIT THIS FILE! See Makefile.am */' >> ${file}.in
417 echo 'struct module_symbols_t {' >> ${file}.in
418 cat ${LIBVLC_HEADERS} | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ \1 (* \2_inner) \3;/' >> ${file}.in
419 echo '};' >> ${file}.in
420 echo '#ifdef __PLUGIN__' >> ${file}.in
421 cat ${LIBVLC_HEADERS} | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/# define \2 p_symbols->\2_inner/' >> ${file}.in
422 echo '#endif /* __PLUGIN__ */' >> ${file}.in
423 if diff >/dev/null 2>&1 ${file} ${file}.in
424 then
425 rm -f ${file}.in
426 else
427 echo "creating new ${file}"
428 mv -f ${file}.in ${file}
431 file="${srcdir}/src/misc/modules_plugin.h"
433 rm -f ${file}.tmp && cp ${file}.in ${file}.tmp
434 sed -e 's#.*\$[I][d]:.*# * Automatically generated from '${file}'.in by bootstrap#' < ${file}.in > ${file}.tmp
435 echo '#define STORE_SYMBOLS( p_symbols ) \' >> ${file}.tmp
436 cat ${LIBVLC_HEADERS} | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ (p_symbols)->\2_inner = \2; \\/' >> ${file}.tmp
437 echo '' >> ${file}.tmp
438 if diff >/dev/null 2>&1 ${file} ${file}.tmp
439 then
440 rm -f ${file}.tmp
441 else
442 echo "creating new ${file}"
443 mv -f ${file}.tmp ${file}
446 file="${srcdir}/src/misc/modules_builtin.h"
448 rm -f ${file}.tmp && cp ${file}.in ${file}.tmp
449 if test -n "${BUILTINS}"
450 then
451 for i in `echo ${BUILTINS}`
453 echo "int vlc_entry__`echo $i | sed -e 'y@/@_@' -e 's@\..*@@'`( module_t* );" >>${file}.tmp
454 done
455 echo "" >> ${file}.tmp
457 echo "#define ALLOCATE_ALL_BUILTINS() \\" >> ${file}.tmp
458 echo " do \\" >> ${file}.tmp
459 echo " { \\" >> ${file}.tmp
460 if test -n "${BUILTINS}"
461 then
462 for i in `echo ${BUILTINS}`
464 echo " ALLOCATE_BUILTIN(`echo $i | sed -e 'y@/@_@' -e 's@\..*@@'`); \\" >> ${file}.tmp
465 done
467 echo " } while( 0 );" >> ${file}.tmp
468 echo "" >> ${file}.tmp
469 if diff >/dev/null 2>&1 ${file} ${file}.tmp
470 then
471 rm -f ${file}.tmp
472 else
473 echo "creating new ${file}"
474 mv -f ${file}.tmp ${file}
477 exit 0
481 ## Fix glade-generated files
483 if test "${action}" = "glade"
484 then
485 for file in modules/gui/gtk/gnome.glade modules/gui/gtk/gtk.glade modules/gui/familiar/familiar.glade
487 echo "generating code from $file"
488 glade -w $file || exit 1
489 done
491 for file in modules/gui/gtk/gnome_interface.c modules/gui/gtk/gtk_interface.c modules/gui/familiar/interface.c
493 echo "fixing $file"
494 if grep "DO NOT EDIT THIS FILE" $file >/dev/null 2>&1
495 then
496 rm -f $file.$$.bak
497 cat > $file.$$.bak << EOF
498 /* This file was created automatically by glade and fixed by bootstrap */
500 #include <vlc/vlc.h>
502 sed -e 1,7d \
503 -e 's#_(\(".:..:.."\))#\1#' \
504 -e 's#_(\("[a-z0-9]*://[^"]*"\))#\1#' \
505 -e 's#_("---")#"---"#' \
506 -e 's#_("--")#"--"#' \
507 -e 's#_(\("/dev/[^"]*"\))#"\1"#' \
508 -e 's#_(\("./."\))#\1#' \
509 < $file >> $file.$$.bak
510 mv -f $file.$$.bak $file
512 done
514 for file in modules/gui/gtk/gtk_support.h modules/gui/familiar/support.h
516 echo "fixing $file"
517 if grep "DO NOT EDIT THIS FILE" $file >/dev/null 2>&1
518 then
519 rm -f $file.$$.bak
520 sed -e 's/DO NOT EDIT.*/Created by glade, fixed by bootstrap/' \
521 -e 's,<config.h>,<vlc/vlc.h>,' \
522 -e 's,#if.*ENABLE_NLS.*,#if 0 /* Disabled by bootstrap */,' \
523 -e 's,#else,/* & */,' \
524 < $file > $file.$$.bak
525 mv -f $file.$$.bak $file
527 done
529 exit 0
533 ## Fix glade2-generated files
535 if test "${action}" = "glade2"
536 then
537 for file in modules/gui/gtk2/gnome2.glade modules/gui/gtk2/gtk2.glade modules/gui/pda/pda.glade
539 echo "generating code from $file"
540 glade-2 -w $file || exit 1
541 done
543 for file in modules/gui/pda/pda_interface.c
545 echo "fixing $file"
546 if grep "DO NOT EDIT THIS FILE" $file >/dev/null 2>&1
547 then
548 rm -f $file.$$.bak
549 cat > $file.$$.bak << EOF
550 /* This file was created automatically by glade2 and fixed by bootstrap */
552 #include <vlc/vlc.h>
554 sed -e 1,7d \
555 -e 's#_(\(".:..:.."\))#\1#' \
556 -e 's#_(\("[a-z0-9]*://[^"]*"\))#\1#' \
557 -e 's#_("---")#"---"#' \
558 -e 's#_("--")#"--"#' \
559 -e 's#_(\("/dev/[^"]*"\))#\1#' \
560 -e 's#_(\("./."\))#\1#' \
561 < $file >> $file.$$.bak
562 mv -f $file.$$.bak $file
564 done
566 exit 0
570 ## Make distclean
572 if test "${action}" = "distclean"
573 then
574 set -x
575 # a naive sanity check to make sure we are in a VLC tree
576 test -f vlc.spec.mdk -a -f debian/rules || exit 1
577 # let's rock!
578 find . -type f '(' -name '*.[oa]' -o -name '*.so' -o -name '*.sl' -o -name '*.dylib' -o -name '*.dll' -o -name .dirstamp -o -name Makefile.in -o -name 'stamp-h*' -o -name '*~' -o -name '*.bak' -o -name '*.moc.cpp' ')' -exec rm -f '{}' ';'
579 (cd autotools && find . -name '[a-z]*' -maxdepth 1 -exec rm -f '{}' ';')
580 (cd debian && find . -type d -name '[a-z]*' -maxdepth 1 -exec rm -Rf '{}' ';')
581 find msvc -type f -name '*.dsp' -exec rm -f '{}' ';'
582 find evc -type f -name '*.vcp' -exec rm -f '{}' ';'
583 #find . -type d -name '.deps' -exec rm -Rf '{}' ';'
584 # there's some more cruft all around
585 rm -f config.h config.log config.status
586 rm -f vlc vlc-config Makefile Modules.am
587 rm -Rf autom4te.cache
588 rm -f mozilla/vlcintf.h mozilla/vlcintf.xpt
589 # FIXME: a lot of Makefiles are still there
593 ## Build a woody-friendly package
595 if test "${action}" = "woody"
596 then
597 set -ex
598 test -d "$1"
600 # changelog: replace (1.2.3-4) with (1.2.3-0woody.4)
601 sed -e 's/^vlc (\([^)]*\)-\([^-)]*\))/vlc-woody (\1-0woody.\2)/' \
602 -e 's/ unstable; / stable; /' \
603 < "$1/debian/changelog" > "$1/debian/changelog.woody"
604 mv "$1/debian/changelog.woody" "$1/debian/changelog"
606 # control: replace liba52-*-dev with a52dec-dev (>=0.7.3)
607 # libdv*-dev with libdv-dev
608 # kdelibs4-dev with kdelibs-dev
609 # libqt3-mt-dev libqt3-compat-headers with libqt-dev
610 # libarts1-dev with libarts-dev
611 # libdvdread3-dev with libdvdread2-dev
612 # libdvdplay0-dev (>=1.0.1-2) with libdvdplay0-dev
613 # libxosd-dev (>=2.2.4-1.3) with libxosd-dev
614 # ttf-freefont with ttf-thryomanes
615 # dvb-dev (>= 1.0.1-6) with dvb-dev
616 # remove libwxgtk2.4-dev
617 # libidl0 (workaround for mozilla-dev's bad deps)
618 # libglib2.0-0 (workaround for mozilla-dev's bad deps)
619 # gcc-3.2 (workaround for an ICE in gcc-3.3)
620 # change Section: gnome with Section: graphics
621 # Section: kde with Section: kde
622 # Section: libdevel with Section: devel
623 sed -e 's/liba52-[^-]*-dev/a52dec-dev (>=0.7.3)/' \
624 -e 's/libdv[0-9]*-dev/libdv-dev/' \
625 -e 's/kdelibs[0-9]*-dev/kdelibs-dev/' \
626 -e 's/libqt[0-9]*-mt-dev/libqt-dev/' \
627 -e 's/, libqt[0-9]*-compat-headers[^,]*//' \
628 -e 's/libarts[0-9]*-dev/libarts-dev/' \
629 -e 's/libdvdread[0-9]*-dev/libdvdread2-dev/' \
630 -e 's/, libdvdplay0-dev[^,]*/, libdvdplay0-dev/' \
631 -e 's/, libxosd-dev[^,]*/, libxosd-dev/' \
632 -e 's/, ttf-freefont[^,]*/, ttf-thryomanes/' \
633 -e 's/, dvb-dev[^,]*/, dvb-dev/' \
634 -e 's/, libwx[^,]*//' \
635 -e '/Package: wxvlc/,/^ *$/d' \
636 -e 's/, libidl0[^,]*//' \
637 -e 's/, libglib2.0-0[^,]*//' \
638 -e 's/, gcc-3.2[^,]*//' \
639 -e 's/Section: gnome/Section: graphics/' \
640 -e 's/Section: kde/Section: graphics/' \
641 -e 's/Section: libdevel/Section: devel/' \
642 < "$1/debian/control" > "$1/debian/control.woody"
643 mv "$1/debian/control.woody" "$1/debian/control"
645 # rules: remove wxwindows and skins stuff
646 sed -e '/# Package: wxvlc/,/^ *$/d' \
647 -e 's,--enable-wxwindows,--disable-wxwindows,' \
648 -e 's,--enable-skins,--disable-skins,' \
649 < "$1/debian/rules" > "$1/debian/rules.woody"
650 mv "$1/debian/rules.woody" "$1/debian/rules"
651 chmod 0755 "$1/debian/rules"
653 # modules/misc/freetype.c: replace the default font
654 sed -e 's,freefont/FreeSerifBold.ttf,thryomanes/thryb___.ttf,' \
655 < "$1/modules/misc/freetype.c" > "$1/modules/misc/freetype.c.woody"
656 mv "$1/modules/misc/freetype.c.woody" "$1/modules/misc/freetype.c"