]> git.sesse.net Git - vlc/blob - debian/rules
* debian/changelog:
[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         --disable-mkv \
48         $(NULL)
49
50 # These ones are currently shipped with VLC
51 CONFIG_FLAGS += --enable-ffmpeg --with-ffmpeg-tree=extras/ffmpeg
52 CONFIG_FLAGS += --enable-faad --with-faad-tree=extras/faad
53 CONFIG_FLAGS += --enable-libmpeg2 --with-libmpeg2-tree=extras/mpeg2dec
54
55 # Glide is only for x86
56 ifeq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
57 CONFIG_FLAGS += --enable-glide
58 CONFIG_FLAGS += --enable-svgalib
59 endif
60
61 # Remove --without-dvdcss in non-totalitarian countries
62 CONFIG_FLAGS += --enable-dvd --without-dvdcss
63
64 # A few shortcuts
65 VIDDIR = usr/share/vlc
66 PIXDIR = usr/share/pixmaps
67 GNOMEDIR = usr/share/gnome/apps/Multimedia
68
69 #
70 # Build rules
71 #
72
73 configure: configure-stamp
74 configure-stamp:
75         dh_testdir
76
77         # Touch stuff
78         touch configure.ac \
79         && touch aclocal.m4 \
80         && touch configure \
81         && touch config.h.in \
82         && touch `find . -name Makefile.in`
83
84         # Check that we have an ffmpeg tree in here (can be a symlink)
85         test -d extras/ffmpeg
86         if test ! -d CVS; then \
87           cd extras/ffmpeg \
88           && ./configure \
89           && cd libavcodec \
90           && $(MAKE); \
91         fi
92
93         # Check that we have an faad tree in here (can be a symlink)
94         test -d extras/faad
95         if test ! -d CVS; then \
96           cd extras/faad \
97           && touch `find . -name configure.in` \
98           && touch `find . -name aclocal.m4` \
99           && touch `find . -name configure` \
100           && touch `find . -name config.h.in` \
101           && touch `find . -name Makefile.in` \
102           && ./configure --disable-shared \
103           && cd libfaad \
104           && $(MAKE); \
105         fi
106
107         # Check that we have an mpeg2dec tree in here (can be a symlink)
108         test -d extras/mpeg2dec
109         if test ! -d CVS; then \
110           cd extras/mpeg2dec \
111           && touch configure.in \
112           && touch aclocal.m4 \
113           && touch acinclude.m4 \
114           && touch configure \
115           && touch `find . -name config.h.in` \
116           && touch `find . -name Makefile.in` \
117           && ./configure --disable-shared \
118           && cd libmpeg2 \
119           && $(MAKE); \
120         fi
121
122         # Configure VLC
123         ./configure --mandir=$${prefix}/share/man \
124           --infodir=$${prefix}/share/info $(CONFIG_FLAGS)
125
126         touch configure-stamp
127
128 build: configure-stamp build-stamp
129 build-stamp:
130         dh_testdir
131
132         # Build only VLC, with the non-PIC libs
133         $(MAKE) vlc
134
135 ifneq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
136         # Hackety hackety hack
137         if test ! -d CVS; then \
138           cd extras/ffmpeg/libavcodec \
139           && $(MAKE) clean \
140           && rm -f Makefile.pic \
141           && sed 's/^CFLAGS *=/&-fPIC -DPIC /' <Makefile >Makefile.pic \
142           && $(MAKE) -f Makefile.pic \
143           && rm -f Makefile.pic; \
144         fi
145
146         # HACKETY HACKETY HACK
147         if test ! -d CVS; then \
148           cd extras/faad/libfaad \
149           && $(MAKE) clean \
150           && $(MAKE) AM_CFLAGS=-fPIC; \
151         fi
152
153         # HACK ME PLENTY MORE!!!
154         if test ! -d CVS; then \
155           cd extras/mpeg2dec/libmpeg2 \
156           && $(MAKE) clean \
157           && $(MAKE) LIBMPEG2_CFLAGS=-fPIC; \
158         fi
159 endif
160
161         # Build all the rest, with the PIC libs
162         $(MAKE)
163
164         touch build-stamp
165
166 clean:
167         dh_testdir
168         dh_testroot
169         rm -f configure-stamp build-stamp
170
171         # Check that we have an ffmpeg tree in here (can be a symlink)
172         test -d extras/ffmpeg
173         -if test ! -d CVS; then cd extras/ffmpeg && $(MAKE) distclean; fi
174         # Check that we have an faad tree in here (can be a symlink)
175         test -d extras/faad
176         -if test ! -d CVS; then cd extras/faad && $(MAKE) distclean; fi
177         # Check that we have an mpeg2dec tree in here (can be a symlink)
178         test -d extras/mpeg2dec
179         -if test ! -d CVS; then cd extras/mpeg2dec && $(MAKE) distclean; fi
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         # Package: libvlc0-dev
206         mv debian/vlc/usr/bin/vlc-config debian/libvlc0-dev/usr/bin/
207         mv debian/vlc/usr/lib/*.a debian/libvlc0-dev/usr/lib/
208         mv debian/vlc/usr/lib/vlc/*.a debian/libvlc0-dev/usr/lib/vlc/
209         mv debian/vlc/usr/include/vlc/*.h debian/libvlc0-dev/usr/include/vlc/
210         rm -Rf debian/vlc/usr/include
211         ln -s vlc debian/libvlc0-dev/usr/share/doc/libvlc0-dev
212
213         # Package: gnome-vlc
214         mv debian/vlc/usr/bin/gnome-vlc debian/gnome-vlc/usr/bin/
215         ln -s vlc debian/gnome-vlc/usr/share/doc/gnome-vlc
216         mv debian/vlc/usr/lib/vlc/misc/libgnome_main_plugin.so \
217           debian/gnome-vlc/usr/lib/vlc/gui/
218         mv debian/vlc/usr/lib/vlc/gui/libgnome_plugin.so \
219           debian/gnome-vlc/usr/lib/vlc/gui/
220         ln -s vlc.1.gz debian/gnome-vlc/usr/share/man/man1/gnome-vlc.1.gz
221         mv debian/vlc/$(VIDDIR)/gnome-vlc32x32.xpm debian/gnome-vlc/$(VIDDIR)/gnome-vlc.xpm
222         mv debian/vlc/$(VIDDIR)/gnome-vlc48x48.png debian/gnome-vlc/$(PIXDIR)/gnome-vlc.png
223
224         # Package: vlc-gnome
225         mkdir -p debian/vlc-gnome/usr/share/doc/
226         ln -s vlc debian/vlc-gnome/usr/share/doc/vlc-gnome
227
228         # Package: gvlc
229         mv debian/vlc/usr/bin/gvlc debian/gvlc/usr/bin/
230         ln -s vlc debian/gvlc/usr/share/doc/gvlc
231         mv debian/vlc/usr/lib/vlc/misc/libgtk_main_plugin.so \
232           debian/gvlc/usr/lib/vlc/gui/
233         mv debian/vlc/usr/lib/vlc/gui/libgtk_plugin.so \
234           debian/gvlc/usr/lib/vlc/gui/
235         mv debian/vlc/usr/lib/vlc/gui/libfamiliar_plugin.so \
236           debian/gvlc/usr/lib/vlc/gui/
237         ln -s vlc.1.gz debian/gvlc/usr/share/man/man1/gvlc.1.gz
238         mv debian/vlc/$(VIDDIR)/gvlc32x32.xpm debian/gvlc/$(VIDDIR)/gvlc.xpm
239         mv debian/vlc/$(VIDDIR)/gvlc48x48.png debian/gvlc/$(PIXDIR)/gvlc.png
240
241         # Package: vlc-gtk
242         mkdir -p debian/vlc-gtk/usr/share/doc/
243         ln -s vlc debian/vlc-gtk/usr/share/doc/vlc-gtk
244
245         # Package: vlc-plugin-esd
246         ln -s vlc debian/vlc-plugin-esd/usr/share/doc/vlc-plugin-esd
247         mv debian/vlc/usr/lib/vlc/audio_output/libesd_plugin.so \
248           debian/vlc-plugin-esd/usr/lib/vlc/audio_output/
249
250         # Package: vlc-esd
251         mkdir -p debian/vlc-esd/usr/share/doc/
252         ln -s vlc debian/vlc-esd/usr/share/doc/vlc-esd
253
254         # Package: vlc-plugin-alsa
255         ln -s vlc debian/vlc-plugin-alsa/usr/share/doc/vlc-plugin-alsa
256         mv debian/vlc/usr/lib/vlc/audio_output/libalsa_plugin.so \
257           debian/vlc-plugin-alsa/usr/lib/vlc/audio_output/
258
259         # Package: vlc-alsa
260         mkdir -p debian/vlc-alsa/usr/share/doc/
261         ln -s vlc debian/vlc-alsa/usr/share/doc/vlc-alsa
262
263         # Package: vlc-plugin-sdl
264         ln -s vlc debian/vlc-plugin-sdl/usr/share/doc/vlc-plugin-sdl
265         mv debian/vlc/usr/lib/vlc/audio_output/libaout_sdl_plugin.so \
266           debian/vlc-plugin-sdl/usr/lib/vlc/audio_output/
267         mv debian/vlc/usr/lib/vlc/video_output/libvout_sdl_plugin.so \
268           debian/vlc-plugin-sdl/usr/lib/vlc/video_output/
269
270         # Package: vlc-sdl
271         mkdir -p debian/vlc-sdl/usr/share/doc/
272         ln -s vlc debian/vlc-sdl/usr/share/doc/vlc-sdl
273
274         # Package: vlc-plugin-ggi
275         ln -s vlc debian/vlc-plugin-ggi/usr/share/doc/vlc-plugin-ggi
276         mv debian/vlc/usr/lib/vlc/video_output/libggi_plugin.so \
277           debian/vlc-plugin-ggi/usr/lib/vlc/video_output/
278
279         # Package: vlc-ggi
280         mkdir -p debian/vlc-ggi/usr/share/doc/
281         ln -s vlc debian/vlc-ggi/usr/share/doc/vlc-ggi
282
283         # Package: vlc-plugin-glide
284 ifeq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
285         ln -s vlc debian/vlc-plugin-glide/usr/share/doc/vlc-plugin-glide
286         mv debian/vlc/usr/lib/vlc/video_output/libglide_plugin.so \
287           debian/vlc-plugin-glide/usr/lib/vlc/video_output/
288
289         # Package: vlc-glide
290         mkdir -p debian/vlc-glide/usr/share/doc/
291         ln -s vlc debian/vlc-glide/usr/share/doc/vlc-glide
292 endif
293
294         # Package: qvlc
295         mv debian/vlc/usr/bin/qvlc debian/qvlc/usr/bin/
296         ln -s vlc debian/qvlc/usr/share/doc/qvlc
297         mv debian/vlc/usr/lib/vlc/gui/libqt_plugin.so \
298           debian/qvlc/usr/lib/vlc/gui/
299         ln -s vlc.1.gz debian/qvlc/usr/share/man/man1/qvlc.1.gz
300         mv debian/vlc/$(VIDDIR)/qvlc32x32.xpm debian/qvlc/$(VIDDIR)/qvlc.xpm
301         mv debian/vlc/$(VIDDIR)/qvlc48x48.png debian/qvlc/$(PIXDIR)/qvlc.png
302
303         # Package: vlc-qt
304         mkdir -p debian/vlc-qt/usr/share/doc/
305         ln -s vlc debian/vlc-qt/usr/share/doc/vlc-qt
306
307         # Package: vlc-plugin-arts
308         ln -s vlc debian/vlc-plugin-arts/usr/share/doc/vlc-plugin-arts
309         mv debian/vlc/usr/lib/vlc/audio_output/libarts_plugin.so \
310           debian/vlc-plugin-arts/usr/lib/vlc/audio_output/
311
312         # Package: mozilla-plugin-vlc
313         ln -s vlc debian/mozilla-plugin-vlc/usr/share/doc/mozilla-plugin-vlc
314         mv debian/vlc/usr/lib/mozilla debian/mozilla-plugin-vlc/usr/lib
315
316         # Package: kvlc
317         mv debian/vlc/usr/bin/kvlc debian/kvlc/usr/bin/
318         ln -s vlc debian/kvlc/usr/share/doc/kvlc
319         mv debian/vlc/usr/lib/vlc/gui/libkde_plugin.so \
320           debian/kvlc/usr/lib/vlc/gui/
321         mv debian/vlc/usr/share/vlc/ui.rc \
322           debian/kvlc/usr/share/vlc
323         ln -s vlc.1.gz debian/kvlc/usr/share/man/man1/kvlc.1.gz
324         mv debian/vlc/$(VIDDIR)/kvlc32x32.xpm debian/kvlc/$(VIDDIR)/kvlc.xpm
325         mv debian/vlc/$(VIDDIR)/kvlc48x48.png debian/kvlc/$(PIXDIR)/kvlc.png
326
327         # Package: vlc-plugin-svgalib
328 ifeq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
329         ln -s vlc debian/vlc-plugin-svgalib/usr/share/doc/vlc-plugin-svgalib
330         mv debian/vlc/usr/lib/vlc/video_output/libsvgalib_plugin.so \
331           debian/vlc-plugin-svgalib/usr/lib/vlc/video_output
332 endif
333
334         # Package: wxvlc
335         mv debian/vlc/usr/bin/wxvlc debian/wxvlc/usr/bin/
336         ln -s vlc debian/wxvlc/usr/share/doc/wxvlc
337         mv debian/vlc/usr/lib/vlc/gui/libwxwindows_plugin.so \
338           debian/wxvlc/usr/lib/vlc/gui/
339         mv debian/vlc/usr/lib/vlc/gui/libskins_plugin.so \
340           debian/wxvlc/usr/lib/vlc/gui/
341         mv debian/vlc/usr/share/vlc/skins \
342           debian/wxvlc/usr/share/vlc/
343         ln -s vlc.1.gz debian/wxvlc/usr/share/man/man1/wxvlc.1.gz
344
345         # Clean up
346         rm -f debian/vlc/$(VIDDIR)/*.png
347
348         #gzip -9 < doc/vlc.1 >| debian/vlc/usr/share/man/man1/vlc.1.gz
349
350 # Build architecture-independent files here.
351 binary-indep: build install
352 # We have nothing to do by default.
353
354 # Build architecture-dependent files here.
355 binary-arch: build install
356 #       dh_testversion
357         dh_testdir
358         dh_testroot
359 #       dh_installdebconf       
360         dh_installdocs -p vlc
361 #       dh_installexamples
362         dh_installmenu -s
363         dh_installmime -s
364         dh_installman doc/vlc.1 -p vlc
365         dh_installman doc/vlc-config.1 -p libvlc0-dev
366 #       dh_installchangelogs ChangeLog -p vlc
367         cp ChangeLog debian/vlc/usr/share/doc/vlc/changelog
368         cp debian/changelog debian/vlc/usr/share/doc/vlc/changelog.Debian
369         dh_link -s
370         dh_strip -s
371         dh_compress -s
372         dh_fixperms -s
373         dh_makeshlibs -s
374         dh_installdeb -s
375 #       dh_perl
376         dh_shlibdeps -s
377         dh_gencontrol -s
378         dh_md5sums -s
379         dh_builddeb -s
380
381 binary: binary-indep binary-arch
382 .PHONY: build clean binary-indep binary-arch binary install
383