aboutsummaryrefslogtreecommitdiff
path: root/debian/rules
blob: 0777da11cf08956a87b32f37142d9fe6a89255fe (plain)
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
#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/gnome.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/rules/autoreconf.mk
include /usr/share/gnome-pkg-tools/1/rules/clean-la.mk

export HOME=$(CURDIR)/fake-home

DEB_DH_AUTORECONF_ARGS += --as-needed

# make autoreconf not call autopoint since we ship a patch for po/Makefile.in.in
export AUTOPOINT=true

CFLAGS += -Wno-error
CXXFLAGS += -Wno-error
LDFLAGS += -Wl,-z,defs -Wl,-O1 -Wl,--as-needed
DEB_MAKE_CHECK_TARGET = check || true

# upstream version with epoch
gst_version := $(shell dpkg-parsechangelog | sed -n 's/Version: //p' | cut -d '-' -f 1)
gst_major := 1
gst_minor := 0
gst_abi := $(gst_major).$(gst_minor)
# gstreamer library package names
gst_lib := libgstreamer$(gst_abi)-0
gst_lib_dev := libgstreamer$(gst_abi)-dev
# what gstreamer version is needed
gst_lib_dev_dep := $(gst_lib_dev) (>= 1.3.2)

gst_pkgname := gstreamer$(gst_abi)
gst_deb_abi := $(gst_abi)-0

# gst-plugins-base library package names
gst_plugins_base_lib := libgstreamer-plugins-base$(gst_deb_abi)
gst_plugins_base_lib_dev := libgstreamer-plugins-base$(gst_abi)-dev
# gst-plugins-base library shlibs
gst_plugins_base_lib_dep := "$(gst_plugins_base_lib) (>= $(gst_version))"

gst_extra_build_depends += libasound2-dev (>= 0.9.0) [linux-any]
gst_extra_build_depends += , libgudev-1.0-dev (>= 143) [linux-any]

# debug package
DEB_DH_STRIP_ARGS += --dbg-package=$(gst_pkgname)-plugins-base-dbg

DEB_COMPRESS_EXCLUDE = .sgml .devhelp .ps .pdf

# disable all CPU specific optimizations in commands launched by this Makefile
# using liboil; this is to work around liboil related build failures which
# are not specially interesting to catch on buildds as these might run very
# specific hardware
OIL_CPU_FLAGS := 0
export OIL_CPU_FLAGS

# The plugins are basically the same.
# Link special names to a template file.
# still need "*.install" to be done by hand

PLUGINS += plugins-base x
ifeq ($(DEB_HOST_ARCH_OS),linux)
PLUGINS += alsa
endif
VERSIONIZE += \
	plugins-base-apps.install \
	plugins-base-apps.manpages \
	plugins-base-doc.install \

ifneq ($(DEB_HOST_ARCH_OS),hurd)
cdparanoia := debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/gstreamer-$(gst_abi)/libgstcdparanoia.so
endif

# Let's decide the package name and url depending on the distribution
DISTRO = "$(shell dpkg-vendor --query vendor)"

GST_PACKAGE_NAME := "GStreamer Base Plugins (unknown Debian derivative)"
GST_PACKAGE_ORIGIN="http://packages.qa.debian.org/gst-plugins-base$(gst_abi)"

ifeq ($(DISTRO),"Debian")
GST_PACKAGE_NAME := "GStreamer Base Plugins (Debian)"
GST_PACKAGE_ORIGIN="http://packages.qa.debian.org/gst-plugins-base$(gst_abi)"
endif

ifeq ($(DISTRO),"Ubuntu")
GST_PACKAGE_NAME := "GStreamer Base Plugins (Ubuntu)"
GST_PACKAGE_ORIGIN="https://launchpad.net/distros/ubuntu/+source/gst-plugins-base$(gst_abi)"
endif


# setup links for packages
pre-build::
	for p in $(PLUGINS); do \
		rm -f debian/$(gst_pkgname)-$$p.install; \
		sed \
			-e 's/@GST_ABI@/$(gst_abi)/g' \
			-e 's,@cdparanoia@,$(cdparanoia),g' \
			debian/gstreamer-$$p.install \
			>debian/$(gst_pkgname)-$$p.install; \
	done
	for f in $(VERSIONIZE); do \
		sed 's/@GST_ABI@/$(gst_abi)/g' debian/gstreamer-$$f \
			>debian/$(gst_pkgname)-$$f; \
	done
	rm -f debian/gir1.2-gst-plugins-base-$(gst_abi).install
	cp debian/gir1.2-gst-plugins-base.install \
		debian/gir1.2-gst-plugins-base-$(gst_abi).install
	rm -f debian/libgstreamer-plugins-base$(gst_deb_abi).install
	sed 's/@GST_ABI@/$(gst_abi)/g' \
		debian/libgstreamer-plugins-base.install \
		>debian/libgstreamer-plugins-base$(gst_deb_abi).install
	rm -f debian/libgstreamer-plugins-base$(gst_deb_abi).symbols
	cp debian/libgstreamer-plugins-base.symbols \
		debian/libgstreamer-plugins-base$(gst_deb_abi).symbols
	rm -f debian/libgstreamer-plugins-base$(gst_abi)-dev.install
	sed 's/@GST_ABI@/$(gst_abi)/g' \
		debian/libgstreamer-plugins-base-dev.install \
		>debian/libgstreamer-plugins-base$(gst_abi)-dev.install

maint: debian/control

debian/build-deps: debian/build-deps.in debian/rules
	cat $< >$@

debian/control:: debian/control.in debian/build-deps debian/mk.control debian/rules debian/changelog force
	perl debian/mk.control | sed \
		-e 's/@GST_VERSION@/$(gst_version)/g' \
		-e 's/@GST_ABI@/$(gst_abi)/g' \
		-e 's/@GST_PKGNAME@/$(gst_pkgname)/g' \
		-e 's/@GST_LIB@/$(gst_lib)/g' \
		-e 's/@GST_LIB_DEV@/$(gst_lib_dev)/g' \
		-e 's/@GST_LIB_DEV_DEP@/$(gst_lib_dev_dep)/g' \
		-e 's/@GST_PLUGINS_BASE_LIB@/$(gst_plugins_base_lib)/g' \
		-e 's/@GST_PLUGINS_BASE_LIB_DEV@/$(gst_plugins_base_lib_dev)/g' \
		-e 's/@GST_EXTRA_BUILD_DEPENDS@/$(gst_extra_build_depends)/g' \
		>$@

DEB_CONFIGURE_EXTRA_FLAGS += \
	--disable-failing-tests \
	--disable-examples \
	--enable-DEBUG \
	--enable-debug \
	--enable-experimental \
	--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
	--with-package-name=$(GST_PACKAGE_NAME) \
	--with-package-origin=$(GST_PACKAGE_ORIGIN) \
	--with-install-plugins-helper="/usr/bin/gstreamer-codec-install"

# only build the docs if gtk-doc-tools is installed, i.e. binary-indep is called
ifeq ($(shell test "`dpkg -l gtk-doc-tools | grep ^ii`" && echo binary-indep),binary-indep)
DEB_CONFIGURE_EXTRA_FLAGS += --enable-gtk-doc
endif

clean::
	# get rid of the symlinks
	for i in $(PLUGINS); do \
		rm -f debian/$(gst_pkgname)-$$i.install; \
		rm -f debian/$(gst_pkgname)-$$i.preinst; \
	done
	for f in $(VERSIONIZE); do \
		rm -f debian/$(gst_pkgname)-$$f; \
	done
	rm -f debian/gir1.2-gst-plugins-base-$(gst_abi).install
	rm -f debian/libgstreamer-plugins-base$(gst_deb_abi).install
	rm -f debian/libgstreamer-plugins-base$(gst_deb_abi).symbols
	rm -f debian/libgstreamer-plugins-base$(gst_abi)-dev.install
	-rm -rf $(CURDIR)/fake-home

binary-post-install/$(gst_pkgname)-plugins-base-apps::
	dh_perl -d

DEB_DH_MAKESHLIBS_ARGS_$(gst_plugins_base_lib) += -X "/usr/lib/$(DEB_HOST_MULTIARCH)/gstreamer-$(gst_abi)" -V $(gst_plugins_base_lib_dep) -- -c4
DEB_INSTALL_DOCS_ALL += debian/README.Debian NEWS
DEB_SHLIBDEPS_INCLUDE += debian/libgstreamer-plugins-base$(gst_deb_abi)/usr/lib/$(DEB_HOST_MULTIARCH)
# Disable inclusion of large upstream ChangeLog
DEB_INSTALL_CHANGELOGS_ALL :=

# override shlibs for libraries from this source before computing dependencies
# of packages generated from this source; we already have inter-dependencies
# expressed manually in the control file, we do not need the shlibs to add
# duplicates
# (this rule runs just before the dh_shlibdeps)
common-binary-fixup-arch::
	mkdir -p $(CURDIR)/fake-home
	HOME=$(CURDIR)/fake-home \
	LD_LIBRARY_PATH=debian/libgstreamer-plugins-base$(gst_deb_abi)/usr/lib/$(DEB_HOST_MULTIARCH):$(LD_LIBRARY_PATH) \
	    dh_gstscancodecs
	HOME=$(CURDIR)/fake-home \
	dh_girepository -pgir1.2-gst-plugins-base-$(gst_abi)
	-rm -f debian/shlibs.local
	rm -rf $(CURDIR)/fake-home
	sed -n -r -e 's/(([^ ]+: )?([^ ]+) ([^ ]+)) .*/\1/p' \
		debian/*/DEBIAN/shlibs \
		>debian/shlibs.local

# (this rules runs just after the dh_shlibdeps)
common-binary-predeb-arch::
	-rm -f debian/shlibs.local

force:

.PHONY: maint force