File: rules

package info (click to toggle)
xine-lib 1.1.19-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 44,660 kB
  • ctags: 77,375
  • sloc: ansic: 521,588; sh: 11,336; asm: 3,649; makefile: 2,836; objc: 828; pascal: 530; awk: 234; perl: 97; sed: 16
file content (260 lines) | stat: -rwxr-xr-x 8,126 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# adapted for xine-lib 2001 by Siggi Langauf
# rewritten for new package structure December 2006 by Reinhard Tartler

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

BINARY_ANY_PACKAGES=$(shell dh_listpackages -a)
BINARY_ALL_PACKAGES=$(shell dh_listpackages -i)

DEB_COMPRESS = -- -Zbzip2

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_ARCH		?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
  $(error cross compiling is not supported by xine)
endif

# predefine as empty
DEB_BUILD_CONFIG_OPTIONS :=
CFLAGS += -g

# add if we don't want optimisations
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
	DEB_BUILD_CONFIG_OPTIONS += --disable-optimizations
endif

ifeq (,$(findstring linux,$(DEB_HOST_GNU_TYPE)))
	DEB_BUILD_CONFIG_OPTIONS += --enable-libv4l
endif

ifneq (,$(findstring mips,$(DEB_HOST_GNU_TYPE)))
	DEB_BUILD_CONFIG_OPTIONS += PTHREAD_LIBS="-lpthread"
endif

# taken from the qemu package
# Support multiple makes at once
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NJOBS := $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
else
NJOBS := 1
endif

# set configure flags here
CONFIGURE_FLAGS := \
	--build $(DEB_BUILD_GNU_TYPE) \
	--host $(DEB_HOST_GNU_TYPE) \
	--prefix=/usr \
	--mandir=\$${prefix}/share/man \
	--with-external-libmad \
	--with-external-a52dec \
	--with-external-libdts \
	--with-external-ffmpeg \
	--with-external-libmpcdec \
	--with-external-dvdnav \
	--enable-ipv6 \
	--with-jack \
	--with-pulseaudio \
	--with-libflac \
	--with-wavpack \
	--with-freetype \
	--disable-vidix \
	--enable-directfb \
	--disable-nosefart \
	$(DEB_BUILD_CONFIG_OPTIONS) \
	$(DEB_EXTRA_CONFIG_FLAGS) \
	LIBMODPLUG_LIBS="$(filter-out -lstdc++ -lm,$(shell pkg-config --libs libmodplug))" \
	CFLAGS="$(CFLAGS)"

configure: configure-stamp
configure-stamp:
	dh_testdir
	./configure $(CONFIGURE_FLAGS)
	touch $@

build: build-stamp
build-stamp: configure-stamp
	dh_testdir
	$(MAKE) -j $(NJOBS)
	touch $@

clean:
	dh_testdir
	dh_testroot
	[ ! -f Makefile ] || $(MAKE) distclean
	dh_clean build-stamp configure-stamp install-stamp po/*.gmo \
	    po/stamp-po binary-*-stamp all-files-stamp \
	    generate-arch-files-stamp \
	    debian/libxine1-bin.install.i386 \
	    debian/libxine1*.install.kfreebsd* \
	    debian/libxine1*.install.hurd* \
	    config.h config.log \
	    a.out # XXX fix the configure script to not create this

install: build install-stamp
install-stamp: generate-arch-files-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp \
	    LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib
	-(cd debian/tmp && find .) | sort -u | sed -e 's%doc/xine-lib%doc/libxine-dev%' > $@

binary-common: build install
	@echo working on package $(DH_PACKAGE)
	dh_testdir
	dh_testroot
	dh_install
	test ! -f debian/overrides/$(DH_PACKAGE) || \
	  install -Dm644 \
	       debian/overrides/$(DH_PACKAGE) \
	       debian/$(DH_PACKAGE)/usr/share/lintian/overrides/$(DH_PACKAGE)
	# mostly, we symlink docs -> libxine1-bin
	set -e; case "$(DH_PACKAGE)" in \
	    libxine1-bin|libxine-dev$(subst lib,|lib,$(BINARY_ALL_PACKAGES))) \
	      dh_installdocs; \
	      dh_installchangelogs -k ChangeLog; \
	      ;; \
	    *) \
	      mkdir -p debian/$(DH_PACKAGE)/usr/share/doc; \
	      ln -fs libxine1-bin \
	         debian/$(DH_PACKAGE)/usr/share/doc/$(DH_PACKAGE); \
	      ;; \
	  esac
	dh_installman
	dh_link
	dh_strip --dbg-package=libxine1-dbg
	dh_compress
	dh_fixperms
	dh_makeshlibs -V 'libxine1 (>= 1.1.8)'
	dh_installdeb
	dh_shlibdeps -ldebian/libxine1-bin/usr/lib
	dh_gencontrol
	dh_md5sums
	dh_builddeb		$(DEB_COMPRESS)

# special rules for the -dbg package.
binary-libxine1-dbg: build install
	@echo working on $@
	dh_testdir		-plibxine1-dbg
	dh_testroot		-plibxine1-dbg
	dh_install 		-plibxine1-dbg
	mkdir -p debian/libxine1-dbg/usr/share/doc
	ln -fs libxine1-bin debian/libxine1-dbg/usr/share/doc/libxine1-dbg
	dh_link			-plibxine1-dbg
	dh_compress 		-plibxine1-dbg
	dh_fixperms 		-plibxine1-dbg
	dh_installdeb 		-plibxine1-dbg
	dh_shlibdeps 		-plibxine1-dbg
	dh_gencontrol 		-plibxine1-dbg
	dh_md5sums 		-plibxine1-dbg
	dh_builddeb 		-plibxine1-dbg $(DEB_COMPRESS)

# Build architecture independant packages using the common target
binary-indep: build install
	set -e; for i in `dh_listpackages -i`; do \
		$(MAKE) -f debian/rules \
	             DH_OPTIONS=-p$$i DH_PACKAGE=$$i binary-common; \
	done
#	-(cd debian/libxine-dev && find .) | grep -v DEBIAN > $@-stamp

# Build architecture dependant packages using the common targets
binary-arch: build install binary-arch-stamp diff-installed-files
binary-arch-stamp: $(addprefix binary-, $(BINARY_ANY_PACKAGES))
	-cat binary-*-stamp | sort -u > $@

diff-installed-files: install-stamp binary-arch-stamp
	@echo "Comparing installed files from xine-lib Makefiles" \
	      "with files installed in packages:"
	-diff -u $^

generate-arch-files-stamp: \
		debian/libxine1-bin.install.i386 \
		debian/libxine1-bin.install.kfreebsd-i386 \
		debian/libxine1-bin.install.hurd-i386 \
		debian/libxine1-x.install.kfreebsd-i386 \
		debian/libxine1-x.install.kfreebsd-amd64 \
		debian/libxine1-x.install.hurd-i386 \
		debian/libxine1-misc-plugins.install.kfreebsd-i386 \
		debian/libxine1-misc-plugins.install.kfreebsd-amd64 \
		debian/libxine1-misc-plugins.install.hurd-i386 \
		debian/libxine1-console.install.kfreebsd-i386 \
		debian/libxine1-console.install.kfreebsd-amd64 \
		debian/libxine1-console.install.hurd-i386
	touch $@

# i386 specific plugins are also available for kfreebsd-i386
debian/libxine1-bin.install.i386: \
		debian/libxine1-bin.install \
		debian/libxine1-bin.install.i386.specific
	cat $^ >$@

debian/libxine1-bin.install.kfreebsd-i386: debian/libxine1-bin.install.i386
	ln -f $^ $@

debian/libxine1-bin.install.hurd-i386: debian/libxine1-bin.install.i386
	ln -f $^ $@

# create install files for Debian GNU/kFreeBSD i386/amd64 by dropping
# everything which is not available on those architectures.
debian/libxine1-x.install.kfreebsd-i386: debian/libxine1-x.install
	grep -v -e dxr3 -e syncfb $^ >$@

debian/libxine1-misc-plugins.install.kfreebsd-i386: debian/libxine1-misc-plugins.install
	grep -v -e dxr3 -e pvr -e v4l -e alsa $^ >$@

debian/libxine1-console.install.kfreebsd-i386: debian/libxine1-console.install
	grep -v -e out_fb $^ >$@

# create install files for Debian GNU/Hurd i386 by dropping
# everything which is not available on those architectures.
debian/libxine1-x.install.hurd-i386: debian/libxine1-x.install
	grep -v -e dxr3 -e syncfb $^ >$@

debian/libxine1-misc-plugins.install.hurd-i386: debian/libxine1-misc-plugins.install
	grep -v -e dxr3 -e pvr -e v4l -e alsa -e dvb -e vcdo $^ >$@

debian/libxine1-console.install.hurd-i386: debian/libxine1-console.install
	grep -v -e out_fb $^ >$@

debian/libxine1-%-amd64: debian/libxine1-%-i386
	ln -f $^ $@


# Any other binary targets build just one binary package at a time.
binary-%: build install
	make -f debian/rules binary-common DH_OPTIONS=-p$* DH_PACKAGE=$*
	-(cd debian/$* && find .) | grep -v DEBIAN > $@-stamp

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary-common binary install configure diff-installed-files


#run only by hand!
ifneq (,$(wildcard /usr/share/misc/config.guess))
config.guess:
	@echo updateing config.guess
	cp -f /usr/share/misc/config.guess config.guess
endif

ifneq (,$(wildcard /usr/share/misc/config.guess))
config.sub: /usr/share/misc/config.sub
	@echo updateing config.sub and config.guess
	cp -f /usr/share/misc/config.sub config.sub
endif

mq:
	mkdir -p .git/patches
	ln -fs ../debian/patches .hg/patches
	touch debian/patches/status
	QUILT_PATCHES=debian/patches quilt pop -a