#!/usr/bin/make -f

%:
	dh "$@"

override_dh_auto_install:
	dh_auto_install -- man3ext=.3pub
	find debian/publib-dev/usr/share/man -type f -name '*.gz' \
	    -exec gunzip {} +
	set -e; find debian/publib-dev/usr/share/man -type f | \
	  while read file; do \
	    sed 's/^\.TH [_A-Z0-9]* [0-9]/&pub/' $$file > $$file.new; \
	    mv $$file.new $$file; done
	find debian/publib-dev/usr/share/man -type f  -exec gzip --best {} +
