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