#!/usr/bin/make -f

DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

#CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
#CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
#CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
#LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)

#include /usr/share/cdbs/1/rules/debhelper.mk
#include /usr/share/cdbs/1/class/autotools.mk

DEB_DH_INSTALL_ARGS := --sourcedir=debian/tmp

CPPFLAGS += -DRESIP_FIXED_POINT
CXXFLAGS += -fpermissive
LDFLAGS += -lcares -lcrypto

override_dh_auto_configure:
	dh_auto_configure -- \
		--with-ssl \
		--with-mysql \
		--with-apps \
		--enable-ipv6 \
		--with-radius \
 	 	--with-c-ares \
		--with-b2bua

override_dh_auto_build:
	dh_auto_build --parallel

# don't actually run the test cases, they don't run well
# automatically and require network access
override_dh_auto_test:
	true

# force building in the pkgroot or it won't build
%:
	dh $@ --builddirectory=.

#install/repro::
#	cp debian/repro.config-sample debian/repro/etc/repro/repro.config

#install/resiprocate-turn-server::
#	cp debian/reTurnServer.config-sample debian/resiprocate-turn-server/etc/reTurnServer.config

