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