#!/usr/bin/make -f

#export DH_VERBOSE = 1

# XXX: This does not currently have any effect on dangling symlinks.
export DH_GOLANG_INSTALL_EXTRA := \
	process/testdata/linux/1/fd/0 \
	process/testdata/linux/1/fd/1 \
	process/testdata/linux/1/fd/2 \
	# EOL

export DH_GOLANG_GO_GENERATE := 1

# Avoid running tests that require root.
export CI := true

BUILT_SOURCE = _build/src/github.com/shirou/gopsutil/

%:
	dh $@ --builddirectory=_build

execute_before_dh_auto_test:
	# Gather information from CI, VM and build environments to be able to
	# update the code.
	-cat /proc/cpuinfo
	# We need to generate these as DH_GOLANG_INSTALL_EXTRA does not copy
	# dangling symlinks.
	ln -s /foo $(BUILT_SOURCE)/process/testdata/linux/1/fd/0
	ln -s /bar $(BUILT_SOURCE)/process/testdata/linux/1/fd/1
	ln -s /baz $(BUILT_SOURCE)/process/testdata/linux/1/fd/2
