#!/usr/bin/make -f

# The version comes from .tarball-version in the release archive, which
# "meson dist" writes. Taking it from the Debian version instead would put a
# series suffix such as ~ubuntu24.04.1 into the version banner.

# Link the runtime plugin with -z now as well: it is opened with dlopen, and a
# resolved symbol table is what keeps the first call out of the resolver.
export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow

%:
	dh $@

# The plugin directories are named here because dh_auto_configure passes a
# multiarch --libdir, and the defaults are built from it.
override_dh_auto_configure:
	dh_auto_configure -- \
		-Dscreen=slang \
		-Dplugins_dir=/usr/lib/bluerig/plugins \
		-Druntime_plugins_dir=/usr/lib/bluerig/runtime-plugins \
		-Dlua=enabled

override_dh_installchangelogs:
	# Ours, not the ChangeLog inherited from upstream mc, which dh_installchangelogs
	# would find on its own and which stops where bluerig begins.
	dh_installchangelogs CHANGELOG.md

override_dh_missing:
	dh_missing --fail-missing
