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