#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

# Skip pt-secure-collect build for now until go-mysql is added to the archive
export DH_GOLANG_EXCLUDES := src/go/pt-secure-collect

%:
	dh $@

# Override configure, build, install, and clean to run both perl and golang build systems.
# Using dh-golang in these steps allows for go dependencies to be brought in from the archive.
override_dh_auto_configure:
	dh_auto_configure --buildsystem=golang --builddirectory=_build
	dh_auto_configure

override_dh_auto_build:
	dh_auto_build --buildsystem=golang --builddirectory=_build
	dh_auto_build

override_dh_auto_install:
	dh_auto_install --buildsystem=golang --builddirectory=_build -- --no-source
	dh_auto_install

override_dh_auto_clean:
	dh_auto_clean --buildsystem=golang --builddirectory=_build
	dh_auto_clean

override_dh_golang:
	dh_golang --builddirectory=_build

override_dh_installdocs:
	./debian/tools/create-upstream-release-notes.sh
	dh_installdocs
	rm -fv debian/RELEASENOTES
