#!/usr/bin/make -f

include /usr/share/dpkg/default.mk
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/buildflags.mk

# workaround address space limitations on some architectures
# see: https://salsa.debian.org/science-team/xraylib/-/merge_requests/2
ifneq (,$(filter $(DEB_HOST_ARCH), m68k mipsel sh4))
  export DEB_CFLAGS_MAINT_APPEND += -g1
endif


%:
	dh $@ --without autoreconf -S meson

override_dh_auto_configure:
	dh_auto_configure -- -Dpython-bindings=enabled -Dpython-numpy-bindings=enabled

override_dh_auto_install:
	dh_auto_install
	find debian/tmp/ -name xraydoc.txt -delete || true
	find debian/tmp -name libxrl.la -delete || true
