#!/usr/bin/make -f

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed
export ACLOCAL_M4=.

%:
	dh $@ --with autoreconf

override_dh_autoreconf:
	dh_autoreconf --as-needed
override_dh_auto_configure:
	dh_auto_configure -- --enable-shared --disable-silent-rules --disable-static CPPFLAGS="$(CPPFLAGS) -D_LARGEFILE_SOURCE"

override_dh_auto_install:
	$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
	rm -f debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.la

override_dh_install:
	dh_install --fail-missing

override_dh_installchangelogs:
	dh_installchangelogs NEWS
