#!/usr/bin/make -f


BASE_PACKAGE=fftw3
PYTHON2_PACKAGE=python-${BASE_PACKAGE}
PYTHON2_DEBUG_PACKAGE=${PYTHON2_PACKAGE}-dbg
PYTHON3_PACKAGE=python3-${BASE_PACKAGE}
PYTHON3_DEBUG_PACKAGE=${PYTHON3_PACKAGE}-dbg
PYTHON2:=$(shell pyversions -vr)
PYTHON3:=$(shell py3versions -vr)

%:
	dh $@ --buildsystem=python_distutils --with python2,python3

build-python%:
	python$* setup.py build

override_dh_auto_build: $(PYTHON3:%=build-python%)
	dh_auto_build

install-python%:
	python$* setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb

override_dh_auto_install: $(PYTHON3:%=install-python%)
	dh_auto_install
	dh_numpy
	dh_numpy3

override_dh_strip:
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
	dh_strip -p${PYTHON2_PACKAGE} --dbg-package=${PYTHON2_DEBUG_PACKAGE}
	dh_strip -p${PYTHON3_PACKAGE} --dbg-package=${PYTHON3_DEBUG_PACKAGE}
endif
