#!/usr/bin/make -f

# enable additional hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

INSTDIR = $(CURDIR)/debian/tmp
PY3VER := $(shell py3versions -d -v | tr -d .)
export PYTHON = $(shell py3versions -d)

%:
	dh $@  --with python3

override_dh_autoreconf:
	./autogen.sh
	dh_autoreconf

override_dh_auto_configure:
	./configure --prefix=/usr --with-boost-python='boost_python$(PY3VER)' CXXFLAGS='$(CXXFLAGS)'

override_dh_auto_install:
	dh_auto_install -- DESTDIR=$(INSTDIR)
	find debian/tmp -name '*.pyc' -delete
	find debian/tmp -name '*.pyo' -delete
	find debian/tmp -name '*.la' -delete
	rm debian/tmp/usr/lib/python3/dist-packages/gengeo/gengeo.so
	mv debian/tmp/usr/lib/python3/dist-packages/gengeo/gengeo-*.so debian/tmp/usr/lib/python3/dist-packages/gengeo/gengeo.so
	chrpath -d debian/tmp/usr/lib/python*/dist-packages/gengeo/gengeo*so

override_dh_makeshlibs:
