]> git.sesse.net Git - vlc/blob - debian/rules
* debian/rules:
[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-wxwindows \
41         --disable-slp \
42         --enable-flac \
43         --disable-skins \
44         --disable-basic-skins \
45         --enable-skins2 \
46         --enable-freetype \
47         --enable-mkv \
48         --enable-v4l \
49         --enable-pvr \
50         --disable-speex \
51         --enable-caca \
52         --enable-livedotcom \
53         --enable-libmpeg2 \
54         --enable-dts \
55         --enable-fribidi \
56         --enable-cdio \
57         --enable-mod \
58         --enable-theora \
59         --enable-modplug \
60         --enable-dvdnav \
61         $(NULL)
62
63 # These ones are currently shipped with VLC
64 CONFIG_FLAGS += --enable-ffmpeg --with-ffmpeg-tree=extras/ffmpeg
65 #CONFIG_FLAGS += --enable-ffmpegaltivec
66 CONFIG_FLAGS += --enable-faad --with-faad-tree=extras/faad2
67 CONFIG_FLAGS += --enable-x264 --with-x264-tree=extras/x264
68
69 # Glide and svgalib are only for x86
70 ifeq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
71 CONFIG_FLAGS += --enable-glide
72 CONFIG_FLAGS += --enable-svgalib
73 endif
74
75 # Remove --without-dvdcss in non-totalitarian countries
76 CONFIG_FLAGS += --enable-dvd --without-dvdcss
77
78 # A few shortcuts
79 VIDDIR = usr/share/vlc
80 PIXDIR = usr/share/pixmaps
81 GNOMEDIR = usr/share/gnome/apps/Multimedia
82
83 #
84 # Build rules
85 #
86
87 configure: configure-stamp
88 configure-stamp:
89         dh_testdir
90
91         # Touch stuff
92         touch configure.ac
93         touch aclocal.m4
94         touch configure
95         touch config.h.in
96         touch `find . -name Makefile.in`
97
98         # Check that we have an ffmpeg tree in here (can be a symlink)
99         test -d extras/ffmpeg
100         if test ! '(' -d CVS -o -d .svn ')'; then \
101           cd extras/ffmpeg \
102           && CC=$(CC) ./configure --enable-pp --enable-gpl --enable-zlib --disable-debug --disable-mmx --disable-altivec \
103           && cd libavcodec \
104           && $(MAKE) \
105           && cd ../libavformat \
106           && $(MAKE); \
107         fi
108
109         # Check that we have an x264 tree in here (can be a symlink)
110         test -d extras/x264
111         if test ! '(' -d CVS -o -d .svn ')'; then \
112           cd extras/x264 \
113           && jam -dx libx264.a; \
114         fi
115
116         # Check that we have an faad2 tree in here (can be a symlink)
117         test -d extras/faad2
118         if test ! '(' -d CVS -o -d .svn ')'; then \
119           cd extras/faad2 \
120           && touch `find . -name configure.in` \
121           && touch `find . -name aclocal.m4` \
122           && touch `find . -name configure` \
123           && touch `find . -name config.h.in` \
124           && touch `find . -name Makefile.in` \
125           && ./configure --disable-shared \
126           && cd libfaad \
127           && $(MAKE); \
128         fi
129
130         # Configure VLC
131         ./configure --mandir=$${prefix}/share/man \
132           --infodir=$${prefix}/share/info $(CONFIG_FLAGS)
133
134         touch configure-stamp
135
136 build: build-stamp
137 build-stamp: patch configure-stamp
138         dh_testdir
139
140         # Build only VLC, with the non-PIC libs
141         $(MAKE) include/vlc_symbols.h
142         cd modules && AM_MAKEFLAGS='plugin=no pic=no' $(MAKE)
143         $(MAKE) vlc
144
145         # Hackety hackety hack
146         if test ! '(' -d CVS -o -d .svn ')'; then \
147           cd extras/ffmpeg/libavcodec \
148           && $(MAKE) clean \
149           && rm -f Makefile.pic \
150           && sed 's/^CFLAGS *=/&-fPIC -DPIC /' <Makefile >Makefile.pic \
151           && $(MAKE) -f Makefile.pic \
152           && rm -f Makefile.pic \
153           && cd ../libavformat \
154           && $(MAKE) clean \
155           && rm -f Makefile.pic \
156           && sed 's/^CFLAGS *=/&-fPIC -DPIC /' <Makefile >Makefile.pic \
157           && $(MAKE) -f Makefile.pic \
158           && rm -f Makefile.pic; \
159         fi
160
161         # Hackety hackety hack
162         if test ! '(' -d CVS -o -d .svn ')'; then \
163           cd extras/x264 \
164           && jam -dx clean \
165           && rm -f Jamfile.pic \
166           && sed 's/^CCFLAGS *=/& -fPIC -DPIC /' <Jamfile >Jamfile.pic \
167           && jam -dx -sJAMFILE=Jamfile.pic libx264.a \
168           && rm -f Jamfile.pic; \
169         fi
170
171         # HACKETY HACKETY HACK
172         if test ! '(' -d CVS -o -d .svn ')'; then \
173           cd extras/faad2/libfaad \
174           && $(MAKE) clean \
175           && $(MAKE) AM_CFLAGS=-fPIC; \
176         fi
177
178         # Build all the rest, with the PIC libs
179         AM_MAKEFLAGS='builtin=no' $(MAKE)
180
181         touch build-stamp
182
183 clean: unpatch
184         dh_testdir
185         dh_testroot
186         rm -f configure-stamp build-stamp
187
188         # Check that we have an ffmpeg tree in here (can be a symlink)
189         test -d extras/ffmpeg
190         -if test ! '(' -d CVS -o -d .svn ')'; then \
191           cd extras/ffmpeg && $(MAKE) distclean; \
192         fi
193         # Check that we have an x264 tree in here (can be a symlink)
194         test -d extras/x264
195         -if test ! '(' -d CVS -o -d .svn ')'; then \
196           cd extras/x264 && jam -dx clean; \
197         fi
198         # Check that we have an faad2 tree in here (can be a symlink)
199         test -d extras/faad2
200         -if test ! '(' -d CVS -o -d .svn ')'; then \
201           cd extras/faad2 && $(MAKE) distclean; \
202         fi
203
204         # Removed ugly cruft
205         rm -f src/misc/modules_builtin.h
206         rm -f mozilla/vlcintf.xpt mozilla/vlcintf.h
207
208         # Remove spurious autotools stuff
209         rm -f config.log confdefs.h
210
211         -$(MAKE) distclean
212
213         dh_clean
214
215 install: build
216         dh_testdir
217         dh_testroot
218         dh_clean -k
219         dh_installdirs
220
221         DESTDIR=`pwd`/debian/vlc/ $(MAKE) install prefix=/usr
222
223         # Package: vlc
224         mv debian/vlc/$(VIDDIR)/vlc48x48.png debian/vlc/$(PIXDIR)/vlc.png
225         mv debian/vlc/$(VIDDIR)/vlc32x32.xpm debian/vlc/$(VIDDIR)/vlc.xpm
226         cp debian/gvlc.desktop debian/gvlc/$(GNOMEDIR)
227         cp debian/gnome-vlc.desktop debian/gnome-vlc/$(GNOMEDIR)
228
229         #cp doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc
230         #strfile doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc.dat
231
232         rm -Rf debian/vlc/$(VIDDIR)/skins
233         ln -s vlc.1.gz debian/vlc/usr/share/man/man1/svlc.1.gz
234
235         # Package: libvlc0-dev
236         mv debian/vlc/usr/bin/vlc-config debian/libvlc0-dev/usr/bin/
237         mv debian/vlc/usr/lib/*.a debian/libvlc0-dev/usr/lib/
238         mv debian/vlc/usr/lib/vlc/*.a debian/libvlc0-dev/usr/lib/vlc/
239         mv debian/vlc/usr/include/vlc/*.h debian/libvlc0-dev/usr/include/vlc/
240         rm -Rf debian/vlc/usr/include
241         ln -s vlc debian/libvlc0-dev/usr/share/doc/libvlc0-dev
242
243         # Package: gnome-vlc
244         #mv debian/vlc/usr/bin/gnome-vlc debian/gnome-vlc/usr/bin/
245         ln -s vlc debian/gnome-vlc/usr/share/doc/gnome-vlc
246         #mv debian/vlc/usr/lib/vlc/misc/libgnome_main_plugin.so \
247         #  debian/gnome-vlc/usr/lib/vlc/gui/
248         #mv debian/vlc/usr/lib/vlc/gui/libgnome_plugin.so \
249         #  debian/gnome-vlc/usr/lib/vlc/gui/
250         #ln -s vlc.1.gz debian/gnome-vlc/usr/share/man/man1/gnome-vlc.1.gz
251         #mv debian/vlc/$(VIDDIR)/gnome-vlc32x32.xpm debian/gnome-vlc/$(VIDDIR)/gnome-vlc.xpm
252         #mv debian/vlc/$(VIDDIR)/gnome-vlc48x48.png debian/gnome-vlc/$(PIXDIR)/gnome-vlc.png
253
254         # Package: vlc-gnome
255         mkdir -p debian/vlc-gnome/usr/share/doc/
256         ln -s vlc debian/vlc-gnome/usr/share/doc/vlc-gnome
257
258         # Package: gvlc
259         #mv debian/vlc/usr/bin/gvlc debian/gvlc/usr/bin/
260         ln -s vlc debian/gvlc/usr/share/doc/gvlc
261         #mv debian/vlc/usr/lib/vlc/misc/libgtk_main_plugin.so \
262         #  debian/gvlc/usr/lib/vlc/gui/
263         #mv debian/vlc/usr/lib/vlc/gui/libgtk_plugin.so \
264         #  debian/gvlc/usr/lib/vlc/gui/
265         #mv debian/vlc/usr/lib/vlc/gui/libfamiliar_plugin.so \
266         #  debian/gvlc/usr/lib/vlc/gui/
267         #ln -s vlc.1.gz debian/gvlc/usr/share/man/man1/gvlc.1.gz
268         #mv debian/vlc/$(VIDDIR)/gvlc32x32.xpm debian/gvlc/$(VIDDIR)/gvlc.xpm
269         #mv debian/vlc/$(VIDDIR)/gvlc48x48.png debian/gvlc/$(PIXDIR)/gvlc.png
270
271         # Package: vlc-gtk
272         mkdir -p debian/vlc-gtk/usr/share/doc/
273         ln -s vlc debian/vlc-gtk/usr/share/doc/vlc-gtk
274
275         # Package: vlc-plugin-esd
276         ln -s vlc debian/vlc-plugin-esd/usr/share/doc/vlc-plugin-esd
277         mv debian/vlc/usr/lib/vlc/audio_output/libesd_plugin.so \
278           debian/vlc-plugin-esd/usr/lib/vlc/audio_output/
279
280         # Package: vlc-esd
281         mkdir -p debian/vlc-esd/usr/share/doc/
282         ln -s vlc debian/vlc-esd/usr/share/doc/vlc-esd
283
284         # Package: vlc-plugin-alsa
285         ln -s vlc debian/vlc-plugin-alsa/usr/share/doc/vlc-plugin-alsa
286         mv debian/vlc/usr/lib/vlc/audio_output/libalsa_plugin.so \
287           debian/vlc-plugin-alsa/usr/lib/vlc/audio_output/
288
289         # Package: vlc-alsa
290         mkdir -p debian/vlc-alsa/usr/share/doc/
291         ln -s vlc debian/vlc-alsa/usr/share/doc/vlc-alsa
292
293         # Package: vlc-plugin-sdl
294         ln -s vlc debian/vlc-plugin-sdl/usr/share/doc/vlc-plugin-sdl
295         mv debian/vlc/usr/lib/vlc/audio_output/libaout_sdl_plugin.so \
296           debian/vlc-plugin-sdl/usr/lib/vlc/audio_output/
297         mv debian/vlc/usr/lib/vlc/video_output/libvout_sdl_plugin.so \
298           debian/vlc-plugin-sdl/usr/lib/vlc/video_output/
299
300         # Package: vlc-sdl
301         mkdir -p debian/vlc-sdl/usr/share/doc/
302         ln -s vlc debian/vlc-sdl/usr/share/doc/vlc-sdl
303
304         # Package: vlc-plugin-ggi
305         ln -s vlc debian/vlc-plugin-ggi/usr/share/doc/vlc-plugin-ggi
306         mv debian/vlc/usr/lib/vlc/video_output/libggi_plugin.so \
307           debian/vlc-plugin-ggi/usr/lib/vlc/video_output/
308
309         # Package: vlc-ggi
310         mkdir -p debian/vlc-ggi/usr/share/doc/
311         ln -s vlc debian/vlc-ggi/usr/share/doc/vlc-ggi
312
313         # Package: vlc-plugin-glide
314 ifeq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
315         ln -s vlc debian/vlc-plugin-glide/usr/share/doc/vlc-plugin-glide
316         mv debian/vlc/usr/lib/vlc/video_output/libglide_plugin.so \
317           debian/vlc-plugin-glide/usr/lib/vlc/video_output/
318
319         # Package: vlc-glide
320         mkdir -p debian/vlc-glide/usr/share/doc/
321         ln -s vlc debian/vlc-glide/usr/share/doc/vlc-glide
322 endif
323
324         # Package: qvlc
325         #mv debian/vlc/usr/bin/qvlc debian/qvlc/usr/bin/
326         ln -s vlc debian/qvlc/usr/share/doc/qvlc
327         #mv debian/vlc/usr/lib/vlc/gui/libqt_plugin.so \
328         #  debian/qvlc/usr/lib/vlc/gui/
329         #ln -s vlc.1.gz debian/qvlc/usr/share/man/man1/qvlc.1.gz
330         #mv debian/vlc/$(VIDDIR)/qvlc32x32.xpm debian/qvlc/$(VIDDIR)/qvlc.xpm
331         #mv debian/vlc/$(VIDDIR)/qvlc48x48.png debian/qvlc/$(PIXDIR)/qvlc.png
332
333         # Package: vlc-qt
334         mkdir -p debian/vlc-qt/usr/share/doc/
335         ln -s vlc debian/vlc-qt/usr/share/doc/vlc-qt
336
337         # Package: vlc-plugin-arts
338         ln -s vlc debian/vlc-plugin-arts/usr/share/doc/vlc-plugin-arts
339         mv debian/vlc/usr/lib/vlc/audio_output/libarts_plugin.so \
340           debian/vlc-plugin-arts/usr/lib/vlc/audio_output/
341
342         # Package: mozilla-plugin-vlc
343         ln -s vlc debian/mozilla-plugin-vlc/usr/share/doc/mozilla-plugin-vlc
344         mv debian/vlc/usr/lib/mozilla debian/mozilla-plugin-vlc/usr/lib
345         # links for firefox
346         mkdir -p debian/mozilla-plugin-vlc/usr/lib/mozilla-firefox/plugins/
347         ln -s ../../mozilla/plugins/libvlcplugin.so debian/mozilla-plugin-vlc/usr/lib/mozilla-firefox/plugins/
348         mkdir -p debian/mozilla-plugin-vlc/usr/lib/mozilla-firefox/components/
349         ln -s ../../mozilla/components/vlcintf.xpt debian/mozilla-plugin-vlc/usr/lib/mozilla-firefox/components/
350
351         # Package: kvlc
352         #mv debian/vlc/usr/bin/kvlc debian/kvlc/usr/bin/
353         ln -s vlc debian/kvlc/usr/share/doc/kvlc
354         #mv debian/vlc/usr/lib/vlc/gui/libkde_plugin.so \
355         #  debian/kvlc/usr/lib/vlc/gui/
356         #mv debian/vlc/$(VIDDIR)/ui.rc debian/kvlc/$(VIDDIR)
357         #ln -s vlc.1.gz debian/kvlc/usr/share/man/man1/kvlc.1.gz
358         #mv debian/vlc/$(VIDDIR)/kvlc32x32.xpm debian/kvlc/$(VIDDIR)/kvlc.xpm
359         #mv debian/vlc/$(VIDDIR)/kvlc48x48.png debian/kvlc/$(PIXDIR)/kvlc.png
360
361         # Package: vlc-plugin-svgalib
362 ifeq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
363         ln -s vlc debian/vlc-plugin-svgalib/usr/share/doc/vlc-plugin-svgalib
364         mv debian/vlc/usr/lib/vlc/video_output/libsvgalib_plugin.so \
365           debian/vlc-plugin-svgalib/usr/lib/vlc/video_output
366 endif
367
368         # Package: wxvlc
369         mv debian/vlc/usr/bin/wxvlc debian/wxvlc/usr/bin/
370         ln -s vlc debian/wxvlc/usr/share/doc/wxvlc
371         cp debian/vlc/$(VIDDIR)/vlc.xpm debian/wxvlc/$(VIDDIR)/wxvlc.xpm
372         mv debian/vlc/usr/lib/vlc/gui/libwxwindows_plugin.so \
373           debian/wxvlc/usr/lib/vlc/gui/
374         ln -s vlc.1.gz debian/wxvlc/usr/share/man/man1/wxvlc.1.gz
375
376         # Clean up
377         rm -f debian/vlc/$(VIDDIR)/*.png
378
379         #gzip -9 < doc/vlc.1 >| debian/vlc/usr/share/man/man1/vlc.1.gz
380
381 # Build architecture-independent files here.
382 binary-indep: build install
383 # We have nothing to do by default.
384
385 # Build architecture-dependent files here.
386 binary-arch: build install
387 #       dh_testversion
388         dh_testdir
389         dh_testroot
390 #       dh_installdebconf       
391         dh_installdocs -p vlc
392 #       dh_installexamples
393         dh_installmenu -s
394         dh_installmime -s
395         dh_installman doc/vlc.1 -p vlc
396         dh_installman doc/vlc-config.1 -p libvlc0-dev
397         dh_installchangelogs ChangeLog -p vlc
398         for x in doc/ChangeLog-* ; do cp "doc/ChangeLog-$${x#*-}" "debian/vlc/usr/share/doc/vlc/changelog$${x#*-}" ; done
399         dh_link -s
400         dh_strip -s
401         dh_compress -s
402         dh_fixperms -s
403         dh_makeshlibs -s
404         dh_installdeb -s
405 #       dh_perl
406         dh_shlibdeps -s
407         dh_gencontrol -s
408         dh_md5sums -s
409         dh_builddeb -s
410
411 binary: binary-indep binary-arch
412 .PHONY: build clean binary-indep binary-arch binary install
413