#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --builddirectory=_build --buildsystem=golang

execute_after_dh_auto_build:
	# Rename binary to deconflict with Midnight Commander (see https://lists.debian.org/debian-devel/2024/04/msg00368.html)
	mv _build/bin/mc _build/bin/minio-client

	# Generate the man pages
	mkdir man1/
	TZ=UTC HOME="~" help2man _build/bin/minio-client -n "Unix like utilities for object store" --no-info --no-discard-stderr --version-string=$(DEB_VERSION_UPSTREAM) > man1/minio-client.1

override_dh_auto_install:
	dh_auto_install -- --no-source
