File: rules

package info (click to toggle)
golang-github-containernetworking-plugins 0.9.1%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,512 kB
  • sloc: sh: 124; makefile: 18
file content (28 lines) | stat: -rwxr-xr-x 1,090 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/make -f

export DH_GOLANG_EXCLUDES := integration plugins/sample plugins/main/windows pkg/testutils/echo

DD=debian/tmp

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

override_dh_auto_test:
	# it only works with legacy iptables https://github.com/containernetworking/plugins/issues/461
	set -e; if test $$(id -u) = 0; then \
		mkdir -p $(CURDIR)/_build/bin; \
		ln -sf /usr/sbin/iptables-legacy $(CURDIR)/_build/bin/iptables; \
		PATH=$(CURDIR)/_build/bin:$$PATH dh_auto_test --no-parallel; \
		ip netns list|grep cnitest|cut -d' ' -f1|xargs -n1 ip netns delete || true; \
	fi

execute_after_dh_auto_install:
	## Exclude main packages from /usr/share/gocode.
	## These can not be imported by other packages.
	find $(DD)/usr/share/gocode/src/github.com/containernetworking/plugins/ \
		-type f -exec grep -Eq '^package (main|main_test)$$' '{}' \; -delete -print
	find $(DD)/usr/share/gocode/src/github.com/containernetworking/plugins/ \
		-type d -empty -delete -print

override_dh_installsystemd:
	dh_installsystemd --name=cni-dhcp --no-enable --no-start