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