#!/usr/bin/make -f

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

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

%:
	dh $@ --with ppp

override_dh_autoreconf:
	dh_autoreconf
	intltoolize

override_dh_autoreconf_clean:
	dh_autoreconf_clean
	rm -f intltool-*.in
	rm -f m4/intltool.m4
	rm -f po/Makefile.in.in

override_dh_auto_configure:
	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:
	dh_install -X.la --list-missing

