#!/usr/bin/make -f
#export DH_VERBOSE=1

# Use automake 1.11 due to bug in automake-1.14.
# see: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16375
# TODO: Remove this, when the bug is fixed.
export AUTOMAKE = automake-1.11
export ACLOCAL = aclocal-1.11

# The autotools in squeeze (Debian 6) are too old, so don't use autoreconf.
ifeq ($(shell cut -c1 /etc/debian_version),6)
AUTORECONF =
else
AUTORECONF = --with autoreconf
endif

%:
	dh $@ --parallel $(AUTORECONF)

override_dh_auto_configure:
	dh_auto_configure -- $(shell DEB_LDFLAGS_MAINT_APPEND="-Wl,-z,defs" dpkg-buildflags --export=configure) \
		--disable-clamav

override_dh_auto_build-arch:
	dh_auto_build -a -- V=1

override_dh_auto_install:
	dh_auto_install
	rm debian/libclamunrar6/usr/lib/*.la
	rm debian/libclamunrar6/usr/lib/*.so
