#!/usr/bin/make -f
# -*- makefile -*-

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	MAKEFLAGS += -j$(NUMJOBS)
endif

# just for configure to display a right path (default to /usr/local/man)
# upstream Makefile patched (010_install.diff) and don't install manpage,
# see debian/hping3.manpages
override_dh_auto_configure:
	MANPATH=/usr/share/man ./configure

override_dh_auto_build:
	dh_auto_build --parallel

# install french manpage
override_dh_installman:
	dh_installman
	mkdir --parents $(CURDIR)/debian/hping3/usr/share/man/fr/man8
	gzip -9 --stdout $(CURDIR)/docs/french/hping2-fr.8 \
		> $(CURDIR)/debian/hping3/usr/share/man/fr/man8/hping3.8.gz

# do not compress example TCL scripts
override_dh_compress:
	dh_compress --exclude=.htcl

%:
	dh $@
