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