#!/usr/bin/make -f

TYPELIBDIR=$(shell pkg-config gobject-introspection-1.0 --variable libdir | sed -e 's/.//')

DHFLAGS=--parallel

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

%:
	dh $@ $(DHFLAGS) --with python2

override_dh_install:
	rm -f debian/tmp/usr/lib/*/*.la
	sed 's@TYPELIBDIR@${TYPELIBDIR}@' debian/gir1.2-mate-desktop.install.in > debian/gir1.2-mate-desktop.install
	dh_install --fail-missing

override_dh_installchangelogs:
	dh_installchangelogs NEWS

override_dh_auto_configure:
	# upstream tarball is without configure. autogen.sh will create it
	NOCONFIGURE=1 ./autogen.sh
	dh_auto_configure $(DHFLAGS) -- \
		--disable-silent-rules \
		--disable-static \
		--disable-schemas-compile \
		--enable-gtk-doc \
		--enable-mpaste \
		--with-gtk=2.0

override_dh_strip:
	dh_strip -pmate-desktop --dbg-package=mate-desktop-dbg
	dh_strip -plibmate-desktop-2-17 --dbg-package=libmate-desktop-2-17-dbg

get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=..
