summaryrefslogtreecommitdiffstats
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules54
1 files changed, 51 insertions, 3 deletions
diff --git a/debian/rules b/debian/rules
index 9d5b3b1..9761185 100755
--- a/debian/rules
+++ b/debian/rules
@@ -61,7 +61,6 @@ CONFFLAGS = \
-Ddbuspolicydir=/usr/share/dbus-1/system.d/ \
-Dsupport-url=$(SUPPORT_URL) \
-Ddefault-kill-user-processes=false \
- -Ddefault-hierarchy=unified \
-Ddefault-dnssec=no \
-Dpamconfdir=no \
-Dpamlibdir=/usr/lib/$(DEB_HOST_MULTIARCH)/security \
@@ -70,7 +69,6 @@ CONFFLAGS = \
-Dfirstboot=true \
-Dxkbcommon=disabled \
-Dwheel-group=false \
- -Dpwquality=disabled \
-Doomd=true \
-Durlify=true \
-Dgnutls=disabled \
@@ -101,7 +99,8 @@ CONFFLAGS = \
-Dnss-systemd=true \
-Dresolve=true \
-Dstatus-unit-format-default=combined \
- -Dstandalone-binaries=true
+ -Dstandalone-binaries=true \
+ -Dmode=$(if $(filter pkg.systemd.upstream,$(DEB_BUILD_PROFILES)),developer,release)
ifeq ($(filter nocheck,$(DEB_BUILD_PROFILES))$(filter noinsttest,$(DEB_BUILD_PROFILES)),nochecknoinsttest)
CONFFLAGS += -Dtests=false
@@ -129,6 +128,7 @@ CONFFLAGS += \
-Dtpm2=enabled \
-Dp11kit=enabled \
-Dqrencode=enabled \
+ -Dpwquality=enabled \
-Dhomed=enabled \
-Duserdb=true \
-Dpcre2=enabled \
@@ -153,6 +153,7 @@ CONFFLAGS += \
-Dtpm2=disabled \
-Dp11kit=disabled \
-Dqrencode=disabled \
+ -Dpwquality=disabled \
-Dhomed=disabled \
-Duserdb=false \
-Dpcre2=disabled \
@@ -161,6 +162,44 @@ CONFFLAGS += \
-Dsysupdate=disabled
endif
+ifneq (, $(filter pkg.systemd.upstream, $(DEB_BUILD_PROFILES)))
+CONFFLAGS += \
+ -Dbpf-framework=enabled \
+ -Dbpf-compiler=clang
+
+# Ubuntu does not yet ship vmlinux.h, generate it at build time for now, until
+# https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2050083 is solved
+ifeq ($(DEB_VENDOR),Ubuntu)
+# Source: https://git.launchpad.net/ubuntu/+source/xdp-tools/tree/debian/rules
+# 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 /usr/lib/linux-tools/ -name 'bpftool' -perm /u=x 2>/dev/null | sort | head -n1)
+ifneq ($(bpftool_binary),)
+export PATH := $(shell dirname $(bpftool_binary)):$(PATH)
+endif
+CONFFLAGS += -Dvmlinux-h=auto
+else
+# The vmlinux.h we want is in the headers package that linux-headers-ARCH depends on,
+# which itself is the package that provides linux-headers-generic that we build depend on.
+# This is available since Trixie.
+HEADERS_PACKAGE = $(shell dpkg-query --showformat='$${Depends}' --show linux-headers-$(DEB_HOST_ARCH) | sed "s/.*\(linux-headers-.*-$(DEB_HOST_ARCH)\).*/\1/")
+ifneq ("$(wildcard /usr/src/$(HEADERS_PACKAGE)/vmlinux.h)","")
+CONFFLAGS += -Dvmlinux-h=provided -Dvmlinux-h-path=/usr/src/$(HEADERS_PACKAGE)/vmlinux.h
+else
+CONFFLAGS += -Dvmlinux-h=auto
+endif
+endif
+endif
+
override_dh_auto_configure:
dh_auto_configure \
-- $(CONFFLAGS) $(CONFFLAGS_DISTRO) $(CONFFLAGS_UPSTREAM)
@@ -235,6 +274,15 @@ endif
# accidential directory removal by dpkg on merged-/usr systems.
find debian/systemd/usr/lib -type d -empty -print -delete
+ # Can be dropped once upstream CI stops running on Jammy, which needs
+ # the old pkla config files, which are created only when building with
+ # old polkit versions.
+ifneq (, $(filter pkg.systemd.upstream, $(DEB_BUILD_PROFILES)))
+ if [ -f debian/tmp/var/lib/polkit-1/localauthority/10-vendor.d/systemd-networkd.pkla ]; then \
+ dh_install -psystemd var/lib/polkit-1/localauthority/10-vendor.d/systemd-networkd.pkla; \
+ fi
+endif
+
override_dh_missing:
dh_missing $(DH_MISSING)