Olivier Naudan | 46788ea | 2012-04-17 06:58:02 -0400 | [diff] [blame] | 1 | #!/usr/bin/make -f |
| 2 | |
| 3 | include /usr/share/cdbs/1/rules/debhelper.mk |
| 4 | include /usr/share/cdbs/1/class/gnome.mk |
| 5 | include /usr/share/cdbs/1/rules/utils.mk |
Iain Lane | 3bee964 | 2014-01-09 17:56:04 +0000 | [diff] [blame] | 6 | include /usr/share/cdbs/1/rules/autoreconf.mk |
Olivier Naudan | 46788ea | 2012-04-17 06:58:02 -0400 | [diff] [blame] | 7 | |
Iain Lane | 3bee964 | 2014-01-09 17:56:04 +0000 | [diff] [blame] | 8 | DEB_DH_AUTORECONF_ARGS=--as-needed |
| 9 | |
Olivier Naudan | 46788ea | 2012-04-17 06:58:02 -0400 | [diff] [blame] | 10 | CFLAGS += -Wno-error |
| 11 | CXXFLAGS += -Wno-error |
| 12 | LDFLAGS += -Wl,-z,defs -Wl,-O1 -Wl,--as-needed |
| 13 | DEB_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> |
| 17 | DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU 2>/dev/null) |
| 18 | DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null) |
| 19 | |
| 20 | # Take account of old dpkg-architecture output. |
| 21 | ifeq ($(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 |
| 26 | endif |
| 27 | ifeq ($(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 |
| 32 | endif |
| 33 | # end of compatibility block |
| 34 | |
| 35 | # debian package version |
| 36 | version=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2) |
| 37 | # upstream version |
| 38 | gst_version=$(shell echo $(version) | cut -d '-' -f 1) |
Olivier Naudan | ba3d593 | 2012-04-17 07:10:46 -0400 | [diff] [blame] | 39 | gst_major=1 |
| 40 | gst_minor=0 |
Olivier Naudan | 46788ea | 2012-04-17 06:58:02 -0400 | [diff] [blame] | 41 | gst_abi=$(gst_major).$(gst_minor) |
| 42 | # gstreamer library package names |
| 43 | gst_lib=libgstreamer$(gst_abi)-0 |
| 44 | gst_lib_dev=libgstreamer$(gst_abi)-dev |
| 45 | # what gstreamer version is needed |
Sebastian Dröge | 1ac574f | 2017-01-12 16:46:59 +0200 | [diff] [blame] | 46 | gst_lib_dev_dep=$(gst_lib_dev) (>= 1.11.1) |
Olivier Naudan | 46788ea | 2012-04-17 06:58:02 -0400 | [diff] [blame] | 47 | |
| 48 | gst_pkgname=gstreamer$(gst_abi) |
| 49 | gst_deb_abi=$(gst_abi)-0 |
| 50 | |
| 51 | gst_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 |
| 58 | EXTRA_PLUGINS += |
| 59 | |
| 60 | PLUGINS += plugins-ugly $(EXTRA_PLUGINS) |
| 61 | ifeq ($(DEB_HOST_ARCH_OS),linux) |
| 62 | PLUGINS += |
| 63 | endif |
| 64 | VERSIONIZE= \ |
| 65 | plugins-ugly-doc.install \ |
| 66 | |
| 67 | # debug package |
| 68 | DEB_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 |
| 72 | DISTRO = "$(shell dpkg-vendor --query vendor)" |
| 73 | |
| 74 | GST_PACKAGE_NAME := "GStreamer Ugly Plugins (unknown Debian derivative)" |
| 75 | GST_PACKAGE_ORIGIN="http://packages.qa.debian.org/gst-plugins-ugly$(gst_abi)" |
| 76 | |
| 77 | ifeq ($(DISTRO),"Debian") |
| 78 | GST_PACKAGE_NAME := "GStreamer Ugly Plugins (Debian)" |
| 79 | GST_PACKAGE_ORIGIN="http://packages.qa.debian.org/gst-plugins-ugly$(gst_abi)" |
| 80 | endif |
| 81 | |
| 82 | ifeq ($(DISTRO),"Ubuntu") |
| 83 | GST_PACKAGE_NAME := "GStreamer Ugly Plugins (Ubuntu)" |
| 84 | GST_PACKAGE_ORIGIN="https://launchpad.net/distros/ubuntu/+source/gst-plugins-ugly$(gst_abi)" |
| 85 | endif |
| 86 | |
| 87 | |
| 88 | # setup links for packages |
| 89 | pre-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 | |
| 103 | maint: debian/control |
| 104 | |
| 105 | debian/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 | |
| 112 | debian/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öge | 1ac574f | 2017-01-12 16:46:59 +0200 | [diff] [blame] | 139 | space := |
| 140 | space += |
| 141 | X264_LIBRARY_PATHS := $(patsubst $(space),:,$(wildcard /usr/lib/*/x264-10bit/libx264.so.*)) |
Olivier Naudan | 46788ea | 2012-04-17 06:58:02 -0400 | [diff] [blame] | 142 | |
| 143 | DEB_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öge | 1ac574f | 2017-01-12 16:46:59 +0200 | [diff] [blame] | 149 | --with-package-origin=$(GST_PACKAGE_ORIGIN) \ |
| 150 | --with-x264-libraries=$(X264_LIBRARY_PATHS) |
Olivier Naudan | 46788ea | 2012-04-17 06:58:02 -0400 | [diff] [blame] | 151 | |
| 152 | # only build the docs on arches which can |
| 153 | ifeq (,$(findstring $(DEB_HOST_ARCH),m68k arm)) |
| 154 | DEB_CONFIGURE_EXTRA_FLAGS += --enable-gtk-doc |
| 155 | endif |
| 156 | |
| 157 | |
| 158 | clean:: |
| 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 | |
| 168 | common-binary-fixup-arch:: |
| 169 | dh_gstscancodecs |
| 170 | |
| 171 | DEB_INSTALL_DOCS_ALL += debian/README.Debian NEWS |
| 172 | |
| 173 | # Disable inclusion of large upstream ChangeLog |
| 174 | DEB_INSTALL_CHANGELOGS_ALL := |
| 175 | |
| 176 | .PHONY: maint |