-
Notifications
You must be signed in to change notification settings - Fork 1
/
rules
executable file
·85 lines (68 loc) · 2.75 KB
/
rules
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
#!/usr/bin/make -f
DH_VERBOSE=1
# List of architectures that lack the *_2POW definitions in varnish,
# which is needed by jemalloc
DISABLE_JEMALLOC_ARCH_LIST := hppa s390 sparc m68k
# Explicitly initialize a variable to select architecture, unless it has been
# defined before. This is compared against the DISABLE_*_LIST variables later
# in this makefile
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
# Set local state dir for FHS
LOCAL_CONFIGURE_FLAGS = --localstatedir=/var/lib
ifneq ($(filter $(DEB_HOST_ARCH),$(DISABLE_JEMALLOC_ARCH_LIST)),)
LOCAL_CONFIGURE_FLAGS += --disable-jemalloc
endif
VMOD_ABI = $(shell printf '\#include "vmod_abi.h"\nVMOD_ABI_Version' | cpp - -Iinclude | sed '/^\#/D;s/"//g;s/\([A-Z]\)/\L\1/g;s/[^a-z0-9.]/-/g;s/varnish/varnishabi/')
# Main build rule, leave everything to debhelper
%:
dh $@ --parallel
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 -a
@ # Activate the default backend
sed -i '/backend default {/,/}/ s/^#[[:space:]]//' \
$(CURDIR)/debian/tmp/etc/varnish/default.vcl
@ # 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_install:
dh_install -a --fail-missing
@ # Override to add the "reload-vcl" script
install -o root -g root -m 755 \
$(CURDIR)/debian/reload-vcl \
$(CURDIR)/debian/varnish/usr/share/varnish/reload-vcl
override_dh_installdocs:
dh_installdocs
@ # Use the packaged javascript libraries
if [ -d $(CURDIR)/debian/varnish-doc ]; then \
rm -f $(CURDIR)/debian/varnish-doc/usr/share/doc/varnish-doc/html/_static/jquery.js; \
ln -s /usr/share/javascript/jquery/jquery.js \
$(CURDIR)/debian/varnish-doc/usr/share/doc/varnish-doc/html/_static/jquery.js; \
rm -f $(CURDIR)/debian/varnish-doc/usr/share/doc/varnish-doc/html/_static/underscore.js; \
ln -s /usr/share/javascript/underscore/underscore.js \
$(CURDIR)/debian/varnish-doc/usr/share/doc/varnish-doc/html/_static/underscore.js; \
fi
override_dh_gencontrol:
echo "Varnish:ABI=$(VMOD_ABI)" >> debian/substvars
if [ -n "$$DEBIAN_OVERRIDE_BINARY_VERSION" ]; then \
dh_gencontrol -- -Tdebian/substvars -v$$DEBIAN_OVERRIDE_BINARY_VERSION; \
else \
dh_gencontrol -- -Tdebian/substvars; \
fi
# Override to add several init scripts
override_dh_installinit:
dh_installinit -a
dh_installinit --name=varnishlog
dh_installinit --name=varnishncsa
override_dh_compress:
dh_compress -X/usr/share/doc/varnish-doc/html
override_dh_strip:
dh_strip --dbg-package=varnish-dbg