]> git.sesse.net Git - vlc/blob - debian/rules
* configure.ac:
[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; then \
91           cd extras/ffmpeg \
92           && CC=$(CC) ./configure --enable-pp --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; 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; 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; 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; then cd extras/ffmpeg && $(MAKE) distclean; fi
158         # Check that we have an faad2 tree in here (can be a symlink)
159         test -d extras/faad2
160         -if test ! -d CVS; then cd extras/faad2 && $(MAKE) distclean; fi
161
162         # Removed ugly cruft
163         rm -f src/misc/modules_builtin.h
164         rm -f mozilla/vlcintf.xpt mozilla/vlcintf.h
165
166         # Remove spurious autotools stuff
167         rm -f config.log confdefs.h
168
169         -$(MAKE) distclean
170
171         dh_clean
172
173 install: build
174         dh_testdir
175         dh_testroot
176         dh_clean -k
177         dh_installdirs
178
179         DESTDIR=`pwd`/debian/vlc/ $(MAKE) install prefix=/usr
180
181         # Package: vlc
182         mv debian/vlc/$(VIDDIR)/vlc48x48.png debian/vlc/$(PIXDIR)/vlc.png
183         mv debian/vlc/$(VIDDIR)/vlc32x32.xpm debian/vlc/$(VIDDIR)/vlc.xpm
184         cp debian/gvlc.desktop debian/gvlc/$(GNOMEDIR)
185         cp debian/gnome-vlc.desktop debian/gnome-vlc/$(GNOMEDIR)
186
187         #cp doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc
188         #strfile doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc.dat
189
190         # Package: libvlc0-dev
191         mv debian/vlc/usr/bin/vlc-config debian/libvlc0-dev/usr/bin/
192         mv debian/vlc/usr/lib/*.a debian/libvlc0-dev/usr/lib/
193         mv debian/vlc/usr/lib/vlc/*.a debian/libvlc0-dev/usr/lib/vlc/
194         mv debian/vlc/usr/include/vlc/*.h debian/libvlc0-dev/usr/include/vlc/
195         rm -Rf debian/vlc/usr/include
196         ln -s vlc debian/libvlc0-dev/usr/share/doc/libvlc0-dev
197
198         # Package: gnome-vlc
199         mv debian/vlc/usr/bin/gnome-vlc debian/gnome-vlc/usr/bin/
200         ln -s vlc debian/gnome-vlc/usr/share/doc/gnome-vlc
201         mv debian/vlc/usr/lib/vlc/misc/libgnome_main_plugin.so \
202           debian/gnome-vlc/usr/lib/vlc/gui/
203         mv debian/vlc/usr/lib/vlc/gui/libgnome_plugin.so \
204           debian/gnome-vlc/usr/lib/vlc/gui/
205         ln -s vlc.1.gz debian/gnome-vlc/usr/share/man/man1/gnome-vlc.1.gz
206         mv debian/vlc/$(VIDDIR)/gnome-vlc32x32.xpm debian/gnome-vlc/$(VIDDIR)/gnome-vlc.xpm
207         mv debian/vlc/$(VIDDIR)/gnome-vlc48x48.png debian/gnome-vlc/$(PIXDIR)/gnome-vlc.png
208
209         # Package: vlc-gnome
210         mkdir -p debian/vlc-gnome/usr/share/doc/
211         ln -s vlc debian/vlc-gnome/usr/share/doc/vlc-gnome
212
213         # Package: gvlc
214         mv debian/vlc/usr/bin/gvlc debian/gvlc/usr/bin/
215         ln -s vlc debian/gvlc/usr/share/doc/gvlc
216         mv debian/vlc/usr/lib/vlc/misc/libgtk_main_plugin.so \
217           debian/gvlc/usr/lib/vlc/gui/
218         mv debian/vlc/usr/lib/vlc/gui/libgtk_plugin.so \
219           debian/gvlc/usr/lib/vlc/gui/
220         #mv debian/vlc/usr/lib/vlc/gui/libfamiliar_plugin.so \
221         #  debian/gvlc/usr/lib/vlc/gui/
222         ln -s vlc.1.gz debian/gvlc/usr/share/man/man1/gvlc.1.gz
223         mv debian/vlc/$(VIDDIR)/gvlc32x32.xpm debian/gvlc/$(VIDDIR)/gvlc.xpm
224         mv debian/vlc/$(VIDDIR)/gvlc48x48.png debian/gvlc/$(PIXDIR)/gvlc.png
225
226         # Package: vlc-gtk
227         mkdir -p debian/vlc-gtk/usr/share/doc/
228         ln -s vlc debian/vlc-gtk/usr/share/doc/vlc-gtk
229
230         # Package: vlc-plugin-esd
231         ln -s vlc debian/vlc-plugin-esd/usr/share/doc/vlc-plugin-esd
232         mv debian/vlc/usr/lib/vlc/audio_output/libesd_plugin.so \
233           debian/vlc-plugin-esd/usr/lib/vlc/audio_output/
234
235         # Package: vlc-esd
236         mkdir -p debian/vlc-esd/usr/share/doc/
237         ln -s vlc debian/vlc-esd/usr/share/doc/vlc-esd
238
239         # Package: vlc-plugin-alsa
240         ln -s vlc debian/vlc-plugin-alsa/usr/share/doc/vlc-plugin-alsa
241         mv debian/vlc/usr/lib/vlc/audio_output/libalsa_plugin.so \
242           debian/vlc-plugin-alsa/usr/lib/vlc/audio_output/
243
244         # Package: vlc-alsa
245         mkdir -p debian/vlc-alsa/usr/share/doc/
246         ln -s vlc debian/vlc-alsa/usr/share/doc/vlc-alsa
247
248         # Package: vlc-plugin-sdl
249         ln -s vlc debian/vlc-plugin-sdl/usr/share/doc/vlc-plugin-sdl
250         mv debian/vlc/usr/lib/vlc/audio_output/libaout_sdl_plugin.so \
251           debian/vlc-plugin-sdl/usr/lib/vlc/audio_output/
252         mv debian/vlc/usr/lib/vlc/video_output/libvout_sdl_plugin.so \
253           debian/vlc-plugin-sdl/usr/lib/vlc/video_output/
254
255         # Package: vlc-sdl
256         mkdir -p debian/vlc-sdl/usr/share/doc/
257         ln -s vlc debian/vlc-sdl/usr/share/doc/vlc-sdl
258
259         # Package: vlc-plugin-ggi
260         ln -s vlc debian/vlc-plugin-ggi/usr/share/doc/vlc-plugin-ggi
261         mv debian/vlc/usr/lib/vlc/video_output/libggi_plugin.so \
262           debian/vlc-plugin-ggi/usr/lib/vlc/video_output/
263
264         # Package: vlc-ggi
265         mkdir -p debian/vlc-ggi/usr/share/doc/
266         ln -s vlc debian/vlc-ggi/usr/share/doc/vlc-ggi
267
268         # Package: vlc-plugin-glide
269 ifeq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
270         ln -s vlc debian/vlc-plugin-glide/usr/share/doc/vlc-plugin-glide
271         mv debian/vlc/usr/lib/vlc/video_output/libglide_plugin.so \
272           debian/vlc-plugin-glide/usr/lib/vlc/video_output/
273
274         # Package: vlc-glide
275         mkdir -p debian/vlc-glide/usr/share/doc/
276         ln -s vlc debian/vlc-glide/usr/share/doc/vlc-glide
277 endif
278
279         # Package: qvlc
280         mv debian/vlc/usr/bin/qvlc debian/qvlc/usr/bin/
281         ln -s vlc debian/qvlc/usr/share/doc/qvlc
282         mv debian/vlc/usr/lib/vlc/gui/libqt_plugin.so \
283           debian/qvlc/usr/lib/vlc/gui/
284         ln -s vlc.1.gz debian/qvlc/usr/share/man/man1/qvlc.1.gz
285         mv debian/vlc/$(VIDDIR)/qvlc32x32.xpm debian/qvlc/$(VIDDIR)/qvlc.xpm
286         mv debian/vlc/$(VIDDIR)/qvlc48x48.png debian/qvlc/$(PIXDIR)/qvlc.png
287
288         # Package: vlc-qt
289         mkdir -p debian/vlc-qt/usr/share/doc/
290         ln -s vlc debian/vlc-qt/usr/share/doc/vlc-qt
291
292         # Package: vlc-plugin-arts
293         ln -s vlc debian/vlc-plugin-arts/usr/share/doc/vlc-plugin-arts
294         mv debian/vlc/usr/lib/vlc/audio_output/libarts_plugin.so \
295           debian/vlc-plugin-arts/usr/lib/vlc/audio_output/
296
297         # Package: mozilla-plugin-vlc
298         ln -s vlc debian/mozilla-plugin-vlc/usr/share/doc/mozilla-plugin-vlc
299         mv debian/vlc/usr/lib/mozilla debian/mozilla-plugin-vlc/usr/lib
300         # links for firefox
301         mkdir -p debian/mozilla-plugin-vlc/usr/lib/mozilla-firefox/plugins/
302         ln -s ../../mozilla/plugins/libvlcplugin.so debian/mozilla-plugin-vlc/usr/lib/mozilla-firefox/plugins/
303         mkdir -p debian/mozilla-plugin-vlc/usr/lib/mozilla-firefox/components/
304         ln -s ../../mozilla/components/vlcintf.xpt debian/mozilla-plugin-vlc/usr/lib/mozilla-firefox/components/
305
306         # Package: kvlc
307         mv debian/vlc/usr/bin/kvlc debian/kvlc/usr/bin/
308         ln -s vlc debian/kvlc/usr/share/doc/kvlc
309         mv debian/vlc/usr/lib/vlc/gui/libkde_plugin.so \
310           debian/kvlc/usr/lib/vlc/gui/
311         mv debian/vlc/usr/share/vlc/ui.rc \
312           debian/kvlc/usr/share/vlc
313         ln -s vlc.1.gz debian/kvlc/usr/share/man/man1/kvlc.1.gz
314         mv debian/vlc/$(VIDDIR)/kvlc32x32.xpm debian/kvlc/$(VIDDIR)/kvlc.xpm
315         mv debian/vlc/$(VIDDIR)/kvlc48x48.png debian/kvlc/$(PIXDIR)/kvlc.png
316
317         # Package: vlc-plugin-svgalib
318 ifeq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
319         ln -s vlc debian/vlc-plugin-svgalib/usr/share/doc/vlc-plugin-svgalib
320         mv debian/vlc/usr/lib/vlc/video_output/libsvgalib_plugin.so \
321           debian/vlc-plugin-svgalib/usr/lib/vlc/video_output
322 endif
323
324         # Package: wxvlc
325         mv debian/vlc/usr/bin/wxvlc debian/wxvlc/usr/bin/
326         mv debian/vlc/usr/bin/svlc debian/wxvlc/usr/bin/
327         ln -s vlc debian/wxvlc/usr/share/doc/wxvlc
328         mv debian/vlc/usr/lib/vlc/gui/libwxwindows_plugin.so \
329           debian/wxvlc/usr/lib/vlc/gui/
330         mv debian/vlc/usr/lib/vlc/gui/libskins_plugin.so \
331           debian/wxvlc/usr/lib/vlc/gui/
332         mv debian/vlc/usr/share/vlc/skins \
333           debian/wxvlc/usr/share/vlc/
334         ln -s vlc.1.gz debian/wxvlc/usr/share/man/man1/wxvlc.1.gz
335         ln -s vlc.1.gz debian/wxvlc/usr/share/man/man1/svlc.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         for x in doc/ChangeLog-* ; do cp "doc/ChangeLog-$${x#*-}" "debian/vlc/usr/share/doc/vlc/changelog$${x#*-}" ; done
360         dh_link -s
361         dh_strip -s
362         dh_compress -s
363         dh_fixperms -s
364         dh_makeshlibs -s
365         dh_installdeb -s
366 #       dh_perl
367         dh_shlibdeps -s
368         dh_gencontrol -s
369         dh_md5sums -s
370         dh_builddeb -s
371
372 binary: binary-indep binary-arch
373 .PHONY: build clean binary-indep binary-arch binary install
374