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