#!/usr/bin/make -f

# Aim for the top, adapt if anything should break on the buildds.
DEB_BUILD_MAINT_OPTIONS=	hardening=+all future=+lfs
export DEB_BUILD_MAINT_OPTIONS

include /usr/share/dpkg/default.mk

include /usr/share/debhelper/dh_package_notes/package-notes.mk

export TEST_ID3_MEOW=	/usr/share/doc/libjs-scriptaculous/test/functional/sword.mp3.gz

%:
	dh $@ --buildsystem=golang --with=golang

execute_after_dh_auto_clean:
	# This is a hack. This is a horrible hack.
	find go/id3 -mindepth 1 -maxdepth 1 -printf '%f ' | xargs rm -fv

execute_before_dh_auto_configure:
	# This is a hack. This is a horrible hack.
	find go/id3 -mindepth 1 -maxdepth 1 -exec ln -s -- '{}' . ';'

execute_after_dh_auto_test:
	env TEST_ID3=./_build/bin/id3 python3 -m pytest -- python/tests/unit

override_dh_auto_install:

override_dh_installchangelogs:
	dh_installchangelogs -X CHANGES
	install -m 644 CHANGES debian/id3/usr/share/doc/id3/NEWS
