#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CONFIG_OPTS += --disable-opt
endif

override_dh_auto_configure:
	dh_auto_configure -- \
--enable-zlib \
--enable-lzo \
--enable-lzma \
--prefix=/usr \
$(CONFIG_OPTS)

override_dh_auto_install:
	$(MAKE) DESTDIR=$$(pwd)/debian/tmp prefix=/usr install

override_dh_installdocs:
	#kyotocabinet-doc doc's created in install file, so this doesn't apply there
	dh_installdocs --link-doc=libkyotocabinet16v5
	# mega-lameness, seem to not be necessary on buildds, but with cowbuilder/pbuilder?
	rm -rf $$(pwd)/debian/kyotocabinet-doc/usr/share/doc/libkyotocabinet16v5

override_dh_strip:
	dh_strip --package=libkyotocabinet16v5 --dbg-package=libkyotocabinet16v5-dbg
	dh_strip

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog

override_dh_builddeb:
	dh_builddeb -- -Zxz -z2

override_dh_makeshlibs:
	dh_makeshlibs -V

override_dh_auto_test:
	echo testsuite disabled

%:
	dh $@
