#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all 
include /usr/share/dpkg/buildflags.mk

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/autoreconf.mk
include /usr/share/cdbs/1/class/gnome.mk

# 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.
DEB_CONFIGURE_EXTRA_FLAGS := --disable-static \
			--enable-python \
			PYTHON=/usr/bin/`pyversions -d` \
			--enable-default-binary \
			--enable-gtk-doc \
			--with-lcms=lcms2 \
			--without-webkit
DEB_BUILDDIR := $(DEB_SRCDIR)/builddir
DEB_BUILD_PARALLEL := 1

DEB_DH_SHLIBDEPS_ARGS_ALL := -Llibgimp2.0 -l$(CURDIR)/debian/libgimp2.0/usr/lib
# exclude this since we manually add the Suggests in debian/control:
DEB_DH_SHLIBDEPS_ARGS_gimp := -Xusr/lib/gimp/2.0/modules/libcontroller-midi.so
DEB_DH_MAKESHLIBS_ARGS_gimp := -X/usr/lib/gimp/2.0/modules/
DEB_DH_MAKESHLIBS_ARGS_libgimp2.0 += -V -- -c4

clean::
	rm -rf $(DEB_BUILDDIR)

common-install-impl::
	# Remove all libtool .la files
	find $(CURDIR)/debian/tmp/usr/lib -name "*.la" -delete

binary-install/gimp::
	dh_python2 -pgimp /usr/lib/gimp/2.0/python
