#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/dpkg/architecture.mk

TEST_ARCHS = i386 amd64

DESTDIR = $(CURDIR)/debian/tmp

override_dh_auto_install:
	dh_auto_install
	# remove unwanted documentation
	cd $(DESTDIR)/usr/share/doc/gperftools/ && \
		rm -f ChangeLog.old INSTALL README_windows.txt
	# remove .la files
	find $(DESTDIR) -name \*.la -exec rm {} \;

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
# List of architectures for which test execution is enabled
ifneq (,$(findstring $(DEB_HOST_ARCH), $(TEST_ARCHS)))
	$(MAKE) check
endif # TEST_ARCHS
endif # nocheck

%:
	dh $@

.PHONY: override_dh_auto_install override_dh_auto_test
