#!/usr/bin/make -f
#export DH_VERBOSE=1

INSTALLB :=     install -o0 -g0 -m 0755
INSTALLF :=     install -o0 -g0 -m 0644
INSTALLD :=     install -o0 -g0 -d

TARGET :=	debian/nikto

clean:
	dh_testdir
	dh_testroot
	dh_clean

build:
install:
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs

	$(INSTALLF) nikto.conf $(TARGET)/etc/nikto/config.txt
	$(INSTALLF) plugins/* $(TARGET)/var/lib/nikto/plugins/
	$(INSTALLF) templates/* $(TARGET)/var/lib/nikto/templates/
	$(INSTALLF) docs/CHANGES.txt $(TARGET)/var/lib/nikto/plugins/
	$(INSTALLB) nikto.pl $(TARGET)/usr/bin/nikto

	# We depends on libwhisker2-perl so we don't need to ship this one
	-rm -f $(TARGET)/var/lib/nikto/plugins/LW2.pm

	# Uncomment this to remove non-free stuff
	# rm $(TARGET)/var/lib/nikto/plugins/db_*

binary-arch: binary-indep

binary-indep: install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installman docs/nikto.1
	dh_installchangelogs docs/CHANGES.txt
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_perl
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: clean binary-arch binary-indep binary install
