#!/usr/bin/make -f

PYTHON3V:=$(shell py3versions -sv)

%:
	dh $@ --with python3

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

override_dh_auto_configure:
	dh_auto_configure -B $(BUILDDIR) -- --enable-gtk-doc

override_dh_auto_install:
	dh_auto_install -B $(BUILDDIR)
	cd python && for pyvers in $(PYTHON3V); do\
		CFLAGS="$(shell dpkg-buildflags --get CFLAGS) -g -I$(CURDIR)/debian/tmp/usr/include" \
		LDFLAGS="$(shell dpkg-buildflags --get LDFLAGS) -L$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)" \
		python$$pyvers setup.py install --install-layout=deb \
		--root=$(CURDIR)/debian/python3-iptcdata; \
	done
