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