#!/usr/bin/make -f

export DH_VERBOSE=1

# libtest-drive-gnu.so.0.5.0 由 dh_fortran_lib 用 patchelf 改写 soname 后，
# binutils objcopy 无法处理该文件（corrupt string table index），导致 dh_strip
# 生成 dbgsym 时必然失败。nostrip 跳过剥离/DWARF 处理，不影响库的运行功能。
export DEB_BUILD_OPTIONS := $(DEB_BUILD_OPTIONS) nostrip

# The magic debhelper  rule
%:
	dh $@ --with fortran


override_dh_auto_clean:
	rm -rf build 

override_dh_auto_configure:
	meson setup build --prefix=$(CURDIR)/debian/tmp/usr

override_dh_auto_build:
	meson compile -C build	

override_dh_auto_test:
	@echo Bypass tests this build. require downloads

override_dh_auto_install:
	meson install -C build

override_dh_dwz:
	@echo "Override dh_dwz: it breaks on shlibs edited by patchelf"
