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