#!/usr/bin/make -f
#
# redumper — repackage of the upstream statically-linked linux-x64 binary.
# Nothing is compiled here, and nothing is generated: debian/redumper.1 is a
# hand-written page shipped verbatim.
#
# It used to be stamped at build time (@TAG@/@DATE@ substituted from the
# changelog version), which was backwards. The prose is maintained by hand and
# does not move when the package does, so a header naming the shipped release
# made every build claim the page documented the binary it came with — while the
# page's own NOTES admitted it might be stale. The .TH header now carries a FIXED
# marker naming the build the text was actually written against (b724), which is
# what lets a reader see their binary is newer. Generated pages are the opposite
# case and do stamp: see aaru, whose page is produced from --help at build time.

%:
	dh $@

# The upstream binary is prebuilt and statically linked — there is nothing to
# configure, compile or test.
#
# On arm64, swap in the linux-arm64 binary. The .orig tarball (Debtransform-Tar)
# is the linux-x64 zip, so bin/redumper arrives as the x86-64 build; the arm64
# zip travels as a Debtransform-Files extra (obs-build covers it with
# --include-binaries) and is unpacked here. On amd64 there is nothing to do.
# This runs AFTER dpkg-source has built the source package from the pristine
# tree, so overwriting bin/redumper here does not perturb the .dsc.
override_dh_auto_build:
ifeq ($(DEB_HOST_ARCH),arm64)
	unzip -o redumper-b*-linux-arm64.zip
	install -m 0755 redumper-b*-linux-arm64/bin/redumper bin/redumper
endif

override_dh_auto_test:

# Do not touch the upstream release binary: it is statically linked and
# shipped as-is by upstream. Stripping / dwz would only risk corrupting it and
# would make the packaged binary differ from the published release.
override_dh_strip:

override_dh_dwz:
