]> git.sesse.net Git - vlc/blob - debian/rules
* debian: updated Debian build files.
[vlc] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for the VLC media player - uses debhelper.
3 # $Id$
4 # based on Joey Hess's one.
5
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
8 include /usr/share/dpatch/dpatch.make
9
10 # These are used for cross-compiling and for saving the configure script
11 # from having to guess our platform (since we know it already)
12 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
13 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
14 confflags = --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) 
15
16 #
17 # Compilation options
18 #
19 vlc_confflags = --enable-release --prefix=/usr
20 vlc_confflags += \
21         --disable-gnome \
22         --disable-gtk \
23         --disable-familiar \
24         --disable-fb \
25         --enable-ggi \
26         --enable-sdl \
27         --enable-esd \
28         --disable-qt \
29         --enable-mad \
30         --enable-arts \
31         --enable-alsa \
32         --enable-lirc \
33         --enable-a52 \
34         --enable-aa \
35         --enable-dvbpsi \
36         --enable-xosd \
37         --enable-mozilla \
38         --disable-kde \
39         --enable-mp4 \
40         --enable-dvb \
41         --enable-dv \
42         --disable-satellite \
43         --enable-ogg \
44         --enable-vorbis \
45         --enable-wxwidgets \
46         --with-wx-config=wx-config \
47         --disable-slp \
48         --enable-flac \
49         --disable-skins \
50         --disable-basic-skins \
51         --enable-skins2 \
52         --enable-freetype \
53         --enable-mkv \
54         --enable-v4l \
55         --enable-pvr \
56         --disable-speex \
57         --enable-caca \
58         --enable-livedotcom \
59         --enable-libmpeg2 \
60         --enable-dts \
61         --enable-fribidi \
62         --enable-cdio \
63         --enable-mod \
64         --enable-theora \
65         --enable-modplug \
66         --enable-dvdnav \
67         --enable-gnutls \
68         --enable-ffmpeg \
69         --enable-ncurses \
70         --enable-smb \
71         --disable-gnomevfs \
72         $(NULL)
73
74 # These ones are currently shipped with VLC
75 vlc_confflags += --enable-faad --with-faad-tree=extras/faad2
76 vlc_confflags += --enable-x264 --with-x264-tree=extras/x264
77
78 # Glide and svgalib are only for x86
79 ifeq ($(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU),i386)
80 vlc_confflags += --enable-glide
81 vlc_confflags += --enable-svgalib
82 endif
83
84 # We need this hack for i386 and amd64
85 ifeq ($(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU),i386)
86 CC = $(shell pwd)/debian/gcc-snapshot
87 export CC
88 endif
89 ifeq ($(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU),amd64)
90 CC = $(shell pwd)/debian/gcc-snapshot
91 export CC
92 endif
93
94 # Remove --without-dvdcss in non-totalitarian countries
95 vlc_confflags += --enable-dvd --without-dvdcss
96
97 # A few shortcuts
98 VIDDIR = usr/share/vlc
99 PIXDIR = usr/share/pixmaps
100 APPDIR = usr/share/applications
101
102
103 #
104 # Build rules
105 #
106
107 configure: configure-stamp
108 configure-stamp:
109         dh_testdir
110
111         # Touch stuff
112         touch configure.ac
113         touch aclocal.m4
114         touch configure
115         touch config.h.in
116         touch `find . -name Makefile.in`
117
118         # Check that we have an x264 tree in here (can be a symlink)
119         test -d extras/x264
120         cd extras/x264 \
121          && ./configure $(confflags) --extra-cflags='$$(ECFLAGS)' \
122                                      --extra-asflags='$$(EASFLAGS)' \
123          && $(MAKE)
124
125         # Check that we have an faad2 tree in here (can be a symlink)
126         test -d extras/faad2
127         cd extras/faad2 \
128          && touch `find . -name configure.in` \
129          && touch `find . -name aclocal.m4` \
130          && touch `find . -name configure` \
131          && touch `find . -name config.h.in` \
132          && touch `find . -name Makefile.in` \
133          && ./configure $(confflags) --disable-shared \
134          && cd libfaad \
135          && $(MAKE)
136
137         # Configure VLC
138         ./configure --mandir=$${prefix}/share/man \
139           --infodir=$${prefix}/share/info $(confflags) $(vlc_confflags)
140
141         touch configure-stamp
142
143 build: build-stamp
144 build-stamp: patch configure-stamp
145         dh_testdir
146
147         # Build only VLC, with the non-PIC libs
148         $(MAKE) include/vlc_symbols.h
149         cd modules && AM_MAKEFLAGS='plugin=no pic=no' $(MAKE)
150         $(MAKE) vlc
151
152         # Hackety hackety hack
153         cd extras/x264 && $(MAKE) clean && $(MAKE) ECFLAGS=-fPIC EASFLAGS=-D__PIC__
154
155         # HACKETY HACKETY HACK
156         cd extras/faad2/libfaad && $(MAKE) clean && $(MAKE) AM_CFLAGS=-fPIC
157
158         # Build all the rest, with the PIC libs
159         AM_MAKEFLAGS='builtin=no' $(MAKE)
160
161         # Minor test, to see which plugins were built and whether they load
162         # properly.
163 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
164         ./vlc --reset-plugins-cache -l -I rc vlc:quit
165 endif
166
167         touch build-stamp
168
169 clean: unpatch
170         dh_testdir
171         dh_testroot
172         rm -f configure-stamp build-stamp
173
174         # Check that we have an x264 tree in here (can be a symlink)
175         test -d extras/x264
176         -cd extras/x264 && $(MAKE) distclean
177         # Check that we have an faad2 tree in here (can be a symlink)
178         test -d extras/faad2
179         -cd extras/faad2 && $(MAKE) distclean
180
181         # Clean zsh completion stuff
182         rm -f extras/zsh
183
184         # Removed ugly cruft
185         rm -f src/misc/modules_builtin.h
186         rm -f mozilla/vlcintf.xpt mozilla/vlcintf.h
187
188         # Remove spurious autotools stuff
189         rm -f config.log confdefs.h
190
191         -$(MAKE) distclean
192
193         dh_clean
194
195 install: build
196         dh_testdir
197         dh_testroot
198         dh_clean -k
199         dh_installdirs
200
201         DESTDIR=`pwd`/debian/vlc/ $(MAKE) install prefix=/usr
202
203         # Package: vlc
204         mv debian/vlc/$(VIDDIR)/vlc48x48.png debian/vlc/$(PIXDIR)/vlc.png
205         mv debian/vlc/$(VIDDIR)/vlc32x32.xpm debian/vlc/$(VIDDIR)/vlc.xpm
206         cp debian/gvlc.desktop debian/gvlc/$(APPDIR)
207         cp debian/gnome-vlc.desktop debian/gnome-vlc/$(APPDIR)
208
209         #cp doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc
210         #strfile doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc.dat
211
212         rm -Rf debian/vlc/$(VIDDIR)/skins
213         ln -s vlc.1.gz debian/vlc/usr/share/man/man1/svlc.1.gz
214
215         # Package: libvlc0-dev
216         mv debian/vlc/usr/bin/vlc-config debian/libvlc0-dev/usr/bin/
217         mv debian/vlc/usr/lib/*.a debian/libvlc0-dev/usr/lib/
218         mv debian/vlc/usr/lib/vlc/*.a debian/libvlc0-dev/usr/lib/vlc/
219         mv debian/vlc/usr/include/vlc/*.h debian/libvlc0-dev/usr/include/vlc/
220         rm -Rf debian/vlc/usr/include
221         ln -s vlc debian/libvlc0-dev/usr/share/doc/libvlc0-dev
222
223         # Package: gnome-vlc
224         #mv debian/vlc/usr/bin/gnome-vlc debian/gnome-vlc/usr/bin/
225         ln -s vlc debian/gnome-vlc/usr/share/doc/gnome-vlc
226         #mv debian/vlc/usr/lib/vlc/misc/libgnome_main_plugin.so \
227         #  debian/gnome-vlc/usr/lib/vlc/gui/
228         #mv debian/vlc/usr/lib/vlc/gui/libgnome_plugin.so \
229         #  debian/gnome-vlc/usr/lib/vlc/gui/
230         #ln -s vlc.1.gz debian/gnome-vlc/usr/share/man/man1/gnome-vlc.1.gz
231         #mv debian/vlc/$(VIDDIR)/gnome-vlc32x32.xpm debian/gnome-vlc/$(VIDDIR)/gnome-vlc.xpm
232         #mv debian/vlc/$(VIDDIR)/gnome-vlc48x48.png debian/gnome-vlc/$(PIXDIR)/gnome-vlc.png
233
234         # Package: gvlc
235         #mv debian/vlc/usr/bin/gvlc debian/gvlc/usr/bin/
236         ln -s vlc debian/gvlc/usr/share/doc/gvlc
237         #mv debian/vlc/usr/lib/vlc/misc/libgtk_main_plugin.so \
238         #  debian/gvlc/usr/lib/vlc/gui/
239         #mv debian/vlc/usr/lib/vlc/gui/libgtk_plugin.so \
240         #  debian/gvlc/usr/lib/vlc/gui/
241         #mv debian/vlc/usr/lib/vlc/gui/libfamiliar_plugin.so \
242         #  debian/gvlc/usr/lib/vlc/gui/
243         #ln -s vlc.1.gz debian/gvlc/usr/share/man/man1/gvlc.1.gz
244         #mv debian/vlc/$(VIDDIR)/gvlc32x32.xpm debian/gvlc/$(VIDDIR)/gvlc.xpm
245         #mv debian/vlc/$(VIDDIR)/gvlc48x48.png debian/gvlc/$(PIXDIR)/gvlc.png
246
247         # Package: vlc-plugin-esd
248         ln -s vlc debian/vlc-plugin-esd/usr/share/doc/vlc-plugin-esd
249         mv debian/vlc/usr/lib/vlc/audio_output/libesd_plugin.so \
250           debian/vlc-plugin-esd/usr/lib/vlc/audio_output/
251
252         # Package: vlc-plugin-alsa
253         ln -s vlc debian/vlc-plugin-alsa/usr/share/doc/vlc-plugin-alsa
254         mv debian/vlc/usr/lib/vlc/audio_output/libalsa_plugin.so \
255           debian/vlc-plugin-alsa/usr/lib/vlc/audio_output/
256
257         # Package: vlc-plugin-sdl
258         ln -s vlc debian/vlc-plugin-sdl/usr/share/doc/vlc-plugin-sdl
259         mv debian/vlc/usr/lib/vlc/audio_output/libaout_sdl_plugin.so \
260           debian/vlc-plugin-sdl/usr/lib/vlc/audio_output/
261         mv debian/vlc/usr/lib/vlc/video_output/libvout_sdl_plugin.so \
262           debian/vlc-plugin-sdl/usr/lib/vlc/video_output/
263
264         # Package: vlc-plugin-ggi
265         ln -s vlc debian/vlc-plugin-ggi/usr/share/doc/vlc-plugin-ggi
266         mv debian/vlc/usr/lib/vlc/video_output/libggi_plugin.so \
267           debian/vlc-plugin-ggi/usr/lib/vlc/video_output/
268
269         # Package: vlc-plugin-glide
270 ifeq ($(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU),i386)
271         ln -s vlc debian/vlc-plugin-glide/usr/share/doc/vlc-plugin-glide
272         mv debian/vlc/usr/lib/vlc/video_output/libglide_plugin.so \
273           debian/vlc-plugin-glide/usr/lib/vlc/video_output/
274 endif
275
276         # Package: qvlc
277         #mv debian/vlc/usr/bin/qvlc debian/qvlc/usr/bin/
278         ln -s vlc debian/qvlc/usr/share/doc/qvlc
279         #mv debian/vlc/usr/lib/vlc/gui/libqt_plugin.so \
280         #  debian/qvlc/usr/lib/vlc/gui/
281         #ln -s vlc.1.gz debian/qvlc/usr/share/man/man1/qvlc.1.gz
282         #mv debian/vlc/$(VIDDIR)/qvlc32x32.xpm debian/qvlc/$(VIDDIR)/qvlc.xpm
283         #mv debian/vlc/$(VIDDIR)/qvlc48x48.png debian/qvlc/$(PIXDIR)/qvlc.png
284
285         # Package: vlc-plugin-arts
286         ln -s vlc debian/vlc-plugin-arts/usr/share/doc/vlc-plugin-arts
287         mv debian/vlc/usr/lib/vlc/audio_output/libarts_plugin.so \
288           debian/vlc-plugin-arts/usr/lib/vlc/audio_output/
289
290         # Package: mozilla-plugin-vlc
291         ln -s vlc debian/mozilla-plugin-vlc/usr/share/doc/mozilla-plugin-vlc
292         mv debian/vlc/usr/lib/mozilla debian/mozilla-plugin-vlc/usr/lib
293         # links for firefox
294         mkdir -p debian/mozilla-plugin-vlc/usr/lib/mozilla-firefox/plugins/
295         ln -s ../../mozilla/plugins/libvlcplugin.so debian/mozilla-plugin-vlc/usr/lib/mozilla-firefox/plugins/
296         mkdir -p debian/mozilla-plugin-vlc/usr/lib/mozilla-firefox/components/
297         ln -s ../../mozilla/components/vlcintf.xpt debian/mozilla-plugin-vlc/usr/lib/mozilla-firefox/components/
298
299         # Package: kvlc
300         #mv debian/vlc/usr/bin/kvlc debian/kvlc/usr/bin/
301         ln -s vlc debian/kvlc/usr/share/doc/kvlc
302         #mv debian/vlc/usr/lib/vlc/gui/libkde_plugin.so \
303         #  debian/kvlc/usr/lib/vlc/gui/
304         #mv debian/vlc/$(VIDDIR)/ui.rc debian/kvlc/$(VIDDIR)
305         #ln -s vlc.1.gz debian/kvlc/usr/share/man/man1/kvlc.1.gz
306         #mv debian/vlc/$(VIDDIR)/kvlc32x32.xpm debian/kvlc/$(VIDDIR)/kvlc.xpm
307         #mv debian/vlc/$(VIDDIR)/kvlc48x48.png debian/kvlc/$(PIXDIR)/kvlc.png
308
309         # Package: vlc-plugin-svgalib
310 ifeq ($(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU),i386)
311         ln -s vlc debian/vlc-plugin-svgalib/usr/share/doc/vlc-plugin-svgalib
312         mv debian/vlc/usr/lib/vlc/video_output/libsvgalib_plugin.so \
313           debian/vlc-plugin-svgalib/usr/lib/vlc/video_output
314 endif
315
316         # Package: wxvlc
317         mv debian/vlc/usr/bin/wxvlc debian/wxvlc/usr/bin/
318         ln -s vlc debian/wxvlc/usr/share/doc/wxvlc
319         cp debian/vlc/$(VIDDIR)/vlc.xpm debian/wxvlc/$(VIDDIR)/wxvlc.xpm
320         cp debian/vlc.desktop debian/wxvlc/$(APPDIR)
321         mv debian/vlc/usr/lib/vlc/gui/libwxwidgets_plugin.so \
322           debian/wxvlc/usr/lib/vlc/gui/
323         ln -s vlc.1.gz debian/wxvlc/usr/share/man/man1/wxvlc.1.gz
324
325         # Clean up
326         rm -f debian/vlc/$(VIDDIR)/*.png
327
328         #gzip -9 < doc/vlc.1 >| debian/vlc/usr/share/man/man1/vlc.1.gz
329
330 # Build architecture-independent files here.
331 binary-indep: build install
332 # We have nothing to do by default.
333
334 # Build architecture-dependent files here.
335 binary-arch: build install
336 #       dh_testversion
337         dh_testdir
338         dh_testroot
339 #       dh_installdebconf       
340         dh_installdocs -p vlc
341         dh_buildinfo -p vlc
342 #       dh_installexamples
343         dh_installmenu -s
344         dh_installmime -s
345         dh_installman doc/vlc.1 -p vlc
346         dh_installman doc/vlc-config.1 -p libvlc0-dev
347         dh_installchangelogs ChangeLog -p vlc
348         for x in doc/ChangeLog-* ; do cp "doc/ChangeLog-$${x#*-}" "debian/vlc/usr/share/doc/vlc/changelog$${x#*-}" ; done
349         dh_link -s
350         dh_strip -s
351         dh_compress -s
352         dh_fixperms -s
353         dh_makeshlibs -s
354         dh_installdeb -s
355 #       dh_perl
356         dh_shlibdeps -s
357         dh_gencontrol -s
358         dh_md5sums -s
359         dh_builddeb -s
360
361 binary: binary-indep binary-arch
362 .PHONY: build clean binary-indep binary-arch binary install
363