v4l.c: compile fix
[vlc.git] / 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 ARCH_EXCLUDE =
16
17 CONFIG_FLAGS = --enable-release --prefix=/usr
18 CONFIG_FLAGS += \
19         --enable-gnome \
20         --enable-gtk \
21         --enable-familiar \
22         --enable-fb \
23         --enable-ggi \
24         --enable-sdl \
25         --enable-esd \
26         --enable-qt \
27         --enable-mad \
28         --enable-arts \
29         --enable-alsa \
30         --enable-lirc \
31         --enable-a52 \
32         --enable-aa \
33         --enable-dvbpsi \
34         --enable-xosd \
35         --enable-mozilla \
36         --enable-kde \
37         --enable-mp4 \
38         --enable-dvb \
39         --enable-dv \
40         --enable-satellite \
41         --enable-ogg \
42         --enable-vorbis \
43         --enable-wxwindows \
44         --enable-slp \
45         --enable-flac \
46         $(NULL)
47
48 # These ones are currently shipped with VLC
49 CONFIG_FLAGS += --enable-ffmpeg --with-ffmpeg-tree=extras/ffmpeg
50 CONFIG_FLAGS += --enable-faad --with-faad-tree=extras/faad
51
52 # Glide is only for x86
53 ifeq ($(DEB_BUILD_ARCH),i386)
54 CONFIG_FLAGS += --enable-glide
55 CONFIG_FLAGS += --enable-svgalib
56 else
57 ARCH_EXCLUDE += -Nvlc-plugin-glide -Nvlc-glide
58 ARCH_EXCLUDE += -Nvlc-plugin-svgalib
59 endif
60
61 # Remove --without-dvdcss in non-totalitarian countries
62 CONFIG_FLAGS += --enable-dvd --without-dvdcss
63
64 # A few shortcuts
65 VIDDIR = usr/share/vlc
66 PIXDIR = usr/share/pixmaps
67 GNOMEDIR = usr/share/gnome/apps/Multimedia
68
69 #
70 # Build rules
71 #
72
73 build: build-stamp
74 build-stamp:
75         dh_testdir
76
77         # Touch stuff
78         touch configure.ac \
79         && touch aclocal.m4 \
80         && touch configure \
81         && touch config.h.in \
82         && touch `find . -name Makefile.in`
83
84         # Check that we have an ffmpeg tree in here (can be a symlink)
85         test -d extras/ffmpeg
86         if test ! -d CVS; then \
87                 cd extras/ffmpeg \
88                 && ./configure \
89                 && cd libavcodec \
90                 && make; \
91         fi
92
93         # Check that we have an faad tree in here (can be a symlink)
94         test -d extras/faad
95         if test ! -d CVS; then \
96                 cd extras/faad \
97                 && touch configure.in \
98                 && touch aclocal.m4 \
99                 && touch configure \
100                 && touch config.h.in \
101                 && touch `find . -name Makefile.in` \
102                 && ./configure --disable-shared \
103                 && cd libfaad \
104                 && make; \
105         fi
106
107         # Configure VLC and build it
108         ./configure --mandir=$${prefix}/share/man \
109                 --infodir=$${prefix}/share/info $(CONFIG_FLAGS)
110         $(MAKE)
111
112         touch build-stamp
113
114 clean:
115         dh_testdir
116         dh_testroot
117         rm -f build-stamp
118
119         # Check that we have an ffmpeg tree in here (can be a symlink)
120         test -d extras/ffmpeg
121         -if test ! -d CVS; then cd extras/ffmpeg && make distclean; fi
122         # Check that we have an faad tree in here (can be a symlink)
123         test -d extras/faad
124         -if test ! -d CVS; then cd extras/faad && make distclean; fi
125
126         -$(MAKE) distclean
127
128         dh_clean
129
130 install: build
131         dh_testdir
132         dh_testroot
133         dh_clean -k
134         dh_installdirs
135
136         DESTDIR=`pwd`/debian/vlc/ $(MAKE) install prefix=/usr
137
138         # Package: vlc
139         mv debian/vlc/$(VIDDIR)/vlc48x48.png debian/vlc/$(PIXDIR)/vlc.png
140         mv debian/vlc/$(VIDDIR)/vlc32x32.xpm debian/vlc/$(VIDDIR)/vlc.xpm
141         cp debian/gvlc.desktop debian/gvlc/$(GNOMEDIR)
142         cp debian/gnome-vlc.desktop debian/gnome-vlc/$(GNOMEDIR)
143
144         cp doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc
145         strfile doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc.dat
146
147         # Package: libvlc0-dev
148         mv debian/vlc/usr/bin/vlc-config debian/libvlc0-dev/usr/bin/
149         mv debian/vlc/usr/lib/*.a debian/libvlc0-dev/usr/lib/
150         mv debian/vlc/usr/lib/vlc/*.a debian/libvlc0-dev/usr/lib/vlc/
151         mv debian/vlc/usr/include/vlc/*.h debian/libvlc0-dev/usr/include/vlc/
152         rm -Rf debian/vlc/usr/include
153         ln -s vlc debian/libvlc0-dev/usr/share/doc/libvlc0-dev
154
155         # Package: gnome-vlc
156         mv debian/vlc/usr/bin/gnome-vlc debian/gnome-vlc/usr/bin/
157         ln -s vlc debian/gnome-vlc/usr/share/doc/gnome-vlc
158         mv debian/vlc/usr/lib/vlc/misc/libgnome_main_plugin.so \
159                 debian/gnome-vlc/usr/lib/vlc/gui/
160         mv debian/vlc/usr/lib/vlc/gui/libgnome_plugin.so \
161                 debian/gnome-vlc/usr/lib/vlc/gui/
162         ln -s vlc.1.gz debian/gnome-vlc/usr/share/man/man1/gnome-vlc.1.gz
163         mv debian/vlc/$(VIDDIR)/gnome-vlc32x32.xpm debian/gnome-vlc/$(VIDDIR)/gnome-vlc.xpm
164         mv debian/vlc/$(VIDDIR)/gnome-vlc48x48.png debian/gnome-vlc/$(PIXDIR)/gnome-vlc.png
165
166         # Package: vlc-gnome
167         mkdir -p debian/vlc-gnome/usr/share/doc/
168         ln -s vlc debian/vlc-gnome/usr/share/doc/vlc-gnome
169
170         # Package: gvlc
171         mv debian/vlc/usr/bin/gvlc debian/gvlc/usr/bin/
172         ln -s vlc debian/gvlc/usr/share/doc/gvlc
173         mv debian/vlc/usr/lib/vlc/misc/libgtk_main_plugin.so \
174                 debian/gvlc/usr/lib/vlc/gui/
175         mv debian/vlc/usr/lib/vlc/gui/libgtk_plugin.so \
176                 debian/gvlc/usr/lib/vlc/gui/
177         mv debian/vlc/usr/lib/vlc/gui/libfamiliar_plugin.so \
178                 debian/gvlc/usr/lib/vlc/gui/
179         ln -s vlc.1.gz debian/gvlc/usr/share/man/man1/gvlc.1.gz
180         mv debian/vlc/$(VIDDIR)/gvlc32x32.xpm debian/gvlc/$(VIDDIR)/gvlc.xpm
181         mv debian/vlc/$(VIDDIR)/gvlc48x48.png debian/gvlc/$(PIXDIR)/gvlc.png
182
183         # Package: vlc-gtk
184         mkdir -p debian/vlc-gtk/usr/share/doc/
185         ln -s vlc debian/vlc-gtk/usr/share/doc/vlc-gtk
186
187         # Package: vlc-plugin-esd
188         ln -s vlc debian/vlc-plugin-esd/usr/share/doc/vlc-plugin-esd
189         mv debian/vlc/usr/lib/vlc/audio_output/libesd_plugin.so \
190                 debian/vlc-plugin-esd/usr/lib/vlc/audio_output/
191
192         # Package: vlc-esd
193         mkdir -p debian/vlc-esd/usr/share/doc/
194         ln -s vlc debian/vlc-esd/usr/share/doc/vlc-esd
195
196         # Package: vlc-plugin-alsa
197         ln -s vlc debian/vlc-plugin-alsa/usr/share/doc/vlc-plugin-alsa
198         mv debian/vlc/usr/lib/vlc/audio_output/libalsa_plugin.so \
199                 debian/vlc-plugin-alsa/usr/lib/vlc/audio_output/
200
201         # Package: vlc-alsa
202         mkdir -p debian/vlc-alsa/usr/share/doc/
203         ln -s vlc debian/vlc-alsa/usr/share/doc/vlc-alsa
204
205         # Package: vlc-plugin-sdl
206         ln -s vlc debian/vlc-plugin-sdl/usr/share/doc/vlc-plugin-sdl
207         mv debian/vlc/usr/lib/vlc/audio_output/libaout_sdl_plugin.so \
208                 debian/vlc-plugin-sdl/usr/lib/vlc/audio_output/
209         mv debian/vlc/usr/lib/vlc/video_output/libvout_sdl_plugin.so \
210                 debian/vlc-plugin-sdl/usr/lib/vlc/video_output/
211
212         # Package: vlc-sdl
213         mkdir -p debian/vlc-sdl/usr/share/doc/
214         ln -s vlc debian/vlc-sdl/usr/share/doc/vlc-sdl
215
216         # Package: vlc-plugin-ggi
217         ln -s vlc debian/vlc-plugin-ggi/usr/share/doc/vlc-plugin-ggi
218         mv debian/vlc/usr/lib/vlc/video_output/libggi_plugin.so \
219                 debian/vlc-plugin-ggi/usr/lib/vlc/video_output/
220
221         # Package: vlc-ggi
222         mkdir -p debian/vlc-ggi/usr/share/doc/
223         ln -s vlc debian/vlc-ggi/usr/share/doc/vlc-ggi
224
225         # Package: vlc-plugin-glide
226 ifeq ($(DEB_BUILD_ARCH),i386)
227         ln -s vlc debian/vlc-plugin-glide/usr/share/doc/vlc-plugin-glide
228         mv debian/vlc/usr/lib/vlc/video_output/libglide_plugin.so \
229                 debian/vlc-plugin-glide/usr/lib/vlc/video_output/
230
231         # Package: vlc-glide
232         mkdir -p debian/vlc-glide/usr/share/doc/
233         ln -s vlc debian/vlc-glide/usr/share/doc/vlc-glide
234 endif
235
236         # Package: qvlc
237         mv debian/vlc/usr/bin/qvlc debian/qvlc/usr/bin/
238         ln -s vlc debian/qvlc/usr/share/doc/qvlc
239         mv debian/vlc/usr/lib/vlc/gui/libqt_plugin.so \
240                 debian/qvlc/usr/lib/vlc/gui/
241         ln -s vlc.1.gz debian/qvlc/usr/share/man/man1/qvlc.1.gz
242         mv debian/vlc/$(VIDDIR)/qvlc32x32.xpm debian/qvlc/$(VIDDIR)/qvlc.xpm
243         mv debian/vlc/$(VIDDIR)/qvlc48x48.png debian/qvlc/$(PIXDIR)/qvlc.png
244
245         # Package: vlc-qt
246         mkdir -p debian/vlc-qt/usr/share/doc/
247         ln -s vlc debian/vlc-qt/usr/share/doc/vlc-qt
248
249         # Package: vlc-plugin-arts
250         ln -s vlc debian/vlc-plugin-arts/usr/share/doc/vlc-plugin-arts
251         mv debian/vlc/usr/lib/vlc/audio_output/libarts_plugin.so \
252                 debian/vlc-plugin-arts/usr/lib/vlc/audio_output/
253
254         # Package: mozilla-plugin-vlc
255         ln -s vlc debian/mozilla-plugin-vlc/usr/share/doc/mozilla-plugin-vlc
256         mv debian/vlc/usr/lib/mozilla debian/mozilla-plugin-vlc/usr/lib
257
258         # Package: kvlc
259         mv debian/vlc/usr/bin/kvlc debian/kvlc/usr/bin/
260         ln -s vlc debian/kvlc/usr/share/doc/kvlc
261         mv debian/vlc/usr/lib/vlc/gui/libkde_plugin.so \
262                 debian/kvlc/usr/lib/vlc/gui/
263         mv debian/vlc/usr/share/vlc/ui.rc \
264                 debian/kvlc/usr/share/vlc
265         ln -s vlc.1.gz debian/kvlc/usr/share/man/man1/kvlc.1.gz
266         mv debian/vlc/$(VIDDIR)/kvlc32x32.xpm debian/kvlc/$(VIDDIR)/kvlc.xpm
267         mv debian/vlc/$(VIDDIR)/kvlc48x48.png debian/kvlc/$(PIXDIR)/kvlc.png
268
269         # Package: vlc-plugin-svgalib
270 ifeq ($(DEB_BUILD_ARCH),i386)
271         ln -s vlc debian/vlc-plugin-svgalib/usr/share/doc/vlc-plugin-svgalib
272         mv debian/vlc/usr/lib/vlc/video_output/libsvgalib_plugin.so \
273                 debian/vlc-plugin-svgalib/usr/lib/vlc/video_output
274 endif
275
276         # Package: wxvlc
277         mv debian/vlc/usr/bin/wxvlc debian/wxvlc/usr/bin/
278         ln -s vlc debian/wxvlc/usr/share/doc/wxvlc
279         mv debian/vlc/usr/lib/vlc/gui/libwxwindows_plugin.so \
280                 debian/wxvlc/usr/lib/vlc/gui/
281         ln -s vlc.1.gz debian/wxvlc/usr/share/man/man1/wxvlc.1.gz
282
283         # Clean up
284         rm -f debian/vlc/$(VIDDIR)/*.png
285
286         #gzip -9 < doc/vlc.1 >| debian/vlc/usr/share/man/man1/vlc.1.gz
287
288 # Build architecture-independent files here.
289 binary-indep: build install
290 # We have nothing to do by default.
291
292 # Build architecture-dependent files here.
293 binary-arch: build install
294 #       dh_testversion
295         dh_testdir
296         dh_testroot
297 #       dh_installdebconf       
298         dh_installdocs -p vlc
299 #       dh_installexamples
300         dh_installmenu
301         dh_installman doc/vlc.1 -p vlc
302         dh_installman doc/vlc-config.1 -p libvlc0-dev
303 #       dh_installchangelogs ChangeLog -p vlc
304         cp ChangeLog debian/vlc/usr/share/doc/vlc/changelog
305         cp debian/changelog debian/vlc/usr/share/doc/vlc/changelog.Debian
306         dh_link
307         dh_strip
308         dh_compress
309         dh_fixperms
310         dh_makeshlibs
311         dh_installdeb
312 #       dh_perl
313         dh_shlibdeps $(ARCH_EXCLUDE)
314         dh_gencontrol $(ARCH_EXCLUDE)
315         dh_md5sums $(ARCH_EXCLUDE)
316         dh_builddeb $(ARCH_EXCLUDE)
317
318 binary: binary-indep binary-arch
319 .PHONY: build clean binary-indep binary-arch binary install
320