File: rules

package info (click to toggle)
kustomize 5.8.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,608 kB
  • sloc: makefile: 162; sh: 123
file content (46 lines) | stat: -rwxr-xr-x 1,879 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

include /usr/share/dpkg/default.mk
include /usr/share/dpkg/pkg-info.mk

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

ifeq (,$(filter $(DEB_HOST_ARCH), mips mipsel mips64el))
HARDENING := -buildmode=pie -ldflags="-extldflags -Wl,-z,now,-z,relro"
endif

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

# Override dh_auto_configure to use installed source files (as opposed to the
# ones in the source directory).
# https://salsa.debian.org/go-team/packages/dh-golang/-/blob/ae5fd9e2937153ca1fff1b455a392b0b570d6a96/script/dh_golang_autopkgtest#L83
override_dh_auto_configure:
	dh_auto_configure
	# This step is necessary because the upstream distributes the library with
	# a folder structure that differs from the expected Go module path.
	# The Go module for this library is sigs.k8s.io/kustomize/kustomize/v5.
	# To align the folder structure with the expected module path, this step
	# renames the 'kustomize' folder to 'v5'.
	mv $(CURDIR)/_build/src/sigs.k8s.io/kustomize/kustomize/kustomize $(CURDIR)/_build/src/sigs.k8s.io/kustomize/kustomize/v5

override_dh_auto_build:
	dh_auto_build -O --buildsystem=golang -- $(HARDENING)

execute_before_dh_auto_install:
	mv _build/bin/v5 _build/bin/kustomize
ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
	mkdir -v -p $(CURDIR)/debian/completion
	_build/bin/kustomize completion bash > $(CURDIR)/debian/completion/kustomize.bash
	_build/bin/kustomize completion fish > $(CURDIR)/debian/completion/kustomize.fish
	_build/bin/kustomize completion zsh > $(CURDIR)/debian/completion/kustomize.zsh
endif

ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
execute_before_dh_installman-arch:
	help2man debian/kustomize/usr/bin/kustomize \
		--no-info --no-discard-stderr \
		--version-string="$(DEB_VERSION_UPSTREAM)" \
		-n "Customization of Kubernetes YAML configurations" > debian/kustomize.1
endif