#!/usr/bin/make -f

DATADIR="/usr/share/pisg"

%:
	dh $@

# The default target of the upstream Makefile is 'release', which prepares
# the release tarball (regenerating lang.txt from the old lang/*.dat
# sources); 'make clean' deletes lang.txt. Neither is wanted in the
# Debian build. Nothing to compile or clean for pure Perl.
override_dh_auto_build:

override_dh_auto_clean:

execute_after_dh_auto_build:
	docbook2man docs/pisg.sgml --output docs
	mv -f docs/PISG.1 docs/pisg.1

execute_after_dh_install:
	perl -pi \
		-e "s[(langfile =>) '.*',][\$$1 => '$(DATADIR)/lang.txt',];" \
		-e "s[(cssdir =>) '.*',][\$$1 => '$(DATADIR)/layout/',]" \
		debian/pisg/usr/share/perl5/Pisg.pm
