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