File: rules

package info (click to toggle)
varnish 6.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 19,876 kB
  • sloc: ansic: 97,412; javascript: 9,421; sh: 4,771; python: 2,170; makefile: 1,315; awk: 114; ruby: 34
file content (119 lines) | stat: -rwxr-xr-x 3,646 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
114
115
116
117
118
119
#!/usr/bin/make -f

DH_VERBOSE=1

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
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

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

# Workaround for a breaking change in GNU make 4.3.
H := \#

# Extract varnishd ABI and VRT versions, for dependencies
VARNISHD_ABI = $(shell \
	printf '$(H)include "vcs_version.h"\nVCS_Version\n' | \
	cpp - -Iinclude | \
	tail -1 | \
	tr -d '"')

VARNISHD_VRT = $(shell \
	printf '$(H)include "vdef.h"\n$(H)include "vrt.h"\n%s.%s\n' \
		VRT_MAJOR_VERSION VRT_MINOR_VERSION | \
	cpp - -Iinclude | \
	tail -1 | \
	tr -c -d '[0-9.]')

VMOD_ABI       = varnishabi-$(VARNISHD_VRT)
VMOD_strictABI = varnishabi-strict-$(VARNISHD_ABI)

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 $@

ifeq (,$(filter test,$(LOCAL_BUILD_OPTIONS)))
# Disable automated build tests
override_dh_auto_test:
endif

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

override_dh_auto_install:
	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

override_dh_auto_install-arch:
	dh_auto_install -a
	rm -v debian/tmp/usr/share/doc/varnish/builtin.vcl
	rm -v debian/tmp/usr/share/doc/varnish/example.vcl

override_dh_install-arch:
	install -d debian/tmp/etc/varnish
	install -T -m 0644 etc/example.vcl debian/tmp/etc/varnish/default.vcl
	dh_install -a
	@ # Override to add the "varnishreload" script
	install -o root -g root -m 755 \
		$(CURDIR)/debian/varnishreload \
		$(CURDIR)/debian/varnish/usr/share/varnish/varnishreload

override_dh_installchangelogs:
	dh_installchangelogs -XChangeLog doc/changes.html

override_dh_installdocs:
	dh_installdocs
	@ # Use the packaged javascript libraries
	if [ -d debian/varnish-doc ]; then \
	  rm -vf debian/varnish-doc/usr/share/doc/varnish/html/_static/jquery.js; \
	  ln -vs /usr/share/javascript/jquery/jquery.js \
	    debian/varnish-doc/usr/share/doc/varnish/html/_static/jquery.js; \
	  rm -vf debian/varnish-doc/usr/share/doc/varnish/html/_static/underscore.js; \
	  ln -vs /usr/share/javascript/underscore/underscore.js \
	    debian/varnish-doc/usr/share/doc/varnish/html/_static/underscore.js; \
	fi

# Override to add several init scripts
override_dh_installinit:
	dh_installinit -a
	dh_installinit --name=varnishlog
	dh_installinit --name=varnishncsa

override_dh_makeshlibs:
	dh_makeshlibs -VUpstream-Version

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

override_dh_gencontrol:
	echo "Varnish:ABI=$(VMOD_ABI)"             >> debian/varnish.substvars
	echo "Varnish:strictABI=$(VMOD_strictABI)" >> debian/varnish.substvars
	dh_gencontrol