#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

override_dh_clean:
	dh_clean
	-rm debian/bgpdump.1
	-rm -rf debian/tests/test_out/

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test
	./test.sh debian/tests/
	@[ -d test_data ] && ./test.sh || echo "Skipping upstream tests as they are huge (see README.Debian)"
endif

override_dh_install:
	dh_install
	# don't ship the library for the time being, see README.Debian
	rm -rf debian/bgpdump/usr/lib/
	rm -rf debian/bgpdump/usr/include/

override_dh_installman:
	asciidoctor --attribute reproducible --backend=manpage debian/bgpdump.txt
	dh_installman
