#!/usr/bin/make -f

PACKAGE = $(shell dh_listpackages)
TMP     = $(CURDIR)/debian/$(PACKAGE)

%:
	dh $@

override_dh_auto_install:
	dh_auto_install

	# mv Japanese manpage to better location
	dh_installdirs usr/share/man/ja/man3/
	mv -v $(TMP)/usr/share/man/man3/POD2::JA::KiokuDB::Tutorial.3pm \
		$(TMP)/usr/share/man/ja/man3/KiokuDB::Tutorial.3pm

	# remove empty manpages
	for f in $(TMP)/usr/share/man/man3/*.3pm ; do \
		grep -q DESCRIPTION $$f || $(RM) -v $$f ; \
	done
