DEBIAN: Debianization
[glsdk/gst-plugins-ugly0-10.git] / debian / rules
1 #!/usr/bin/make -f
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
6 -include /usr/share/cdbs/1/rules/autoreconf.mk
8 # make autoreconf not call libtoolize since we ship a patch for ltmain.sh
9 export LIBTOOLIZE=true
10 # make autoreconf not call autopoint since we ship a patch for po/Makefile.in.in
11 export AUTOPOINT=true
13 CFLAGS += -Wno-error
14 CXXFLAGS += -Wno-error
15 LDFLAGS += -Wl,-z,defs -Wl,-O1 -Wl,--as-needed
16 DEB_MAKE_CHECK_TARGET = check || true
18 # this is for compatibility with dpkg-dev < 1.13.5, see
19 # <http://lists.debian.org/debian-devel-announce/2005/06/msg00010.html>
20 DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU 2>/dev/null)
21 DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
23 # Take account of old dpkg-architecture output.
24 ifeq ($(DEB_HOST_ARCH_CPU),)
25   DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
26   ifeq ($(DEB_HOST_ARCH_CPU),x86_64)
27     DEB_HOST_ARCH_CPU := amd64
28   endif
29 endif
30 ifeq ($(DEB_HOST_ARCH_OS),)
31   DEB_HOST_ARCH_OS := $(subst -gnu,,$(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM))
32   ifeq ($(DEB_HOST_ARCH_OS),gnu)
33     DEB_HOST_ARCH_OS := hurd
34   endif
35 endif
36 # end of compatibility block
38 # debian package version
39 version=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
40 # upstream version
41 gst_version=$(shell echo $(version) | cut -d '-' -f 1)
42 gst_major=0
43 gst_minor=10
44 gst_abi=$(gst_major).$(gst_minor)
45 # gstreamer library package names
46 gst_lib=libgstreamer$(gst_abi)-0
47 gst_lib_dev=libgstreamer$(gst_abi)-dev
48 # what gstreamer version is needed
49 gst_lib_dev_dep=$(gst_lib_dev) (>= 0.10.35.2)
51 gst_pkgname=gstreamer$(gst_abi)
52 gst_deb_abi=$(gst_abi)-0
54 gst_extra_build_depends =
56 # The plugins are basically the same.
57 # Link special names to a template file.
58 # still need "*.install" to be done by hand
59
60 # EXTRA_PLUGINS: See debian/README.Debian for docs
61 EXTRA_PLUGINS +=
63 PLUGINS += plugins-ugly $(EXTRA_PLUGINS)
64 ifeq ($(DEB_HOST_ARCH_OS),linux)
65 PLUGINS +=
66 endif
67 VERSIONIZE= \
68         plugins-ugly-doc.install \
70 # debug package
71 DEB_DH_STRIP_ARGS := --dbg-package=$(gst_pkgname)-plugins-ugly-dbg
74 # Let's decide the package name and url depending on the distribution
75 DISTRO = "$(shell dpkg-vendor --query vendor)"
77 GST_PACKAGE_NAME := "GStreamer Ugly Plugins (unknown Debian derivative)"
78 GST_PACKAGE_ORIGIN="http://packages.qa.debian.org/gst-plugins-ugly$(gst_abi)"
80 ifeq ($(DISTRO),"Debian")
81 GST_PACKAGE_NAME := "GStreamer Ugly Plugins (Debian)"
82 GST_PACKAGE_ORIGIN="http://packages.qa.debian.org/gst-plugins-ugly$(gst_abi)"
83 endif
85 ifeq ($(DISTRO),"Ubuntu")
86 GST_PACKAGE_NAME := "GStreamer Ugly Plugins (Ubuntu)"
87 GST_PACKAGE_ORIGIN="https://launchpad.net/distros/ubuntu/+source/gst-plugins-ugly$(gst_abi)"
88 endif
91 # setup links for packages
92 pre-build::
93         for p in $(PLUGINS); do \
94                 rm -f debian/$(gst_pkgname)-$$p.install; \
95                 cat debian/gstreamer-$$p.install | \
96                         sed 's/@GST_ABI@/$(gst_abi)/g' \
97                         > debian/$(gst_pkgname)-$$p.install; \
98         done
100         for f in $(VERSIONIZE); do \
101                 cat debian/gstreamer-$$f | \
102                         sed 's/@GST_ABI@/$(gst_abi)/g' \
103                         > debian/$(gst_pkgname)-$$f; \
104         done
106 maint: debian/control
108 debian/build-deps: debian/build-deps.in debian/rules
109         cat $< > $@
110         for plugin in $(EXTRA_PLUGINS) ; do \
111                 sh debian/extra deps $$plugin >> $@; \
112         done
113         sort $@ -o $@
115 debian/control:: debian/control.in debian/build-deps debian/mk.control debian/rules
116         perl debian/mk.control | \
117                 sed  -e 's/@GST_VERSION@/$(gst_version)/g' \
118                     -e 's/@GST_ABI@/$(gst_abi)/g' \
119                     -e 's/@GST_PKGNAME@/$(gst_pkgname)/g' \
120                     -e 's/@GST_LIB@/$(gst_lib)/g' \
121                     -e 's/@GST_LIB_DEV@/$(gst_lib_dev)/g' \
122                     -e 's/@GST_LIB_DEV_DEP@/$(gst_lib_dev_dep)/g' \
123                     -e 's/@GST_EXTRA_BUILD_DEPENDS@/$(gst_extra_build_depends)/g' \
124                     -e '/^Build-Depends\(-Indep\)\?/s/,\( *,\)*/,/g' \
125                     -e '/^Build-Depends\(-Indep\)\?/s/\ *,\ */,\n               /g' \
126                     >$@
127         for plugin in $(EXTRA_PLUGINS) ; do \
128                 sh debian/extra control $$plugin | \
129                         sed 's/@GST_ABI@/$(gst_abi)/g' | \
130                         sed 's/@GST_PKGNAME@/$(gst_pkgname)/g' | \
131                         sed 's/@GST_LIB@/$(gst_lib)/g' | \
132                         sed 's/@GST_LIB_DEV@/$(gst_lib_dev)/g' | \
133                         sed 's/@GST_LIB_DEV_DEP@/$(gst_lib_dev_dep)/g' | \
134                         sed 's/@GST_PLUGINS_LIB@/$(gst_plugins_lib)/g' | \
135                         sed 's/@GST_PLUGINS_LIB_DEV@/$(gst_plugins_lib_dev)/g' | \
136                         sed 's/@GST_PLUGINS_LIB_DEV_DEP@/$(gst_plugins_lib_dev_dep)/g' | \
137                         sed 's/@GST_GCONF_LIB@/$(gst_gconf_lib)/g' | \
138                         sed 's/@GST_GCONF_LIB_DEV@/$(gst_gconf_lib_dev)/g' | \
139                         sed 's/@GST_GCONF_LIB_DEV_DEP@/$(gst_gconf_lib_dev_dep)/g' >> $@; \
140         done
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) \
149         --with-package-origin=$(GST_PACKAGE_ORIGIN)
151 # only build the docs on arches which can
152 ifeq (,$(findstring $(DEB_HOST_ARCH),m68k arm))
153 DEB_CONFIGURE_EXTRA_FLAGS += --enable-gtk-doc
154 endif
157 clean::
158         # get rid of the sym links
159         for i in $(PLUGINS); do \
160                 rm -f debian/$(gst_pkgname)-$$i.install; \
161                 rm -f debian/$(gst_pkgname)-$$i.preinst; \
162         done
163         for f in $(VERSIONIZE); do \
164                 rm -f debian/$(gst_pkgname)-$$f; \
165         done
167 common-binary-fixup-arch::
168         dh_gstscancodecs
170 DEB_INSTALL_DOCS_ALL += debian/README.Debian NEWS
172 # Disable inclusion of large upstream ChangeLog
173 DEB_INSTALL_CHANGELOGS_ALL :=
175 .PHONY: maint