rules 11.1 KB
Newer Older
1
2
3
4
5
6
7
8
#!/usr/bin/make -f
# debian/rules for the VideoLAN Client - uses debhelper.
# based on Joey Hess's one.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This is the debhelper compatability version to use.
9
export DH_COMPAT=3
10

11
#
Sam Hocevar's avatar
   
Sam Hocevar committed
12
# Compilation options
13
14
#

15
CONFIG_FLAGS = --enable-release --prefix=/usr
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
CONFIG_FLAGS += \
	--enable-gnome \
	--enable-gtk \
	--enable-familiar \
	--enable-fb \
	--enable-ggi \
	--enable-sdl \
	--enable-esd \
	--enable-qt \
	--enable-mad \
	--enable-arts \
	--enable-alsa \
	--enable-lirc \
	--enable-a52 \
	--enable-aa \
	--enable-dvbpsi \
	--enable-xosd \
	--enable-mozilla \
	--enable-kde \
	--enable-mp4 \
	--enable-dvb \
	--enable-dv \
	--enable-satellite \
	--enable-ogg \
	--enable-vorbis \
41
	--enable-wxwindows \
42
	--enable-slp \
43
	--enable-flac \
Sam Hocevar's avatar
Sam Hocevar committed
44
45
46
	--enable-skins \
	--disable-basic-skins \
	--disable-freetype \
Sam Hocevar's avatar
Sam Hocevar committed
47
	--disable-mkv \
48
49
50
	$(NULL)

# These ones are currently shipped with VLC
51
52
CONFIG_FLAGS += --enable-ffmpeg --with-ffmpeg-tree=extras/ffmpeg
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
Sam Hocevar's avatar
Sam Hocevar committed
56
ifeq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
57
CONFIG_FLAGS += --enable-glide
58
CONFIG_FLAGS += --enable-svgalib
59
60
endif

61
# Remove --without-dvdcss in non-totalitarian countries
62
63
CONFIG_FLAGS += --enable-dvd --without-dvdcss

64
# A few shortcuts
65
66
67
VIDDIR = usr/share/vlc
PIXDIR = usr/share/pixmaps
GNOMEDIR = usr/share/gnome/apps/Multimedia
Sam Hocevar's avatar
   
Sam Hocevar committed
68

69
70
71
#
# Build rules
#
Sam Hocevar's avatar
   
Sam Hocevar committed
72

Sam Hocevar's avatar
Sam Hocevar committed
73
74
configure: configure-stamp
configure-stamp:
75
76
	dh_testdir

77
	# Touch stuff
78
	touch configure.ac \
79
80
	&& touch aclocal.m4 \
	&& touch configure \
81
82
	&& touch config.h.in \
	&& 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 \
Sam Hocevar's avatar
Sam Hocevar committed
87
88
89
90
	  cd extras/ffmpeg \
	  && ./configure \
	  && cd libavcodec \
	  && $(MAKE); \
91
	fi
92
93
94

	# Check that we have an faad tree in here (can be a symlink)
	test -d extras/faad
95
	if test ! -d CVS; then \
Sam Hocevar's avatar
Sam Hocevar committed
96
97
98
99
100
101
102
103
104
	  cd extras/faad \
	  && touch `find . -name configure.in` \
	  && touch `find . -name aclocal.m4` \
	  && touch `find . -name configure` \
	  && touch `find . -name config.h.in` \
	  && touch `find . -name Makefile.in` \
	  && ./configure --disable-shared \
	  && cd libfaad \
	  && $(MAKE); \
105
	fi
106

107
108
109
	# Check that we have an mpeg2dec tree in here (can be a symlink)
	test -d extras/mpeg2dec
	if test ! -d CVS; then \
Sam Hocevar's avatar
Sam Hocevar committed
110
111
112
113
114
115
116
117
118
119
	  cd extras/mpeg2dec \
	  && touch configure.in \
	  && touch aclocal.m4 \
	  && touch acinclude.m4 \
	  && touch configure \
	  && touch `find . -name config.h.in` \
	  && touch `find . -name Makefile.in` \
	  && ./configure --disable-shared \
	  && cd libmpeg2 \
	  && $(MAKE); \
120
121
	fi

122
	# Configure VLC
Sam Hocevar's avatar
Sam Hocevar committed
123
	./configure --mandir=$${prefix}/share/man \
Sam Hocevar's avatar
Sam Hocevar committed
124
	  --infodir=$${prefix}/share/info $(CONFIG_FLAGS)
125

Sam Hocevar's avatar
Sam Hocevar committed
126
127
128
129
130
131
	touch configure-stamp

build: configure-stamp build-stamp
build-stamp:
	dh_testdir

132
133
134
	# Build only VLC, with the non-PIC libs
	$(MAKE) vlc

Sam Hocevar's avatar
Sam Hocevar committed
135
ifneq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
136
137
	# Hackety hackety hack
	if test ! -d CVS; then \
Sam Hocevar's avatar
Sam Hocevar committed
138
139
140
141
142
143
	  cd extras/ffmpeg/libavcodec \
	  && $(MAKE) clean \
	  && rm -f Makefile.pic \
	  && sed 's/^CFLAGS *=/&-fPIC -DPIC /' <Makefile >Makefile.pic \
	  && $(MAKE) -f Makefile.pic \
	  && rm -f Makefile.pic; \
144
145
146
147
	fi

	# HACKETY HACKETY HACK
	if test ! -d CVS; then \
Sam Hocevar's avatar
Sam Hocevar committed
148
149
150
	  cd extras/faad/libfaad \
	  && $(MAKE) clean \
	  && $(MAKE) AM_CFLAGS=-fPIC; \
151
	fi
152
153
154

	# HACK ME PLENTY MORE!!!
	if test ! -d CVS; then \
Sam Hocevar's avatar
Sam Hocevar committed
155
156
157
	  cd extras/mpeg2dec/libmpeg2 \
	  && $(MAKE) clean \
	  && $(MAKE) LIBMPEG2_CFLAGS=-fPIC; \
158
	fi
159
160
161
endif

	# Build all the rest, with the PIC libs
162
163
164
165
166
167
168
	$(MAKE)

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
Sam Hocevar's avatar
Sam Hocevar committed
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
178
179
	# Check that we have an mpeg2dec tree in here (can be a symlink)
	test -d extras/mpeg2dec
	-if test ! -d CVS; then cd extras/mpeg2dec && $(MAKE) distclean; fi
180

181
182
183
	# Remove spurious autotools stuff
	rm -f config.log confdefs.h

184
185
186
187
188
189
190
191
192
193
	-$(MAKE) distclean

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

Sam Hocevar's avatar
   
Sam Hocevar committed
194
	DESTDIR=`pwd`/debian/vlc/ $(MAKE) install prefix=/usr
195

196
197
	# Package: vlc
	mv debian/vlc/$(VIDDIR)/vlc48x48.png debian/vlc/$(PIXDIR)/vlc.png
198
	mv debian/vlc/$(VIDDIR)/vlc32x32.xpm debian/vlc/$(VIDDIR)/vlc.xpm
199
200
	cp debian/gvlc.desktop debian/gvlc/$(GNOMEDIR)
	cp debian/gnome-vlc.desktop debian/gnome-vlc/$(GNOMEDIR)
201

202
203
204
	cp doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc
	strfile doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc.dat

205
	# Package: libvlc0-dev
206
207
	mv debian/vlc/usr/bin/vlc-config debian/libvlc0-dev/usr/bin/
	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
210
	mv debian/vlc/usr/include/vlc/*.h debian/libvlc0-dev/usr/include/vlc/
	rm -Rf debian/vlc/usr/include
211
212
	ln -s vlc debian/libvlc0-dev/usr/share/doc/libvlc0-dev

213
	# Package: gnome-vlc
Sam Hocevar's avatar
Sam Hocevar committed
214
215
	mv debian/vlc/usr/bin/gnome-vlc debian/gnome-vlc/usr/bin/
	ln -s vlc debian/gnome-vlc/usr/share/doc/gnome-vlc
216
	mv debian/vlc/usr/lib/vlc/misc/libgnome_main_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
217
	  debian/gnome-vlc/usr/lib/vlc/gui/
218
	mv debian/vlc/usr/lib/vlc/gui/libgnome_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
219
	  debian/gnome-vlc/usr/lib/vlc/gui/
Sam Hocevar's avatar
Sam Hocevar committed
220
	ln -s vlc.1.gz debian/gnome-vlc/usr/share/man/man1/gnome-vlc.1.gz
221
222
223
	mv debian/vlc/$(VIDDIR)/gnome-vlc32x32.xpm debian/gnome-vlc/$(VIDDIR)/gnome-vlc.xpm
	mv debian/vlc/$(VIDDIR)/gnome-vlc48x48.png debian/gnome-vlc/$(PIXDIR)/gnome-vlc.png

224
	# Package: vlc-gnome
225
226
227
	mkdir -p debian/vlc-gnome/usr/share/doc/
	ln -s vlc debian/vlc-gnome/usr/share/doc/vlc-gnome

228
229
230
	# Package: gvlc
	mv debian/vlc/usr/bin/gvlc debian/gvlc/usr/bin/
	ln -s vlc debian/gvlc/usr/share/doc/gvlc
231
	mv debian/vlc/usr/lib/vlc/misc/libgtk_main_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
232
	  debian/gvlc/usr/lib/vlc/gui/
233
	mv debian/vlc/usr/lib/vlc/gui/libgtk_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
234
	  debian/gvlc/usr/lib/vlc/gui/
235
	mv debian/vlc/usr/lib/vlc/gui/libfamiliar_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
236
	  debian/gvlc/usr/lib/vlc/gui/
237
238
239
	ln -s vlc.1.gz debian/gvlc/usr/share/man/man1/gvlc.1.gz
	mv debian/vlc/$(VIDDIR)/gvlc32x32.xpm debian/gvlc/$(VIDDIR)/gvlc.xpm
	mv debian/vlc/$(VIDDIR)/gvlc48x48.png debian/gvlc/$(PIXDIR)/gvlc.png
Sam Hocevar's avatar
Sam Hocevar committed
240

241
	# Package: vlc-gtk
242
243
244
	mkdir -p debian/vlc-gtk/usr/share/doc/
	ln -s vlc debian/vlc-gtk/usr/share/doc/vlc-gtk

245
246
	# Package: vlc-plugin-esd
	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 \
Sam Hocevar's avatar
Sam Hocevar committed
248
	  debian/vlc-plugin-esd/usr/lib/vlc/audio_output/
249

250
	# Package: vlc-esd
251
252
253
	mkdir -p debian/vlc-esd/usr/share/doc/
	ln -s vlc debian/vlc-esd/usr/share/doc/vlc-esd

254
255
	# Package: vlc-plugin-alsa
	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 \
Sam Hocevar's avatar
Sam Hocevar committed
257
	  debian/vlc-plugin-alsa/usr/lib/vlc/audio_output/
258

259
	# Package: vlc-alsa
260
261
262
	mkdir -p debian/vlc-alsa/usr/share/doc/
	ln -s vlc debian/vlc-alsa/usr/share/doc/vlc-alsa

263
264
	# Package: vlc-plugin-sdl
	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 \
Sam Hocevar's avatar
Sam Hocevar committed
266
	  debian/vlc-plugin-sdl/usr/lib/vlc/audio_output/
267
	mv debian/vlc/usr/lib/vlc/video_output/libvout_sdl_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
268
	  debian/vlc-plugin-sdl/usr/lib/vlc/video_output/
269

270
	# Package: vlc-sdl
271
272
273
	mkdir -p debian/vlc-sdl/usr/share/doc/
	ln -s vlc debian/vlc-sdl/usr/share/doc/vlc-sdl

274
275
	# Package: vlc-plugin-ggi
	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 \
Sam Hocevar's avatar
Sam Hocevar committed
277
	  debian/vlc-plugin-ggi/usr/lib/vlc/video_output/
278

279
	# Package: vlc-ggi
280
281
282
	mkdir -p debian/vlc-ggi/usr/share/doc/
	ln -s vlc debian/vlc-ggi/usr/share/doc/vlc-ggi

283
	# Package: vlc-plugin-glide
Sam Hocevar's avatar
Sam Hocevar committed
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 \
Sam Hocevar's avatar
Sam Hocevar committed
287
	  debian/vlc-plugin-glide/usr/lib/vlc/video_output/
288

289
	# Package: vlc-glide
290
291
	mkdir -p debian/vlc-glide/usr/share/doc/
	ln -s vlc debian/vlc-glide/usr/share/doc/vlc-glide
292
293
294
endif

	# Package: qvlc
Sam Hocevar's avatar
Sam Hocevar committed
295
296
	mv debian/vlc/usr/bin/qvlc debian/qvlc/usr/bin/
	ln -s vlc debian/qvlc/usr/share/doc/qvlc
297
	mv debian/vlc/usr/lib/vlc/gui/libqt_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
298
	  debian/qvlc/usr/lib/vlc/gui/
Sam Hocevar's avatar
Sam Hocevar committed
299
	ln -s vlc.1.gz debian/qvlc/usr/share/man/man1/qvlc.1.gz
300
301
302
	mv debian/vlc/$(VIDDIR)/qvlc32x32.xpm debian/qvlc/$(VIDDIR)/qvlc.xpm
	mv debian/vlc/$(VIDDIR)/qvlc48x48.png debian/qvlc/$(PIXDIR)/qvlc.png

303
	# Package: vlc-qt
304
305
306
	mkdir -p debian/vlc-qt/usr/share/doc/
	ln -s vlc debian/vlc-qt/usr/share/doc/vlc-qt

307
308
	# Package: vlc-plugin-arts
	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 \
Sam Hocevar's avatar
Sam Hocevar committed
310
	  debian/vlc-plugin-arts/usr/lib/vlc/audio_output/
311
312
313
314
315
316

	# Package: mozilla-plugin-vlc
	ln -s vlc debian/mozilla-plugin-vlc/usr/share/doc/mozilla-plugin-vlc
	mv debian/vlc/usr/lib/mozilla debian/mozilla-plugin-vlc/usr/lib

	# Package: kvlc
Sam Hocevar's avatar
Sam Hocevar committed
317
318
	mv debian/vlc/usr/bin/kvlc debian/kvlc/usr/bin/
	ln -s vlc debian/kvlc/usr/share/doc/kvlc
319
	mv debian/vlc/usr/lib/vlc/gui/libkde_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
320
	  debian/kvlc/usr/lib/vlc/gui/
321
	mv debian/vlc/usr/share/vlc/ui.rc \
Sam Hocevar's avatar
Sam Hocevar committed
322
	  debian/kvlc/usr/share/vlc
Sam Hocevar's avatar
Sam Hocevar committed
323
324
325
	ln -s vlc.1.gz debian/kvlc/usr/share/man/man1/kvlc.1.gz
	mv debian/vlc/$(VIDDIR)/kvlc32x32.xpm debian/kvlc/$(VIDDIR)/kvlc.xpm
	mv debian/vlc/$(VIDDIR)/kvlc48x48.png debian/kvlc/$(PIXDIR)/kvlc.png
Sam Hocevar's avatar
   
Sam Hocevar committed
326

327
	# Package: vlc-plugin-svgalib
Sam Hocevar's avatar
Sam Hocevar committed
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 \
Sam Hocevar's avatar
Sam Hocevar committed
331
	  debian/vlc-plugin-svgalib/usr/lib/vlc/video_output
332
endif
333

334
335
336
337
	# Package: wxvlc
	mv debian/vlc/usr/bin/wxvlc debian/wxvlc/usr/bin/
	ln -s vlc debian/wxvlc/usr/share/doc/wxvlc
	mv debian/vlc/usr/lib/vlc/gui/libwxwindows_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
338
339
340
341
342
	  debian/wxvlc/usr/lib/vlc/gui/
	mv debian/vlc/usr/lib/vlc/gui/libskins_plugin.so \
	  debian/wxvlc/usr/lib/vlc/gui/
	mv debian/vlc/usr/share/vlc/skins \
	  debian/wxvlc/usr/share/vlc/
343
344
	ln -s vlc.1.gz debian/wxvlc/usr/share/man/man1/wxvlc.1.gz

345
346
	# Clean up
	rm -f debian/vlc/$(VIDDIR)/*.png
Sam Hocevar's avatar
   
Sam Hocevar committed
347
348

	#gzip -9 < doc/vlc.1 >| debian/vlc/usr/share/man/man1/vlc.1.gz
Sam Hocevar's avatar
   
Sam Hocevar committed
349

350
351
352
353
354
355
356
357
358
359
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
#	dh_testversion
	dh_testdir
	dh_testroot
#	dh_installdebconf	
360
	dh_installdocs -p vlc
Sam Hocevar's avatar
   
Sam Hocevar committed
361
#	dh_installexamples
Sam Hocevar's avatar
Sam Hocevar committed
362
363
	dh_installmenu -s
	dh_installmime -s
364
365
	dh_installman doc/vlc.1 -p vlc
	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
Sam Hocevar's avatar
Sam Hocevar committed
368
	for x in doc/ChangeLog-* ; do cp "doc/ChangeLog-$${x\#*/\#*-}" "debian/vlc/usr/share/doc/vlc/changelog-$$x\#*/\#*-}" ; done
369
	cp debian/changelog debian/vlc/usr/share/doc/vlc/changelog.Debian
Sam Hocevar's avatar
Sam Hocevar committed
370
371
372
373
374
375
	dh_link -s
	dh_strip -s
	dh_compress -s
	dh_fixperms -s
	dh_makeshlibs -s
	dh_installdeb -s
376
#	dh_perl
Sam Hocevar's avatar
Sam Hocevar committed
377
378
379
380
	dh_shlibdeps -s
	dh_gencontrol -s
	dh_md5sums -s
	dh_builddeb -s
381
382
383

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
Sam Hocevar's avatar
   
Sam Hocevar committed
384