#!/usr/bin/make -f

export DH_VERBOSE=1
export DH_OPTIONS=-v
export PETSC_DIR=/usr/lib/petsc
export PYBUILD_SYSTEM=pyproject
export PYBUILD_NAME=damask

# see FEATURE AREAS in dpkg-buildflags(1)
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed


%:
	dh $@               -Ndamask-mesh -Npython3-damask -Ndamask --buildsystem=cmake --builddir=build-grid --without build-stamp
	dh $@ -Ndamask-grid               -Npython3-damask -Ndamask --buildsystem=cmake --builddir=build-mesh --without build-stamp
	dh $@ -Ndamask-grid -Ndamask-mesh                  -Ndamask --buildsystem=pybuild --with python3 --sourcedir=python
	dh $@ -Ndamask-grid -Ndamask-mesh -Npython3-damask

override_dh_auto_configure-arch:
	dh_auto_configure -Ndamask-mesh -Npython3-damask -Ndamask -- -DGRID=ON -DCMAKE_BUILD_TYPE=RELEASE
	dh_auto_configure -Ndamask-grid -Npython3-damask -Ndamask -- -DMESH=ON -DCMAKE_BUILD_TYPE=RELEASE

# dpkg-shlibdeps: error: no dependency information found for /usr/lib/petscdir/petsc3.25/x86_64-linux-gnu-real/lib/libpetsc_real.so.3.25
# https://stackoverflow.com/questions/11238134 and 
override_dh_shlibdeps:
	dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info

override_dh_auto_test:
	
