Skip to content

Commit

Permalink
MDEV-34721: Make debian/autobake-debs.sh change compat level when needed
Browse files Browse the repository at this point in the history
Debian Deb Compat level version 12 brings more Systemd confort
to Debian package installation handling.
Althought it's not working correctly on certain Debian and
Ubuntu version which MariaDB supports.

Commit add change to compat level to version 12 when
it's should be working correctly.

Currently these distros that are changed:
  * Debian Bullseye (11)
  * Debian Bookwork (12)
  * Debian Trixie (13)
  * Debian Sid
  * Ubuntu Lunar (23.04)
  * Ubuntu Mantic (23.10)
  * Ubuntu Noble (24.04)
  * Ubuntu Oracular (24.10)
  • Loading branch information
illuusio committed Oct 7, 2024
1 parent 8a6a4c9 commit 72b67be
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
17 changes: 15 additions & 2 deletions debian/autobake-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ disable_libfmt()
sed '/libfmt-dev/d' -i debian/control
}

change_compat_level()
{
echo "${1}" > debian/compat
sed -e 's/ --fail-missing//' \
-e 's/#override_dh_missing/override_dh_missing/' \
-e 's/#\tdh_missing/\tdh_missing/' -i debian/rules
}

architecture=$(dpkg-architecture -q DEB_BUILD_ARCH)
uname_machine=$(uname -m)

Expand Down Expand Up @@ -111,9 +119,10 @@ in
"buster")
disable_libfmt
replace_uring_with_aio
;&
;;
"bullseye")
add_lsb_base_depends
change_compat_level 12
;&
"bookworm")
# mariadb-plugin-rocksdb in control is 4 arches covered by the distro rocksdb-tools
Expand All @@ -122,10 +131,12 @@ in
then
replace_uring_with_aio
fi
change_compat_level 12
;&
"trixie"|"sid")
# The default packaging should always target Debian Sid, so in this case
# there is intentionally no customizations whatsoever.
change_compat_level 12
;;
# Ubuntu
"focal")
Expand All @@ -134,12 +145,13 @@ in
;&
"jammy"|"kinetic")
add_lsb_base_depends
;&
;;
"lunar"|"mantic")
if [[ ! "$architecture" =~ amd64|arm64|armhf|ppc64el|s390x ]]
then
replace_uring_with_aio
fi
change_compat_level 12
;&
"noble")
# mariadb-plugin-rocksdb s390x not supported by us (yet)
Expand All @@ -149,6 +161,7 @@ in
then
remove_rocksdb_tools
fi
change_compat_level 12
;;
*)
echo "Error: Unknown release '$LSBNAME'" >&2
Expand Down
5 changes: 5 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ override_dh_installinit-arch:
override_dh_gencontrol:
dh_gencontrol -- -Tdebian/substvars

# When running compat level 12 or higher this is needed
# to preserve --fail-missing
#override_dh_missing:
# dh_missing --list-missing --fail-missing

# If a file is not supposed to be included anywhere, add it to the not-installed
# file and document the reason. Note that dh_install supports the above mentioned
# white list file only starting from Debian Stretch and Ubuntu Xenial.
Expand Down

0 comments on commit 72b67be

Please sign in to comment.