]> git.sesse.net Git - vlc/blob - debian/rules
* ./debian/rules: we now build the static objects twice: once the normal
[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
52 # Glide is only for x86
53 ifeq ($(DEB_BUILD_ARCH),i386)
54 CONFIG_FLAGS += --enable-glide
55 CONFIG_FLAGS += --enable-svgalib
56 else
57 ARCH_EXCLUDE += -Nvlc-plugin-glide -Nvlc-glide
58 ARCH_EXCLUDE += -Nvlc-plugin-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 build: build-stamp
74 build-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         # Configure VLC
108         ./configure --mandir=$${prefix}/share/man \
109                 --infodir=$${prefix}/share/info $(CONFIG_FLAGS)
110
111         # Build only VLC, with the non-PIC libs
112         $(MAKE) vlc
113
114 ifneq ($(DEB_BUILD_ARCH),i386)
115         # Hackety hackety hack
116         if test ! -d CVS; then \
117                 cd extras/ffmpeg/libavcodec \
118                 && $(MAKE) clean \
119                 && rm -f Makefile.pic \
120                 && sed 's/^CFLAGS *=/&-fPIC -DPIC /' <Makefile >Makefile.pic \
121                 && $(MAKE) -f Makefile.pic \
122                 && rm -f Makefile.pic; \
123         fi
124
125         # HACKETY HACKETY HACK
126         if test ! -d CVS; then \
127                 cd extras/faad/libfaad \
128                 && $(MAKE) clean \
129                 && $(MAKE) AM_CFLAGS=-fPIC; \
130         fi
131 endif
132
133         # Build all the rest, with the PIC libs
134         $(MAKE)
135
136         touch build-stamp
137
138 clean:
139         dh_testdir
140         dh_testroot
141         rm -f build-stamp
142
143         # Check that we have an ffmpeg tree in here (can be a symlink)
144         test -d extras/ffmpeg
145         -if test ! -d CVS; then cd extras/ffmpeg && $(MAKE) distclean; fi
146         # Check that we have an faad tree in here (can be a symlink)
147         test -d extras/faad
148         -if test ! -d CVS; then cd extras/faad && $(MAKE) distclean; fi
149
150         # Remove spurious autotools stuff
151         rm -f config.log confdefs.h
152
153         -$(MAKE) distclean
154
155         dh_clean
156
157 install: build
158         dh_testdir
159         dh_testroot
160         dh_clean -k
161         dh_installdirs
162
163         DESTDIR=`pwd`/debian/vlc/ $(MAKE) install prefix=/usr
164
165         # Package: vlc
166         mv debian/vlc/$(VIDDIR)/vlc48x48.png debian/vlc/$(PIXDIR)/vlc.png
167         mv debian/vlc/$(VIDDIR)/vlc32x32.xpm debian/vlc/$(VIDDIR)/vlc.xpm
168         cp debian/gvlc.desktop debian/gvlc/$(GNOMEDIR)
169         cp debian/gnome-vlc.desktop debian/gnome-vlc/$(GNOMEDIR)
170
171         cp doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc
172         strfile doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc.dat
173
174         # Package: libvlc0-dev
175         mv debian/vlc/usr/bin/vlc-config debian/libvlc0-dev/usr/bin/
176         mv debian/vlc/usr/lib/*.a debian/libvlc0-dev/usr/lib/
177         mv debian/vlc/usr/lib/vlc/*.a debian/libvlc0-dev/usr/lib/vlc/
178         mv debian/vlc/usr/include/vlc/*.h debian/libvlc0-dev/usr/include/vlc/
179         rm -Rf debian/vlc/usr/include
180         ln -s vlc debian/libvlc0-dev/usr/share/doc/libvlc0-dev
181
182         # Package: gnome-vlc
183         mv debian/vlc/usr/bin/gnome-vlc debian/gnome-vlc/usr/bin/
184         ln -s vlc debian/gnome-vlc/usr/share/doc/gnome-vlc
185         mv debian/vlc/usr/lib/vlc/misc/libgnome_main_plugin.so \
186                 debian/gnome-vlc/usr/lib/vlc/gui/
187         mv debian/vlc/usr/lib/vlc/gui/libgnome_plugin.so \
188                 debian/gnome-vlc/usr/lib/vlc/gui/
189         ln -s vlc.1.gz debian/gnome-vlc/usr/share/man/man1/gnome-vlc.1.gz
190         mv debian/vlc/$(VIDDIR)/gnome-vlc32x32.xpm debian/gnome-vlc/$(VIDDIR)/gnome-vlc.xpm
191         mv debian/vlc/$(VIDDIR)/gnome-vlc48x48.png debian/gnome-vlc/$(PIXDIR)/gnome-vlc.png
192
193         # Package: vlc-gnome
194         mkdir -p debian/vlc-gnome/usr/share/doc/
195         ln -s vlc debian/vlc-gnome/usr/share/doc/vlc-gnome
196
197         # Package: gvlc
198         mv debian/vlc/usr/bin/gvlc debian/gvlc/usr/bin/
199         ln -s vlc debian/gvlc/usr/share/doc/gvlc
200         mv debian/vlc/usr/lib/vlc/misc/libgtk_main_plugin.so \
201                 debian/gvlc/usr/lib/vlc/gui/
202         mv debian/vlc/usr/lib/vlc/gui/libgtk_plugin.so \
203                 debian/gvlc/usr/lib/vlc/gui/
204         mv debian/vlc/usr/lib/vlc/gui/libfamiliar_plugin.so \
205                 debian/gvlc/usr/lib/vlc/gui/
206         ln -s vlc.1.gz debian/gvlc/usr/share/man/man1/gvlc.1.gz
207         mv debian/vlc/$(VIDDIR)/gvlc32x32.xpm debian/gvlc/$(VIDDIR)/gvlc.xpm
208         mv debian/vlc/$(VIDDIR)/gvlc48x48.png debian/gvlc/$(PIXDIR)/gvlc.png
209
210         # Package: vlc-gtk
211         mkdir -p debian/vlc-gtk/usr/share/doc/
212         ln -s vlc debian/vlc-gtk/usr/share/doc/vlc-gtk
213
214         # Package: vlc-plugin-esd
215         ln -s vlc debian/vlc-plugin-esd/usr/share/doc/vlc-plugin-esd
216         mv debian/vlc/usr/lib/vlc/audio_output/libesd_plugin.so \
217                 debian/vlc-plugin-esd/usr/lib/vlc/audio_output/
218
219         # Package: vlc-esd
220         mkdir -p debian/vlc-esd/usr/share/doc/
221         ln -s vlc debian/vlc-esd/usr/share/doc/vlc-esd
222
223         # Package: vlc-plugin-alsa
224         ln -s vlc debian/vlc-plugin-alsa/usr/share/doc/vlc-plugin-alsa
225         mv debian/vlc/usr/lib/vlc/audio_output/libalsa_plugin.so \
226                 debian/vlc-plugin-alsa/usr/lib/vlc/audio_output/
227
228         # Package: vlc-alsa
229         mkdir -p debian/vlc-alsa/usr/share/doc/
230         ln -s vlc debian/vlc-alsa/usr/share/doc/vlc-alsa
231
232         # Package: vlc-plugin-sdl
233         ln -s vlc debian/vlc-plugin-sdl/usr/share/doc/vlc-plugin-sdl
234         mv debian/vlc/usr/lib/vlc/audio_output/libaout_sdl_plugin.so \
235                 debian/vlc-plugin-sdl/usr/lib/vlc/audio_output/
236         mv debian/vlc/usr/lib/vlc/video_output/libvout_sdl_plugin.so \
237                 debian/vlc-plugin-sdl/usr/lib/vlc/video_output/
238
239         # Package: vlc-sdl
240         mkdir -p debian/vlc-sdl/usr/share/doc/
241         ln -s vlc debian/vlc-sdl/usr/share/doc/vlc-sdl
242
243         # Package: vlc-plugin-ggi
244         ln -s vlc debian/vlc-plugin-ggi/usr/share/doc/vlc-plugin-ggi
245         mv debian/vlc/usr/lib/vlc/video_output/libggi_plugin.so \
246                 debian/vlc-plugin-ggi/usr/lib/vlc/video_output/
247
248         # Package: vlc-ggi
249         mkdir -p debian/vlc-ggi/usr/share/doc/
250         ln -s vlc debian/vlc-ggi/usr/share/doc/vlc-ggi
251
252         # Package: vlc-plugin-glide
253 ifeq ($(DEB_BUILD_ARCH),i386)
254         ln -s vlc debian/vlc-plugin-glide/usr/share/doc/vlc-plugin-glide
255         mv debian/vlc/usr/lib/vlc/video_output/libglide_plugin.so \
256                 debian/vlc-plugin-glide/usr/lib/vlc/video_output/
257
258         # Package: vlc-glide
259         mkdir -p debian/vlc-glide/usr/share/doc/
260         ln -s vlc debian/vlc-glide/usr/share/doc/vlc-glide
261 endif
262
263         # Package: qvlc
264         mv debian/vlc/usr/bin/qvlc debian/qvlc/usr/bin/
265         ln -s vlc debian/qvlc/usr/share/doc/qvlc
266         mv debian/vlc/usr/lib/vlc/gui/libqt_plugin.so \
267                 debian/qvlc/usr/lib/vlc/gui/
268         ln -s vlc.1.gz debian/qvlc/usr/share/man/man1/qvlc.1.gz
269         mv debian/vlc/$(VIDDIR)/qvlc32x32.xpm debian/qvlc/$(VIDDIR)/qvlc.xpm
270         mv debian/vlc/$(VIDDIR)/qvlc48x48.png debian/qvlc/$(PIXDIR)/qvlc.png
271
272         # Package: vlc-qt
273         mkdir -p debian/vlc-qt/usr/share/doc/
274         ln -s vlc debian/vlc-qt/usr/share/doc/vlc-qt
275
276         # Package: vlc-plugin-arts
277         ln -s vlc debian/vlc-plugin-arts/usr/share/doc/vlc-plugin-arts
278         mv debian/vlc/usr/lib/vlc/audio_output/libarts_plugin.so \
279                 debian/vlc-plugin-arts/usr/lib/vlc/audio_output/
280
281         # Package: mozilla-plugin-vlc
282         ln -s vlc debian/mozilla-plugin-vlc/usr/share/doc/mozilla-plugin-vlc
283         mv debian/vlc/usr/lib/mozilla debian/mozilla-plugin-vlc/usr/lib
284
285         # Package: kvlc
286         mv debian/vlc/usr/bin/kvlc debian/kvlc/usr/bin/
287         ln -s vlc debian/kvlc/usr/share/doc/kvlc
288         mv debian/vlc/usr/lib/vlc/gui/libkde_plugin.so \
289                 debian/kvlc/usr/lib/vlc/gui/
290         mv debian/vlc/usr/share/vlc/ui.rc \
291                 debian/kvlc/usr/share/vlc
292         ln -s vlc.1.gz debian/kvlc/usr/share/man/man1/kvlc.1.gz
293         mv debian/vlc/$(VIDDIR)/kvlc32x32.xpm debian/kvlc/$(VIDDIR)/kvlc.xpm
294         mv debian/vlc/$(VIDDIR)/kvlc48x48.png debian/kvlc/$(PIXDIR)/kvlc.png
295
296         # Package: vlc-plugin-svgalib
297 ifeq ($(DEB_BUILD_ARCH),i386)
298         ln -s vlc debian/vlc-plugin-svgalib/usr/share/doc/vlc-plugin-svgalib
299         mv debian/vlc/usr/lib/vlc/video_output/libsvgalib_plugin.so \
300                 debian/vlc-plugin-svgalib/usr/lib/vlc/video_output
301 endif
302
303         # Package: wxvlc
304         mv debian/vlc/usr/bin/wxvlc debian/wxvlc/usr/bin/
305         ln -s vlc debian/wxvlc/usr/share/doc/wxvlc
306         mv debian/vlc/usr/lib/vlc/gui/libwxwindows_plugin.so \
307                 debian/wxvlc/usr/lib/vlc/gui/
308         ln -s vlc.1.gz debian/wxvlc/usr/share/man/man1/wxvlc.1.gz
309
310         # Clean up
311         rm -f debian/vlc/$(VIDDIR)/*.png
312
313         #gzip -9 < doc/vlc.1 >| debian/vlc/usr/share/man/man1/vlc.1.gz
314
315 # Build architecture-independent files here.
316 binary-indep: build install
317 # We have nothing to do by default.
318
319 # Build architecture-dependent files here.
320 binary-arch: build install
321 #       dh_testversion
322         dh_testdir
323         dh_testroot
324 #       dh_installdebconf       
325         dh_installdocs -p vlc
326 #       dh_installexamples
327         dh_installmenu
328         dh_installman doc/vlc.1 -p vlc
329         dh_installman doc/vlc-config.1 -p libvlc0-dev
330 #       dh_installchangelogs ChangeLog -p vlc
331         cp ChangeLog debian/vlc/usr/share/doc/vlc/changelog
332         cp debian/changelog debian/vlc/usr/share/doc/vlc/changelog.Debian
333         dh_link
334         dh_strip
335         dh_compress
336         dh_fixperms
337         dh_makeshlibs
338         dh_installdeb
339 #       dh_perl
340         dh_shlibdeps $(ARCH_EXCLUDE)
341         dh_gencontrol $(ARCH_EXCLUDE)
342         dh_md5sums $(ARCH_EXCLUDE)
343         dh_builddeb $(ARCH_EXCLUDE)
344
345 binary: binary-indep binary-arch
346 .PHONY: build clean binary-indep binary-arch binary install
347