#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2022 IOhannes m zmölnig <umlaeute@debian.org>
# Description: Main Debian packaging script for CSound Plugins

#export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export DEB_CPPFLAGS_MAINT_APPEND = -DH5_USE_110_API
%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_BUILD_RPATH_USE_ORIGIN=ON \
		-DBUILD_RELEASE=ON \
		-DUSE_GIT_COMMIT=OFF \
		-DUSE_DOUBLE=ON \
		-DABLETON_LINK_HOME=/ \
		-DDEFAULT_STK_RAWWAVE_PATH=/usr/share/stk/rawwaves \
		$(empty)

override_dh_auto_install:
	dh_auto_install --destdir=debian/tmp/


################ d/copyright helper ##############
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = \
        debian/.*
# licensecheck v1
.PHONY: licensecheck
licensecheck:
	LANG=C.UTF-8 licensecheck \
		-i "^($(DEB_COPYRIGHT_CHECK_IGNORE_REGEX))$$" \
		--check '.*' --recursive --deb-machine --lines 0 * \
		> debian/copyright_newhints
	cmp debian/copyright_hints debian/copyright_newhints \
		&& rm debian/copyright_newhints