#!/usr/bin/make -f
export DEB_BUILD_HARDENING=1
CFLAGS=$(shell dpkg-buildflags --get CFLAGS)
LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS)
PPPD_PLUGIN_DIR := $(shell dh_ppp --plugin-dir)
CFLAGS+=$(HARDENING_CFLAGS)
LDFLAGS+=$(HARDENING_LDFLAGS)
export DEB_BUILD_OPTIONS=nocheck
override_dh_auto_configure:
	dh_auto_configure -- \
		--with-runtime-dir="/var/run/sstpc" \
		--with-pppd-plugin-dir=$(PPPD_PLUGIN_DIR) \
		--with-libevent=2

%:
	dh $@ --with autoreconf,ppp

override_dh_makeshlibs:
	dh_makeshlibs -X$(PPPD_PLUGIN_DIR)


#get-orig-source:
#	cd $(dir $(firstword $(MAKEFILE_LIST)))../ && \
#		uscan --rename --force-download --watchfile debian/watch --destdir $(CURDIR)
