Add systemd-networkd-defaults subpackage

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2023-11-23 00:38:44 +01:00
parent 92eed01493
commit f93a1346f0
3 changed files with 66 additions and 1 deletions

View File

@ -0,0 +1,42 @@
From 518d40b992abca8de5b9136e88748783200535da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Thu, 23 Nov 2023 00:06:29 +0100
Subject: [PATCH] meson: always install network example files
I started working on integrating this in the Fedora package and realized that
the example files should be installed regardless of the renamed files when
default-network=true is used. This is because the renamed files become part of
a different package, and we want to have the other files which are used as
documentation in the main package anyway.
---
network/meson.build | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/network/meson.build b/network/meson.build
index 4f17f7385e..2a472f4f51 100644
--- a/network/meson.build
+++ b/network/meson.build
@@ -18,6 +18,10 @@ if conf.get('ENABLE_NETWORKD') == 1
'80-wifi-station.network.example',
)
+ install_data(
+ example_network_files,
+ install_dir : networkdir)
+
if get_option('default-network')
foreach f : example_network_files
install_data(
@@ -25,12 +29,7 @@ if conf.get('ENABLE_NETWORKD') == 1
rename : fs.replace_suffix(fs.name(f), ''),
install_dir : networkdir)
endforeach
- else
- install_data(
- example_network_files,
- install_dir : networkdir)
endif
-
endif
install_data('99-default.link',

View File

@ -24,6 +24,7 @@ o_rpm_macros = open('.file-list-rpm-macros', 'w')
o_devel = open('.file-list-devel', 'w') o_devel = open('.file-list-devel', 'w')
o_container = open('.file-list-container', 'w') o_container = open('.file-list-container', 'w')
o_networkd = open('.file-list-networkd', 'w') o_networkd = open('.file-list-networkd', 'w')
o_networkd_defaults = open('.file-list-networkd-defaults', 'w')
o_oomd_defaults = open('.file-list-oomd-defaults', 'w') o_oomd_defaults = open('.file-list-oomd-defaults', 'w')
o_remote = open('.file-list-remote', 'w') o_remote = open('.file-list-remote', 'w')
o_resolve = open('.file-list-resolve', 'w') o_resolve = open('.file-list-resolve', 'w')
@ -103,7 +104,13 @@ for file in files(buildroot):
''', n, re.X): ''', n, re.X):
o = o_container o = o_container
elif re.search(r'''/usr/lib/systemd/network/80-| # .network.example files go into systemd-networkd, and the matching files
# without .example go into systemd-networkd-defaults
elif (re.search(r'''/usr/lib/systemd/network/.*\.network$''', n)
and os.path.exists(f'./{n}.example')):
o = o_networkd_defaults
elif re.search(r'''/usr/lib/systemd/network/.*\.network|
networkd| networkd|
networkctl| networkctl|
org.freedesktop.network1| org.freedesktop.network1|

View File

@ -105,6 +105,8 @@ GIT_DIR=../../src/systemd/.git git diffab -M v233..master@{2017-06-15} -- hwdb/[
# Drop when dracut-060 is available. # Drop when dracut-060 is available.
Patch0001: https://github.com/systemd/systemd/pull/26494.patch Patch0001: https://github.com/systemd/systemd/pull/26494.patch
Patch0002: 0001-meson-always-install-network-example-files.patch
# Those are downstream-only patches, but we don't want them in packit builds: # Those are downstream-only patches, but we don't want them in packit builds:
# https://bugzilla.redhat.com/show_bug.cgi?id=1738828 # https://bugzilla.redhat.com/show_bug.cgi?id=1738828
@ -489,6 +491,17 @@ systemd-networkd is a system service that manages networks. It detects and
configures network devices as they appear, as well as creating virtual network configures network devices as they appear, as well as creating virtual network
devices. devices.
%package networkd-defaults
Summary: Configure network interfaces with networkd by default
Requires: %{name}-networkd = %{version}-%{release}
License: MIT-0
BuildArch: noarch
%description networkd-defaults
This package contains a set of config files for systemd-networkd that cause it
to configure network interfaces by default. Note that systemd-networkd needs to
enabled for this to have any effect.
%package resolved %package resolved
Summary: Network Name Resolution manager Summary: Network Name Resolution manager
Requires: %{name}%{_isa} = %{version}-%{release} Requires: %{name}%{_isa} = %{version}-%{release}
@ -625,6 +638,7 @@ CONFIGURE_OPTS=(
-Dstandalone-binaries=true -Dstandalone-binaries=true
-Ddefault-kill-user-processes=false -Ddefault-kill-user-processes=false
-Dfirst-boot-full-preset=true -Dfirst-boot-full-preset=true
-Ddefault-network=true
-Dtests=unsafe -Dtests=unsafe
-Dinstall-tests=true -Dinstall-tests=true
-Dtty-gid=5 -Dtty-gid=5
@ -1150,6 +1164,8 @@ fi
%files networkd -f .file-list-networkd %files networkd -f .file-list-networkd
%files networkd-defaults -f .file-list-networkd-defaults
%files oomd-defaults -f .file-list-oomd-defaults %files oomd-defaults -f .file-list-oomd-defaults
%files tests -f .file-list-tests %files tests -f .file-list-tests