#!/usr/bin/make -f

DEB_BUILD_PARALLEL=yes

include /usr/share/cdbs/1/rules/autoreconf.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/debhelper.mk

DEB_CONFIGURE_EXTRA_FLAGS = --with-epoll=$(if $(filter $(DEB_HOST_ARCH_OS),linux),yes,no)
DEB_DH_MAKESHLIBS_ARGS := -X/usr/lib/tntnet/

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
