debian: fix build on ubuntu 20.04 without liburing

Ubuntu 20.04 is based on debian 11, but does not have liburing. Extend
the logic to cover this distribution too, so building packages for it
isn't stuck anymore on libosmocore not being able to resolve the
liburing-dev dependency.

I have verified that this makes libosmocore properly build with/without
liburing on debian 10, 11 and ubuntu 20.04 and 22.04.

Fixes: e486e012 ("debian: depend on liburing-dev for debian >= 11")
Change-Id: If18d6543fae9537c8b188e90499491bda3fdfe59
This commit is contained in:
Oliver Smith 2023-08-31 12:40:22 +02:00
parent 3236fdffd6
commit 405e7cc971
2 changed files with 5 additions and 4 deletions

3
debian/control vendored
View File

@ -2,6 +2,7 @@ Source: libosmocore
Maintainer: Osmocom team <openbsc@lists.osmocom.org>
Section: libs
Priority: optional
# liburing-dev: don't try to install it on debian 10 and ubuntu 20.04
Build-Depends: debhelper (>= 10),
autotools-dev,
autoconf,
@ -19,7 +20,7 @@ Build-Depends: debhelper (>= 10),
libusb-1.0-0-dev,
libmnl-dev,
libsystemd-dev,
base-files (<< 11) | liburing-dev,
liburing-dev | base-files (<< 11) | ubuntu-keyring (<< 2021),
python3:native
Standards-Version: 3.9.8
Vcs-Git: https://gitea.osmocom.org/osmocom/libosmocore

6
debian/rules vendored
View File

@ -25,7 +25,7 @@ override_dh_install:
override_dh_auto_test:
dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false)
# Set --disable-uring for debian < 11 based distributions
# Set --disable-uring for debian 10 and ubuntu 20.04
override_dh_auto_configure:
set -x && \
CONFIGURE_FLAGS=" \
@ -33,8 +33,8 @@ override_dh_auto_configure:
--enable-static \
--enable-systemd-logging \
"; \
base_ver="$$(dpkg -l base-files | grep "^ii" | awk '{print $$3}')"; \
if dpkg --compare-versions "$$base_ver" lt 11; then \
distro_v=$$(. /etc/os-release && echo $$VERSION_ID); \
if [ "$$distro_v" = 10 ] || [ "$$distro_v" = 20.04 ]; then \
CONFIGURE_FLAGS="$$CONFIGURE_FLAGS --disable-uring"; \
fi; \
dh_auto_configure -- $$CONFIGURE_FLAGS