#!/usr/bin/make -f

DEB_BUILD_PARALLEL=yes

CONFIGURE_FLAGS = --with-epoll=$(if $(filter $(DEB_HOST_ARCH_OS),linux),yes,no) --enable-demos --with-md2man

#
#binary-post-install/tntnet-doc::
#	find debian/tntnet-doc/usr/share/doc/tntnet-doc/ \( -name "*.la" -o -name "*.lo" -o -name "*.o" -o -name "Makefile.in" -o -path "*/.libs/*" \) -exec rm "{}" ";"
#	find debian/tntnet-doc/usr/share/doc/tntnet-doc/ -name "Makefile" "!" -path "*/newsdb/Makefile"  -exec rm "{}" ";"
#
#ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
#binary-post-install/tntnet::
#	cd utest; ./utest || /bin/true
#endif

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

override_dh_install:
	find
	dh_install

override_dh_clean:
	rm -rf doc/html doc/latex
	dh_clean

override_dh_auto_configure:
	dh_auto_configure -- $(CONFIGURE_FLAGS)
	find

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	cd utest; ./utest || /bin/true
endif

%:
	dh $@ --with autoreconf
