#!/usr/bin/make -f

# See debhelper(7) (uncomment to enable).
# Output every command that modifies files on the build system.

include /usr/share/dpkg/architecture.mk

export DEB_CXXFLAGS_MAINT_APPEND += -fexcess-precision=fast

#export DH_VERBOSE = 1


# 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 $@


# dh_make generated override targets.
# This is an example for Cmake (see <https://bugs.debian.org/641051>).
#override_dh_auto_configure:
#	dh_auto_configure -- \
#	-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

override_dh_autoreconf-indep:
override_dh_auto_configure-indep:
	@# nothing

override_dh_auto_configure-arch:
	dh_auto_configure -- --disable-silent-rules --with-boost-libdir=/usr/lib/$(DEB_HOST_MULTIARCH) --enable-static

override_dh_auto_build-indep:
	cd doc && \
		doxygen doxygen.conf && \
		mkdir tmp && sphinx-build -v -a . tmp

override_dh_auto_test-arch:
	PYTHONPATH="$(CURDIR)/src/python/.libs" dh_auto_test

override_dh_missing:
	rm -f debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libixion-0.18.la
	dh_missing

override_dh_makeshlibs:
	# ImportError: /lib/x86_64-linux-gnu/liborcus-spreadsheet-model-0.18.so.0: undefined symbol: _ZN5ixion12print_configD1Ev
	dh_makeshlibs -VUpstream-Version

override_dh_installdocs:
	# Ignore Policy v3.9.7 §12.3 for now
	dh_installdocs -plibixion-doc --doc-main-package=libixion-doc
	dh_installdocs --remaining-packages