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