tools: debs: support for version-specific files

Some debian control files (e.g. "control") may need to be adopted
for specific Debian/Ubuntu version being used. However, instead of
copying the whole debian directory for each Debian/Ubuntu version,
support having a version-specific ending (e.g. ".noble") which
takes preference over the default file.

Example: when building for "noble", the file "control.noble" will
be copied to "control" before executing the debuild commands.
This commit is contained in:
Jörg Hofrichter 2025-08-07 09:45:39 +02:00
parent 055db05b8e
commit 7223c59625

View File

@ -73,6 +73,9 @@ def main(args):
# Copy debian build files to build folder
shutil.copytree("host/cmake/debian", uhd_deb_build_path / "debian")
# Copy version specific files (e.g. debian/control.noble to debian/control)
for version_specific_file in pathlib.Path(uhd_deb_build_path / "debian").glob(f"*.{args.release}"):
shutil.copy2(version_specific_file, version_specific_file.with_suffix(""))
shutil.copy2("host/utils/uhd-usrp.rules",
uhd_deb_build_path / "debian/uhd-host.udev")
with open(uhd_deb_build_path / "debian/uhd-host.manpages", "w") as man_file: