#!/usr/bin/make -f

export DEB_ENABLE_TESTS = yes
# GHC can't link a PIE (Debian's Haskell libraries aren't built as PIC),
# but it can link with -z now.
export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow

%:
	dh $@

# The unit can't do anything until the zone is configured in
# /etc/tordnsel.conf; see README.Debian.
override_dh_installsystemd:
	dh_installsystemd --no-enable --no-start

# Cabal hashes the external deps of every enabled component, test suite
# included, into the unit ID, so building with and without nocheck gave
# different binaries. Pin the IPID to keep the build reproducible.
include /usr/share/dpkg/pkg-info.mk
export DEB_SETUP_GHC_CONFIGURE_ARGS += --ipid=tordnsel-$(DEB_VERSION_UPSTREAM)
