* modules/stream_out/transcode.c, modules/audio_filter/format.c: fixed a bunch of...
[vlc.git] / toolbox
blobfe1272c47712e055d0773dd0cf20ca20a3fadb96
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-01-01}:{$YEAR-12-31}' > 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 !ENDIF${M}
222 # End Source File${M}
224 else
225 cat >> ${target} << EOF
226 # Begin Source File${M}
227 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
228 # ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\".\\" /D DATA_PATH=\\"share\\"${M}
229 !IF "\$(CFG)" == "libvlc - Win32 Release"${M}
230 # PROP Output_Dir "Release\\${subdir}"${M}
231 # PROP Intermediate_Dir "Release\\${subdir}"${M}
232 !ELSEIF "\$(CFG)" == "libvlc - Win32 Debug"${M}
233 # PROP Output_Dir "Debug\\${subdir}"${M}
234 # PROP Intermediate_Dir "Debug\\${subdir}"${M}
235 !ENDIF${M}
236 # End Source File${M}
239 done
240 cat >> ${target} << EOF
241 # End Group${M}
243 done
244 # The headers
245 perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){if(/§HEADERS§/){last;}print $_}' < ${target}.in >> ${target}
246 for file in ${LIBVLC_HEADERS}
248 cat >> ${target} << EOF
249 # Begin Source File${M}
250 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
251 # End Source File${M}
253 done
254 cat >> ${target} << EOF
255 # Begin Group "vlc"${M}
257 for file in ${LIBVLC_PKG_HEADERS}
259 cat >> ${target} << EOF
260 # Begin Source File${M}
261 SOURCE="..\\`echo ${file} | sed -e 's%/%\\\\%g'`"${M}
262 # End Source File${M}
264 done
265 cat >> ${target} << EOF
266 # End Group${M}
268 perl -e 'while(<>){if(/§HEADERS§/){last;}}while(<>){print $_}' < ${target}.in >> ${target}
269 done
271 # plugins files
272 for dir in `sed -ne 's,modules/\(.*\)/Makefile,\1,p' ${srcdir}/configure.ac`
274 mf="${srcdir}/modules/${dir}/Modules.am"
275 for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf}`
277 # this is an attempt at getting a list of plugin sources... we take the
278 # production and remove everything that does not contain "module", which
279 # means you miss $(NULL), but other variables too.
280 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 '\.'`
281 hfiles=`for i in ${allfiles} ; do echo "$i" ; done | grep '\.h$'`
282 cfiles=`for i in ${allfiles} ; do echo "$i" ; done | grep -v '\.h$'`
283 for msdir in evc msvc
285 test "${msdir}" = "evc" && suf="vcp" || suf="dsp"
286 source="${msdir}/plugins.${suf}.in"
287 target="${msdir}/plugin_${mod}.${suf}"
288 printf "."
289 perl -pe 'if(/§SOURCES§/){last;} s/§PLUGIN§/'${mod}'/g' < ${source} > ${target}
290 for cfile in ${cfiles}
292 cat >> ${target} << EOF
293 # Begin Source File${M}
294 SOURCE="..\\modules\\`echo ${dir}/${cfile} | sed 's,/,\\\\,g'`"${M}
295 # ADD CPP /D "__VLC__" /D "__PLUGIN__" /D "MODULE_NAME=${mod}" /D "MODULE_NAME_IS_${mod}" ${M}
296 !IF "\$(CFG)" == "plugin_${mod} - Win32 Release"${M}
297 # PROP Output_Dir "Release\\modules\\`echo ${dir} | sed 's,/,\\\\,g'`"${M}
298 # PROP Intermediate_Dir "Release\\modules\\`echo ${dir} | sed 's,/,\\\\,g'`"${M}
299 !ELSEIF "\$(CFG)" == "plugin_${mod} - Win32 Debug"${M}
300 # PROP Output_Dir "Debug\\modules\\`echo ${dir} | sed 's,/,\\\\,g'`"${M}
301 # PROP Intermediate_Dir "Debug\\modules\\`echo ${dir} | sed 's,/,\\\\,g'`"${M}
302 # End Source File${M}
304 done
305 # sed is really nicer for this... unfortunately it's broken under cygwin
306 # sed -ne '1,/§SOURCES§/d; /§HEADERS§/,$d; p' < ${source} >> ${target}
307 perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){if(/§HEADERS§/){last;}print $_}' < ${source} >> ${target}
308 for hfile in ${hfiles}
310 cat >> ${target} << EOF
311 # Begin Source File${M}
312 SOURCE="..\\modules\\`echo ${dir}/${hfile} | sed 's,/,\\\\,g'`"${M}
313 # End Source File${M}
315 done
316 # sed -ne '1,/§HEADERS§/d; p' < ${source} >> ${target}
317 perl -e 'while(<>){if(/§HEADERS§/){last;}}while(<>){print $_}' < ${source} >> ${target}
318 done
319 done
320 done
322 # vlc files
323 for target in evc/vlc.vcp msvc/vlc.dsp
325 printf "."
326 # Top of the project file
327 perl -pe 'if(/§SOURCES§/){last;}' < ${target}.in > ${target}
328 # The source files
329 if test "${target}" = "evc/vlc.vcp"
330 then
331 cat >> ${target} << EOF
332 # Begin Source File${M}
333 SOURCE="..\\evc\\vlc.c"${M}
334 # End Source File${M}
336 else
337 cat >> ${target} << EOF
338 # Begin Source File${M}
339 SOURCE="..\\src\\vlc.c"${M}
340 # End Source File${M}
343 # Bottom of the project file - handles resource files too
344 perl -e 'while(<>){if(/§SOURCES§/){last;}}while(<>){print $_}' < ${target}.in >> ${target}
345 done
347 echo " done."
348 exit 0
352 ## Update the potfiles because no one ever does it
354 if test "${action}" = "po"
355 then
356 # create a fake file containing win32 strings
357 rm -f modules/gui/win32/strings.cpp
358 #printf "/* Automatically generated by 'toolbox --update-po', please don't compile */\n" > modules/gui/win32/strings.cpp
359 #find modules/gui/win32 -name '*.dfm' | while read file
361 # printf "\n/*\n * from $file:\n */\n\n" >> modules/gui/win32/strings.cpp
362 # 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
363 #done
364 # find out the source files
365 rm -f po/POTFILES.in
366 echo "# automatically created by toolbox --update-po" > po/POTFILES.in
367 echo "" >> po/POTFILES.in
368 echo "# main sources" >> po/POTFILES.in
369 find include src -name '*.[chm]' -o -name '*.[ch]pp' \
370 | grep -v '\(vlc_symbols\|misc/modules_\)' \
371 | sort >> po/POTFILES.in
372 echo "" >> po/POTFILES.in
373 echo "# modules" >> po/POTFILES.in
374 find modules -name '*.[chm]' -o -name '*.[ch]pp' \
375 | grep -v '\(gui/wxwindows/wizard\|\.moc\.\|gui/gtk2/\)' \
376 | sort >> po/POTFILES.in
377 # clean old potfiles
378 cd po
379 rm -f vlc.pot
380 # update
381 make vlc.pot || exit 1
382 make update-po || exit 1
383 cd ..
385 exit 0
389 ## Create include files
391 if test "${action}" = "includes"
392 then
393 #set -x
395 if test -z "${srcdir}"; then
396 srcdir="`sed -ne 's/^srcdir *= *//p' < Makefile`"
398 LIBVLC_HEADERS=`getfiles HEADERS_include`
399 BUILTINS=`sed -ne 's/.*builtins *= *" *\([^"]*\)".*/\1/p' vlc-config`
401 file="${srcdir}/include/vlc_symbols.h"
403 rm -f ${file}.in
404 echo '/* DO NOT EDIT THIS FILE! See Makefile.am */' >> ${file}.in
405 echo 'struct module_symbols_t {' >> ${file}.in
406 cat ${LIBVLC_HEADERS} | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ \1 (* \2_inner) \3;/' >> ${file}.in
407 echo '};' >> ${file}.in
408 echo '#ifdef __PLUGIN__' >> ${file}.in
409 cat ${LIBVLC_HEADERS} | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/# define \2 p_symbols->\2_inner/' >> ${file}.in
410 echo '#endif /* __PLUGIN__ */' >> ${file}.in
411 if diff >/dev/null 2>&1 ${file} ${file}.in
412 then
413 rm -f ${file}.in
414 else
415 echo "creating new ${file}"
416 mv -f ${file}.in ${file}
419 file="${srcdir}/src/misc/modules_plugin.h"
421 rm -f ${file}.tmp && cp ${file}.in ${file}.tmp
422 sed -e 's#.*\$[I][d]:.*# * Automatically generated from '${file}'.in by bootstrap#' < ${file}.in > ${file}.tmp
423 echo '#define STORE_SYMBOLS( p_symbols ) \' >> ${file}.tmp
424 cat ${LIBVLC_HEADERS} | grep '^ *VLC_EXPORT.*;' | sed -e 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ (p_symbols)->\2_inner = \2; \\/' >> ${file}.tmp
425 echo '' >> ${file}.tmp
426 if diff >/dev/null 2>&1 ${file} ${file}.tmp
427 then
428 rm -f ${file}.tmp
429 else
430 echo "creating new ${file}"
431 mv -f ${file}.tmp ${file}
434 file="${srcdir}/src/misc/modules_builtin.h"
436 rm -f ${file}.tmp && cp ${file}.in ${file}.tmp
437 if test -n "${BUILTINS}"
438 then
439 for i in `echo ${BUILTINS}`
441 echo "int vlc_entry__`echo $i | sed -e 'y@/@_@' -e 's@\..*@@'`( module_t* );" >>${file}.tmp
442 done
443 echo "" >> ${file}.tmp
445 echo "#define ALLOCATE_ALL_BUILTINS() \\" >> ${file}.tmp
446 echo " do \\" >> ${file}.tmp
447 echo " { \\" >> ${file}.tmp
448 if test -n "${BUILTINS}"
449 then
450 for i in `echo ${BUILTINS}`
452 echo " ALLOCATE_BUILTIN(`echo $i | sed -e 'y@/@_@' -e 's@\..*@@'`); \\" >> ${file}.tmp
453 done
455 echo " } while( 0 );" >> ${file}.tmp
456 echo "" >> ${file}.tmp
457 if diff >/dev/null 2>&1 ${file} ${file}.tmp
458 then
459 rm -f ${file}.tmp
460 else
461 echo "creating new ${file}"
462 mv -f ${file}.tmp ${file}
465 exit 0
469 ## Fix glade-generated files
471 if test "${action}" = "glade"
472 then
473 for file in modules/gui/gtk/gnome.glade modules/gui/gtk/gtk.glade modules/gui/familiar/familiar.glade
475 echo "generating code from $file"
476 glade -w $file || exit 1
477 done
479 for file in modules/gui/gtk/gnome_interface.c modules/gui/gtk/gtk_interface.c modules/gui/familiar/interface.c
481 echo "fixing $file"
482 if grep "DO NOT EDIT THIS FILE" $file >/dev/null 2>&1
483 then
484 rm -f $file.$$.bak
485 cat > $file.$$.bak << EOF
486 /* This file was created automatically by glade and fixed by bootstrap */
488 #include <vlc/vlc.h>
490 sed -e 1,7d \
491 -e 's#_(\(".:..:.."\))#\1#' \
492 -e 's#_(\("[a-z0-9]*://[^"]*"\))#\1#' \
493 -e 's#_("---")#"---"#' \
494 -e 's#_("--")#"--"#' \
495 -e 's#_(\("/dev/[^"]*"\))#"\1"#' \
496 -e 's#_(\("./."\))#\1#' \
497 < $file >> $file.$$.bak
498 mv -f $file.$$.bak $file
500 done
502 for file in modules/gui/gtk/gtk_support.h modules/gui/familiar/support.h
504 echo "fixing $file"
505 if grep "DO NOT EDIT THIS FILE" $file >/dev/null 2>&1
506 then
507 rm -f $file.$$.bak
508 sed -e 's/DO NOT EDIT.*/Created by glade, fixed by bootstrap/' \
509 -e 's,<config.h>,<vlc/vlc.h>,' \
510 -e 's,#if.*ENABLE_NLS.*,#if 0 /* Disabled by bootstrap */,' \
511 -e 's,#else,/* & */,' \
512 < $file > $file.$$.bak
513 mv -f $file.$$.bak $file
515 done
517 exit 0
521 ## Fix glade2-generated files
523 if test "${action}" = "glade2"
524 then
525 for file in modules/gui/gtk2/gnome2.glade modules/gui/gtk2/gtk2.glade modules/gui/pda/pda.glade
527 echo "generating code from $file"
528 glade-2 -w $file || exit 1
529 done
531 for file in modules/gui/pda/pda_interface.c
533 echo "fixing $file"
534 if grep "DO NOT EDIT THIS FILE" $file >/dev/null 2>&1
535 then
536 rm -f $file.$$.bak
537 cat > $file.$$.bak << EOF
538 /* This file was created automatically by glade2 and fixed by bootstrap */
540 #include <vlc/vlc.h>
542 sed -e 1,7d \
543 -e 's#_(\(".:..:.."\))#\1#' \
544 -e 's#_(\("[a-z0-9]*://[^"]*"\))#\1#' \
545 -e 's#_("---")#"---"#' \
546 -e 's#_("--")#"--"#' \
547 -e 's#_(\("/dev/[^"]*"\))#\1#' \
548 -e 's#_(\("./."\))#\1#' \
549 < $file >> $file.$$.bak
550 mv -f $file.$$.bak $file
552 done
554 exit 0
558 ## Make distclean
560 if test "${action}" = "distclean"
561 then
562 set -x
563 # a naive sanity check to make sure we are in a VLC tree
564 test -f vlc.spec.mdk -a -f debian/rules || exit 1
565 # let's rock!
566 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 '{}' ';'
567 (cd autotools && find . -name '[a-z]*' -maxdepth 1 -exec rm -f '{}' ';')
568 (cd debian && find . -type d -name '[a-z]*' -maxdepth 1 -exec rm -Rf '{}' ';')
569 find msvc -type f -name '*.dsp' -exec rm -f '{}' ';'
570 find evc -type f -name '*.vcp' -exec rm -f '{}' ';'
571 #find . -type d -name '.deps' -exec rm -Rf '{}' ';'
572 # there's some more cruft all around
573 rm -f config.h config.log config.status
574 rm -f vlc vlc-config Makefile Modules.am
575 rm -Rf autom4te.cache
576 rm -f mozilla/vlcintf.h mozilla/vlcintf.xpt
577 # FIXME: a lot of Makefiles are still there
581 ## Build a woody-friendly package
583 if test "${action}" = "woody"
584 then
585 set -ex
586 test -d "$1"
588 # changelog: replace (1.2.3-4) with (1.2.3-0woody.4)
589 sed -e 's/^vlc (\([^)]*\)-\([^-)]*\))/vlc-woody (\1-0woody.\2)/' \
590 -e 's/ unstable; / stable; /' \
591 < "$1/debian/changelog" > "$1/debian/changelog.woody"
592 mv "$1/debian/changelog.woody" "$1/debian/changelog"
594 # control: replace liba52-*-dev with a52dec-dev (>=0.7.3)
595 # libdv*-dev with libdv-dev
596 # kdelibs4-dev with kdelibs-dev
597 # libqt3-mt-dev libqt3-compat-headers with libqt-dev
598 # libarts1-dev with libarts-dev
599 # libdvdread3-dev with libdvdread2-dev
600 # libdvdplay0-dev (>=1.0.1-2) with libdvdplay0-dev
601 # libxosd-dev (>=2.2.4-1.3) with libxosd-dev
602 # ttf-freefont with ttf-thryomanes
603 # dvb-dev (>= 1.0.1-6) with dvb-dev
604 # remove libwxgtk2.4-dev
605 # libidl0 (workaround for mozilla-dev's bad deps)
606 # libglib2.0-0 (workaround for mozilla-dev's bad deps)
607 # gcc-3.2 (workaround for an ICE in gcc-3.3)
608 # change Section: gnome with Section: graphics
609 # Section: kde with Section: kde
610 # Section: libdevel with Section: devel
611 sed -e 's/liba52-[^-]*-dev/a52dec-dev (>=0.7.3)/' \
612 -e 's/libdv[0-9]*-dev/libdv-dev/' \
613 -e 's/kdelibs[0-9]*-dev/kdelibs-dev/' \
614 -e 's/libqt[0-9]*-mt-dev/libqt-dev/' \
615 -e 's/, libqt[0-9]*-compat-headers[^,]*//' \
616 -e 's/libarts[0-9]*-dev/libarts-dev/' \
617 -e 's/libdvdread[0-9]*-dev/libdvdread2-dev/' \
618 -e 's/, libdvdplay0-dev[^,]*/, libdvdplay0-dev/' \
619 -e 's/, libxosd-dev[^,]*/, libxosd-dev/' \
620 -e 's/, ttf-freefont[^,]*/, ttf-thryomanes/' \
621 -e 's/, dvb-dev[^,]*/, dvb-dev/' \
622 -e 's/, libwx[^,]*//' \
623 -e '/Package: wxvlc/,/^ *$/d' \
624 -e 's/, libidl0[^,]*//' \
625 -e 's/, libglib2.0-0[^,]*//' \
626 -e 's/, gcc-3.2[^,]*//' \
627 -e 's/Section: gnome/Section: graphics/' \
628 -e 's/Section: kde/Section: graphics/' \
629 -e 's/Section: libdevel/Section: devel/' \
630 < "$1/debian/control" > "$1/debian/control.woody"
631 mv "$1/debian/control.woody" "$1/debian/control"
633 # rules: remove wxwindows and skins stuff
634 sed -e '/# Package: wxvlc/,/^ *$/d' \
635 -e 's,--enable-wxwindows,--disable-wxwindows,' \
636 -e 's,--enable-skins,--disable-skins,' \
637 < "$1/debian/rules" > "$1/debian/rules.woody"
638 mv "$1/debian/rules.woody" "$1/debian/rules"
639 chmod 0755 "$1/debian/rules"
641 # modules/misc/freetype.c: replace the default font
642 sed -e 's,freefont/FreeSerifBold.ttf,thryomanes/thryb___.ttf,' \
643 < "$1/modules/misc/freetype.c" > "$1/modules/misc/freetype.c.woody"
644 mv "$1/modules/misc/freetype.c.woody" "$1/modules/misc/freetype.c"