3 -include /usr/share/cdbs/1/rules/debhelper.mk
4 -include /usr/share/cdbs/1/rules/simple-patchsys.mk
5 -include /usr/share/cdbs/1/class/gnome.mk
6 -include /usr/share/cdbs/1/rules/utils.mk
8 LDFLAGS += -Wl,-z,defs -Wl,-O1 -Wl,--as-needed
12 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
18 ifneq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
19 DEB_CONFIGURE_EXTRA_FLAGS += --disable-gtk-doc --disable-docbook
20 common-install-indep::
21 mkdir -p debian/tmp/usr/share/gtk-doc
23 DEB_CONFIGURE_EXTRA_FLAGS += --enable-gtk-doc --enable-docbook
26 ifeq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
27 CFLAGS += -DG_DISABLE_CAST_CHECKS -DGST_DISABLE_GST_DEBUG=1
28 DEB_CONFIGURE_EXTRA_FLAGS += --enable-glib-asserts=no
30 DEB_CONFIGURE_EXTRA_FLAGS += --enable-glib-asserts=yes
33 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
34 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
35 MAKEFLAGS += -j$(NUMJOBS)
38 DEB_MAKE_CHECK_TARGET = check GST_CHECKS=disable ORC_CODE=debug || true
40 # upstream version with epoch
41 gst_version := $(shell echo $(DEB_VERSION) | cut -d '-' -f 1)
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.22)
51 gst_pkgname := gstreamer$(gst_abi)
52 gst_deb_abi := $(gst_abi)-0
54 # gst-plugins-base library package names
55 gst_plugins_base_lib := libgstreamer-plugins-base$(gst_deb_abi)
56 gst_plugins_base_lib_dev := libgstreamer-plugins-base$(gst_abi)-dev
57 # gst-plugins-base library shlibs
58 gst_plugins_base_lib_dep := "$(gst_plugins_base_lib) (>= $(gst_version))"
61 DEB_DH_STRIP_ARGS += --dbg-package=$(gst_pkgname)-plugins-base-dbg
63 DEB_COMPRESS_EXCLUDE = .sgml .devhelp .ps .pdf
65 # The plugins are basically the same.
66 # Link special names to a template file.
67 # still need "*.install" to be done by hand
69 PLUGINS += plugins-base x alsa plugins-base-extra plugins-base-subtitles
71 plugins-base-apps.install \
72 plugins-base-apps.manpages \
73 plugins-base-doc.install \
75 # setup links for packages
77 for p in $(PLUGINS); do \
78 rm -f debian/$(gst_pkgname)-$$p.install; \
79 cat debian/gstreamer-$$p.install | \
80 sed 's/@GST_ABI@/$(gst_abi)/g' \
81 >debian/$(gst_pkgname)-$$p.install; \
83 for f in $(VERSIONIZE); do \
84 cat debian/gstreamer-$$f | \
85 sed 's/@GST_ABI@/$(gst_abi)/g' \
86 >debian/$(gst_pkgname)-$$f; \
88 rm -f debian/libgstreamer-plugins-base$(gst_deb_abi).install
89 cat debian/libgstreamer-plugins-base.install | \
90 sed 's/@GST_ABI@/$(gst_abi)/g' \
91 >debian/libgstreamer-plugins-base$(gst_deb_abi).install
92 rm -f debian/libgstreamer-plugins-base$(gst_abi)-dev.install
93 cat debian/libgstreamer-plugins-base-dev.install | \
94 sed 's/@GST_ABI@/$(gst_abi)/g' \
95 >debian/libgstreamer-plugins-base$(gst_abi)-dev.install
100 ./autogen.sh --noconfigure
103 post-patches:: debian/stamp-autogen
105 debian/control:: debian/control.in debian/rules debian/changelog force
106 cat debian/control.in | \
107 sed 's/@GST_VERSION@/$(gst_version)/g' | \
108 sed 's/@GST_ABI@/$(gst_abi)/g' | \
109 sed 's/@GST_PKGNAME@/$(gst_pkgname)/g' | \
110 sed 's/@GST_LIB@/$(gst_lib)/g' | \
111 sed 's/@GST_LIB_DEV@/$(gst_lib_dev)/g' | \
112 sed 's/@GST_LIB_DEV_DEP@/$(gst_lib_dev_dep)/g' | \
113 sed 's/@GST_PLUGINS_BASE_LIB@/$(gst_plugins_base_lib)/g' | \
114 sed 's/@GST_PLUGINS_BASE_LIB_DEV@/$(gst_plugins_base_lib_dev)/g' >$@
116 DEB_CONFIGURE_EXTRA_FLAGS += \
117 --enable-introspection=no \
120 --enable-experimental \
121 --with-audioresample-format=int \
122 --with-package-name=$(GST_PACKAGE_NAME) \
123 --with-package-origin=$(GST_PACKAGE_ORIGIN) \
124 --with-install-plugins-helper="/usr/bin/gstreamer-codec-install"
127 # get rid of the symlinks
128 for i in $(PLUGINS); do \
129 rm -f debian/$(gst_pkgname)-$$i.install; \
130 rm -f debian/$(gst_pkgname)-$$i.preinst; \
132 for f in $(VERSIONIZE); do \
133 rm -f debian/$(gst_pkgname)-$$f; \
135 rm -f debian/libgstreamer-plugins-base$(gst_deb_abi).install
136 rm -f debian/libgstreamer-plugins-base$(gst_abi)-dev.install
138 binary-post-install/$(gst_pkgname)-plugins-base-apps::
141 DEB_DH_MAKESHLIBS_ARGS_$(gst_plugins_base_lib) += -V $(gst_plugins_base_lib_dep) -- -c4
142 DEB_INSTALL_DOCS_ALL += debian/README.Debian NEWS
143 DEB_SHLIBDEPS_INCLUDE += debian/libgstreamer-plugins-base$(gst_deb_abi)/usr/lib
144 # Disable inclusion of large upstream ChangeLog
145 DEB_INSTALL_CHANGELOGS_ALL :=
147 # override shlibs for libraries from this source before computing dependencies
148 # of packages generated from this source; we already have inter-dependencies
149 # expressed manually in the control file, we do not need the shlibs to add
151 # (this rule runs just before the dh_shlibdeps)
152 common-binary-fixup-arch::
153 mkdir -p $(CURDIR)/fake-home
154 HOME=$(CURDIR)/fake-home \
155 LD_LIBRARY_PATH=debian/libgstreamer-plugins-base0.10-0/usr/lib:$(LD_LIBRARY_PATH) \
157 -rm -f debian/shlibs.local
158 rm -rf $(CURDIR)/fake-home
159 cat debian/*/DEBIAN/shlibs | \
160 sed -n -r -e 's/(([^ ]+: )?([^ ]+) ([^ ]+)) .*/\1/p' \
163 # (this rules runs just after the dh_shlibdeps)
164 common-binary-predeb-arch::
165 -rm -f debian/shlibs.local
172 PATCHES_REF=maemo-patches
175 mkdir -p $(CURDIR)/debian/patches
176 rm -f $(CURDIR)/debian/patches/*.patch
177 git format-patch -N -o $(CURDIR)/debian/patches $(PATCHES_REF) ^$(UPSTREAM_REF) | \
178 xargs -n 1 basename > $(CURDIR)/debian/patches/series
179 for patch in $$(ls $(CURDIR)/debian/patches/*.patch) ; \
181 lines=$$(cat $$patch | wc -l) ; \
182 head -n $$(($$lines - 3)) $$patch > $${patch}.chomped ; \
183 mv $${patch}.chomped $$patch ; \
186 update-common: COMMIT = $(shell git rev-parse $(shell git rev-parse --verify MERGE_HEAD || git merge-base $(UPSTREAM_REF) HEAD):common)
188 @if ! git diff-files --ignore-submodules --quiet common || \
189 ! git diff-index --ignore-submodules --cached --quiet HEAD -- common; then \
190 echo "your common/ directory state is dirty"; \
193 if test -d $(CURDIR)/common ; then rm -rfv $(CURDIR)/common ; git rm -r --cached --ignore-unmatch $(CURDIR)/common ; fi
194 git clone -n git://anongit.freedesktop.org/gstreamer/common $(CURDIR)/common
195 cd $(CURDIR)/common && git checkout -f $(COMMIT)
196 rm -rfv $(CURDIR)/common/.git
197 git add $(CURDIR)/common
198 @echo "common update staged, git commit to proceed"