#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

#: parallel build by default on linux
ifeq ($(DEB_HOST_ARCH_OS),linux)
	ifeq ($(findstring parallel=,$(DEB_BUILD_OPTIONS)),)
		export DEB_BUILD_OPTIONS+=parallel=$(shell grep -c ^processor /proc/cpuinfo)
	endif
endif

# see http://lists.debian.org/debian-devel-announce/2011/09/msg00001.html
# Also it does hardening by default, see http://wiki.debian.org/Hardening
DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/default.mk

LDFLAGS+= -Wl,--as-needed

%:
	dh $@ --parallel --with python2,autoreconf

override_dh_auto_configure:
	dh_auto_configure -- --disable-update-mimedb --enable-python-plugin --enable-gtk-doc --libdir=/usr/lib/planner/ --disable-schemas-install

override_dh_makeshlibs:
	dh_makeshlibs -Xlibmsp -Xlibhtml -Xlibpython -Xplannerui.so -Xplanner -Xlibmrp -Xlibstorage-mrproject -Xlibxmlplanner

override_dh_python2:
	dh_python2 --no-guessing-versions

override_dh_compress:
	dh_compress --exclude=.planner

override_dh_autoreconf:
	dh_autoreconf --as-needed
