#!/usr/bin/make -f 
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
#ifeq ($(CARCH), amd64)
#export LD_LIBRARY=/usr/lib/x86_64-linux-gnu/libfakeroot:/usr/lib64/libfakeroot:/usr/lib32/libfakeroot
#../../sysroot/lib/powerpc-linux-gnu/:../../sysroot/usr/lib/powerpc-linux-gnu/
#endif

export DEB_BUILD_HARDENING=1
export DEB_BUILD_OPTIONS+=noopt
#
#include /usr/share/hardening-includes/hardening.make
#
export CFLAGS=$(shell dpkg-buildflags --get CFLAGS)
export LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS)
#export CFLAGS+=$(HARDENING_CFLAGS)
#export LDFLAGS+=$(HARDENING_LDFLAGS)
DH_OPTION=-v

%:
	dh $@ --with systemd,autoreconf

override_dh_auto_build: 
	scripts/create-sym-links.sh
	dh_auto_build

override_dh_auto_test:

override_dh_strip:

override_dh_auto_install:
	dh_auto_install
	scripts/deb-rst2man.sh .
	install --mode=644 -D debian/rsyslog.d-ptmd.conf debian/tmp/etc/rsyslog.d/30-ptmd.conf
	install --mode=644 -D debian/ptmd.conf debian/tmp/etc/systemd/system/ptmd.service.d/ptmd.conf

override_dh_installinit:
	dh_installinit --no-act
