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