#!/usr/bin/make -f

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

export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# GCC 15+ 默认 C23：'bool' 成为关键字、旧式空括号函数声明 () 等价于 (void)，
# 导致 utils/magic.h 的 typedef unsigned char bool 与 bpDump.c 对
# CIFGetOutputScale(1000) 的调用报错。固定为 gnu17 以保留 K&R 声明语义
# 与 typedef bool（上游源码基于 C89/C99 编写）。
export DEB_CFLAGS_MAINT_APPEND = -std=gnu17

%:
	dh $@ --no-parallel


override_dh_auto_install:
	dh_auto_install
	sed -i -e "s,/usr/bin/wish,$(shell readlink -f /usr/bin/wish)," debian/magic/usr/bin/magic

override_dh_auto_clean:
	dh_auto_clean
	-rm -f scripts/config.cache
