rules 11.2 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 \
Sam Hocevar's avatar
Sam Hocevar committed
48
	--enable-v4l \
49 50 51
	$(NULL)

# These ones are currently shipped with VLC
52 53
CONFIG_FLAGS += --enable-ffmpeg --with-ffmpeg-tree=extras/ffmpeg
CONFIG_FLAGS += --enable-faad --with-faad-tree=extras/faad
54
CONFIG_FLAGS += --enable-libmpeg2 --with-libmpeg2-tree=extras/mpeg2dec
55 56

# Glide is only for x86
Sam Hocevar's avatar
Sam Hocevar committed
57
ifeq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
58
CONFIG_FLAGS += --enable-glide
59
CONFIG_FLAGS += --enable-svgalib
60 61
endif

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

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

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

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

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

	# Check that we have an faad tree in here (can be a symlink)
	test -d extras/faad
96
	if test ! -d CVS; then \
Sam Hocevar's avatar
Sam Hocevar committed
97 98 99 100 101 102 103 104 105
	  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); \
106
	fi
107

108 109 110
	# 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
111 112 113 114 115 116 117 118 119 120
	  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); \
121 122
	fi

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

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

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

133
	# Build only VLC, with the non-PIC libs
134
	$(MAKE) include/vlc_symbols.h
135
	cd modules && AM_MAKEFLAGS='plugin=no pic=no' $(MAKE)
136 137
	$(MAKE) vlc

Sam Hocevar's avatar
Sam Hocevar committed
138
ifneq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
139 140
	# Hackety hackety hack
	if test ! -d CVS; then \
Sam Hocevar's avatar
Sam Hocevar committed
141 142 143 144 145 146
	  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; \
147 148 149 150
	fi

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

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

	# Build all the rest, with the PIC libs
165
	AM_MAKEFLAGS='builtin=no' $(MAKE)
166 167 168 169 170 171

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
Sam Hocevar's avatar
Sam Hocevar committed
172
	rm -f configure-stamp build-stamp
173

174
	# Check that we have an ffmpeg tree in here (can be a symlink)
175
	test -d extras/ffmpeg
176
	-if test ! -d CVS; then cd extras/ffmpeg && $(MAKE) distclean; fi
177
	# Check that we have an faad tree in here (can be a symlink)
178
	test -d extras/faad
179
	-if test ! -d CVS; then cd extras/faad && $(MAKE) distclean; fi
180 181 182
	# 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
183

184 185 186
	# Remove spurious autotools stuff
	rm -f config.log confdefs.h

187 188 189 190 191 192 193 194 195 196
	-$(MAKE) distclean

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

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

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

205 206 207
	cp doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc
	strfile doc/fortunes.txt debian/vlc/usr/share/games/fortunes/vlc.dat

208
	# Package: libvlc0-dev
209 210
	mv debian/vlc/usr/bin/vlc-config debian/libvlc0-dev/usr/bin/
	mv debian/vlc/usr/lib/*.a debian/libvlc0-dev/usr/lib/
211
	mv debian/vlc/usr/lib/vlc/*.a debian/libvlc0-dev/usr/lib/vlc/
212 213
	mv debian/vlc/usr/include/vlc/*.h debian/libvlc0-dev/usr/include/vlc/
	rm -Rf debian/vlc/usr/include
214 215
	ln -s vlc debian/libvlc0-dev/usr/share/doc/libvlc0-dev

216
	# Package: gnome-vlc
Sam Hocevar's avatar
Sam Hocevar committed
217 218
	mv debian/vlc/usr/bin/gnome-vlc debian/gnome-vlc/usr/bin/
	ln -s vlc debian/gnome-vlc/usr/share/doc/gnome-vlc
219
	mv debian/vlc/usr/lib/vlc/misc/libgnome_main_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
220
	  debian/gnome-vlc/usr/lib/vlc/gui/
221
	mv debian/vlc/usr/lib/vlc/gui/libgnome_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
222
	  debian/gnome-vlc/usr/lib/vlc/gui/
Sam Hocevar's avatar
Sam Hocevar committed
223
	ln -s vlc.1.gz debian/gnome-vlc/usr/share/man/man1/gnome-vlc.1.gz
224 225 226
	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

227
	# Package: vlc-gnome
228 229 230
	mkdir -p debian/vlc-gnome/usr/share/doc/
	ln -s vlc debian/vlc-gnome/usr/share/doc/vlc-gnome

231 232 233
	# Package: gvlc
	mv debian/vlc/usr/bin/gvlc debian/gvlc/usr/bin/
	ln -s vlc debian/gvlc/usr/share/doc/gvlc
234
	mv debian/vlc/usr/lib/vlc/misc/libgtk_main_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
235
	  debian/gvlc/usr/lib/vlc/gui/
236
	mv debian/vlc/usr/lib/vlc/gui/libgtk_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
237
	  debian/gvlc/usr/lib/vlc/gui/
238
	mv debian/vlc/usr/lib/vlc/gui/libfamiliar_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
239
	  debian/gvlc/usr/lib/vlc/gui/
240 241 242
	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
243

244
	# Package: vlc-gtk
245 246 247
	mkdir -p debian/vlc-gtk/usr/share/doc/
	ln -s vlc debian/vlc-gtk/usr/share/doc/vlc-gtk

248 249
	# Package: vlc-plugin-esd
	ln -s vlc debian/vlc-plugin-esd/usr/share/doc/vlc-plugin-esd
250
	mv debian/vlc/usr/lib/vlc/audio_output/libesd_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
251
	  debian/vlc-plugin-esd/usr/lib/vlc/audio_output/
252

253
	# Package: vlc-esd
254 255 256
	mkdir -p debian/vlc-esd/usr/share/doc/
	ln -s vlc debian/vlc-esd/usr/share/doc/vlc-esd

257 258
	# Package: vlc-plugin-alsa
	ln -s vlc debian/vlc-plugin-alsa/usr/share/doc/vlc-plugin-alsa
259
	mv debian/vlc/usr/lib/vlc/audio_output/libalsa_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
260
	  debian/vlc-plugin-alsa/usr/lib/vlc/audio_output/
261

262
	# Package: vlc-alsa
263 264 265
	mkdir -p debian/vlc-alsa/usr/share/doc/
	ln -s vlc debian/vlc-alsa/usr/share/doc/vlc-alsa

266 267
	# Package: vlc-plugin-sdl
	ln -s vlc debian/vlc-plugin-sdl/usr/share/doc/vlc-plugin-sdl
268
	mv debian/vlc/usr/lib/vlc/audio_output/libaout_sdl_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
269
	  debian/vlc-plugin-sdl/usr/lib/vlc/audio_output/
270
	mv debian/vlc/usr/lib/vlc/video_output/libvout_sdl_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
271
	  debian/vlc-plugin-sdl/usr/lib/vlc/video_output/
272

273
	# Package: vlc-sdl
274 275 276
	mkdir -p debian/vlc-sdl/usr/share/doc/
	ln -s vlc debian/vlc-sdl/usr/share/doc/vlc-sdl

277 278
	# Package: vlc-plugin-ggi
	ln -s vlc debian/vlc-plugin-ggi/usr/share/doc/vlc-plugin-ggi
279
	mv debian/vlc/usr/lib/vlc/video_output/libggi_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
280
	  debian/vlc-plugin-ggi/usr/lib/vlc/video_output/
281

282
	# Package: vlc-ggi
283 284 285
	mkdir -p debian/vlc-ggi/usr/share/doc/
	ln -s vlc debian/vlc-ggi/usr/share/doc/vlc-ggi

286
	# Package: vlc-plugin-glide
Sam Hocevar's avatar
Sam Hocevar committed
287
ifeq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
288
	ln -s vlc debian/vlc-plugin-glide/usr/share/doc/vlc-plugin-glide
289
	mv debian/vlc/usr/lib/vlc/video_output/libglide_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
290
	  debian/vlc-plugin-glide/usr/lib/vlc/video_output/
291

292
	# Package: vlc-glide
293 294
	mkdir -p debian/vlc-glide/usr/share/doc/
	ln -s vlc debian/vlc-glide/usr/share/doc/vlc-glide
295 296 297
endif

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

306
	# Package: vlc-qt
307 308 309
	mkdir -p debian/vlc-qt/usr/share/doc/
	ln -s vlc debian/vlc-qt/usr/share/doc/vlc-qt

310 311
	# Package: vlc-plugin-arts
	ln -s vlc debian/vlc-plugin-arts/usr/share/doc/vlc-plugin-arts
312
	mv debian/vlc/usr/lib/vlc/audio_output/libarts_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
313
	  debian/vlc-plugin-arts/usr/lib/vlc/audio_output/
314 315 316 317 318 319

	# 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
320 321
	mv debian/vlc/usr/bin/kvlc debian/kvlc/usr/bin/
	ln -s vlc debian/kvlc/usr/share/doc/kvlc
322
	mv debian/vlc/usr/lib/vlc/gui/libkde_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
323
	  debian/kvlc/usr/lib/vlc/gui/
324
	mv debian/vlc/usr/share/vlc/ui.rc \
Sam Hocevar's avatar
Sam Hocevar committed
325
	  debian/kvlc/usr/share/vlc
Sam Hocevar's avatar
Sam Hocevar committed
326 327 328
	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
329

330
	# Package: vlc-plugin-svgalib
Sam Hocevar's avatar
Sam Hocevar committed
331
ifeq ($(shell dpkg-architecture -qDEB_BUILD_GNU_CPU),i386)
332
	ln -s vlc debian/vlc-plugin-svgalib/usr/share/doc/vlc-plugin-svgalib
333
	mv debian/vlc/usr/lib/vlc/video_output/libsvgalib_plugin.so \
Sam Hocevar's avatar
Sam Hocevar committed
334
	  debian/vlc-plugin-svgalib/usr/lib/vlc/video_output
335
endif
336

337 338 339 340
	# 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
341 342 343 344 345
	  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/
346 347
	ln -s vlc.1.gz debian/wxvlc/usr/share/man/man1/wxvlc.1.gz

348 349
	# Clean up
	rm -f debian/vlc/$(VIDDIR)/*.png
Sam Hocevar's avatar
 
Sam Hocevar committed
350 351

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

353 354 355 356 357 358 359 360 361 362
# 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	
363
	dh_installdocs -p vlc
Sam Hocevar's avatar
 
Sam Hocevar committed
364
#	dh_installexamples
Sam Hocevar's avatar
Sam Hocevar committed
365 366
	dh_installmenu -s
	dh_installmime -s
367 368
	dh_installman doc/vlc.1 -p vlc
	dh_installman doc/vlc-config.1 -p libvlc0-dev
369
#	dh_installchangelogs ChangeLog -p vlc
370
	cp ChangeLog debian/vlc/usr/share/doc/vlc/changelog
371
	for x in doc/ChangeLog-* ; do cp "doc/ChangeLog-$${x#*-}" "debian/vlc/usr/share/doc/vlc/changelog-$${x#*-}" ; done
372
	cp debian/changelog debian/vlc/usr/share/doc/vlc/changelog.Debian
Sam Hocevar's avatar
Sam Hocevar committed
373 374 375 376 377 378
	dh_link -s
	dh_strip -s
	dh_compress -s
	dh_fixperms -s
	dh_makeshlibs -s
	dh_installdeb -s
379
#	dh_perl
Sam Hocevar's avatar
Sam Hocevar committed
380 381 382 383
	dh_shlibdeps -s
	dh_gencontrol -s
	dh_md5sums -s
	dh_builddeb -s
384 385 386

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