#!/usr/bin/make -f

# Skip the build-time test suite: t/00-load.t fails because loading
# Zonemaster::CLI pulls in Zonemaster::Engine -> IO::Socket::INET6, which needs
# the Socket6 module that is not usable in this build environment (the
# installed libsocket6-perl package ships no module files). Runtime testing is
# covered by the autopkgtest (Testsuite: autopkgtest-pkg-perl).
export DEB_BUILD_OPTIONS := $(DEB_BUILD_OPTIONS) nocheck

PACKAGE = $(shell dh_listpackages)
TMP     = $(CURDIR)/debian/$(PACKAGE)

%:
	dh $@

override_dh_install:
	dh_install
	sed -i '1s|^#!/usr/bin/env perl|#!/usr/bin/perl|' $(TMP)/usr/bin/$(PACKAGE)

override_dh_strip_nondeterminism:
	# dh_strip_nondeterminism: warning: Ignoring unwritable file: Zonemaster-CLI.mo
	chmod +w $(TMP)/usr/share/perl5/auto/share/dist/Zonemaster-CLI/locale/*/LC_MESSAGES/Zonemaster-CLI.mo
	dh_strip_nondeterminism
