#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

ifeq ($(DEB_BUILD_ARCH_OS),linux)
  SYSTEMD_PARAMS := --with-systemd-journal --with-systemd-unit-dir=/usr/lib/systemd/system
else
  SYSTEMD_PARAMS := --without-systemd-journal --without-systemd-unit-dir
endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- --libdir=/usr/lib \
                             --htmldir=/usr/share/doc/realmd/html \
                             --with-new-samba-cli-options=yes \
                             --with-distro=debian ${SYSTEMD_PARAMS}

override_dh_installchangelogs:
	dh_installchangelogs NEWS

override_dh_install:
	dh_install
	# drop zero-byte file
	rm debian/realmd/usr/share/doc/realmd/html/realmd-docs.proc
