ryantimwilson / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone
Zbigniew Jędrzejewski-Szmek b64db8
#global commit 1781de18ab8ebc3e42a607851d8effb3b0355c87
d0811f
%{?commit:%global shortcommit %(c=%{commit}; echo ${c:0:7})}
d0811f
d0811f
# We ship a .pc file but don't want to have a dep on pkg-config. We
d0811f
# strip the automatically generated dep here and instead co-own the
d0811f
# directory.
d0811f
%global __requires_exclude pkg-config
d0811f
d0811f
%global pkgdir %{_prefix}/lib/systemd
d0811f
%global system_unit_dir %{pkgdir}/system
d0811f
%global user_unit_dir %{pkgdir}/user
d0811f
ae4880
%if 0%{?__isa_bits} == 64
ae4880
%global elf_bits (64bit)
ae4880
%global elf_suffix ()%{elf_bits}
ae4880
%endif
ae4880
e3e8c4
%bcond bzip2     1
e3e8c4
%bcond gnutls    1
e3e8c4
%bcond lz4       1
e3e8c4
%bcond xz        1
e3e8c4
%bcond zlib      1
e3e8c4
%bcond zstd      1
f2f90a
9e3166
# Bootstrap may be needed to break circular dependencies with cryptsetup,
9e3166
# e.g. when re-building cryptsetup on a json-c SONAME-bump.
f2f90a
%bcond bootstrap 0
f2f90a
%bcond tests     1
f2f90a
%bcond lto       1
e3e8c4
%bcond docs      1
ae4880
f2f90a
# Build from git main
e3e8c4
%bcond upstream  0
ae4880
U2FsdGVkX1 ebf352
# When bootstrap, libcryptsetup is disabled
U2FsdGVkX1 ebf352
# but auto-features causes many options to be turned on
U2FsdGVkX1 ebf352
# that depend on libcryptsetup (e.g. libcryptsetup-plugins, homed)
U2FsdGVkX1 ebf352
%if %{with bootstrap}
U2FsdGVkX1 ebf352
%global __meson_auto_features disabled
U2FsdGVkX1 ebf352
%endif
U2FsdGVkX1 ebf352
d0811f
Name:           systemd
Zbigniew Jędrzejewski-Szmek 54a3b6
Url:            https://systemd.io
Ryan Wilson a2fc29
# Allow users to specify the version and release when building the rpm by
615463
# setting the %%version_override and %%release_override macros.
17fa64
Version:        %{?version_override}%{!?version_override:256.7}
Ryan Wilson a2fc29
Release:        %{?release_override}%{!?release_override:1.9}%{?dist}
8c1b90
8c1b90
%global stable %(c="%version"; [ "$c" = "${c#*.*}" ]; echo $?)
9e3166
d0811f
# For a breakdown of the licensing, see README
8c1b90
License:        LGPL-2.1-or-later AND MIT AND GPL-2.0-or-later
d0811f
Summary:        System and Service Manager
d0811f
d0811f
# download tarballs with "spectool -g systemd.spec"
cbc614
%if %{defined branch}
cbc614
Source0:        https://github.com/systemd/systemd/archive/refs/heads/%{branch}.tar.gz
cbc614
%elif %{defined commit}
de389d
Source0:        https://github.com/systemd/systemd/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
de389d
%else
de389d
Source0:        https://github.com/systemd/systemd/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz
de389d
%endif
d0811f
# This file must be available before %%prep.
d0811f
# It is generated during systemd build and can be found in build/src/core/.
d0811f
Source1:        triggers.systemd
d0811f
Source2:        split-files.py
d0811f
Source3:        purge-nobody-user
Zbigniew Jędrzejewski-Szmek c56891
Source4:        test_sysusers_defined.py
d0811f
Zbigniew Jędrzejewski-Szmek 694729
Source6:        inittab
Zbigniew Jędrzejewski-Szmek 694729
Source7:        sysctl.conf.README
Zbigniew Jędrzejewski-Szmek 694729
Source8:        systemd-journal-remote.xml
Zbigniew Jędrzejewski-Szmek 694729
Source9:        systemd-journal-gatewayd.xml
Zbigniew Jędrzejewski-Szmek 694729
Source10:       20-yama-ptrace.conf
Zbigniew Jędrzejewski-Szmek 694729
Source11:       systemd-udev-trigger-no-reload.conf
f2f90a
# https://fedoraproject.org/wiki/How_to_filter_libabigail_reports
f2f90a
Source13:       .abignore
d0811f
04a488
Source14:       10-oomd-defaults.conf
09f814
Source15:       10-oomd-per-slice-defaults.conf
f2f90a
Source16:       10-timeout-abort.conf
8c1b90
Source17:       10-map-count.conf
00babc
Source18:       60-block-scheduler.rules
04a488
d0811f
Source21:       macros.sysusers
d0811f
Source22:       sysusers.attr
d0811f
Source23:       sysusers.prov
d0811f
Source24:       sysusers.generate-pre.sh
d0811f
8c1b90
Source25:       98-default-mac-none.link
8c1b90
abb115
Source26:       systemd-user
abb115
d0811f
%if 0
d0811f
GIT_DIR=../../src/systemd/.git git format-patch-ab --no-signature -M -N v235..v235-stable
d0811f
i=1; for j in 00*patch; do printf "Patch%04d:      %s\n" $i $j; i=$((i+1));done|xclip
9e3166
GIT_DIR=../../src/systemd/.git git diffab -M v233..master@{2017-06-15} -- hwdb/[67]* hwdb/parse_hwdb.py >hwdb.patch
d0811f
%endif
d0811f
505ca8
# Backports of patches from upstream (0000–0499)
167d2b
#
d2f4df
# Any patches which are "in preparation" upstream should be listed here, rather
d2f4df
# than in the next section. Packit CI will drop any patches in this range before
d2f4df
# applying upstream pull requests.
d2f4df
Zbigniew Jędrzejewski-Szmek 79828f
%if 0%{?fedora} < 40 && 0%{?rhel} < 10
f2f90a
# Work-around for dracut issue: run generators directly when we are in initrd
8c1b90
# https://bugzilla.redhat.com/show_bug.cgi?id=2164404
f2f90a
# Drop when dracut-060 is available.
Zbigniew Jędrzejewski-Szmek a94605
Patch0010:      https://github.com/systemd/systemd/pull/26494.patch
Zbigniew Jędrzejewski-Szmek 8fe1f0
%endif
f2f90a
Zbigniew Jędrzejewski-Szmek 8d080f
# Requested in https://bugzilla.redhat.com/show_bug.cgi?id=2298422
Zbigniew Jędrzejewski-Szmek 8d080f
Patch0011:      https://github.com/systemd/systemd/pull/33738.patch
Zbigniew Jędrzejewski-Szmek 8d080f
0c89c4
# Various logging improvements
0c89c4
Patch0013:      https://github.com/systemd/systemd/pull/34728.patch
0c89c4
0c89c4
# Make sure bus_connect_transport_systemd() actually connects to the private manager bus
0c89c4
Patch0014:      https://github.com/systemd/systemd/pull/34686.patch
0c89c4
0c89c4
# Simplify user manager upgrades
0c89c4
Patch0015:      https://github.com/systemd/systemd/pull/34707.patch
c3bad6
cd9377
# Those are downstream-only patches, but we don't want them in packit builds:
f2f90a
# https://bugzilla.redhat.com/show_bug.cgi?id=2251843
f2f90a
Patch0491:      https://github.com/systemd/systemd/pull/30846.patch
167d2b
Zbigniew Jędrzejewski-Szmek b3e1d5
# Soft-disable tmpfiles --purge until a good use case comes up.
Zbigniew Jędrzejewski-Szmek b3e1d5
Patch0492:      0001-tmpfiles-make-purge-hard-to-mis-use.patch
f2f90a
Ryan Wilson 10c3e1
# core/device: ignore ID_PROCESSING udev property on enumerate
Ryan Wilson 10c3e1
Patch0493: https://github.com/systemd/systemd/pull/35332.patch
Ryan Wilson 10c3e1
cf29d2
# Meta specific backports (900-1000)
cf29d2
cf29d2
%if 0%{?facebook}
cf29d2
cf29d2
# network: Make qdisc reconfigurable
142bf4
Patch0900:      https://github.com/systemd/systemd/pull/34543.patch
cf29d2
15d25f
# network: Add support for multiq qdisc
cf29d2
Patch0901:      https://github.com/systemd/systemd/pull/34251.patch
cf29d2
cf29d2
# core: Add support for PrivateUsers=identity
142bf4
Patch0902:      https://github.com/systemd/systemd/pull/34400.patch
cf29d2
05ec6e
# bus-util: Return ENOMEDIUM if XDG_RUNTIME_DIR is unset
Ryan Wilson a2fc29
Patch0903:      https://github.com/systemd/systemd/pull/34851.patch
05ec6e
d36331
# pam_systemd: Make pam_systemd 256 backwards compatible to logind 255
Ryan Wilson a2fc29
Patch0904: 0001-pam_systemd-Make-pam_systemd-256-backwards-compatibl.patch
99f2d6
Ryan Wilson 9cbcc8
# networkctl: Make networkctl lldp output backwards compatible with 255
Ryan Wilson a2fc29
Patch0905: 0001-networkctl-Make-networkctl-lldp-output-backwards-com.patch
Ryan Wilson a2fc29
Ryan Wilson a2fc29
# networkctl: Make lldp/status backwards compatible with 255 over dbus
Ryan Wilson a2fc29
Patch0906: 0001-networkctl-Make-lldp-status-backwards-compatible-wit.patch
Ryan Wilson a2fc29
Ryan Wilson a2fc29
# Revert "network/lldp: do not save LLDP neighbors under /run/systemd"
Ryan Wilson a2fc29
Patch0907: 0001-Revert-network-lldp-do-not-save-LLDP-neighbors-under.patch
Ryan Wilson 9cbcc8
Ryan Wilson 61c859
# Meta specific patches for builds from git main (1001-1100)
Ryan Wilson 61c859
# TODO: These should be removed once they are either merged into git main
Ryan Wilson 61c859
# or upstreamed
Ryan Wilson 61c859
%if %{with upstream}
Ryan Wilson 61c859
Ryan Wilson 61c859
# core: Add ProtectHostname=private
Ryan Wilson 61c859
Patch1001: https://github.com/systemd/systemd/pull/35447.patch
Ryan Wilson 61c859
Ryan Wilson 61c859
# core: Add PrivateUsers=full
Ryan Wilson 61c859
Patch1002: https://github.com/systemd/systemd/pull/35183.patch
Ryan Wilson 61c859
Ryan Wilson 61c859
# Temporary workaround: PrivateUsers=full implies DelegateNamespaces=yes
Ryan Wilson 61c859
Patch1003: 0001-Temporary-workaround-PrivateUsers-full-implies-Deleg.patch
Ryan Wilson 61c859
Ryan Wilson 61c859
%endif
Ryan Wilson 61c859
cf29d2
%endif
15d25f
e3e8c4
%ifarch %{ix86} x86_64 aarch64 riscv64
f2f90a
%global want_bootloader 1
d0811f
%endif
d0811f
d0811f
BuildRequires:  gcc
d0811f
BuildRequires:  gcc-c++
9e3166
BuildRequires:  clang
d0811f
BuildRequires:  coreutils
f9fe17
BuildRequires:  rpmdevtools
d0811f
BuildRequires:  libcap-devel
d0811f
BuildRequires:  libmount-devel
9e3166
BuildRequires:  libfdisk-devel
d0811f
BuildRequires:  libpwquality-devel
d0811f
BuildRequires:  pam-devel
d0811f
BuildRequires:  libselinux-devel
d0811f
BuildRequires:  audit-libs-devel
d0811f
%if %{without bootstrap}
d0811f
BuildRequires:  cryptsetup-devel
d0811f
%endif
d0811f
BuildRequires:  dbus-devel
f2f90a
BuildRequires:  util-linux
d0811f
# /usr/bin/getfacl is needed by test-acl-util
f2f90a
BuildRequires:  acl
d0811f
BuildRequires:  libacl-devel
d0811f
BuildRequires:  gobject-introspection-devel
d0811f
BuildRequires:  libblkid-devel
f2f90a
%if %{with xz}
d0811f
BuildRequires:  xz-devel
d0811f
BuildRequires:  xz
f2f90a
%endif
f2f90a
%if %{with lz4}
d0811f
BuildRequires:  lz4-devel
d0811f
BuildRequires:  lz4
f2f90a
%endif
f2f90a
%if %{with bzip2}
d0811f
BuildRequires:  bzip2-devel
f2f90a
%endif
f2f90a
%if %{with zstd}
d0811f
BuildRequires:  libzstd-devel
f2f90a
%endif
d0811f
BuildRequires:  libidn2-devel
d0811f
BuildRequires:  libcurl-devel
d0811f
BuildRequires:  kmod-devel
d0811f
BuildRequires:  elfutils-devel
d0811f
BuildRequires:  openssl-devel
Yaakov Selkowitz d62b1f
%if 0%{?fedora} >= 41 || 0%{?rhel} >= 11
Zbigniew Jędrzejewski-Szmek 9cbad9
BuildRequires:  openssl-devel-engine
Zbigniew Jędrzejewski-Szmek 9cbad9
%endif
f2f90a
%if %{with gnutls}
d0811f
BuildRequires:  gnutls-devel
f2f90a
%endif
Zbigniew Jędrzejewski-Szmek 79828f
%if 0%{?fedora}
09f814
BuildRequires:  qrencode-devel
8c1b90
%endif
d0811f
BuildRequires:  libmicrohttpd-devel
d0811f
BuildRequires:  libxkbcommon-devel
d0811f
BuildRequires:  iptables-devel
e3e8c4
BuildRequires:  pkgconfig(bash-completion)
e3e8c4
BuildRequires:  pkgconfig(libarchive)
09f814
BuildRequires:  pkgconfig(libfido2)
167d2b
BuildRequires:  pkgconfig(tss2-esys)
167d2b
BuildRequires:  pkgconfig(tss2-rc)
167d2b
BuildRequires:  pkgconfig(tss2-mu)
9e3166
BuildRequires:  pkgconfig(libbpf)
ae4880
BuildRequires:  systemtap-sdt-devel
e3e8c4
%if %{with docs}
d0811f
BuildRequires:  libxslt
d0811f
BuildRequires:  docbook-style-xsl
e3e8c4
%endif
d0811f
BuildRequires:  pkgconfig
d0811f
BuildRequires:  gperf
d0811f
BuildRequires:  gawk
d0811f
BuildRequires:  tree
d0811f
BuildRequires:  hostname
09f814
BuildRequires:  python3
8c1b90
BuildRequires:  python3-devel
09f814
BuildRequires:  python3dist(jinja2)
8c1b90
BuildRequires:  python3dist(lxml)
8c1b90
BuildRequires:  python3dist(pefile)
Zbigniew Jędrzejewski-Szmek 79828f
%if 0%{?fedora}
8c1b90
BuildRequires:  python3dist(pillow)
8c1b90
BuildRequires:  python3dist(pytest-flakes)
d0811f
%endif
8c1b90
BuildRequires:  python3dist(pytest)
f2f90a
%if 0%{?want_bootloader}
f2f90a
BuildRequires:  python3dist(pyelftools)
23a125
%endif
8c1b90
# gzip and lzma are provided by the stdlib
8c1b90
BuildRequires:  firewalld-filesystem
d0811f
BuildRequires:  libseccomp-devel
d0811f
BuildRequires:  meson >= 0.43
d0811f
BuildRequires:  gettext
d0811f
# We use RUNNING_ON_VALGRIND in tests, so the headers need to be available
e3e8c4
%ifarch %{valgrind_arches}
d0811f
BuildRequires:  valgrind-devel
e7b73e
%endif
084503
%if %{defined rhel} && 0%{?rhel} < 10
084503
BuildRequires: rsync
084503
%endif
d0811f
d2f4df
%ifnarch %ix86
d2f4df
# bpftool is not built for i368
d2f4df
BuildRequires:  bpftool
f9fe17
BuildRequires:  kernel-devel
d2f4df
%global have_bpf 1
d2f4df
%endif
d2f4df
8c1b90
%if 0%{?fedora}
8c1b90
%ifarch x86_64 aarch64
Yu Watanabe db600d
%global have_xen 1
8c1b90
# That package is only built for those two architectures
8c1b90
BuildRequires:  xen-devel
8c1b90
%endif
8c1b90
%endif
8c1b90
d0811f
Requires(post): coreutils
d0811f
Requires(post): grep
d0811f
# systemd-machine-id-setup requires libssl
d0811f
Requires(post): openssl-libs
d0811f
Requires:       dbus >= 1.9.18
f2f90a
Requires:       %{name}-pam%{_isa} = %{version}-%{release}
f2f90a
Requires(meta): (%{name}-rpm-macros = %{version}-%{release} if rpm-build)
f2f90a
Requires:       %{name}-libs%{_isa} = %{version}-%{release}
167d2b
%{?fedora:Recommends:     %{name}-networkd = %{version}-%{release}}
ae4880
%{?fedora:Recommends:     %{name}-resolved = %{version}-%{release}}
d0811f
Recommends:     diffutils
ae4880
Requires:       (util-linux-core or util-linux)
d0811f
Provides:       /bin/systemctl
d0811f
Provides:       /sbin/shutdown
d0811f
Provides:       syslog
d0811f
Provides:       systemd-units = %{version}-%{release}
d0811f
Obsoletes:      system-setup-keyboard < 0.9
d0811f
Provides:       system-setup-keyboard = 0.9
d0811f
# systemd-sysv-convert was removed in f20: https://fedorahosted.org/fpc/ticket/308
d0811f
Obsoletes:      systemd-sysv < 206
d0811f
# self-obsoletes so that dnf will install new subpackages on upgrade (#1260394)
ae4880
Obsoletes:      %{name} < 249~~
7172f2
Provides:       systemd-sysv = 206
f2f90a
Conflicts:      initscripts < 9.56.1
d0811f
%if 0%{?fedora}
d0811f
Conflicts:      fedora-release < 23-0.12
d0811f
%endif
Zbigniew Jędrzejewski-Szmek c56891
%if 0%{?fedora} >= 41
Zbigniew Jędrzejewski-Szmek c56891
BuildRequires:  setup >= 2.15.0-3
Zbigniew Jędrzejewski-Szmek c56891
BuildRequires:  python3
Zbigniew Jędrzejewski-Szmek c56891
Conflicts:      setup < 2.15.0-3
980ede
Conflicts:      selinux-policy-any < 41.3
Zbigniew Jędrzejewski-Szmek c56891
%endif
Zbigniew Jędrzejewski-Szmek 8fe1f0
7db154
%if 0%{?fedora} >= 41 || 0%{?rhel} >= 10
Zbigniew Jędrzejewski-Szmek 9ebc19
# Make sure that dracut supports systemd-executor and the renames done for v255,
Zbigniew Jędrzejewski-Szmek 9ebc19
# and dlopen libraries and read-only fs in initrd.
Zbigniew Jędrzejewski-Szmek 9ebc19
Conflicts:      dracut < 060-2
75f210
%elif 0%{?fedora} || %{without upstream}
Zbigniew Jędrzejewski-Szmek 8fe1f0
# Make sure that dracut supports systemd-executor and the renames done for v255.
f2f90a
Conflicts:      dracut < 059-16
Zbigniew Jędrzejewski-Szmek 8fe1f0
%endif
f2f90a
d0811f
Obsoletes:      timedatex < 0.6-3
d0811f
Provides:       timedatex = 0.6-3
Zbigniew Jędrzejewski-Szmek b7800e
Conflicts:      %{name}-standalone-tmpfiles
d2f4df
Provides:       %{name}-tmpfiles = %{version}-%{release}
Zbigniew Jędrzejewski-Szmek b7800e
Conflicts:      %{name}-standalone-sysusers
d2f4df
Provides:       %{name}-sysusers = %{version}-%{release}
Zbigniew Jędrzejewski-Szmek b7800e
Conflicts:      %{name}-standalone-shutdown
8c1b90
Provides:       %{name}-shutdown = %{version}-%{release}
505ca8
e3e8c4
%if "%{_sbindir}" == "%{_bindir}"
e3e8c4
# Compat symlinks for Requires in other packages.
e3e8c4
# We rely on filesystem to create the symlinks for us.
e3e8c4
Requires:       filesystem(unmerged-sbin-symlinks)
e3e8c4
Provides:       /usr/sbin/halt
e3e8c4
Provides:       /usr/sbin/init
e3e8c4
Provides:       /usr/sbin/poweroff
e3e8c4
Provides:       /usr/sbin/reboot
e3e8c4
Provides:       /usr/sbin/runlevel
e3e8c4
Provides:       /usr/sbin/shutdown
e3e8c4
Provides:       /usr/sbin/telinit
e3e8c4
%endif
e3e8c4
505ca8
# Recommends to replace normal Requires deps for stuff that is dlopen()ed
Zbigniew Jędrzejewski-Szmek a3524f
Recommends:     libxkbcommon.so.0%{?elf_suffix}
ae4880
Recommends:     libidn2.so.0%{?elf_suffix}
ae4880
Recommends:     libidn2.so.0(IDN2_0.0.0)%{?elf_bits}
ae4880
Recommends:     libpcre2-8.so.0%{?elf_suffix}
ae4880
Recommends:     libpwquality.so.1%{?elf_suffix}
ae4880
Recommends:     libpwquality.so.1(LIBPWQUALITY_1.0)%{?elf_bits}
Zbigniew Jędrzejewski-Szmek 79828f
%if 0%{?fedora}
9e3166
Recommends:     libqrencode.so.4%{?elf_suffix}
8c1b90
%endif
f2f90a
Recommends:     libbpf.so.1%{?elf_suffix}
f2f90a
Recommends:     libbpf.so.1(LIBBPF_0.4.0)%{?elf_bits}
7172f2
9e3166
# used by systemd-coredump and systemd-analyze
9e3166
Recommends:     libdw.so.1%{?elf_suffix}
9e3166
Recommends:     libdw.so.1(ELFUTILS_0.186)%{?elf_bits}
9e3166
Recommends:     libelf.so.1%{?elf_suffix}
9e3166
Recommends:     libelf.so.1(ELFUTILS_1.7)%{?elf_bits}
9e3166
9e3166
# used by dissect, integritysetup, veritysetyp, growfs, repart, cryptenroll, home
9e3166
Recommends:     libcryptsetup.so.12%{?elf_suffix}
9e3166
Recommends:     libcryptsetup.so.12(CRYPTSETUP_2.4)%{?elf_bits}
9e3166
e6e171
# Libkmod is used to load modules.
e6e171
Recommends:     libkmod.so.2%{?elf_suffix}
e6e171
# kmod_list_next, kmod_load_resources, kmod_module_get_initstate,
e6e171
# kmod_module_get_module, kmod_module_get_name, kmod_module_new_from_lookup,
e6e171
# kmod_module_probe_insert_module, kmod_module_unref, kmod_module_unref_list,
e6e171
# kmod_new, kmod_set_log_fn, kmod_unref, kmod_validate_resources
e6e171
# are part of LIBKMOD_5.
e6e171
Recommends:     libkmod.so.2(LIBKMOD_5)%{?elf_bits}
e6e171
f2f90a
Recommends:     libarchive.so.13%{?elf_suffix}
f2f90a
d0811f
%description
9e3166
systemd is a system and service manager that runs as PID 1 and starts the rest
9e3166
of the system. It provides aggressive parallelization capabilities, uses socket
9e3166
and D-Bus activation for starting services, offers on-demand starting of
9e3166
daemons, keeps track of processes using Linux control groups, maintains mount
9e3166
and automount points, and implements an elaborate transactional dependency-based
9e3166
service control logic. systemd supports SysV and LSB init scripts and works as a
d0811f
replacement for sysvinit. Other parts of this package are a logging daemon,
9e3166
utilities to control basic system configuration like the hostname, date, locale,
9e3166
maintain a list of logged-in users, system accounts, runtime directories and
9e3166
settings, and a logging daemons.
d0811f
%if 0%{?stable}
8c1b90
This package was built from the %(c=%version; echo "v${c%.*}-stable") branch of systemd.
d0811f
%endif
d0811f
d0811f
%package libs
d0811f
Summary:        systemd libraries
8c1b90
License:        LGPL-2.1-or-later AND MIT
d0811f
Obsoletes:      libudev < 183
d0811f
Obsoletes:      systemd < 185-4
d0811f
Conflicts:      systemd < 185-4
d0811f
Obsoletes:      systemd-compat-libs < 230
d0811f
Obsoletes:      nss-myhostname < 0.4
d0811f
Provides:       nss-myhostname = 0.4
d0811f
Provides:       nss-myhostname%{_isa} = 0.4
d0811f
d0811f
%description libs
d0811f
Libraries for systemd and udev.
d0811f
d0811f
%package pam
d0811f
Summary:        systemd PAM module
d0811f
Requires:       %{name} = %{version}-%{release}
d0811f
d0811f
%description pam
d0811f
Systemd PAM module registers the session with systemd-logind.
d0811f
d0811f
%package rpm-macros
d0811f
Summary:        Macros that define paths and scriptlets related to systemd
d0811f
BuildArch:      noarch
d0811f
d0811f
%description rpm-macros
d0811f
Just the definitions of rpm macros.
d0811f
d0811f
See
d0811f
https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_systemd
d0811f
for information how to use those macros.
d0811f
d0811f
%package devel
d0811f
Summary:        Development headers for systemd
8c1b90
License:        LGPL-2.1-or-later AND MIT
09f814
Requires:       %{name}-libs%{_isa} = %{version}-%{release}
f2f90a
Requires(meta): (%{name}-rpm-macros = %{version}-%{release} if rpm-build)
d0811f
Provides:       libudev-devel = %{version}
d0811f
Provides:       libudev-devel%{_isa} = %{version}
d0811f
Obsoletes:      libudev-devel < 183
d0811f
d0811f
%description devel
d0811f
Development headers and auxiliary files for developing applications linking
d0811f
to libudev or libsystemd.
d0811f
d0811f
%package udev
d0811f
Summary: Rule-based device node and kernel event manager
8c1b90
License:        LGPL-2.1-or-later
d0811f
09f814
Requires:       systemd%{_isa} = %{version}-%{release}
e3e8c4
Requires(post):   systemd%{_isa} = %{version}-%{release}
e3e8c4
Requires(preun):  systemd%{_isa} = %{version}-%{release}
e3e8c4
Requires(postun): systemd%{_isa} = %{version}-%{release}
d0811f
Requires(post): grep
d0811f
Requires:       kmod >= 18-4
d0811f
# https://bodhi.fedoraproject.org/updates/FEDORA-2020-dd43dd05b1
d0811f
Obsoletes:      systemd < 245.6-1
d0811f
Provides:       udev = %{version}
d0811f
Provides:       udev%{_isa} = %{version}
d0811f
Obsoletes:      udev < 183
a9807c
%if 0%{?fedora} || 0%{?rhel} >= 10
3c24f0
Requires:       (grubby > 8.40-72 if grubby)
3c24f0
Requires:       (sdubby > 1.0-3 if sdubby)
a9807c
%endif
9378a0
# A backport of systemd-timesyncd is shipped as a separate package in EPEL so
9378a0
# let's make sure we properly handle that.
9378a0
%if 0%{?rhel}
7172f2
Conflicts:      systemd-timesyncd < %{version}-%{release}
7172f2
Obsoletes:      systemd-timesyncd < %{version}-%{release}
7172f2
Provides:       systemd-timesyncd = %{version}-%{release}
9378a0
%endif
505ca8
e6e171
# Libkmod is used to load modules. Assume that if we need udevd, we certainly
e6e171
# want to load modules, so make this into a hard dependency here.
e6e171
Requires:       libkmod.so.2%{?elf_suffix}
e6e171
Requires:       libkmod.so.2(LIBKMOD_5)%{?elf_bits}
e6e171
9e3166
# Recommends to replace normal Requires deps for stuff that is dlopen()ed
9e3166
# used by dissect, integritysetup, veritysetyp, growfs, repart, cryptenroll, home
9e3166
Recommends:     libcryptsetup.so.12%{?elf_suffix}
9e3166
Recommends:     libcryptsetup.so.12(CRYPTSETUP_2.4)%{?elf_bits}
9e3166
9e3166
# used by systemd-coredump and systemd-analyze
9e3166
Recommends:     libdw.so.1%{?elf_suffix}
9e3166
Recommends:     libdw.so.1(ELFUTILS_0.186)%{?elf_bits}
9e3166
Recommends:     libelf.so.1%{?elf_suffix}
9e3166
Recommends:     libelf.so.1(ELFUTILS_1.7)%{?elf_bits}
9e3166
8c1b90
# used by home, cryptsetup, cryptenroll, logind
9e3166
Recommends:     libfido2.so.1%{?elf_suffix}
8c1b90
Recommends:     libp11-kit.so.0%{?elf_suffix}
9e3166
Recommends:     libtss2-esys.so.0%{?elf_suffix}
9e3166
Recommends:     libtss2-mu.so.0%{?elf_suffix}
9e3166
Recommends:     libtss2-rc.so.0%{?elf_suffix}
9e3166
d0811f
# https://bugzilla.redhat.com/show_bug.cgi?id=1377733#c9
d0811f
Suggests:       systemd-bootchart
d0811f
# https://bugzilla.redhat.com/show_bug.cgi?id=1408878
d0811f
Requires:       kbd
d0811f
d0811f
# https://bugzilla.redhat.com/show_bug.cgi?id=1753381
d0811f
Provides:       u2f-hidraw-policy = 1.0.2-40
d0811f
Obsoletes:      u2f-hidraw-policy < 1.0.2-40
d0811f
f2f90a
# self-obsoletes to install both packages after split of systemd-boot
f2f90a
Obsoletes:      systemd-udev < 252.2^
f2f90a
Zbigniew Jędrzejewski-Szmek b7800e
Conflicts:      %{name}-standalone-repart
f2f90a
Provides:       %{name}-repart = %{version}-%{release}
f2f90a
e3e8c4
%if "%{_sbindir}" == "%{_bindir}"
e3e8c4
# Compat symlinks for Requires in other packages.
e3e8c4
# We rely on filesystem to create the symlinks for us.
e3e8c4
Requires:       filesystem(unmerged-sbin-symlinks)
e3e8c4
Provides:       /usr/sbin/udevadm
e3e8c4
%endif
e3e8c4
d0811f
%description udev
9e3166
This package contains systemd-udev and the rules and hardware database needed to
9e3166
manage device nodes. This package is necessary on physical machines and in
9e3166
virtual machines, but not in containers.
9e3166
9e3166
This package also provides systemd-timesyncd, a network time protocol daemon.
9e3166
9e3166
It also contains tools to manage encrypted home areas and secrets bound to the
9e3166
machine, and to create or grow partitions and make file systems automatically.
d0811f
8c1b90
%package ukify
8c1b90
Summary:        Tool to build Unified Kernel Images
8c1b90
Requires:       %{name} = %{version}-%{release}
8c1b90
a67221
Requires:       (systemd-boot if %{shrink:(
a67221
        filesystem(x86-32) or
a67221
        filesystem(x86-64) or
a67221
        filesystem(aarch64) or
a67221
        filesystem(riscv64)
a67221
)})
8c1b90
Requires:       python3dist(pefile)
Zbigniew Jędrzejewski-Szmek 79828f
%if 0%{?fedora}
8c1b90
Requires:       python3dist(zstd)
8ae009
%endif
f2f90a
Requires:       python3dist(cryptography)
28076e
%if 0%{?fedora}
8c1b90
Recommends:     python3dist(pillow)
28076e
%endif
8c1b90
e3e8c4
# for tests
e3e8c4
%ifarch riscv64
e3e8c4
# 2.42 received support for riscv64 + efi targets
e3e8c4
%global binutils_version_req >= 2.42
e3e8c4
%endif
e3e8c4
BuildRequires:  binutils %{?binutils_version_req}
e3e8c4
8c1b90
BuildArch:      noarch
8c1b90
8c1b90
%description ukify
8c1b90
This package provides ukify, a script that combines a kernel image, an initrd,
8c1b90
with a command line, and possibly PCR measurements and other metadata, into a
8c1b90
Unified Kernel Image (UKI).
8c1b90
a67221
%if 0%{?want_bootloader}
09f814
%package boot-unsigned
09f814
Summary: UEFI boot manager (unsigned version)
09f814
09f814
Provides: systemd-boot-unsigned-%{efi_arch} = %version-%release
09f814
Provides: systemd-boot = %version-%release
09f814
Provides: systemd-boot%{_isa} = %version-%release
8c1b90
# A provides with just the version, no release or dist, used to build systemd-boot
8c1b90
Provides: version(systemd-boot-unsigned) = %version
8c1b90
Provides: version(systemd-boot-unsigned)%{_isa} = %version
09f814
09f814
# self-obsoletes to install both packages after split of systemd-boot
09f814
Obsoletes:      systemd-udev < 252.2^
09f814
09f814
%description boot-unsigned
09f814
systemd-boot (short: sd-boot) is a simple UEFI boot manager. It provides a
09f814
graphical menu to select the entry to boot and an editor for the kernel command
09f814
line. systemd-boot supports systems with UEFI firmware only.
09f814
09f814
This package contains the unsigned version. Install systemd-boot instead to get
09f814
the version that works with Secure Boot.
09f814
%endif
09f814
d0811f
%package container
d0811f
# Name is the same as in Debian
d0811f
Summary: Tools for containers and VMs
09f814
Requires:       %{name}%{_isa} = %{version}-%{release}
e3e8c4
Requires(post):   systemd%{_isa} = %{version}-%{release}
e3e8c4
Requires(preun):  systemd%{_isa} = %{version}-%{release}
e3e8c4
Requires(postun): systemd%{_isa} = %{version}-%{release}
d0811f
# obsolete parent package so that dnf will install new subpackage on upgrade (#1260394)
d0811f
Obsoletes:      %{name} < 229-5
9e3166
# Bias the system towards libcurl-minimal if nothing pulls in full libcurl (#1997040)
9e3166
Suggests:       libcurl-minimal
8c1b90
License:        LGPL-2.1-or-later
d0811f
d0811f
%description container
d0811f
Systemd tools to spawn and manage containers and virtual machines.
d0811f
f2f90a
This package contains systemd-nspawn, systemd-vmspawn, machinectl,
f2f90a
systemd-machined, and systemd-importd.
d0811f
d0811f
%package journal-remote
d0811f
# Name is the same as in Debian
d0811f
Summary:        Tools to send journal events over the network
09f814
Requires:       %{name}%{_isa} = %{version}-%{release}
8c1b90
License:        LGPL-2.1-or-later
09f814
Requires:       firewalld-filesystem
d0811f
Provides:       %{name}-journal-gateway = %{version}-%{release}
d0811f
Provides:       %{name}-journal-gateway%{_isa} = %{version}-%{release}
d0811f
Obsoletes:      %{name}-journal-gateway < 227-7
9e3166
# Bias the system towards libcurl-minimal if nothing pulls in full libcurl (#1997040)
9e3166
Suggests:       libcurl-minimal
d0811f
d0811f
%description journal-remote
9e3166
Programs to forward journal entries over the network, using encrypted HTTP, and
9e3166
to write journal files from serialized journal contents.
d0811f
9e3166
This package contains systemd-journal-gatewayd, systemd-journal-remote, and
9e3166
systemd-journal-upload.
d0811f
ae4880
%package networkd
ae4880
Summary:        System daemon that manages network configurations
09f814
Requires:       %{name}%{_isa} = %{version}-%{release}
e3e8c4
%{?fedora:Recommends:     %{name}-udev = %{version}-%{release}}
8c1b90
License:        LGPL-2.1-or-later
d2f4df
# https://src.fedoraproject.org/rpms/systemd/pull-request/34
d2f4df
Obsoletes:      systemd < 246.6-2
ae4880
ae4880
%description networkd
9e3166
systemd-networkd is a system service that manages networks. It detects and
9e3166
configures network devices as they appear, as well as creating virtual network
9e3166
devices.
ae4880
f2f90a
%package networkd-defaults
f2f90a
Summary:        Configure network interfaces with networkd by default
f2f90a
Requires:       %{name}-networkd = %{version}-%{release}
f2f90a
License:        MIT-0
f2f90a
BuildArch:      noarch
f2f90a
f2f90a
%description networkd-defaults
f2f90a
This package contains a set of config files for systemd-networkd that cause it
f2f90a
to configure network interfaces by default. Note that systemd-networkd needs to
f2f90a
enabled for this to have any effect.
f2f90a
ae4880
%package resolved
ae4880
Summary:        Network Name Resolution manager
09f814
Requires:       %{name}%{_isa} = %{version}-%{release}
d2f4df
Obsoletes:      %{name} < 249~~
9e3166
Requires:       libidn2.so.0%{?elf_suffix}
9e3166
Requires:       libidn2.so.0(IDN2_0.0.0)%{?elf_bits}
9e3166
Requires(posttrans): grep
ae4880
ae4880
%description resolved
9e3166
systemd-resolved is a system service that provides network name resolution to
9e3166
local applications. It implements a caching and validating DNS/DNSSEC stub
9e3166
resolver, as well as an LLMNR and MulticastDNS resolver and responder.
ae4880
04a488
%package oomd-defaults
04a488
Summary:        Configuration files for systemd-oomd
f2f90a
Requires:       %{name}-udev = %{version}-%{release}
8c1b90
License:        LGPL-2.1-or-later
ae4880
BuildArch:      noarch
04a488
04a488
%description oomd-defaults
04a488
A set of drop-in files for systemd units to enable action from systemd-oomd,
04a488
a userspace out-of-memory (OOM) killer.
04a488
d0811f
%package tests
d0811f
Summary:       Internal unit tests for systemd
09f814
Requires:      %{name}%{_isa} = %{version}-%{release}
f2f90a
# This dependency is provided transitively. Also add it explicitly to
f2f90a
# appease rpminspect, https://github.com/rpminspect/rpminspect/issues/1231:
f2f90a
Requires:      %{name}-libs%{_isa} = %{version}-%{release}
e3e8c4
Requires:      python3dist(psutil)
f2f90a
8c1b90
License:       LGPL-2.1-or-later
d0811f
d0811f
%description tests
Zbigniew Jędrzejewski-Szmek 5a8212
Systemd unit tests used to test the internal implementation after a build.
Zbigniew Jędrzejewski-Szmek 5a8212
Different binaries test different parts of the codebase.
d0811f
8c1b90
%package standalone-repart
8c1b90
Summary:       Standalone systemd-repart binary for use on systems without systemd
8c1b90
Provides:      %{name}-repart = %{version}-%{release}
Zbigniew Jędrzejewski-Szmek b7800e
Conflicts:     %{name}-udev
Zbigniew Jędrzejewski-Szmek 3889da
Suggests:      coreutils-single
8c1b90
RemovePathPostfixes: .standalone
8c1b90
8c1b90
%description standalone-repart
Zbigniew Jędrzejewski-Szmek 5a8212
Standalone systemd-repart binary with no dependencies on the systemd-shared
Zbigniew Jędrzejewski-Szmek 5a8212
library or other libraries from systemd-libs. This package conflicts with the
Zbigniew Jędrzejewski-Szmek 5a8212
main systemd package and is meant for use on systems without systemd.
8c1b90
d2f4df
%package standalone-tmpfiles
8c1b90
Summary:       Standalone systemd-tmpfiles binary for use on systems without systemd
d2f4df
Provides:      %{name}-tmpfiles = %{version}-%{release}
Zbigniew Jędrzejewski-Szmek b7800e
Conflicts:     %{name}
Zbigniew Jędrzejewski-Szmek 3889da
Suggests:      coreutils-single
d2f4df
RemovePathPostfixes: .standalone
36c356
d2f4df
%description standalone-tmpfiles
Zbigniew Jędrzejewski-Szmek 5a8212
Standalone systemd-tmpfiles binary with no dependencies on the systemd-shared
Zbigniew Jędrzejewski-Szmek 5a8212
library or other libraries from systemd-libs. This package conflicts with the
Zbigniew Jędrzejewski-Szmek 5a8212
main systemd package and is meant for use on systems without systemd.
d0811f
d2f4df
%package standalone-sysusers
8c1b90
Summary:       Standalone systemd-sysusers binary for use on systems without systemd
d2f4df
Provides:      %{name}-sysusers = %{version}-%{release}
Zbigniew Jędrzejewski-Szmek b7800e
Conflicts:     %{name}
Zbigniew Jędrzejewski-Szmek 3889da
Suggests:      coreutils-single
d2f4df
RemovePathPostfixes: .standalone
d2f4df
d2f4df
%description standalone-sysusers
Zbigniew Jędrzejewski-Szmek 5a8212
Standalone systemd-sysusers binary with no dependencies on the systemd-shared
Zbigniew Jędrzejewski-Szmek 5a8212
library or other libraries from systemd-libs. This package conflicts with the
Zbigniew Jędrzejewski-Szmek 5a8212
main systemd package and is meant for use on systems without systemd.
8c1b90
8c1b90
%package standalone-shutdown
Zbigniew Jędrzejewski-Szmek 5a8212
Summary:       Standalone systemd-shutdown binary for use in exitrds
8c1b90
Provides:      %{name}-shutdown = %{version}-%{release}
Zbigniew Jędrzejewski-Szmek b7800e
Conflicts:     %{name}
Zbigniew Jędrzejewski-Szmek 3889da
Suggests:      coreutils-single
8c1b90
RemovePathPostfixes: .standalone
8c1b90
8c1b90
%description standalone-shutdown
Zbigniew Jędrzejewski-Szmek 5a8212
Standalone systemd-shutdown binary with no dependencies on the systemd-shared
Zbigniew Jędrzejewski-Szmek 5a8212
library or other libraries from systemd-libs. This package conflicts with the
Zbigniew Jędrzejewski-Szmek 5a8212
main systemd package and is meant for use in exitrds.
d2f4df
d2f4df
%prep
Ryan Wilson 61c859
%if 0%{?facebook} && %{with upstream}
d3f84c
# For systemd-cd (https://gitlab.com/CentOS/Hyperscale/releng/systemd-releng) builds,
d3f84c
# we want to allow certain patches to accelerate internal projects.
Ryan Wilson 61c859
Ryan Wilson 61c859
# Call autosetup but disable patch management, we'll do that with autopatch below
Ryan Wilson 61c859
%if %{defined branch}
Ryan Wilson 61c859
%autosetup -N -n %{name}-%{branch}
Ryan Wilson 61c859
%elif %{defined commit}
Ryan Wilson 61c859
%autosetup -N -n %{name}-%{commit}
Ryan Wilson 61c859
%else
Ryan Wilson 61c859
%autosetup -N -n %{name}-%{version_no_tilde}
Ryan Wilson 61c859
%endif
Ryan Wilson 61c859
Ryan Wilson 61c859
# Now only install only patches in the specific Meta-only range
Ryan Wilson 61c859
%autopatch -m 1001 -M 1100 -p1
Ryan Wilson 61c859
Ryan Wilson 61c859
%else
Ryan Wilson 61c859
Ryan Wilson 61c859
# Use standard autosetup with automatic patch management
cbc614
%if %{defined branch}
608445
%autosetup -n %{name}-%{branch} -p1
cbc614
%elif %{defined commit}
608445
%autosetup -n %{name}-%{commit} -p1
cbc614
%else
cbc614
%autosetup -n %{name}-%{version_no_tilde} -p1
cbc614
%endif
5cdaa6
Ryan Wilson 61c859
%endif
Ryan Wilson 61c859
d0811f
%build
9e3166
%global ntpvendor %(source /etc/os-release; echo ${ID})
d0811f
%{!?ntpvendor: echo 'NTP vendor zone is not set!'; exit 1}
d0811f
f9fe17
VMLINUX_H_PATH=''
f9fe17
f9fe17
%if 0%{?have_bpf}
f9fe17
f9fe17
%global find_vmlinux_h %{expand:
f9fe17
import functools, glob, subprocess
f9fe17
def cmp(a, b):
f9fe17
  c = subprocess.call(["rpmdev-vercmp", a, b], stdout=subprocess.DEVNULL)
f9fe17
  return {0:0, 11:+1, 12:-1}[c]
f9fe17
choices = list(glob.glob("/usr/src/kernels/*/vmlinux.h"))
f9fe17
assert choices
f9fe17
print(max(choices, key=functools.cmp_to_key(cmp)))
f9fe17
}
f9fe17
f9fe17
# The build fails on ppc64le with
f9fe17
# "GCC error "Must specify a BPF target arch via __TARGET_ARCH_xxx".
f9fe17
# TODO: Remove this when libbpf checks for __powerpc64__ macro.
f9fe17
%ifnarch ppc64le
f9fe17
VMLINUX_H_PATH=$(%python3 -c '%find_vmlinux_h')
f9fe17
%endif
f9fe17
%endif
f9fe17
d0811f
CONFIGURE_OPTS=(
e3e8c4
        -Dmode=%[%{with upstream}?"developer":"release"]
d0811f
        -Dsysvinit-path=/etc/rc.d/init.d
d0811f
        -Drc-local=/etc/rc.d/rc.local
d0811f
        -Dntp-servers='0.%{ntpvendor}.pool.ntp.org 1.%{ntpvendor}.pool.ntp.org 2.%{ntpvendor}.pool.ntp.org 3.%{ntpvendor}.pool.ntp.org'
505ca8
        -Ddns-servers=
d0811f
        -Duser-path=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin
d0811f
        -Dservice-watchdog=
d0811f
        -Ddev-kvm-mode=0666
f2f90a
        -Dkmod=enabled
f2f90a
        -Dxkbcommon=enabled
f2f90a
        -Dblkid=enabled
f2f90a
        -Dfdisk=enabled
f2f90a
        -Dseccomp=enabled
d0811f
        -Dima=true
f2f90a
        -Dselinux=enabled
f2f90a
        -Dbpf-framework=%[0%{?have_bpf}?"enabled":"disabled"]
f9fe17
        -Dvmlinux-h=%[0%{?have_bpf}?"auto":"disabled"]
f9fe17
        -Dvmlinux-h-path="$VMLINUX_H_PATH"
f2f90a
        -Dapparmor=disabled
f2f90a
        -Dpolkit=enabled
f2f90a
        -Dxz=%[%{with xz}?"enabled":"disabled"]
f2f90a
        -Dzlib=%[%{with zlib}?"enabled":"disabled"]
f2f90a
        -Dbzip2=%[%{with bzip2}?"enabled":"disabled"]
f2f90a
        -Dlz4=%[%{with lz4}?"enabled":"disabled"]
f2f90a
        -Dzstd=%[%{with zstd}?"enabled":"disabled"]
f2f90a
        -Dpam=enabled
f2f90a
        -Dacl=enabled
d0811f
        -Dsmack=true
f2f90a
        -Dopenssl=enabled
9e3166
        -Dcryptolib=openssl
f2f90a
        -Dp11kit=enabled
f2f90a
        -Dgcrypt=disabled
f2f90a
        -Daudit=enabled
f2f90a
        -Delfutils=enabled
f2f90a
        -Dlibcryptsetup=%[%{with bootstrap}?"disabled":"enabled"]
f2f90a
        -Delfutils=enabled
U2FsdGVkX1 ebf352
        -Drepart=enabled
f2f90a
        -Dpwquality=enabled
f2f90a
        -Dqrencode=%[%{defined rhel}?"disabled":"enabled"]
f2f90a
        -Dgnutls=%[%{with gnutls}?"enabled":"disabled"]
f2f90a
        -Dmicrohttpd=enabled
f2f90a
        -Dvmspawn=enabled
f2f90a
        -Dlibidn2=enabled
f2f90a
        -Dlibiptc=disabled
f2f90a
        -Dlibcurl=enabled
f2f90a
        -Dlibfido2=enabled
f2f90a
        -Dxenctrl=%[0%{?have_xen}?"enabled":"disabled"]
d0811f
        -Defi=true
d0811f
        -Dtpm=true
f2f90a
        -Dtpm2=enabled
d0811f
        -Dhwdb=true
d0811f
        -Dsysusers=true
09f814
        -Dstandalone-binaries=true
d0811f
        -Ddefault-kill-user-processes=false
09f814
        -Dfirst-boot-full-preset=true
27adc3
        -Ddefault-network=true
d0811f
        -Dtests=unsafe
d0811f
        -Dinstall-tests=true
d0811f
        -Dnobody-user=nobody
d0811f
        -Dnobody-group=nobody
505ca8
        -Dcompat-mutable-uid-boundaries=true
d0811f
        -Dsplit-bin=true
d0811f
        -Db_ndebug=false
e3e8c4
        -Dman=%[%{with docs}?"enabled":"disabled"]
3c24f0
        -Dversion-tag=%{version}%[%{without upstream}?"-%{release}":""]
d2f4df
        # https://bugzilla.redhat.com/show_bug.cgi?id=1906010
f2f90a
        -Dshared-lib-tag=%{version_no_tilde}%[%{without upstream}?"-%{release}":""]
Zbigniew Jędrzejewski-Szmek 38b885
        -Dlink-executor-shared=false
09f814
        -Dfallback-hostname="localhost"
505ca8
        -Ddefault-dnssec=no
d2f4df
        -Ddefault-dns-over-tls=no
505ca8
        # https://bugzilla.redhat.com/show_bug.cgi?id=1867830
505ca8
        -Ddefault-mdns=no
505ca8
        -Ddefault-llmnr=resolve
9e3166
        # https://bugzilla.redhat.com/show_bug.cgi?id=2028169
9e3166
        -Dstatus-unit-format-default=combined
a8c5c7
%if 0%{?fedora}
ba02e9
        # https://fedoraproject.org/wiki/Changes/Shorter_Shutdown_Timer
ba02e9
        -Ddefault-timeout-sec=45
ba02e9
        -Ddefault-user-timeout-sec=45
a8c5c7
%endif
f2f90a
        -Dconfigfiledir=/usr/lib
167d2b
        -Doomd=true
e3e8c4
ae4880
        -Dadm-gid=4
e3e8c4
        -Dtty-gid=5
ae4880
        -Ddisk-gid=6
e3e8c4
        -Dlp-gid=7
ae4880
        -Dkmem-gid=9
e3e8c4
        -Dwheel-gid=10
e3e8c4
        -Dcdrom-gid=11
e3e8c4
        -Ddialout-gid=18
e3e8c4
        -Dutmp-gid=22
e3e8c4
        -Dtape-gid=33
ae4880
        -Dkvm-gid=36
e3e8c4
        -Dvideo-gid=39
e3e8c4
        -Daudio-gid=63
e3e8c4
        -Dusers-gid=100
e3e8c4
        -Dinput-gid=104
9e3166
        -Drender-gid=105
9e3166
        -Dsgx-gid=106
ae4880
        -Dsystemd-journal-gid=190
ae4880
        -Dsystemd-network-uid=192
ae4880
        -Dsystemd-resolve-uid=193
ae4880
        # -Dsystemd-timesync-uid=, not set yet
f2f90a
f2f90a
        # For now, let's build the bootloader in the same places where we
f2f90a
        # built with gnu-efi. Later on, we might want to extend coverage, but
f2f90a
        # considering that that support is untested, let's not do this now.
f2f90a
        -Dbootloader=%[%{?want_bootloader}?"enabled":"disabled"]
a67221
        -Dukify=enabled
7172f2
)
7172f2
7172f2
%if 0%{?facebook}
7172f2
CONFIGURE_OPTS+=(
7172f2
        -Dntp-servers='1.ntp.vip.facebook.com 2.ntp.vip.facebook.com 3.ntp.vip.facebook.com 4.ntp.vip.facebook.com'
7172f2
        -Ddns-servers='10.127.255.51 10.191.255.51 2401:db00:eef0:a53:: 2401:db00:eef0:b53::'
66b4a7
        -Dsupport-url='https://fb.workplace.com/groups/systemd.and.friends'
7172f2
        -Dcontainer-uid-base-min=10485760
d0811f
)
7172f2
%endif
d0811f
505ca8
%if %{without lto}
505ca8
%global _lto_cflags %nil
505ca8
%endif
505ca8
e6e171
{ %meson "${CONFIGURE_OPTS[@]}" %{?meson_extra_configure_options} ; }
ae4880
ae4880
%meson_build
167d2b
167d2b
new_triggers=%{_vpath_builddir}/src/rpm/triggers.systemd.sh
167d2b
if ! diff -u %{SOURCE1} ${new_triggers}; then
167d2b
   echo -e "\n\n\nWARNING: triggers.systemd in Source1 is different!"
167d2b
   echo -e "      cp $PWD/${new_triggers} %{SOURCE1}\n\n\n"
167d2b
   sleep 5
167d2b
fi
167d2b
f2f90a
sed -r 's|/system/|/user/|g' %{SOURCE16} >10-timeout-abort.conf.user
f2f90a
d0811f
%install
d0811f
%meson_install
d0811f
d0811f
# udev links
e3e8c4
%if "%{_sbindir}" != "%{_bindir}"
d0811f
mkdir -p %{buildroot}/%{_sbindir}
d0811f
ln -sf ../bin/udevadm %{buildroot}%{_sbindir}/udevadm
e3e8c4
%endif
d0811f
d0811f
# Compatiblity and documentation files
d0811f
touch %{buildroot}/etc/crypttab
d0811f
chmod 600 %{buildroot}/etc/crypttab
d0811f
f2f90a
# Config files that were moved under /usr.
f2f90a
# We need to %ghost them so that they are not removed on upgrades.
f2f90a
touch %{buildroot}/etc/systemd/coredump.conf \
f2f90a
      %{buildroot}/etc/systemd/homed.conf \
f2f90a
      %{buildroot}/etc/systemd/journald.conf \
f2f90a
      %{buildroot}/etc/systemd/journal-remote.conf \
f2f90a
      %{buildroot}/etc/systemd/journal-upload.conf \
f2f90a
      %{buildroot}/etc/systemd/logind.conf \
f2f90a
      %{buildroot}/etc/systemd/networkd.conf \
f2f90a
      %{buildroot}/etc/systemd/oomd.conf \
f2f90a
      %{buildroot}/etc/systemd/pstore.conf \
f2f90a
      %{buildroot}/etc/systemd/resolved.conf \
f2f90a
      %{buildroot}/etc/systemd/sleep.conf \
f2f90a
      %{buildroot}/etc/systemd/system.conf \
f2f90a
      %{buildroot}/etc/systemd/timesyncd.conf \
f2f90a
      %{buildroot}/etc/systemd/user.conf \
f2f90a
      %{buildroot}/etc/udev/udev.conf \
f2f90a
      %{buildroot}/etc/udev/iocost.conf
f2f90a
Zbigniew Jędrzejewski-Szmek 694729
install -D -t %{buildroot}/usr/lib/systemd/ %{SOURCE3}
Zbigniew Jędrzejewski-Szmek 694729
09f814
# /etc/initab
Zbigniew Jędrzejewski-Szmek 694729
install -Dm0644 -t %{buildroot}/etc/ %{SOURCE6}
09f814
d0811f
# /etc/sysctl.conf compat
Zbigniew Jędrzejewski-Szmek 694729
install -Dm0644 %{SOURCE7} %{buildroot}/etc/sysctl.conf
d0811f
ln -s ../sysctl.conf %{buildroot}/etc/sysctl.d/99-sysctl.conf
d0811f
d0811f
# Make sure these directories are properly owned
d0811f
mkdir -p %{buildroot}%{system_unit_dir}/basic.target.wants
d0811f
mkdir -p %{buildroot}%{system_unit_dir}/default.target.wants
d0811f
mkdir -p %{buildroot}%{system_unit_dir}/dbus.target.wants
d0811f
mkdir -p %{buildroot}%{system_unit_dir}/syslog.target.wants
d0811f
mkdir -p %{buildroot}/run
d0811f
mkdir -p %{buildroot}%{_localstatedir}/log
9e3166
touch %{buildroot}%{_localstatedir}/log/lastlog
9e3166
chmod 0664 %{buildroot}%{_localstatedir}/log/lastlog
d0811f
touch %{buildroot}/run/utmp
d0811f
touch %{buildroot}%{_localstatedir}/log/{w,b}tmp
d0811f
d0811f
# Make sure the user generators dir exists too
d0811f
mkdir -p %{buildroot}%{pkgdir}/system-generators
d0811f
mkdir -p %{buildroot}%{pkgdir}/user-generators
d0811f
d0811f
# Create new-style configuration files so that we can ghost-own them
d0811f
touch %{buildroot}%{_sysconfdir}/hostname
d0811f
touch %{buildroot}%{_sysconfdir}/vconsole.conf
d0811f
touch %{buildroot}%{_sysconfdir}/locale.conf
d0811f
touch %{buildroot}%{_sysconfdir}/machine-id
d0811f
touch %{buildroot}%{_sysconfdir}/machine-info
d0811f
touch %{buildroot}%{_sysconfdir}/localtime
d0811f
mkdir -p %{buildroot}%{_sysconfdir}/X11/xorg.conf.d
d0811f
touch %{buildroot}%{_sysconfdir}/X11/xorg.conf.d/00-keyboard.conf
d0811f
d0811f
# Make sure the shutdown/sleep drop-in dirs exist
d0811f
mkdir -p %{buildroot}%{pkgdir}/system-shutdown/
d0811f
mkdir -p %{buildroot}%{pkgdir}/system-sleep/
d0811f
d0811f
# Make sure directories in /var exist
d0811f
mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/coredump
d0811f
mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/catalog
d0811f
mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/backlight
d0811f
mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/rfkill
d0811f
mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/linger
d0811f
mkdir -p %{buildroot}%{_localstatedir}/lib/private
d0811f
mkdir -p %{buildroot}%{_localstatedir}/log/private
d0811f
mkdir -p %{buildroot}%{_localstatedir}/cache/private
d0811f
mkdir -p %{buildroot}%{_localstatedir}/lib/private/systemd/journal-upload
d0811f
mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/timesync
d0811f
ln -s ../private/systemd/journal-upload %{buildroot}%{_localstatedir}/lib/systemd/journal-upload
d0811f
mkdir -p %{buildroot}%{_localstatedir}/log/journal
d0811f
touch %{buildroot}%{_localstatedir}/lib/systemd/catalog/database
d0811f
touch %{buildroot}%{_sysconfdir}/udev/hwdb.bin
d0811f
touch %{buildroot}%{_localstatedir}/lib/systemd/random-seed
d0811f
touch %{buildroot}%{_localstatedir}/lib/systemd/timesync/clock
d0811f
touch %{buildroot}%{_localstatedir}/lib/private/systemd/journal-upload/state
d0811f
Zbigniew Jędrzejewski-Szmek bedc02
# Install yum protection config. Old location in /etc.
Zbigniew Jędrzejewski-Szmek bedc02
mkdir -p %{buildroot}/etc/dnf/protected.d/
Zbigniew Jędrzejewski-Szmek bedc02
cat >%{buildroot}/etc/dnf/protected.d/systemd.conf <
Zbigniew Jędrzejewski-Szmek bedc02
systemd
Zbigniew Jędrzejewski-Szmek bedc02
systemd-udev
Zbigniew Jędrzejewski-Szmek bedc02
EOF
Zbigniew Jędrzejewski-Szmek bedc02
# Install dnf5 protection config. New location under /usr.
Zbigniew Jędrzejewski-Szmek bedc02
mkdir -p %{buildroot}/usr/share/dnf5/libdnf.conf.d/
Zbigniew Jędrzejewski-Szmek bedc02
cat >%{buildroot}/usr/share/dnf5/libdnf.conf.d/protect-systemd.conf <
Zbigniew Jędrzejewski-Szmek bedc02
[main]
Zbigniew Jędrzejewski-Szmek bedc02
protected_packages = systemd, systemd-udev
Zbigniew Jędrzejewski-Szmek bedc02
EOF
d0811f
Zbigniew Jędrzejewski-Szmek 694729
install -Dm0644 -t %{buildroot}/usr/lib/firewalld/services/ %{SOURCE8} %{SOURCE9}
09f814
d0811f
# Install additional docs
d0811f
# https://bugzilla.redhat.com/show_bug.cgi?id=1234951
Zbigniew Jędrzejewski-Szmek 694729
install -Dm0644 -t %{buildroot}%{_pkgdocdir}/ %{SOURCE10}
d0811f
d0811f
# https://bugzilla.redhat.com/show_bug.cgi?id=1378974
Zbigniew Jędrzejewski-Szmek 694729
install -Dm0644 -t %{buildroot}%{system_unit_dir}/systemd-udev-trigger.service.d/ %{SOURCE11}
d0811f
ae4880
install -Dm0644 -t %{buildroot}%{_prefix}/lib/systemd/ %{SOURCE13}
ae4880
04a488
# systemd-oomd default configuration
04a488
install -Dm0644 -t %{buildroot}%{_prefix}/lib/systemd/oomd.conf.d/ %{SOURCE14}
09f814
install -Dm0644 -t %{buildroot}%{system_unit_dir}/system.slice.d/ %{SOURCE15}
09f814
install -Dm0644 -t %{buildroot}%{user_unit_dir}/slice.d/ %{SOURCE15}
a8c5c7
%if 0%{?fedora}
Zbigniew Jędrzejewski-Szmek 55ee78
# https://fedoraproject.org/wiki/Changes/Shorter_Shutdown_Timer
Zbigniew Jędrzejewski-Szmek 55ee78
install -Dm0644 -t %{buildroot}%{system_unit_dir}/service.d/ %{SOURCE16}
Zbigniew Jędrzejewski-Szmek 55ee78
install -Dm0644 10-timeout-abort.conf.user %{buildroot}%{user_unit_dir}/service.d/10-timeout-abort.conf
a8c5c7
%endif
8c1b90
8c1b90
# https://fedoraproject.org/wiki/Changes/IncreaseVmMaxMapCount
8c1b90
install -Dm0644 -t %{buildroot}%{_prefix}/lib/sysctl.d/ %{SOURCE17}
04a488
6185b0
%if %{undefined facebook}
00babc
# As requested in https://bugzilla.redhat.com/show_bug.cgi?id=1738828.
00babc
# Test results are that bfq seems to behave better and more consistently on
00babc
# typical hardware. The kernel does not have a configuration option to set the
00babc
# default scheduler, and it currently needs to be set by userspace.
00babc
install -Dm0644 -t %{buildroot}%{_prefix}/lib/udev/rules.d/ %{SOURCE18}
6185b0
%endif
00babc
d0811f
sed -i 's|#!/usr/bin/env python3|#!%{__python3}|' %{buildroot}/usr/lib/systemd/tests/run-unit-tests.py
d0811f
d0811f
install -m 0644 -D -t %{buildroot}%{_rpmconfigdir}/macros.d/ %{SOURCE21}
f2f90a
# Use rpm's own sysusers provides where available
f2f90a
%if ! (0%{?fedora} >= 39 || 0%{?rhel} >= 10)
d0811f
install -m 0644 -D -t %{buildroot}%{_rpmconfigdir}/fileattrs/ %{SOURCE22}
d0811f
install -m 0755 -D -t %{buildroot}%{_rpmconfigdir}/ %{SOURCE23}
f2f90a
%endif
d0811f
install -m 0755 -D -t %{buildroot}%{_rpmconfigdir}/ %{SOURCE24}
d0811f
8c1b90
# https://bugzilla.redhat.com/show_bug.cgi?id=2107754
8c1b90
install -Dm0644 -t %{buildroot}%{_prefix}/lib/systemd/network/ %{SOURCE25}
8c1b90
12d1f0
%if 0%{?fedora} || 0%{?rhel} >= 10
Zbigniew Jędrzejewski-Szmek 360975
ln -s --relative %{buildroot}%{_bindir}/kernel-install %{buildroot}%{_sbindir}/installkernel
12d1f0
%endif
Zbigniew Jędrzejewski-Szmek f66faf
e3e8c4
%if "%{_sbindir}" == "%{_bindir}"
e3e8c4
# Systemd has the split-sbin option which is also used to select the directory
e3e8c4
# for alias symlinks. We need to keep split-sbin=true for now, to support
e3e8c4
# unmerged systems. Move the symlinks here instead.
e3e8c4
mv -v %{buildroot}/usr/sbin/* %{buildroot}%{_bindir}/
e3e8c4
%endif
e3e8c4
Zbigniew Jędrzejewski-Szmek c56891
%if 0%{?fedora} >= 41
Zbigniew Jędrzejewski-Szmek c56891
# This requires https://pagure.io/setup/pull-request/50
Zbigniew Jędrzejewski-Szmek c56891
# and https://src.fedoraproject.org/rpms/setup/pull-request/10.
Zbigniew Jędrzejewski-Szmek c56891
%{python3} %{SOURCE4} /usr/lib/sysusers.d/20-setup-{users,groups}.conf %{buildroot}/usr/lib/sysusers.d/basic.conf
Zbigniew Jędrzejewski-Szmek c56891
rm %{buildroot}/usr/lib/sysusers.d/basic.conf
Zbigniew Jędrzejewski-Szmek c56891
%endif
Zbigniew Jędrzejewski-Szmek c56891
Zbigniew Jędrzejewski-Szmek 38291e
# Disable sshd_config.d/20-systemd-userdb.conf for now.
Zbigniew Jędrzejewski-Szmek 38291e
# This option may override an existing AuthorizedKeysCommand setting
Zbigniew Jędrzejewski-Szmek 38291e
# (or be ineffective, depending on the order of configuration).
Zbigniew Jędrzejewski-Szmek 38291e
# See https://github.com/systemd/systemd/issues/33648.
Zbigniew Jędrzejewski-Szmek 38291e
rm %{buildroot}/etc/ssh/sshd_config.d/20-systemd-userdb.conf
Zbigniew Jędrzejewski-Szmek 38291e
mv %{buildroot}/usr/lib/tmpfiles.d/20-systemd-userdb.conf{,.example}
Zbigniew Jędrzejewski-Szmek 38291e
abb115
install -m 0644 -t %{buildroot}%{_prefix}/lib/pam.d/ %{SOURCE26}
abb115
d0811f
%find_lang %{name}
d0811f
f2f90a
# Split files in build root into rpms
f2f90a
python3 %{SOURCE2} %buildroot %{!?want_bootloader:--no-bootloader}
d0811f
d0811f
%check
d0811f
%if %{with tests}
f2f90a
meson test -C %{_vpath_builddir} -t 6 --print-errorlogs
d0811f
%endif
d0811f
d0811f
#############################################################################################
d0811f
d0811f
%include %{SOURCE1}
d0811f
3c6b3b
# This macro is newly added upstream so we can't rely on it being always being available
9f811f
# in the systemd-rpm-macros yet so we define it ourselves. Also, we can't detect upgrades
9f811f
# on c9s because https://github.com/rpm-software-management/rpm/commit/3848c97cb227e7c018781aa7d5e1e46990ce1ffb
9f811f
# is not in c9s so we remove the upgrade check and unconditionally try to restart the units.
3c6b3b
%global systemd_posttrans_with_restart() \
3c6b3b
%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# systemd_posttrans_with_restart}} \
9f811f
if [ -x "/usr/lib/systemd/systemd-update-helper" ]; then \
3c6b3b
    /usr/lib/systemd/systemd-update-helper mark-restart-system-units %* || : \
3c6b3b
fi \
3c6b3b
%{nil}
3c6b3b
703bd5
%define systemd_rpmstatedir %{_localstatedir}/lib/rpm-state/systemd
703bd5
d0811f
%post
d0811f
systemd-machine-id-setup &>/dev/null || :
d0811f
ae4880
[ $1 -eq 1 ] || exit 0
d0811f
ae4880
# create /var/log/journal only on initial installation,
ae4880
# and only if it's writable (it won't be in rpm-ostree).
ae4880
[ -w %{_localstatedir} ] && mkdir -p %{_localstatedir}/log/journal
d0811f
ae4880
[ -w %{_localstatedir} ] && journalctl --update-catalog || :
ae4880
systemd-sysusers || :
ae4880
systemd-tmpfiles --create &>/dev/null || :
505ca8
d0811f
# We reset the enablement of all services upon initial installation
d0811f
# https://bugzilla.redhat.com/show_bug.cgi?id=1118740#c23
d0811f
# This will fix up enablement of any preset services that got installed
d0811f
# before systemd due to rpm ordering problems:
d0811f
# https://bugzilla.redhat.com/show_bug.cgi?id=1647172.
d0811f
# We also do this for user units, see
d0811f
# https://fedoraproject.org/wiki/Changes/Systemd_presets_for_user_units.
505ca8
systemctl preset-all &>/dev/null || :
505ca8
systemctl --global preset-all &>/dev/null || :
505ca8
703bd5
%pre
703bd5
[ -w %{_localstatedir} ] && mkdir -p %{systemd_rpmstatedir} && touch %{systemd_rpmstatedir}/restart-required || :
703bd5
179179
%postun
d36331
[ -w %{systemd_rpmstatedir} ] && [ ! -f %{systemd_rpmstatedir}/restart-required ] && exit 0 || :
703bd5
703bd5
[ -w %{systemd_rpmstatedir} ] && rm -f %{systemd_rpmstatedir}/restart-required || :
703bd5
179179
if [ $1 -ge 1 ]; then
179179
    [ -w %{_localstatedir} ] && journalctl --update-catalog || :
179179
179179
    systemctl daemon-reexec || :
179179
179179
    systemd-tmpfiles --create &>/dev/null || :
179179
fi
179179
179179
%systemd_postun_with_restart systemd-timedated.service systemd-hostnamed.service systemd-journald.service systemd-localed.service systemd-userdbd.service
179179
179179
# This is the expanded form of %%systemd_user_daemon_reexec. We
179179
# can't use the macro because we define it ourselves.
179179
if [ $1 -ge 1 ] && [ -x "/usr/lib/systemd/systemd-update-helper" ]; then
179179
    /usr/lib/systemd/systemd-update-helper user-reexec || :
179179
fi
179179
3c6b3b
%posttrans
d36331
[ -w %{systemd_rpmstatedir} ] && [ ! -f %{systemd_rpmstatedir}/restart-required ] && exit 0 || :
703bd5
703bd5
[ -w %{systemd_rpmstatedir} ] && rm -f %{systemd_rpmstatedir}/restart-required || :
703bd5
9f811f
# We can't check for upgrades on c9s as https://github.com/rpm-software-management/rpm/commit/3848c97cb227e7c018781aa7d5e1e46990ce1ffb
9f811f
# is missing so we run this stuff unconditionally on installs and upgrades.
9f811f
[ -w %{_localstatedir} ] && journalctl --update-catalog || :
e3e8c4
9f811f
systemctl daemon-reexec || :
e3e8c4
9f811f
systemd-tmpfiles --create &>/dev/null || :
d0811f
3c6b3b
%systemd_posttrans_with_restart systemd-timedated.service systemd-hostnamed.service systemd-journald.service systemd-localed.service systemd-userdbd.service
f2f90a
Zbigniew Jędrzejewski-Szmek 65d9b4
# This is the expanded form of %%systemd_user_daemon_reexec. We
f2f90a
# can't use the macro because we define it ourselves.
9f811f
if [ -x "/usr/lib/systemd/systemd-update-helper" ]; then
f2f90a
    /usr/lib/systemd/systemd-update-helper user-reexec || :
f2f90a
fi
ae4880
703bd5
# Facebook minimum version is 255 so once 255-1.5 is released to Facebook's fleet,
703bd5
# we can rely on the fact all systemd RPMs will use posttrans/postun and RPM state
703bd5
# to ensure only one daemon-reexec. However, non-Facebook Centos RPMs may be older
703bd5
# versions and we can't rely on removing triggerun for versions < 256.
703bd5
%if 0%{?facebook} == 0
e3e8c4
%triggerun -- systemd < 256
e3e8c4
# This is for upgrades from previous versions before systemd restart was moved to %%postun
e3e8c4
systemctl daemon-reexec || :
703bd5
%endif
8c1b90
8c1b90
%triggerpostun -- systemd < 253~rc1-2
8c1b90
# This is for upgrades from previous versions where systemd-journald-audit.socket
8c1b90
# had a static enablement symlink.
ae4880
# We use %%triggerpostun here because rpm doesn't allow a second %%triggerun with
ae4880
# a different package version.
8c1b90
systemctl --no-reload preset systemd-journald-audit.socket &>/dev/null || :
8c1b90
f2f90a
%global udev_services systemd-udev{d,-settle,-trigger}.service systemd-udevd-{control,kernel}.socket systemd-homed.service %{?want_bootloader:systemd-boot-update.service} systemd-oomd.service systemd-portabled.service systemd-pstore.service systemd-timesyncd.service remote-cryptsetup.target
d0811f
d0811f
%post udev
d0811f
# Move old stuff around in /var/lib
d0811f
mv %{_localstatedir}/lib/random-seed %{_localstatedir}/lib/systemd/random-seed &>/dev/null
d0811f
mv %{_localstatedir}/lib/backlight %{_localstatedir}/lib/systemd/backlight &>/dev/null
d0811f
if [ -L %{_localstatedir}/lib/systemd/timesync ]; then
d0811f
    rm %{_localstatedir}/lib/systemd/timesync
d0811f
    mv %{_localstatedir}/lib/private/systemd/timesync %{_localstatedir}/lib/systemd/timesync
d0811f
fi
e3e8c4
if [ -f %{_localstatedir}/lib/systemd/clock ]; then
d0811f
    mkdir -p %{_localstatedir}/lib/systemd/timesync
d0811f
    mv %{_localstatedir}/lib/systemd/clock %{_localstatedir}/lib/systemd/timesync/.
d0811f
fi
d0811f
d0811f
udevadm hwdb --update &>/dev/null
505ca8
d0811f
%systemd_post %udev_services
505ca8
505ca8
# Try to save the random seed, but don't complain if /dev/urandom is unavailable
505ca8
/usr/lib/systemd/systemd-random-seed save 2>&1 | \
505ca8
    grep -v 'Failed to open /dev/urandom' || :
d0811f
d0811f
# Replace obsolete keymaps
d0811f
# https://bugzilla.redhat.com/show_bug.cgi?id=1151958
d0811f
grep -q -E '^KEYMAP="?fi-latin[19]"?' /etc/vconsole.conf 2>/dev/null &&
d0811f
    sed -i.rpm.bak -r 's/^KEYMAP="?fi-latin[19]"?/KEYMAP="fi"/' /etc/vconsole.conf || :
d0811f
d0811f
%preun udev
d0811f
%systemd_preun %udev_services
d0811f
179179
%postun udev
179179
%systemd_postun_with_restart systemd-udevd.service systemd-timesyncd.service
179179
3c6b3b
%posttrans udev
167d2b
# Restart some services.
d0811f
# Others are either oneshot services, or sockets, and restarting them causes issues (#1378974)
3c6b3b
%systemd_posttrans_with_restart systemd-udevd.service systemd-timesyncd.service
9e3166
ae4880
%global journal_remote_units_restart systemd-journal-gatewayd.service systemd-journal-remote.service systemd-journal-upload.service
ae4880
%global journal_remote_units_norestart systemd-journal-gatewayd.socket systemd-journal-remote.socket
d0811f
%post journal-remote
ae4880
%systemd_post %journal_remote_units_restart %journal_remote_units_norestart
09f814
%firewalld_reload
d0811f
d0811f
%preun journal-remote
ae4880
%systemd_preun %journal_remote_units_restart %journal_remote_units_norestart
d0811f
if [ $1 -eq 1 ] ; then
d0811f
    if [ -f %{_localstatedir}/lib/systemd/journal-upload/state -a ! -L %{_localstatedir}/lib/systemd/journal-upload ] ; then
d0811f
        mkdir -p %{_localstatedir}/lib/private/systemd/journal-upload
d0811f
        mv %{_localstatedir}/lib/systemd/journal-upload/state %{_localstatedir}/lib/private/systemd/journal-upload/.
d0811f
        rmdir %{_localstatedir}/lib/systemd/journal-upload || :
d0811f
    fi
d0811f
fi
d0811f
3c6b3b
%posttrans journal-remote
3c6b3b
%systemd_posttrans_with_restart %journal_remote_units_restart
09f814
%firewalld_reload
ae4880
ae4880
%post networkd
ae4880
# systemd-networkd was split out in systemd-246.6-2.
ae4880
# Ideally, we would have a trigger scriptlet to record enablement
ae4880
# state when upgrading from systemd <= systemd-246.6-1. But, AFAICS,
ae4880
# rpm doesn't allow us to trigger on another package, short of
ae4880
# querying the rpm database ourselves, which seems risky. For rpm,
ae4880
# systemd and systemd-networkd are completely unrelated.  So let's use
ae4880
# a hack to detect if an old systemd version is currently present in
ae4880
# the file system.
ae4880
# https://bugzilla.redhat.com/show_bug.cgi?id=1943263
ae4880
if [ $1 -eq 1 ] && ls /usr/lib/systemd/libsystemd-shared-24[0-6].so &>/dev/null; then
ae4880
    echo "Skipping presets for systemd-networkd.service, seems we are upgrading from old systemd."
ae4880
else
ae4880
    %systemd_post systemd-networkd.service systemd-networkd-wait-online.service
ae4880
fi
ae4880
ae4880
%preun networkd
ae4880
%systemd_preun systemd-networkd.service systemd-networkd-wait-online.service
ae4880
179179
%postun networkd
179179
%if %{undefined facebook}
179179
%systemd_postun_with_restart systemd-networkd.service
179179
%endif
179179
3c6b3b
%posttrans networkd
9cf135
%if %{undefined facebook}
3c6b3b
%systemd_posttrans_with_restart systemd-networkd.service
daec12
%endif
f2f90a
f2f90a
%post resolved
f2f90a
[ $1 -eq 1 ] || exit 0
f2f90a
# Initial installation
f2f90a
f2f90a
touch %{_localstatedir}/lib/rpm-state/systemd-resolved.initial-installation
f2f90a
f2f90a
# Related to https://bugzilla.redhat.com/show_bug.cgi?id=1943263
f2f90a
if ls /usr/lib/systemd/libsystemd-shared-24[0-8].so &>/dev/null; then
f2f90a
    echo "Skipping presets for systemd-resolved.service, seems we are upgrading from old systemd."
f2f90a
    exit 0
f2f90a
fi
f2f90a
f2f90a
%systemd_post systemd-resolved.service
f2f90a
ae4880
%preun resolved
ae4880
if [ $1 -eq 0 ] ; then
ae4880
        systemctl disable --quiet \
ae4880
                systemd-resolved.service \
ae4880
                >/dev/null || :
9e3166
        if [ -L /etc/resolv.conf ] && \
9e3166
            realpath /etc/resolv.conf | grep ^/run/systemd/resolve/; then
9e3166
                rm -f /etc/resolv.conf # no longer useful
9e3166
                # if network manager is enabled, move to it instead
9e3166
                [ -f /run/NetworkManager/resolv.conf ] && \
9e3166
                systemctl -q is-enabled NetworkManager.service &>/dev/null && \
9e3166
                    ln -fsv ../run/NetworkManager/resolv.conf /etc/resolv.conf
9e3166
        fi
ae4880
fi
ae4880
179179
%postun resolved
179179
%systemd_postun_with_restart systemd-resolved.service
179179
9e3166
%posttrans resolved
3c6b3b
%systemd_posttrans_with_restart systemd-resolved.service
09f814
[ -e %{_localstatedir}/lib/rpm-state/systemd-resolved.initial-installation ] || exit 0
09f814
rm %{_localstatedir}/lib/rpm-state/systemd-resolved.initial-installation
d2f4df
# Initial installation
d2f4df
ae4880
# Create /etc/resolv.conf symlink.
09f814
# (https://bugzilla.redhat.com/show_bug.cgi?id=1873856)
09f814
#
09f814
# We would also create it using tmpfiles, but let's do this here too
09f814
# before NetworkManager gets a chance. (systemd-tmpfiles invocation
09f814
# above does not do this, because the line is marked with ! and
09f814
# tmpfiles is invoked without --boot in the scriptlet.)
ae4880
#
9e3166
# *Create* the symlink if nothing is present yet.
9e3166
# (https://bugzilla.redhat.com/show_bug.cgi?id=2032085)
9e3166
#
9e3166
# *Override* the symlink if systemd is running. Don't do it if systemd
9e3166
# is not running, because that will immediately break DNS resolution,
9e3166
# since systemd-resolved is also not running
9e3166
# (https://bugzilla.redhat.com/show_bug.cgi?id=1891847).
ae4880
#
ae4880
# Also don't create the symlink to the stub when the stub is disabled (#1891847 again).
9e3166
if systemctl -q is-enabled systemd-resolved.service &>/dev/null &&
9e3166
   ! systemd-analyze cat-config systemd/resolved.conf 2>/dev/null |
9e3166
        grep -iqE '^DNSStubListener\s*=\s*(no?|false|0|off)\s*$'; then
9e3166
9e3166
  if ! test -e /etc/resolv.conf && ! test -L /etc/resolv.conf; then
9e3166
    ln -sv ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf || :
9e3166
  elif test -d /run/systemd/system/ &&
9e3166
     ! mountpoint /etc/resolv.conf &>/dev/null; then
9e3166
    ln -fsv ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf || :
9e3166
  fi
ae4880
fi
d0811f
d0811f
%global _docdir_fmt %{name}
d0811f
d2f4df
%files -f %{name}.lang -f .file-list-main
d0811f
%doc %{_pkgdocdir}
9e3166
%exclude %{_pkgdocdir}/LICENSE*
9e3166
# Only the licenses texts for the licenses in License line are included.
f2f90a
%license LICENSE.GPL2
9e3166
%license LICENSES/MIT.txt
d0811f
%ghost %dir %attr(0755,-,-) /etc/systemd/system/basic.target.wants
d0811f
%ghost %dir %attr(0755,-,-) /etc/systemd/system/bluetooth.target.wants
d0811f
%ghost %dir %attr(0755,-,-) /etc/systemd/system/default.target.wants
d0811f
%ghost %dir %attr(0755,-,-) /etc/systemd/system/getty.target.wants
d0811f
%ghost %dir %attr(0755,-,-) /etc/systemd/system/graphical.target.wants
d0811f
%ghost %dir %attr(0755,-,-) /etc/systemd/system/local-fs.target.wants
d0811f
%ghost %dir %attr(0755,-,-) /etc/systemd/system/machines.target.wants
d0811f
%ghost %dir %attr(0755,-,-) /etc/systemd/system/multi-user.target.wants
d0811f
%ghost %dir %attr(0755,-,-) /etc/systemd/system/network-online.target.wants
d0811f
%ghost %dir %attr(0755,-,-) /etc/systemd/system/printer.target.wants
d0811f
%ghost %dir %attr(0755,-,-) /etc/systemd/system/remote-fs.target.wants
d0811f
%ghost %dir %attr(0755,-,-) /etc/systemd/system/sockets.target.wants
d0811f
%ghost %dir %attr(0755,-,-) /etc/systemd/system/sysinit.target.wants
d0811f
%ghost %dir %attr(0755,-,-) /etc/systemd/system/system-update.target.wants
d0811f
%ghost %dir %attr(0755,-,-) /etc/systemd/system/timers.target.wants
9e3166
%ghost %dir %attr(0700,-,-) /var/lib/portables
d0811f
%ghost %dir %attr(0755,-,-) /var/lib/rpm-state/systemd
d0811f
d0811f
%files libs -f .file-list-libs
d0811f
%license LICENSE.LGPL2.1
d0811f
d0811f
%files pam -f .file-list-pam
d0811f
d0811f
%files rpm-macros -f .file-list-rpm-macros
d0811f
ae4880
%files resolved -f .file-list-resolve
ae4880
d0811f
%files devel -f .file-list-devel
d0811f
d0811f
%files udev -f .file-list-udev
d0811f
8c1b90
%files ukify -f .file-list-ukify
a67221
%if 0%{?want_bootloader}
09f814
%files boot-unsigned -f .file-list-boot
09f814
%endif
09f814
d0811f
%files container -f .file-list-container
9e3166
%ghost %dir %attr(0700,-,-) /var/lib/machines
d0811f
d0811f
%files journal-remote -f .file-list-remote
d0811f
ae4880
%files networkd -f .file-list-networkd
ae4880
f2f90a
%files networkd-defaults -f .file-list-networkd-defaults
f2f90a
04a488
%files oomd-defaults -f .file-list-oomd-defaults
04a488
d0811f
%files tests -f .file-list-tests
d0811f
8c1b90
%files standalone-repart -f .file-list-standalone-repart
8c1b90
09f814
%files standalone-tmpfiles -f .file-list-standalone-tmpfiles
09f814
09f814
%files standalone-sysusers -f .file-list-standalone-sysusers
09f814
8c1b90
%files standalone-shutdown -f .file-list-standalone-shutdown
8c1b90
b81998
%clean
b81998
rm -rf $RPM_BUILD_ROOT
b81998
rm -f 10-timeout-abort.conf.user
b81998
rm -f .file-list-*
b81998
rm -f %{name}.lang
b81998
d0811f
%changelog
f2f90a
%autochangelog