#!/usr/bin/make -f

export DH_OPTIONS
# Install everything, for testdata/ directories:
export DH_GOLANG_INSTALL_ALL := 1

# FUSE doesn’t work within schroot
export RESTIC_TEST_FUSE := 0

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

# Prevent sphinx-build from accessing the internet during build.
override_dh_auto_build: export http_proxy=127.0.0.1:9
override_dh_auto_build: export https_proxy=127.0.0.1:9
override_dh_auto_build:
	dh_auto_build -- -ldflags "-X \"main.version=$(shell cat VERSION)\""
	PYTHONPATH=. sphinx-build -N -bhtml doc/ build/html

# Do not install the restic source code, there are no downstream consumers and
# it is not intended to be used as a library right now.
override_dh_auto_install:
	dh_auto_install -- --no-source
