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