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