blob: b7cf3d16a0197becbde5d5f51014017f3d3fc60c [file] [log] [blame]
Olivier Naudan46788ea2012-04-17 06:58:02 -04001#!/usr/bin/make -f
2
3include /usr/share/cdbs/1/rules/debhelper.mk
4include /usr/share/cdbs/1/class/gnome.mk
5include /usr/share/cdbs/1/rules/utils.mk
Iain Lane3bee9642014-01-09 17:56:04 +00006include /usr/share/cdbs/1/rules/autoreconf.mk
Olivier Naudan46788ea2012-04-17 06:58:02 -04007
Iain Lane3bee9642014-01-09 17:56:04 +00008DEB_DH_AUTORECONF_ARGS=--as-needed
9
Olivier Naudan46788ea2012-04-17 06:58:02 -040010CFLAGS += -Wno-error
11CXXFLAGS += -Wno-error
12LDFLAGS += -Wl,-z,defs -Wl,-O1 -Wl,--as-needed
13DEB_MAKE_CHECK_TARGET = check || true
14
15# this is for compatibility with dpkg-dev < 1.13.5, see
16# <http://lists.debian.org/debian-devel-announce/2005/06/msg00010.html>
17DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU 2>/dev/null)
18DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
19
20# Take account of old dpkg-architecture output.
21ifeq ($(DEB_HOST_ARCH_CPU),)
22 DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
23 ifeq ($(DEB_HOST_ARCH_CPU),x86_64)
24 DEB_HOST_ARCH_CPU := amd64
25 endif
26endif
27ifeq ($(DEB_HOST_ARCH_OS),)
28 DEB_HOST_ARCH_OS := $(subst -gnu,,$(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM))
29 ifeq ($(DEB_HOST_ARCH_OS),gnu)
30 DEB_HOST_ARCH_OS := hurd
31 endif
32endif
33# end of compatibility block
34
35# debian package version
36version=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
37# upstream version
38gst_version=$(shell echo $(version) | cut -d '-' -f 1)
Olivier Naudanba3d5932012-04-17 07:10:46 -040039gst_major=1
40gst_minor=0
Olivier Naudan46788ea2012-04-17 06:58:02 -040041gst_abi=$(gst_major).$(gst_minor)
42# gstreamer library package names
43gst_lib=libgstreamer$(gst_abi)-0
44gst_lib_dev=libgstreamer$(gst_abi)-dev
45# what gstreamer version is needed
Sebastian Dröge1ac574f2017-01-12 16:46:59 +020046gst_lib_dev_dep=$(gst_lib_dev) (>= 1.11.1)
Olivier Naudan46788ea2012-04-17 06:58:02 -040047
48gst_pkgname=gstreamer$(gst_abi)
49gst_deb_abi=$(gst_abi)-0
50
51gst_extra_build_depends =
52
53# The plugins are basically the same.
54# Link special names to a template file.
55# still need "*.install" to be done by hand
56#
57# EXTRA_PLUGINS: See debian/README.Debian for docs
58EXTRA_PLUGINS +=
59
60PLUGINS += plugins-ugly $(EXTRA_PLUGINS)
61ifeq ($(DEB_HOST_ARCH_OS),linux)
62PLUGINS +=
63endif
64VERSIONIZE= \
65 plugins-ugly-doc.install \
66
67# debug package
68DEB_DH_STRIP_ARGS := --dbg-package=$(gst_pkgname)-plugins-ugly-dbg
69
70
71# Let's decide the package name and url depending on the distribution
72DISTRO = "$(shell dpkg-vendor --query vendor)"
73
74GST_PACKAGE_NAME := "GStreamer Ugly Plugins (unknown Debian derivative)"
75GST_PACKAGE_ORIGIN="http://packages.qa.debian.org/gst-plugins-ugly$(gst_abi)"
76
77ifeq ($(DISTRO),"Debian")
78GST_PACKAGE_NAME := "GStreamer Ugly Plugins (Debian)"
79GST_PACKAGE_ORIGIN="http://packages.qa.debian.org/gst-plugins-ugly$(gst_abi)"
80endif
81
82ifeq ($(DISTRO),"Ubuntu")
83GST_PACKAGE_NAME := "GStreamer Ugly Plugins (Ubuntu)"
84GST_PACKAGE_ORIGIN="https://launchpad.net/distros/ubuntu/+source/gst-plugins-ugly$(gst_abi)"
85endif
86
87
88# setup links for packages
89pre-build::
90 for p in $(PLUGINS); do \
91 rm -f debian/$(gst_pkgname)-$$p.install; \
92 cat debian/gstreamer-$$p.install | \
93 sed 's/@GST_ABI@/$(gst_abi)/g' \
94 > debian/$(gst_pkgname)-$$p.install; \
95 done
96
97 for f in $(VERSIONIZE); do \
98 cat debian/gstreamer-$$f | \
99 sed 's/@GST_ABI@/$(gst_abi)/g' \
100 > debian/$(gst_pkgname)-$$f; \
101 done
102
103maint: debian/control
104
105debian/build-deps: debian/build-deps.in debian/rules
106 cat $< > $@
107 for plugin in $(EXTRA_PLUGINS) ; do \
108 sh debian/extra deps $$plugin >> $@; \
109 done
110 sort $@ -o $@
111
112debian/control:: debian/control.in debian/build-deps debian/mk.control debian/rules
113 perl debian/mk.control | \
114 sed -e 's/@GST_VERSION@/$(gst_version)/g' \
115 -e 's/@GST_ABI@/$(gst_abi)/g' \
116 -e 's/@GST_PKGNAME@/$(gst_pkgname)/g' \
117 -e 's/@GST_LIB@/$(gst_lib)/g' \
118 -e 's/@GST_LIB_DEV@/$(gst_lib_dev)/g' \
119 -e 's/@GST_LIB_DEV_DEP@/$(gst_lib_dev_dep)/g' \
120 -e 's/@GST_EXTRA_BUILD_DEPENDS@/$(gst_extra_build_depends)/g' \
121 -e '/^Build-Depends\(-Indep\)\?/s/,\( *,\)*/,/g' \
122 -e '/^Build-Depends\(-Indep\)\?/s/\ *,\ */,\n /g' \
123 >$@
124 for plugin in $(EXTRA_PLUGINS) ; do \
125 sh debian/extra control $$plugin | \
126 sed 's/@GST_ABI@/$(gst_abi)/g' | \
127 sed 's/@GST_PKGNAME@/$(gst_pkgname)/g' | \
128 sed 's/@GST_LIB@/$(gst_lib)/g' | \
129 sed 's/@GST_LIB_DEV@/$(gst_lib_dev)/g' | \
130 sed 's/@GST_LIB_DEV_DEP@/$(gst_lib_dev_dep)/g' | \
131 sed 's/@GST_PLUGINS_LIB@/$(gst_plugins_lib)/g' | \
132 sed 's/@GST_PLUGINS_LIB_DEV@/$(gst_plugins_lib_dev)/g' | \
133 sed 's/@GST_PLUGINS_LIB_DEV_DEP@/$(gst_plugins_lib_dev_dep)/g' | \
134 sed 's/@GST_GCONF_LIB@/$(gst_gconf_lib)/g' | \
135 sed 's/@GST_GCONF_LIB_DEV@/$(gst_gconf_lib_dev)/g' | \
136 sed 's/@GST_GCONF_LIB_DEV_DEP@/$(gst_gconf_lib_dev_dep)/g' >> $@; \
137 done
138
Sebastian Dröge1ac574f2017-01-12 16:46:59 +0200139space :=
140space +=
141X264_LIBRARY_PATHS := $(patsubst $(space),:,$(wildcard /usr/lib/*/x264-10bit/libx264.so.*))
Olivier Naudan46788ea2012-04-17 06:58:02 -0400142
143DEB_CONFIGURE_EXTRA_FLAGS += \
144 --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
145 --disable-examples \
146 --enable-DEBUG \
147 --enable-debug \
148 --with-package-name=$(GST_PACKAGE_NAME) \
Sebastian Dröge1ac574f2017-01-12 16:46:59 +0200149 --with-package-origin=$(GST_PACKAGE_ORIGIN) \
150 --with-x264-libraries=$(X264_LIBRARY_PATHS)
Olivier Naudan46788ea2012-04-17 06:58:02 -0400151
152# only build the docs on arches which can
153ifeq (,$(findstring $(DEB_HOST_ARCH),m68k arm))
154DEB_CONFIGURE_EXTRA_FLAGS += --enable-gtk-doc
155endif
156
157
158clean::
159 # get rid of the sym links
160 for i in $(PLUGINS); do \
161 rm -f debian/$(gst_pkgname)-$$i.install; \
162 rm -f debian/$(gst_pkgname)-$$i.preinst; \
163 done
164 for f in $(VERSIONIZE); do \
165 rm -f debian/$(gst_pkgname)-$$f; \
166 done
167
168common-binary-fixup-arch::
169 dh_gstscancodecs
170
171DEB_INSTALL_DOCS_ALL += debian/README.Debian NEWS
172
173# Disable inclusion of large upstream ChangeLog
174DEB_INSTALL_CHANGELOGS_ALL :=
175
176.PHONY: maint