#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
export GPIB_PYTHON_VERSION=1.0.1
export PYBUILD_NAME = gpib

%:
	dh $@

# We'll build the Python bindings ourselves.
override_dh_auto_configure:
	dh_auto_configure -- --disable-python-binding
	dh_auto_configure --buildsystem=pybuild --sourcedirectory=language/python

execute_after_dh_auto_build:
	dh_auto_build --buildsystem=pybuild --sourcedirectory=language/python

execute_after_dh_auto_install:
	dh_auto_install --buildsystem=pybuild --sourcedirectory=language/python

execute_after_dh_auto_clean:
	dh_auto_clean --buildsystem=pybuild --sourcedirectory=language/python
	touch ChangeLog

# Don't use the source package version for the python module
override_dh_gencontrol:
	dh_gencontrol -ppython3-gpib -- -v$(GPIB_PYTHON_VERSION)-$(DEB_VERSION_REVISION)
	dh_gencontrol --remaining-packages
