#!/usr/bin/make -f

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

#DEB_DH_INSTALL_ARGS := --sourcedir=debian/tmp

# reSIProcate ABI is dependent on the compile flags
# this should be fixed in v1.9
# for now, we must emulate the compile flags that were used to
# build reSIProcate on Debian
CPPFLAGS += -DRESIP_TOOLCHAIN_GNU
#CPPFLAGS += -DRESIP_OSTYPE_LINUX
#CPPFLAGS += -DRESIP_ARCH_X86_64
#CPPFLAGS += -DHAVE_sockaddr_in_len
CPPFLAGS += -DUSE_CARES
CPPFLAGS += -DUSE_SSL
CPPFLAGS += -DUSE_IPV6
#CPPFLAGS += -DHAVE_EPOLL

# cmake doesn't appear to recognize CPPFLAGS
CFLAGS += $(CPPFLAGS)
CXXFLAGS += $(CPPFLAGS)

%:
	dh $@ --builddirectory=.

override_dh_install:
	dh_install
	sed -i \
		-e 's!UserAccountFile = users.txt!UserAccountFile = /etc/registrationAgent/users.txt!' \
		debian/registration-agent/etc/registrationAgent/registrationAgent.config
	install -D registration-agent.init debian/registration-agent/etc/init.d/registration-agent

