Split out -sysusers and -shared

... (rhbz#2344322)

rpm-libs has Requires:/usr/bin/systemd-sysusers.

We split split out /usr/bin/systemd-sysusers (the normal version) to a
subpackage, and the shared library
/usr/lib64/systemd/libsystemd-shared-257.2-14.fc42.so to a second subpackage.
(In preparation for maybe making further splits later.)
systemd-sysusers+libsystemd-shared.so is 4.8MB, but libsystemd-shared.so also
pulls in a bunch of libraries. We'll find out what the actual change in
installation footprint (compared to systemd-standalone-sysusers) really is when
we build some images with the new split.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2025-02-14 19:33:03 +01:00
commit eba1721678
2 changed files with 38 additions and 4 deletions

View file

@ -57,12 +57,14 @@ def files(root):
outputs = {suffix: open(f'.file-list-{suffix}', 'w')
for suffix in (
'shared',
'libs',
'udev',
'ukify',
'boot',
'pam',
'rpm-macros',
'sysusers',
'devel',
'container',
'networkd',
@ -122,8 +124,10 @@ for file in files(buildroot):
o = outputs['tests']
elif 'ukify' in n:
o = outputs['ukify']
elif re.search(r'/libsystemd-(shared|core)-.*\.so$', n):
elif re.search(r'/libsystemd-core-.*\.so$', n):
o = outputs['main']
elif re.search(r'/libsystemd-shared-.*\.so$', n):
o = outputs['shared']
elif re.search(r'/libcryptsetup-token-systemd-.*\.so$', n):
o = outputs['udev']
elif re.search(r'/lib.*\.pc|/man3/|/usr/include|\.so$', n):
@ -135,6 +139,14 @@ for file in files(buildroot):
''', n, re.X):
o = outputs['remote']
# Just the binary, the dir, and the man page.
elif re.search(r'''systemd-sysusers$|
sysusers\.d$|
man/.*sysusers\.d\.5|
man/.*systemd-sysusers\.8
''', n, re.X):
o = outputs['sysusers']
elif re.search(r'''mymachines|
machinectl|
importctl|

View file

@ -253,6 +253,8 @@ Requires(meta): (%{name}-rpm-macros = %{version}-%{release} if rpm-build)
Requires: %{name}-libs%{_isa} = %{version}-%{release}
%{?fedora:Recommends: %{name}-networkd = %{version}-%{release}}
%{?fedora:Recommends: %{name}-resolved = %{version}-%{release}}
Requires: %{name}-shared%{_isa} = %{version}-%{release}
Requires: %{name}-sysusers%{_isa} = %{version}-%{release}
Recommends: diffutils
Requires: (util-linux-core or util-linux)
Provides: /bin/systemctl
@ -264,7 +266,7 @@ Provides: system-setup-keyboard = 0.9
# systemd-sysv-convert was removed in f20: https://fedorahosted.org/fpc/ticket/308
Obsoletes: systemd-sysv < 206
# self-obsoletes so that dnf will install new subpackages on upgrade (#1260394)
Obsoletes: %{name} < 249~~
Obsoletes: systemd < 257.3-4
Provides: systemd-sysv = 206
Conflicts: initscripts < 9.56.1
%if 0%{?fedora}
@ -290,8 +292,6 @@ Obsoletes: timedatex < 0.6-3
Provides: timedatex = 0.6-3
Conflicts: %{name}-standalone-tmpfiles
Provides: %{name}-tmpfiles = %{version}-%{release}
Conflicts: %{name}-standalone-sysusers
Provides: %{name}-sysusers = %{version}-%{release}
Conflicts: %{name}-standalone-shutdown
Provides: %{name}-shutdown = %{version}-%{release}
@ -371,6 +371,13 @@ Provides: nss-myhostname%{_isa} = 0.4
%description libs
Libraries for systemd and udev.
%package shared
Summary: Internal systemd shared library
License: LGPL-2.1-or-later AND MIT
%description shared
Internal libraries used by various systemd binaries.
%package pam
Summary: systemd PAM module
Requires: %{name} = %{version}-%{release}
@ -389,6 +396,15 @@ See
https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_systemd
for information how to use those macros.
%package sysusers
Summary: systemd-sysusers program
Requires: %{name}-shared%{_isa} = %{version}-%{release}
Conflicts: %{name}-standalone-sysusers
Obsoletes: systemd < 257.3-4
%description sysusers
This package contains the systemd-sysusers program.
%package devel
Summary: Development headers for systemd
License: LGPL-2.1-or-later AND MIT
@ -1322,10 +1338,16 @@ fi
%files libs -f .file-list-libs
%license LICENSE.LGPL2.1
%files shared -f .file-list-shared
%license LICENSE.LGPL2.1
%license LICENSES/MIT.txt
%files pam -f .file-list-pam
%files rpm-macros -f .file-list-rpm-macros
%files sysusers -f .file-list-sysusers
%files resolved -f .file-list-resolve
%files devel -f .file-list-devel