File: rules

package info (click to toggle)
bpftune 0.0~git20250314.8fd59cc-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 7,592 kB
  • sloc: ansic: 254,985; sh: 3,324; makefile: 476
file content (37 lines) | stat: -rwxr-xr-x 1,088 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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export libdir=lib/$(DEB_HOST_MULTIARCH)

# On Ubuntu, the `bpftool` in path is a shell wrapper pointing at
# the binary corresponding to runtime kernel version.
#
# We do not know the kernel version being used on the system building
# this package, and in sbuild/container environments uname might not
# even match anything available to the build.
# Gladly for the build we only need the tool to generate skeleton code.
#
# If any /usr/lib/linux-tools/*/bpftool exists, locate the most recent
# version and point to that, otherwise `bpftool` from PATH will be
# used.
bpftool_binary := $(shell find -L /usr/lib/linux-tools/ -name 'bpftool' -perm /u=x 2>/dev/null | sort | head -n1)
ifneq ($(bpftool_binary),)
export BPFTOOL=$(bpftool_binary)
endif

%:
	dh $@

clean:
	dh $@
	rm -f src/*.plist

override_dh_auto_test:
	# no test for now, needs root and more magic.

override_dh_auto_install:
	dh_auto_install
	for sopath in $$(find debian -name 'libbpftune.so'); do \
		ln -sf $$(basename $$sopath.*) $$sopath ; \
	done