#!/usr/bin/make -f
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
	dh $@ --with gnome,python2

# explicitly set PYTHON to be the versioned python binary, since dh_python2
# will just end up depending on the pythonX.X package, and we don't want a
# version mismatch between the installed python binary and the private python
# modules.
# Don't switch to Multi-Arch yet because of potential incompatibility with
# third-party add-ons
override_dh_auto_configure:
	dh_auto_configure -- \
		--libdir=/usr/lib
		--disable-static \
		--enable-python \
		PYTHON=/usr/bin/`pyversions -d` \
		--enable-default-binary \
		--enable-gtk-doc \
		--with-lcms=lcms2 \
		--without-webkit

override_dh_autoreconf:
	dh_autoreconf --as-needed

# exclude since we manually add the Suggests in debian/control
override_dh_shlibdeps:
	dh_shlibdeps -Xusr/lib/gimp/2.0/modules/libcontroller-midi.so \
		-Llibgimp2.0 -l$(CURDIR)/debian/libgimp2.0/usr/lib

override_dh_makeshlibs:
	dh_makeshlibs -X/usr/lib/gimp/2.0/modules -- -c4

override_dh_python2:
	dh_python2 -pgimp /usr/lib/gimp/2.0/python

override_dh_install:
	find debian/tmp -name '*.la' -print -delete
	dh_install

override_dh_missing:
	dh_missing --fail-missing
