#!/usr/bin/make -f
#export DH_VERBOSE=1

%:
	dh $@

#	--enable-debug

# disable TLS to fix warning with TLS and arpack
CONF_FLAGS=\
	--enable-gmp \
	--disable-tls \
	--with-external-arpack \
	--with-external-blas \
	--with-external-lapack \
	--with-external-glpk

override_dh_auto_configure:
	dh_auto_configure -- $(CONF_FLAGS)

override_dh_install:
	dh_install
	d-shlibmove --commit \
		    --multiarch \
		    --devunversioned \
		    --exclude-la \
		    --movedev debian/tmp/usr/include/igraph usr/include \
		    --movedev "debian/tmp/usr/lib/*/pkgconfig/*.pc" usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \
		    debian/tmp/usr/lib/*/*.so
	find debian -name "*.la" -delete

override_dh_fixperms:
	dh_fixperms
	find debian \( -name "*.xml" -o -name "*.c" \) -exec chmod -x \{\} \;
