File: rules

package info (click to toggle)
golang-k8s-sigs-kustomize-api 0.19.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,732 kB
  • sloc: makefile: 206; sh: 67
file content (81 lines) | stat: -rwxr-xr-x 3,056 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/default.mk

# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1

export DH_GOLANG_EXCLUDES := plugin/builtin plugin/someteam.example.com
# Setting DH_GOLANG_EXCLUDES_ALL to false to ensure that only files from the
# plugin folder are excluded during the build process, while keeping them in
# the source. These files are necessary for Autopkgtest to run successfully.
export DH_GOLANG_EXCLUDES_ALL := 0
export DH_GOLANG_INSTALL_EXTRA := plugin/someteam.example.com/v1/bashedconfigmap/BashedConfigMap

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

LDFLAGS := \
	-X 'sigs.k8s.io/kustomize/api/provenance.buildDate=2023-01-31T23:38:41Z' \
	-X 'sigs.k8s.io/kustomize/api/provenance.version=(test)'

# Default list of tests to skip that try to access the internet
SKIP_TESTS_LIST := \
	TestDefaultAbsPluginHomeNoXdgWithDotConfig|\
	TestDefaultAbsPluginHomeNoXdgJustHomeDir|\
	TestAnnoOriginRemoteBuiltinTransformer|\
	TestRemoteLoad_RemoteProtocols|\
	TestAnnoOriginRemoteBuiltinGenerator|\
	TestCustomOpenApiFieldFromOverlayWithRemoteSchema|\
	TestCustomOpenApiFieldFromBaseWithRemoteSchema|\
	TestCustomOpenApiFieldBasicUsageWithRemoteSchema|\
	TestExistingCacheDir|\
	TestRemoteRootNoRef|\
	TestResourcesRepoNotFile|\
	TestNestedRemoteRoots|\
	TestRemoteRoot|\
	TestRemoteFile|\
	TestBadArgs|\
	TestRemoteTargetDefaultDst|\
	ExampleFilter|\
	TestSedTransformer|\
	TestPluginEnvironment

# Additional tests to skip not supported on linux/riscv64
ifeq ($(DEB_HOST_ARCH),riscv64)
SKIP_TESTS_LIST := $(SKIP_TESTS_LIST)|\
	TestCompiler|\
	TestLoader|\
	TestReusableCustomTransformers|\
	TestIssue1251_Plugins_ProdVsDev|\
	TestIssue1251_Plugins_Local|\
	TestIssue1251_Plugins_Bundled|\
	TestPluginsNotEnabled
endif

# Remove spaces after "|"
SKIP_TESTS := $(subst | ,|,$(SKIP_TESTS_LIST))

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

execute_after_dh_auto_configure:
	# dh_auto_configure first copies source files to the build root, then
	# symlinks libraries from /usr/share/gocode/src.
	# The dependency symlink will NOT occur when the library package uses the
	# same XS-Go-Import-Path (DH_GOPKG) as the source package and ship files
	# under the same GOPATH, causing problems in dh_auto_build due to lack of
	# installed libraries.
	# dh_auto_configure: warning: "sigs.k8s.io/kustomize" is already installed.
	# https://salsa.debian.org/go-team/packages/dh-golang/-/blob/81892fe8d3a51a22c910a649052669dd9f18837e/lib/Debian/Debhelper/Buildsystem/golang.pm#L495
	ln -vs /usr/share/gocode/src/sigs.k8s.io/kustomize/kyaml $(CURDIR)/_build/src/sigs.k8s.io/kustomize/kyaml

override_dh_auto_test:
	# Set missing flags and skip tests that try to access the internet.
	dh_auto_test --builddirectory=_build -- -ldflags "$(LDFLAGS)" -skip="$(SKIP_TESTS)" -timeout 30m

execute_before_dh_auto_install:
	find $(CURDIR)/_build/src/sigs.k8s.io/kustomize/plugin -type f -name "*.so" -delete

override_dh_auto_install:
	dh_auto_install -- --no-binaries