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

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

include /usr/share/dpkg/pkg-info.mk

export DEB_VERSION_UPSTREAM

ifneq (,$(filter $(DEB_BUILD_PROFILES),pkg.rtpengine.no-transcoding))
export with_transcoding = no
endif
ifneq (,$(filter $(DEB_BUILD_PROFILES),pkg.rtpengine.asan))
export DO_ASAN_FLAGS = 1
# this prevents dh from setting default (including -O2) which we don't want
export DEB_CFLAGS_MAINT_SET =
export DEB_LDFLAGS_MAINT_SET =
endif

export deb_systemdsystemunitdir = $(shell pkg-config --variable=systemdsystemunitdir systemd)

%:
	dh $@

execute_before_dh_auto_install-indep:
	# markdown README
	markdown README.md | gzip -9n > debian/README.html.gz
	gzip -9n < README.md > debian/README.md.gz

execute_after_dh_installsystemd:
	dh_installsystemd -prtpengine-recording-daemon --name=rtpengine-recording-nfs-mount

override_dh_dkms:
	dh_dkms -V $(DEB_VERSION_UPSTREAM)