#!/usr/bin/make -f

# yarn wants to create ~/.yarn/
export HOME = $(CURDIR)/debian/home

%:
	dh $@ --with installsysusers

# go leaves non-writable directories behind
execute_before_dh_clean:
	find debian/home/go -type d -print0 | xargs -0 -r chmod u+rwx

override_dh_auto_build:
	cd internal/webui && yarnpkg install --network-timeout 100000
	cd internal/webui && yarnpkg build
	cd api/pb && protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative pgwatch.proto
	go build ./cmd/pgwatch/
	mkdocs build

override_dh_dwz:
	# skip, doesn't work
