File: rules

package info (click to toggle)
falcosecurity-libs 0.1.1dev%2Bgit20220316.e5c53d64-5.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,732 kB
  • sloc: cpp: 55,770; ansic: 37,330; makefile: 74; sh: 13
file content (51 lines) | stat: -rwxr-xr-x 1,563 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
#!/usr/bin/make -f
# -*- makefile -*-

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

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

# Increase hardening to maximum, considering attack surface
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		-DUSE_BUNDLED_DEPS=OFF \
		-DBUILD_DRIVER=OFF     \
		-DVALIJSON_INCLUDE=/usr/include/valijson \
		-DFALCOSECURITY_LIBS_VERSION="$(DEB_VERSION_UPSTREAM)" \
		-DBUILD_LIBSCAP_EXAMPLES=OFF \
		-DBUILD_LIBSINSP_EXAMPLES=OFF \
		-DCREATE_TEST_TARGETS=ON \
		-DWITH_CHISEL=ON

# I install the headers. Doing this here is way faster and easier than doing it
# with CMake.
override_dh_auto_install-arch:
	dh_auto_install -a

	Din=.; \
	Dout=debian/tmp/usr/include/falcosecurity-libs; \
	mkdir -p $$Dout && \
	rsync -am --include '*.h' --exclude debian --exclude obj-$(DEB_HOST_GNU_TYPE) --include '*/' --exclude '*' $$Din/ $$Dout && \
        cp obj-$(DEB_HOST_GNU_TYPE)/libsinsp/cri.* $$Dout/userspace/libsinsp && \
        cp obj-$(DEB_HOST_GNU_TYPE)/driver/src/driver_config.h $$Dout/driver

override_dh_auto_install-indep:
	dh_auto_install -i
	dh_dkms -i -pfalcosecurity-scap-dkms -- debian/tmp/usr/src/scap-$(DEB_VERSION_UPSTREAM)/dkms.conf

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	cd obj-$(DEB_HOST_GNU_TYPE)/libsinsp/test && ./unit-test-libsinsp
endif

# Everything is small. Compressing creates extra work for little benefit, so I
# don't do it
override_dh_compress:
	dh_compress -X.c -X.h -XCMakeLists.txt -XREADME