#!/usr/bin/make -f

export DH_GOLANG_EXCLUDES := cmd/cgctl
export DH_VERBOSE := 1

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

execute_after_dh_auto_configure:
	cd _build/src && protoc -I.:/usr/include \
		--go_out=. --go_opt=paths=source_relative \
		github.com/containerd/cgroups/cgroup1/stats/metrics.proto
	cd _build/src && protoc -I.:/usr/include \
        --go_out=. --go_opt=paths=source_relative \
		github.com/containerd/cgroups/cgroup2/stats/metrics.proto
	find _build/src/github.com/containerd/cgroups -ls
	go-fix-acronym -w -a '(Cpu|Tcp|Rss|Psi)' \
		_build/src/github.com/containerd/cgroups/cgroup1/stats/metrics.pb.go \
		_build/src/github.com/containerd/cgroups/cgroup2/stats/metrics.pb.go
