#!/usr/bin/make -f

USRDIR   := $(CURDIR)/debian/php-services-weather/usr
UPSTREAM := $(shell dpkg-parsechangelog -S Version | sed 's/-[^-]*//')

override_dh_installman:
	mkdir --parent $(CURDIR)/debian/tmp
	help2man \
		--help-option=-h \
		--version-string=$(UPSTREAM) \
		--no-info \
		--include=$(CURDIR)/debian/buildMetarDB.1.in \
		'php $(USRDIR)/share/php/data/Services_Weather/buildMetarDB.php' \
		| sed -r 's/\\fB(\\-)+\\fR"\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-/of the DB to be used/' \
		> $(CURDIR)/debian/tmp/buildMetarDB.1
	dh_installman

%:
	dh $@ --buildsystem=phppear --with phppear

override_dh_fixperms:
	dh_fixperms -O--buildsystem=phppear
	chmod +x debian/php-services-weather/usr/share/php/data/Services_Weather/buildMetarDB.php
