#!/usr/bin/make -f

# Include files needed for tests
export DH_GOLANG_INSTALL_EXTRA := \
	internal/exif/DATA \
	internal/exif/sidecars/xmpsidecar/DATA \
	internal/fakefs/TESTDATA \
	internal/fshelper/TESTDATA

IMMICH_GO := debian/_build/bin/immich-go

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

execute_after_dh_auto_build:
	mkdir -p debian/completion
	cd debian/completion && mkdir -p bash fish zsh
	$(IMMICH_GO) completion bash > debian/completion/bash/immich-go
	$(IMMICH_GO) completion fish > debian/completion/fish/immich-go.fish
	$(IMMICH_GO) completion zsh > debian/completion/zsh/_immich-go
#	$(IMMICH_GO) gen man --dir=debian/man

override_dh_auto_install:
	dh_auto_install -- --no-source

# Remove binaries from the "internal" package
execute_after_dh_auto_install:
	rm $(CURDIR)/debian/immich-go/usr/bin/cmd
	rm $(CURDIR)/debian/immich-go/usr/bin/createUser
	rm $(CURDIR)/debian/immich-go/usr/bin/docs
	rm $(CURDIR)/debian/immich-go/usr/bin/downloader
