#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
	dh $@

override_dh_auto_install:
	tar --exclude debian --exclude README --exclude NEWS --exclude .pc -cf - ./ | ( cd debian/mh-book/usr/share/doc/mh-book/html/ ; tar xf - )
	(cd debian/mh-book/usr/share/doc/mh-book/html/ ; mv examples ../ ; ln -s ../examples)
	(cd debian/mh-book/usr/share/doc/mh-book/examples/mh/bin; perl -pi -e s:/usr/local/bin/perl:/usr/bin/perl: rfl)

override_dh_compress:
	dh_compress --exclude mh.php --exclude NEWS

override_dh_fixperms:
	dh_fixperms
	chmod +x debian/mh-book/usr/share/doc/mh-book/examples/mh/bin/*
	chmod +x debian/mh-book/usr/share/doc/mh-book/examples/xmh/bin/*
	chmod -x debian/mh-book/usr/share/doc/mh-book/examples/mh/old-edition2/rm_msgs.cron*
