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