#!/usr/bin/make -f

#export DH_VERBOSE=1

PACKAGE = fcrackzip

include debian/debian-vars.mk

include /usr/share/dpkg/buildflags.mk
CFLAGS	+= -Wall -pedantic
LDFLAGS += -Wl,--as-needed

man:
	$(MAKE) -C debian -f pod2man.mk PACKAGE=$(PACKAGE)info makeman

override_dh_auto_test:
	# Skip tests, because:
	#    fcrackzip --benchmark
	#    /bin/bash: fcrackzip: command not found

override_dh_auto_configure:
	CFLAGS="$(CFLAGS)" \
	LDFLAGS="$(LDFLAGS)" \
	./configure \
		--prefix=/usr \
		--mandir=\$${prefix}/share/man

override_dh_installdocs:
	#  No need to install manual page in HTML format
	dh_installdocs -X fcrackzip.html

override_dh_auto_install: build man
	dh_auto_install
	# $(MAKE) install DESTDIR=$(PKGDIR)

	#  As a program called zipinfo is already present in the "unzip" package,
	#  we'll rename our own in fcrackzipinfo

	mv $(BINDIR)/zipinfo $(BINDIR)/fcrackzipinfo

override_dh_installchangelogs:
	dh_installchangelogs NEWS

%:
	dh $@

.PHONY: man

# End of file
