#!/usr/bin/make -f

# DH_VERBOSE=1
NUMJOBS=$(filter parallel=%,$(DEB_BUILD_OPTIONS))
SCONSPARFLAGS=$(subst parallel=,-j, $(NUMJOBS))

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
	dh $@ --parallel --with autoreconf --with python2

override_dh_strip:
	dh_strip -plibbrial0 \
	  --dbg-package=libbrial0-dbg
	dh_strip -plibbrial-groebner0 \
	  --dbg-package=libbrial-groebner0-dbg
	dh_strip -a -Nlibbrial0 \
	  -Nlibbrial-groebner0

# Disable test suite for now because running scons modiefies files
# that are going to be installed. 
#override_dh_auto_test:
#	scons $(SCONSPARFLAGS) testsuite/unittests
#ifeq ($(DEB_HOST_ARCH_OS),hurd) # problems with rpath on hurd
#	LD_LIBRARY_PATH=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) testsuite/unittests
#else
#	testsuite/unittests
#endif
