#!/usr/bin/make -f

#export DH_VERBOSE=1

%:
	dh $@ --with=autoreconf

override_dh_auto_build:
	dh_auto_build
	(cd debian; \
		for man in hfsplus.7 hpcd.1 hpcopy.1 hpfsck.1 \
			hpls.1 hpmkdir.1 hpmount.1 hppwd.1 \
			hprm.1 hpumount.1; \
		do docbook-to-man `echo $$man|sed 's/[17]/sgml/'` >$$man; \
	done)

override_dh_auto_install:
	dh_auto_install
	mkdir -p $(CURDIR)/debian/tmp/usr/include/hfsplus
	install -c -m 644 -o root -g root libhfsp/src/*.h $(CURDIR)/debian/tmp/usr/include/hfsplus

override_dh_auto_clean:
	dh_auto_clean
	find . -type l -exec rm {} \;
	rm -rf conftest conftest.o debian/*.[17] \
		doc/Makefile.in doc/Makefile libhfsp/src/Makefile.in \
		libhfsp/test/.deps/ libhfsp/test/Makefile.in \
		libhfsp/test/Makefile libhfsp/Makefile.in config.h.in

override_dh_install:
	dh_install -X.la --fail-missing

override_dh_strip:
	dh_strip --no-automatic-dbgsym
