]> git.sesse.net Git - vlc/blob - debian/rules
mkv.cpp: support segments with "unknown" size
[vlc] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for the VLC media player - uses debhelper.
3 # $Id$
4 # based on Joey Hess's one.
5
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
8 include /usr/share/dpatch/dpatch.make
9
10 #
11 # Compilation options
12 #
13
14 CONFIG_FLAGS = --enable-release --prefix=/usr
15 CONFIG_FLAGS += \
16         --disable-gnome \
17         --disable-gtk \
18         --disable-familiar \
19         --disable-fb \
20         --enable-ggi \
21         --enable-sdl \
22         --enable-esd \
23         --disable-qt \
24         --enable-mad \
25         --enable-arts \
26         --enable-alsa \
27         --enable-lirc \
28         --enable-a52 \
29         --enable-aa \
30         --enable-dvbpsi \
31         --enable-xosd \
32         --enable-mozilla \
33         --disable-kde \
34         --enable-mp4 \
35         --enable-dvb \
36         --enable-dv \
37         --disable-satellite \
38         --enable-ogg \
39         --enable-vorbis \
40         --enable-wxwidgets \
41         --with-wx-config=wx-config \
42         --disable-slp \
43         --enable-flac \
44         --disable-skins \
45         --disable-basic-skins \
46         --enable-skins2 \
47         --enable-freetype \
48         --enable-mkv \
49         --enable-v4l \
50         --enable-pvr \
51         --disable-speex \
52         --enable-caca \
53         --enable-livedotcom \
54         --enable-libmpeg2 \
55         --enable-dts \
56         --enable-fribidi \
57         --enable-cdio \
58         --enable-mod \
59         --enable-theora \
60         --enable-modplug \
61         --enable-dvdnav \
62         --enable-gnutls \
63         --enable-ffmpeg \
64         --enable-ncurses \
65         --enable-smb \
66         $(NULL)
67
68 # These ones are currently shipped with VLC
69 CONFIG_FLAGS += --enable-faad --with-faad-tree=extras/faad2
70 CONFIG_FLAGS += --enable-x264 --with-x264-tree=extras/x264
71
72 # Glide and svgalib are only for x86
73 ifeq ($(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU),i386)
74 CONFIG_FLAGS += --enable-glide
75 CONFIG_FLAGS += --enable-svgalib
76 endif
77
78 # Remove --without-dvdcss in non-totalitarian countries
79 CONFIG_FLAGS += --enable-dvd --without-dvdcss
80
81 # A few shortcuts
82 VIDDIR = usr/share/vlc
83 PIXDIR = usr/share/pixmaps
84 APPDIR = usr/share/applications
85
86 #
87 # Build rules
88 #
89
90 configure: configure-stamp
91 configure-stamp:
92         dh_testdir
93
94         # Touch stuff
95         touch configure.ac
96         touch aclocal.m4
97         touch configure
98         touch config.h.in
99         touch `find . -name Makefile.in`
100
101         # Check that we have an x264 tree in here (can be a symlink)
102         test -d extras/x264
103         if test ! '(' -d CVS -o -d .svn ')'; then \
104           cd extras/x264 \
105           && jam -dx libx264.a; \
106         fi
107
108         # Check that we have an faad2 tree in here (can be a symlink)
109         test -d extras/faad2
110         if test ! '(' -d CVS -o -d .svn ')'; then \
111           cd extras/faad2 \
112           && touch `find . -name configure.in` \
113           && touch `find . -name aclocal.m4` \
114           && touch `find . -name configure` \
115           && touch `find . -name config.h.in` \
116           && touch `find . -name Makefile.in` \
117           && ./configure --disable-shared \
118           && cd libfaad \
119           && $(MAKE); \
120         fi
121
122         # Configure VLC
123         ./configure --mandir=$${prefix}/share/man \
124           --infodir=$${prefix}/share/info $(CONFIG_FLAGS)
125
126         touch configure-stamp
127
128 build: build-stamp
129 build-stamp: patch configure-stamp
130         dh_testdir
131
132         # Build only VLC, with the non-PIC libs
133         $(MAKE) include/vlc_symbols.h
134         cd modules && AM_MAKEFLAGS='plugin=no pic=no' $(MAKE)
135         $(MAKE) vlc
136
137         # Hackety hackety hack
138         if test ! '(' -d CVS -o -d .svn ')'; then \
139           cd extras/x264 \
140           && jam -dx clean \
141           && rm -f Jamfile.pic \
142           && sed 's/^CCFLAGS *=/& -fPIC -DPIC /' <Jamfile >Jamfile.pic \
143           && jam -dx -sJAMFILE=Jamfile.pic libx264.a \
144           && rm -f Jamfile.pic; \
145         fi
146
147         # HACKETY HACKETY HACK
148         if test ! '(' -d CVS -o -d .svn ')'; then \
149           cd extras/faad2/libfaad \
150           && $(MAKE) clean \
151           && $(MAKE) AM_CFLAGS=-fPIC; \
152         fi
153
154         # Build all the rest, with the PIC libs
155         AM_MAKEFLAGS='builtin=no' $(MAKE)
156
157         touch build-stamp
158
159 clean: unpatch
160         dh_testdir
161         dh_testroot
162         rm -f configure-stamp build-stamp
163
164         # Check that we have an x264 tree in here (can be a symlink)
165         test -d extras/x264
166         -if test ! '(' -d CVS -o -d .svn ')'; then \
167           cd extras/x264 && jam -dx clean; \
168         fi
169         # Check that we have an faad2 tree in here (can be a symlink)
170         test -d extras/faad2
171         -if test ! '(' -d CVS -o -d .svn ')'; then \
172           cd extras/faad2 && $(MAKE) distclean; \
173         fi
174
175         # Clean zsh completion stuff
176         rm -f extras/zsh
177
178         # Removed ugly cruft
179         rm -f src/misc/modules_builtin.h
180         rm -f mozilla/vlcintf.xpt mozilla/vlcintf.h
181
182         # Remove spurious autotools stuff
183         rm -f config.log confdefs.h
184
185         -$(MAKE) distclean
186
187         dh_clean
188
189 install: build
190         dh_testdir
191         dh_testroot
192         dh_clean -k
193         dh_installdirs
194
195         DESTDIR=`pwd`/debian/vlc/ $(MAKE) install prefix=/usr
196
197         # Package: vlc
198         mv debian/vlc/$(VIDDIR)/vlc48x48.png debian/vlc/$(PIXDIR)/vlc.png
199         mv debian/vlc/$(VIDDIR)/vlc32x32.xpm debian/vlc/$(VIDDIR)/vlc.xpm
200         cp debian/gvlc.desktop debian/gvlc/$(APPDIR)
201         cp debian/gnome-vlc.desktop debian/gnome-vlc/$(APPDIR)
202
203         #cp doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc
204         #strfile doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc.dat
205
206         rm -Rf debian/vlc/$(VIDDIR)/skins
207         ln -s vlc.1.gz debian/vlc/usr/share/man/man1/svlc.1.gz
208
209         # Package: libvlc0-dev
210         mv debian/vlc/usr/bin/vlc-config debian/libvlc0-dev/usr/bin/
211         mv debian/vlc/usr/lib/*.a debian/libvlc0-dev/usr/lib/
212         mv debian/vlc/usr/lib/vlc/*.a debian/libvlc0-dev/usr/lib/vlc/
213         mv debian/vlc/usr/include/vlc/*.h debian/libvlc0-dev/usr/include/vlc/
214         rm -Rf debian/vlc/usr/include
215         ln -s vlc debian/libvlc0-dev/usr/share/doc/libvlc0-dev
216
217         # Package: gnome-vlc
218         #mv debian/vlc/usr/bin/gnome-vlc debian/gnome-vlc/usr/bin/
219         ln -s vlc debian/gnome-vlc/usr/share/doc/gnome-vlc
220         #mv debian/vlc/usr/lib/vlc/misc/libgnome_main_plugin.so \
221         #  debian/gnome-vlc/usr/lib/vlc/gui/
222         #mv debian/vlc/usr/lib/vlc/gui/libgnome_plugin.so \
223         #  debian/gnome-vlc/usr/lib/vlc/gui/
224         #ln -s vlc.1.gz debian/gnome-vlc/usr/share/man/man1/gnome-vlc.1.gz
225         #mv debian/vlc/$(VIDDIR)/gnome-vlc32x32.xpm debian/gnome-vlc/$(VIDDIR)/gnome-vlc.xpm
226         #mv debian/vlc/$(VIDDIR)/gnome-vlc48x48.png debian/gnome-vlc/$(PIXDIR)/gnome-vlc.png
227
228         # Package: gvlc
229         #mv debian/vlc/usr/bin/gvlc debian/gvlc/usr/bin/
230         ln -s vlc debian/gvlc/usr/share/doc/gvlc
231         #mv debian/vlc/usr/lib/vlc/misc/libgtk_main_plugin.so \
232         #  debian/gvlc/usr/lib/vlc/gui/
233         #mv debian/vlc/usr/lib/vlc/gui/libgtk_plugin.so \
234         #  debian/gvlc/usr/lib/vlc/gui/
235         #mv debian/vlc/usr/lib/vlc/gui/libfamiliar_plugin.so \
236         #  debian/gvlc/usr/lib/vlc/gui/
237         #ln -s vlc.1.gz debian/gvlc/usr/share/man/man1/gvlc.1.gz
238         #mv debian/vlc/$(VIDDIR)/gvlc32x32.xpm debian/gvlc/$(VIDDIR)/gvlc.xpm
239         #mv debian/vlc/$(VIDDIR)/gvlc48x48.png debian/gvlc/$(PIXDIR)/gvlc.png
240
241         # Package: vlc-plugin-esd
242         ln -s vlc debian/vlc-plugin-esd/usr/share/doc/vlc-plugin-esd
243         mv debian/vlc/usr/lib/vlc/audio_output/libesd_plugin.so \
244           debian/vlc-plugin-esd/usr/lib/vlc/audio_output/
245
246         # Package: vlc-plugin-alsa
247         ln -s vlc debian/vlc-plugin-alsa/usr/share/doc/vlc-plugin-alsa
248         mv debian/vlc/usr/lib/vlc/audio_output/libalsa_plugin.so \
249           debian/vlc-plugin-alsa/usr/lib/vlc/audio_output/
250
251         # Package: vlc-plugin-sdl
252         ln -s vlc debian/vlc-plugin-sdl/usr/share/doc/vlc-plugin-sdl
253         mv debian/vlc/usr/lib/vlc/audio_output/libaout_sdl_plugin.so \
254           debian/vlc-plugin-sdl/usr/lib/vlc/audio_output/
255         mv debian/vlc/usr/lib/vlc/video_output/libvout_sdl_plugin.so \
256           debian/vlc-plugin-sdl/usr/lib/vlc/video_output/
257
258         # Package: vlc-plugin-ggi
259         ln -s vlc debian/vlc-plugin-ggi/usr/share/doc/vlc-plugin-ggi
260         mv debian/vlc/usr/lib/vlc/video_output/libggi_plugin.so \
261           debian/vlc-plugin-ggi/usr/lib/vlc/video_output/
262
263         # Package: vlc-plugin-glide
264 ifeq ($(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU),i386)
265         ln -s vlc debian/vlc-plugin-glide/usr/share/doc/vlc-plugin-glide
266         mv debian/vlc/usr/lib/vlc/video_output/libglide_plugin.so \
267           debian/vlc-plugin-glide/usr/lib/vlc/video_output/
268 endif
269
270         # Package: qvlc
271         #mv debian/vlc/usr/bin/qvlc debian/qvlc/usr/bin/
272         ln -s vlc debian/qvlc/usr/share/doc/qvlc
273         #mv debian/vlc/usr/lib/vlc/gui/libqt_plugin.so \
274         #  debian/qvlc/usr/lib/vlc/gui/
275         #ln -s vlc.1.gz debian/qvlc/usr/share/man/man1/qvlc.1.gz
276         #mv debian/vlc/$(VIDDIR)/qvlc32x32.xpm debian/qvlc/$(VIDDIR)/qvlc.xpm
277         #mv debian/vlc/$(VIDDIR)/qvlc48x48.png debian/qvlc/$(PIXDIR)/qvlc.png
278
279         # Package: vlc-plugin-arts
280         ln -s vlc debian/vlc-plugin-arts/usr/share/doc/vlc-plugin-arts
281         mv debian/vlc/usr/lib/vlc/audio_output/libarts_plugin.so \
282           debian/vlc-plugin-arts/usr/lib/vlc/audio_output/
283
284         # Package: mozilla-plugin-vlc
285         ln -s vlc debian/mozilla-plugin-vlc/usr/share/doc/mozilla-plugin-vlc
286         mv debian/vlc/usr/lib/mozilla debian/mozilla-plugin-vlc/usr/lib
287         # links for firefox
288         mkdir -p debian/mozilla-plugin-vlc/usr/lib/mozilla-firefox/plugins/
289         ln -s ../../mozilla/plugins/libvlcplugin.so debian/mozilla-plugin-vlc/usr/lib/mozilla-firefox/plugins/
290         mkdir -p debian/mozilla-plugin-vlc/usr/lib/mozilla-firefox/components/
291         ln -s ../../mozilla/components/vlcintf.xpt debian/mozilla-plugin-vlc/usr/lib/mozilla-firefox/components/
292
293         # Package: kvlc
294         #mv debian/vlc/usr/bin/kvlc debian/kvlc/usr/bin/
295         ln -s vlc debian/kvlc/usr/share/doc/kvlc
296         #mv debian/vlc/usr/lib/vlc/gui/libkde_plugin.so \
297         #  debian/kvlc/usr/lib/vlc/gui/
298         #mv debian/vlc/$(VIDDIR)/ui.rc debian/kvlc/$(VIDDIR)
299         #ln -s vlc.1.gz debian/kvlc/usr/share/man/man1/kvlc.1.gz
300         #mv debian/vlc/$(VIDDIR)/kvlc32x32.xpm debian/kvlc/$(VIDDIR)/kvlc.xpm
301         #mv debian/vlc/$(VIDDIR)/kvlc48x48.png debian/kvlc/$(PIXDIR)/kvlc.png
302
303         # Package: vlc-plugin-svgalib
304 ifeq ($(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU),i386)
305         ln -s vlc debian/vlc-plugin-svgalib/usr/share/doc/vlc-plugin-svgalib
306         mv debian/vlc/usr/lib/vlc/video_output/libsvgalib_plugin.so \
307           debian/vlc-plugin-svgalib/usr/lib/vlc/video_output
308 endif
309
310         # Package: wxvlc
311         mv debian/vlc/usr/bin/wxvlc debian/wxvlc/usr/bin/
312         ln -s vlc debian/wxvlc/usr/share/doc/wxvlc
313         cp debian/vlc/$(VIDDIR)/vlc.xpm debian/wxvlc/$(VIDDIR)/wxvlc.xpm
314         cp debian/vlc.desktop debian/wxvlc/$(APPDIR)
315         mv debian/vlc/usr/lib/vlc/gui/libwxwidgets_plugin.so \
316           debian/wxvlc/usr/lib/vlc/gui/
317         ln -s vlc.1.gz debian/wxvlc/usr/share/man/man1/wxvlc.1.gz
318
319         # Clean up
320         rm -f debian/vlc/$(VIDDIR)/*.png
321
322         #gzip -9 < doc/vlc.1 >| debian/vlc/usr/share/man/man1/vlc.1.gz
323
324 # Build architecture-independent files here.
325 binary-indep: build install
326 # We have nothing to do by default.
327
328 # Build architecture-dependent files here.
329 binary-arch: build install
330 #       dh_testversion
331         dh_testdir
332         dh_testroot
333 #       dh_installdebconf       
334         dh_installdocs -p vlc
335 #       dh_installexamples
336         dh_installmenu -s
337         dh_installmime -s
338         dh_installman doc/vlc.1 -p vlc
339         dh_installman doc/vlc-config.1 -p libvlc0-dev
340         dh_installchangelogs ChangeLog -p vlc
341         for x in doc/ChangeLog-* ; do cp "doc/ChangeLog-$${x#*-}" "debian/vlc/usr/share/doc/vlc/changelog$${x#*-}" ; done
342         dh_link -s
343         dh_strip -s
344         dh_compress -s
345         dh_fixperms -s
346         dh_makeshlibs -s
347         dh_installdeb -s
348 #       dh_perl
349         dh_shlibdeps -s
350         dh_gencontrol -s
351         dh_md5sums -s
352         dh_builddeb -s
353
354 binary: binary-indep binary-arch
355 .PHONY: build clean binary-indep binary-arch binary install
356