#!/usr/bin/make -f

# The "gen" directory is needed for the tests, but the
# binary is not used and must not be installed.
# The file metadecoder_iptc_fields.json is embedded.
export DH_GOLANG_INSTALL_EXTRA := metadecoder_iptc_fields.json \
                                  gen
export DH_GOLANG_EXCLUDES := gen

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

# The images used for testing are not included in the Debian package,
# due to an unclear licensing/copyright situation.
# Therefore, most of the testing has to be disabled.
RUN="TestStringer|TestParseXMPGPSCoordinate|TestRat|TestReadNBounds|TestDecompressZTXtBounds|TestDecodePNGZTXtRawProfileIPTC|TestResolveCodedCharacterSetShortInput|TestSubIFDFanOutLimitNumTags"
override_dh_auto_test:
	dh_auto_test $(DH_BUILD_OPTS) -- -run=$(RUN)
