File: rules

package info (click to toggle)
varnish 7.7.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,256 kB
  • sloc: ansic: 104,222; python: 2,679; makefile: 1,303; sh: 1,077; awk: 114; perl: 105; ruby: 41
file content (113 lines) | stat: -rwxr-xr-x 3,797 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/usr/bin/make -f

# Ensure documentation builds do not vary based on locale
export LC_ALL = C.UTF-8

# LTO needs to be disabled until it will be compatible with jemalloc
export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk

# List of architectures where jemalloc is not available
DISABLE_JEMALLOC_ARCH_LIST := hppa m68k

# List of architectures where tests are not expected to fail
RELIABLE_TESTS_ARCH_LIST := amd64 arm64 loong64 ppc64el s390x

# Set local state dir for FHS
LOCAL_CONFIGURE_FLAGS = --localstatedir=/var/lib

# do not waste CI resources by running the package tests again and again
ifneq (, $(filter test-build-% reprotest, $(CI_JOB_NAME_SLUG)))
DEB_BUILD_OPTIONS += nocheck
endif

ifneq ($(filter $(DEB_HOST_ARCH),$(DISABLE_JEMALLOC_ARCH_LIST)),)
LOCAL_CONFIGURE_FLAGS += --disable-jemalloc
endif

# Fix FTBFS on i386:
# https://github.com/varnishcache/varnish-cache/issues/1875
CFLAGS += -fexcess-precision=standard

# Disable reproducible cflags as embedding them in to the binary makes the
# build unreproducible.
export VCC_CC=exec \
	$(DEB_HOST_GNU_TYPE)-gcc \
	$(shell DEB_BUILD_MAINT_OPTIONS="$(DEB_BUILD_MAINT_OPTIONS) reproducible=-all" dpkg-buildflags --get CFLAGS) \
	-Werror -Wno-error=unused-result -pthread -fpic -shared -Wl,-x -o %o %s

# Main build rule, leave everything to debhelper
%:
	dh $@

override_dh_auto_test:
	# ignore the blhc false positives (see $VCC_CC)
	@echo 'blhc: ignore-line-regexp: .+"exec .+-gcc .+ -o %o %s" .+'
ifneq (, $(filter $(DEB_HOST_ARCH), $(RELIABLE_TESTS_ARCH_LIST)))
	dh_auto_test
else
	dh_auto_test || true
endif

# Override to add local configure flags
override_dh_auto_configure:
	dh_auto_configure -- $(LOCAL_CONFIGURE_FLAGS)

execute_after_dh_auto_build:
	$(MAKE) html
	cd doc && $(MAKE) changes.html

execute_after_dh_auto_install:
	@ # Remove .la files
	@ # (See http://wiki.debian.org/ReleaseGoals/LAFileRemoval)
	find $(CURDIR)/debian/ -name \*.la -delete
	@ # Nuke the static libs too
	find $(CURDIR)/debian -name \*.a -delete
	rm -v debian/tmp/usr/share/doc/varnish/example.vcl
	rm -v debian/tmp/usr/bin/varnishstat_help_gen

execute_after_dh_install-arch:
	install -T -m 0644 etc/example.vcl debian/varnish/etc/varnish/default.vcl
	install -m 755 \
		debian/varnishreload \
		debian/varnish/usr/share/varnish/varnishreload

override_dh_installchangelogs:
	dh_installchangelogs -XChangeLog doc/changes.html

execute_after_dh_installman:
	mkdir -p debian/libvarnishapi-dev/usr/share/man/man1/
	pod2man --section=1p --utf8 debian/extra/dh_varnishabi \
		debian/libvarnishapi-dev/usr/share/man/man1/dh_varnishabi.1p

execute_after_dh_installdocs:
#	Use the packaged javascript libraries
	if [ -d debian/varnish-doc ]; then \
	cd debian/varnish-doc/usr/share/doc/varnish/html/_static/ && \
	ln -vsf /usr/share/javascript/jquery/jquery.js jquery.js && \
	ln -vsf /usr/share/javascript/sphinxdoc/1.0/doctools.js doctools.js && \
	ln -vsf /usr/share/javascript/sphinxdoc/1.0/language_data.js language_data.js && \
	ln -vsf /usr/share/javascript/sphinxdoc/1.0/searchtools.js searchtools.js && \
	ln -vsf /usr/share/javascript/underscore/underscore.js underscore.js ; \
	fi

execute_after_dh_installsystemd:
	dh_installsystemd --package=varnish --name=varnishncsa --no-enable

# this is a workaround for https://github.com/systemd/systemd/issues/33547
execute_after_dh_installsysusers:
	dh_installsysusers --name=varnish2

override_dh_makeshlibs:
	dh_makeshlibs -VUpstream-Version -- -c4

override_dh_compress:
	dh_compress -X/usr/share/doc/varnish-doc/html

override_dh_gencontrol:
	perl debian/extra/dh_varnishabi
	dh_gencontrol -- \
		-V"Varnish:gcc=$(shell echo gcc-$(DEB_HOST_GNU_TYPE) | sed -e 's/_/-/g')"