#!/usr/bin/make -f

# Enable Debian Hardening
# https://wiki.debian.org/Hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
# Include all defaults, including buildflags.mk
include /usr/share/dpkg/default.mk

# Set unit test timeout multiplier to make slow tests
# pass on loaded builders.
export CK_TIMEOUT_MULTIPLIER=5

override_dh_auto_test:
	dh_auto_test -O--no-parallel -- ARGS=--output-on-failure

# Start earlier than MySQL which has value 19
override_dh_installinit-arch:
	dh_installinit -n --name=garb -- defaults 18 22

override_dh_installsystemd:
	dh_installsystemd --name=garb

override_dh_auto_configure:
	# Remove bundled asio to force use of system libasio-dev
	rm -rf asio/
	dh_auto_configure

override_dh_auto_install:
	dh_auto_install
	# Install static CTestTestfile.cmake for ctest support
	mkdir -p debian/tmp/usr/share/galera-test
	cp debian/additions/CTestTestfile.cmake debian/tmp/usr/share/galera-test/

%:
	dh $@
