| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
include /usr/share/dpkg/architecture.mk |
| 4 |
include /usr/share/dpkg/default.mk |
| 5 |
|
| 6 |
# Uncomment this to turn on verbose mode. |
| 7 |
# export DH_VERBOSE=1 |
| 8 |
|
| 9 |
export DH_GOLANG_EXCLUDES := plugin/builtin plugin/someteam.example.com |
| 10 |
# Setting DH_GOLANG_EXCLUDES_ALL to false to ensure that only files from the |
| 11 |
# plugin folder are excluded during the build process, while keeping them in |
| 12 |
# the source. These files are necessary for Autopkgtest to run successfully. |
| 13 |
export DH_GOLANG_EXCLUDES_ALL := 0 |
| 14 |
export DH_GOLANG_INSTALL_EXTRA := plugin/someteam.example.com/v1/bashedconfigmap/BashedConfigMap |
| 15 |
|
| 16 |
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) |
| 17 |
|
| 18 |
LDFLAGS := \ |
| 19 |
-X 'sigs.k8s.io/kustomize/api/provenance.buildDate=2023-01-31T23:38:41Z' \ |
| 20 |
-X 'sigs.k8s.io/kustomize/api/provenance.version=(test)' |
| 21 |
|
| 22 |
# Default list of tests to skip that try to access the internet |
| 23 |
SKIP_TESTS_LIST := \ |
| 24 |
TestDefaultAbsPluginHomeNoXdgWithDotConfig|\ |
| 25 |
TestDefaultAbsPluginHomeNoXdgJustHomeDir|\ |
| 26 |
TestAnnoOriginRemoteBuiltinTransformer|\ |
| 27 |
TestRemoteLoad_RemoteProtocols|\ |
| 28 |
TestAnnoOriginRemoteBuiltinGenerator|\ |
| 29 |
TestCustomOpenApiFieldFromOverlayWithRemoteSchema|\ |
| 30 |
TestCustomOpenApiFieldFromBaseWithRemoteSchema|\ |
| 31 |
TestCustomOpenApiFieldBasicUsageWithRemoteSchema|\ |
| 32 |
TestExistingCacheDir|\ |
| 33 |
TestRemoteRootNoRef|\ |
| 34 |
TestResourcesRepoNotFile|\ |
| 35 |
TestNestedRemoteRoots|\ |
| 36 |
TestRemoteRoot|\ |
| 37 |
TestRemoteFile|\ |
| 38 |
TestBadArgs|\ |
| 39 |
TestRemoteTargetDefaultDst|\ |
| 40 |
ExampleFilter|\ |
| 41 |
TestSedTransformer|\ |
| 42 |
TestPluginEnvironment|\ |
| 43 |
TestLoaderHTTPMalformedURL |
| 44 |
|
| 45 |
# Additional tests to skip not supported on linux/riscv64 |
| 46 |
ifeq ($(DEB_HOST_ARCH),riscv64) |
| 47 |
SKIP_TESTS_LIST := $(SKIP_TESTS_LIST)|\ |
| 48 |
TestCompiler|\ |
| 49 |
TestLoader|\ |
| 50 |
TestReusableCustomTransformers|\ |
| 51 |
TestIssue1251_Plugins_ProdVsDev|\ |
| 52 |
TestIssue1251_Plugins_Local|\ |
| 53 |
TestIssue1251_Plugins_Bundled|\ |
| 54 |
TestPluginsNotEnabled |
| 55 |
endif |
| 56 |
|
| 57 |
# Remove spaces after "|" |
| 58 |
SKIP_TESTS := $(subst | ,|,$(SKIP_TESTS_LIST)) |
| 59 |
|
| 60 |
%: |
| 61 |
dh $@ --builddirectory=_build --buildsystem=golang |
| 62 |
|
| 63 |
execute_after_dh_auto_configure: |
| 64 |
# dh_auto_configure first copies source files to the build root, then |
| 65 |
# symlinks libraries from /usr/share/gocode/src. |
| 66 |
# The dependency symlink will NOT occur when the library package uses the |
| 67 |
# same XS-Go-Import-Path (DH_GOPKG) as the source package and ship files |
| 68 |
# under the same GOPATH, causing problems in dh_auto_build due to lack of |
| 69 |
# installed libraries. |
| 70 |
# dh_auto_configure: warning: "sigs.k8s.io/kustomize" is already installed. |
| 71 |
# https://salsa.debian.org/go-team/packages/dh-golang/-/blob/81892fe8d3a51a22c910a649052669dd9f18837e/lib/Debian/Debhelper/Buildsystem/golang.pm#L495 |
| 72 |
ln -vs /usr/share/gocode/src/sigs.k8s.io/kustomize/kyaml $(CURDIR)/_build/src/sigs.k8s.io/kustomize/kyaml |
| 73 |
|
| 74 |
override_dh_auto_test: |
| 75 |
# Set missing flags and skip tests that try to access the internet. |
| 76 |
dh_auto_test --builddirectory=_build -- -ldflags "$(LDFLAGS)" -skip="$(SKIP_TESTS)" -timeout 30m |
| 77 |
|
| 78 |
execute_before_dh_auto_install: |
| 79 |
find $(CURDIR)/_build/src/sigs.k8s.io/kustomize/plugin -type f -name "*.so" -delete |
| 80 |
|
| 81 |
override_dh_auto_install: |
| 82 |
dh_auto_install -- --no-binaries |