--- /dev/null
+#!/usr/bin/make -f
+
+-include /usr/share/cdbs/1/rules/debhelper.mk
+-include /usr/share/cdbs/1/rules/simple-patchsys.mk
+-include /usr/share/cdbs/1/class/gnome.mk
+-include /usr/share/cdbs/1/rules/utils.mk
+
+LDFLAGS += -Wl,-z,defs -Wl,-O1 -Wl,--as-needed
+
+CFLAGS += -Wno-error
+
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+else
+ CFLAGS += -O2
+endif
+
+ifneq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
+ DEB_CONFIGURE_EXTRA_FLAGS += --disable-gtk-doc --disable-docbook
+ common-install-indep::
+ mkdir -p debian/tmp/usr/share/gtk-doc
+else
+ DEB_CONFIGURE_EXTRA_FLAGS += --enable-gtk-doc --enable-docbook
+endif
+
+ifeq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -DG_DISABLE_CAST_CHECKS -DGST_DISABLE_GST_DEBUG=1
+ DEB_CONFIGURE_EXTRA_FLAGS += --enable-glib-asserts=no
+else
+ DEB_CONFIGURE_EXTRA_FLAGS += --enable-glib-asserts=yes
+endif
+
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ MAKEFLAGS += -j$(NUMJOBS)
+endif
+
+DEB_MAKE_CHECK_TARGET = check GST_CHECKS=disable ORC_CODE=debug || true
+
+# upstream version with epoch
+gst_version := $(shell echo $(DEB_VERSION) | cut -d '-' -f 1)
+gst_major := 0
+gst_minor := 10
+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) (>= 0.10.22)
+
+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))"
+
+# debug package
+DEB_DH_STRIP_ARGS += --dbg-package=$(gst_pkgname)-plugins-base-dbg
+
+DEB_COMPRESS_EXCLUDE = .sgml .devhelp .ps .pdf
+
+# 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 alsa plugins-base-extra plugins-base-subtitles
+VERSIONIZE += \
+ plugins-base-apps.install \
+ plugins-base-apps.manpages \
+ plugins-base-doc.install \
+
+# setup links for packages
+pre-build::
+ for p in $(PLUGINS); do \
+ rm -f debian/$(gst_pkgname)-$$p.install; \
+ cat debian/gstreamer-$$p.install | \
+ sed 's/@GST_ABI@/$(gst_abi)/g' \
+ >debian/$(gst_pkgname)-$$p.install; \
+ done
+ for f in $(VERSIONIZE); do \
+ cat debian/gstreamer-$$f | \
+ sed 's/@GST_ABI@/$(gst_abi)/g' \
+ >debian/$(gst_pkgname)-$$f; \
+ done
+ rm -f debian/libgstreamer-plugins-base$(gst_deb_abi).install
+ cat debian/libgstreamer-plugins-base.install | \
+ sed 's/@GST_ABI@/$(gst_abi)/g' \
+ >debian/libgstreamer-plugins-base$(gst_deb_abi).install
+ rm -f debian/libgstreamer-plugins-base$(gst_abi)-dev.install
+ cat debian/libgstreamer-plugins-base-dev.install | \
+ sed 's/@GST_ABI@/$(gst_abi)/g' \
+ >debian/libgstreamer-plugins-base$(gst_abi)-dev.install
+
+maint: debian/control
+
+debian/stamp-autogen:
+ ./autogen.sh --noconfigure
+ touch $@
+
+post-patches:: debian/stamp-autogen
+
+debian/control:: debian/control.in debian/rules debian/changelog force
+ cat debian/control.in | \
+ sed 's/@GST_VERSION@/$(gst_version)/g' | \
+ sed 's/@GST_ABI@/$(gst_abi)/g' | \
+ sed 's/@GST_PKGNAME@/$(gst_pkgname)/g' | \
+ sed 's/@GST_LIB@/$(gst_lib)/g' | \
+ sed 's/@GST_LIB_DEV@/$(gst_lib_dev)/g' | \
+ sed 's/@GST_LIB_DEV_DEP@/$(gst_lib_dev_dep)/g' | \
+ sed 's/@GST_PLUGINS_BASE_LIB@/$(gst_plugins_base_lib)/g' | \
+ sed 's/@GST_PLUGINS_BASE_LIB_DEV@/$(gst_plugins_base_lib_dev)/g' >$@
+
+DEB_CONFIGURE_EXTRA_FLAGS += \
+ --enable-introspection=no \
+ --disable-nls \
+ --enable-debug \
+ --enable-experimental \
+ --with-audioresample-format=int \
+ --with-package-name=$(GST_PACKAGE_NAME) \
+ --with-package-origin=$(GST_PACKAGE_ORIGIN) \
+ --with-install-plugins-helper="/usr/bin/gstreamer-codec-install"
+
+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/libgstreamer-plugins-base$(gst_deb_abi).install
+ rm -f debian/libgstreamer-plugins-base$(gst_abi)-dev.install
+
+binary-post-install/$(gst_pkgname)-plugins-base-apps::
+ dh_perl
+
+DEB_DH_MAKESHLIBS_ARGS_$(gst_plugins_base_lib) += -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
+# 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-base0.10-0/usr/lib:$(LD_LIBRARY_PATH) \
+ dh_gstscancodecs
+ -rm -f debian/shlibs.local
+ rm -rf $(CURDIR)/fake-home
+ cat debian/*/DEBIAN/shlibs | \
+ sed -n -r -e 's/(([^ ]+: )?([^ ]+) ([^ ]+)) .*/\1/p' \
+ >debian/shlibs.local
+
+# (this rules runs just after the dh_shlibdeps)
+common-binary-predeb-arch::
+ -rm -f debian/shlibs.local
+
+force:
+
+.PHONY: maint force
+
+UPSTREAM_REF=master
+PATCHES_REF=maemo-patches
+
+update-patch-series:
+ mkdir -p $(CURDIR)/debian/patches
+ rm -f $(CURDIR)/debian/patches/*.patch
+ git format-patch -N -o $(CURDIR)/debian/patches $(PATCHES_REF) ^$(UPSTREAM_REF) | \
+ xargs -n 1 basename > $(CURDIR)/debian/patches/series
+ for patch in $$(ls $(CURDIR)/debian/patches/*.patch) ; \
+ do \
+ lines=$$(cat $$patch | wc -l) ; \
+ head -n $$(($$lines - 3)) $$patch > $${patch}.chomped ; \
+ mv $${patch}.chomped $$patch ; \
+ done
+
+update-common: COMMIT = $(shell git rev-parse $(shell git rev-parse --verify MERGE_HEAD || git merge-base $(UPSTREAM_REF) HEAD):common)
+update-common:
+ @if ! git diff-files --ignore-submodules --quiet common || \
+ ! git diff-index --ignore-submodules --cached --quiet HEAD -- common; then \
+ echo "your common/ directory state is dirty"; \
+ exit 1; \
+ fi
+ if test -d $(CURDIR)/common ; then rm -rfv $(CURDIR)/common ; git rm -r --cached --ignore-unmatch $(CURDIR)/common ; fi
+ git clone -n git://anongit.freedesktop.org/gstreamer/common $(CURDIR)/common
+ cd $(CURDIR)/common && git checkout -f $(COMMIT)
+ rm -rfv $(CURDIR)/common/.git
+ git add $(CURDIR)/common
+ @echo "common update staged, git commit to proceed"