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