#!/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_DH_MAKESHLIBS_ARGS := -X/usr/lib/tntnet/

clean::
	rm -f etc/tntnet/tntnet.conf etc/tntnet/tntnet.properties
	rm -f etc/init.d/tntnet
	rm -rf sdk/demos/subcomp/
	rm -f config.sub config.guess
	rm -f framework/common/config.h.in

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
