#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

PPPD_PLUGIN_DIR := $(shell dh_ppp --plugin-dir)

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
	dh $@ --with ppp

override_dh_autoreconf:
	dh_autoreconf --as-needed

override_dh_auto_configure:
	intltoolize; \
	dh_auto_configure -- \
		--libexecdir=/usr/lib/NetworkManager \
		--without-libnm-glib \
		--disable-static \
		--with-pppd-plugin-dir=$(PPPD_PLUGIN_DIR)

override_dh_makeshlibs:
	dh_makeshlibs -X/usr/lib/$(DEB_HOST_MULTIARCH)/NetworkManager/ -X/usr/lib/pppd/

override_dh_install:
	find debian/tmp -name '*.la' -print -delete
	dh_install

override_dh_missing:
	dh_missing --fail-missing
