dryang / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
167d2b
#global commit c4b843473a75fb38ed5bf54e9d3cfb1cb3719efa
d0811f
%{?commit:%global shortcommit %(c=%{commit}; echo ${c:0:7})}
d0811f
7172f2
%if 0%{?facebook}
a3ef01
%global hs_commit b503711a2569ce76e6a735a5ea15669fc5e0a724
7172f2
%else
10eaf0
%global hs_commit ebdc7d8d718bc0aa48f18a2517ed209271a319b1
7172f2
%endif
7172f2
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
9e3166
# Bootstrap may be needed to break circular dependencies with cryptsetup,
9e3166
# e.g. when re-building cryptsetup on a json-c SONAME-bump.
d0811f
%bcond_with    bootstrap
d0811f
%bcond_without tests
caa2f9
%bcond_without lto
ae4880
ae4880
# Support for quick builds with rpmbuild --build-in-place.
ae4880
# See README.build-in-place.
ae4880
%bcond_with    inplace
ae4880
d0811f
Name:           systemd
7172f2
Url:            https://pagure.io/centos-sig-hyperscale/systemd
ae4880
%if %{without inplace}
09f814
Version:        252.4
a3ef01
Release:        598.10%{?dist}
ae4880
%else
ae4880
# determine the build information from local checkout
ae4880
Version:        %(tools/meson-vcs-tag.sh . error | sed -r 's/-([0-9])/.^\1/; s/-g/_g/')
9e3166
Release:        2
ae4880
%endif
9e3166
Richard Phibel 307406
%global stable %(c="%version"; [ "$c" = "${c#*.*}" ]; echo $?)
Richard Phibel 307406
d0811f
# For a breakdown of the licensing, see README
Richard Phibel 307406
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"
7172f2
Source0:        %{url}/archive/%{hs_commit}/%{name}-hs%{?facebook:+fb}-%{version}.tar.gz
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
d0811f
d0811f
# Prevent accidental removal of the systemd package
d0811f
Source4:        yum-protect-systemd.conf
d0811f
09f814
Source5:        inittab
09f814
Source6:        sysctl.conf.README
09f814
Source7:        systemd-journal-remote.xml
09f814
Source8:        systemd-journal-gatewayd.xml
d0811f
Source9:        20-yama-ptrace.conf
d0811f
Source10:       systemd-udev-trigger-no-reload.conf
ae4880
Source13:       libsystemd-shared.abignore
d0811f
04a488
Source14:       10-oomd-defaults.conf
09f814
Source15:       10-oomd-per-slice-defaults.conf
Richard Phibel 307406
Source16:       10-timeout-abort.conf
04a488
d0811f
Source21:       macros.sysusers
d0811f
Source22:       sysusers.attr
d0811f
Source23:       sysusers.prov
d0811f
Source24:       sysusers.generate-pre.sh
d0811f
Richard Phibel 307406
Source25:       98-default-mac-none.link
7172f2
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
Richard Phibel 307406
# https://github.com/systemd/systemd/issues/26488
Richard Phibel 307406
# https://bugzilla.redhat.com/show_bug.cgi?id=2164404
Richard Phibel 307406
Patch0001:      https://github.com/systemd/systemd/pull/26494.patch
Richard Phibel 307406
d0811f
d2f4df
# Those are downstream-only patches, but we don't want them in packit builds:
d2f4df
# https://bugzilla.redhat.com/show_bug.cgi?id=1738828
Richard Phibel 307406
Patch0490:      use-bfq-scheduler.patch
167d2b
09f814
# Adjust upstream config to use our shared stack
09f814
Patch0491:      fedora-use-system-auth-in-pam-systemd-user.patch
d0811f
d0811f
%ifarch %{ix86} x86_64 aarch64
d0811f
%global have_gnu_efi 1
d0811f
%endif
d0811f
d0811f
BuildRequires:  gcc
d0811f
BuildRequires:  gcc-c++
9e3166
BuildRequires:  clang
d0811f
BuildRequires:  coreutils
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
c3e528
BuildRequires:  /usr/sbin/sfdisk
d0811f
# /usr/bin/getfacl is needed by test-acl-util
c3e528
BuildRequires:  /usr/bin/getfacl
d0811f
BuildRequires:  libacl-devel
d0811f
BuildRequires:  gobject-introspection-devel
d0811f
BuildRequires:  libblkid-devel
d0811f
BuildRequires:  xz-devel
d0811f
BuildRequires:  xz
d0811f
BuildRequires:  lz4-devel
d0811f
BuildRequires:  lz4
d0811f
BuildRequires:  bzip2-devel
d0811f
BuildRequires:  libzstd-devel
d0811f
BuildRequires:  libidn2-devel
d0811f
BuildRequires:  libcurl-devel
d0811f
BuildRequires:  kmod-devel
d0811f
BuildRequires:  elfutils-devel
d0811f
BuildRequires:  openssl-devel
d0811f
BuildRequires:  gnutls-devel
09f814
BuildRequires:  qrencode-devel
d0811f
BuildRequires:  libmicrohttpd-devel
d0811f
BuildRequires:  libxkbcommon-devel
d0811f
BuildRequires:  iptables-devel
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
d0811f
BuildRequires:  libxslt
d0811f
BuildRequires:  docbook-style-xsl
d0811f
BuildRequires:  pkgconfig
d0811f
BuildRequires:  gperf
d0811f
BuildRequires:  gawk
d0811f
BuildRequires:  tree
d0811f
BuildRequires:  hostname
09f814
BuildRequires:  python3
Richard Phibel 307406
BuildRequires:  python3-devel
09f814
BuildRequires:  python3dist(jinja2)
Richard Phibel 307406
BuildRequires:  python3dist(lxml)
Richard Phibel 307406
BuildRequires:  python3dist(pefile)
Richard Phibel 307406
BuildRequires:  python3dist(pillow)
Richard Phibel 307406
BuildRequires:  python3dist(pytest)
Richard Phibel 307406
#BuildRequires:  python3dist(pytest-flakes)
Richard Phibel 307406
#BuildRequires:  python3dist(zstd)
Richard Phibel 307406
# gzip and lzma are provided by the stdlib
09f814
BuildRequires:  firewalld-filesystem
d0811f
BuildRequires:  libseccomp-devel
7172f2
%if 0%{?el8}
7172f2
BuildRequires:  meson >= 0.57
7172f2
%else
d0811f
BuildRequires:  meson >= 0.43
7172f2
%endif
d0811f
BuildRequires:  gettext
d0811f
# We use RUNNING_ON_VALGRIND in tests, so the headers need to be available
d0811f
BuildRequires:  valgrind-devel
d0811f
BuildRequires:  pkgconfig(bash-completion)
505ca8
BuildRequires:  perl
505ca8
BuildRequires:  perl(IPC::SysV)
d0811f
d2f4df
%ifnarch %ix86
d2f4df
# bpftool is not built for i368
d2f4df
BuildRequires:  bpftool
d2f4df
%global have_bpf 1
d2f4df
%endif
d2f4df
Richard Phibel 307406
%if 0%{?fedora}
Richard Phibel 307406
%ifarch x86_64 aarch64
Richard Phibel 307406
# That package is only built for those two architectures
Richard Phibel 307406
BuildRequires:  xen-devel
Richard Phibel 307406
%endif
Richard Phibel 307406
%endif
Richard Phibel 307406
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
d0811f
Requires:       %{name}-pam = %{version}-%{release}
Richard Phibel 025743
Requires:       (%{name}-rpm-macros = %{version}-%{release} if rpm-build)
d0811f
Requires:       %{name}-libs = %{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)
09f814
Recommends:     libxkbcommon%{_isa}
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
Richard Phibel 307406
Conflicts:      initscripts < 9.56.1
d0811f
%if 0%{?fedora}
d0811f
Conflicts:      fedora-release < 23-0.12
d0811f
%endif
d0811f
Obsoletes:      timedatex < 0.6-3
d0811f
Provides:       timedatex = 0.6-3
d2f4df
Conflicts:      %{name}-standalone-tmpfiles < %{version}-%{release}^
d2f4df
Provides:       %{name}-tmpfiles = %{version}-%{release}
d2f4df
Conflicts:      %{name}-standalone-sysusers < %{version}-%{release}^
d2f4df
Provides:       %{name}-sysusers = %{version}-%{release}
505ca8
505ca8
# Recommends to replace normal Requires deps for stuff that is dlopen()ed
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}
9e3166
Recommends:     libqrencode.so.4%{?elf_suffix}
9e3166
Recommends:     libbpf.so.0%{?elf_suffix}
9e3166
Recommends:     libbpf.so.0(LIBBPF_0.4.0)%{?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
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
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}
Richard Phibel 307406
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
Richard Phibel 307406
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
7172f2
# Make sure we obsolete the existing version and any possible future versions
7172f2
# of epel-rpm-macros-systemd in c8s and c9s.
7172f2
Conflicts:      epel-rpm-macros-systemd < 10-0
7172f2
Obsoletes:      epel-rpm-macros-systemd < 10-0
7172f2
Provides:       epel-rpm-macros-systemd = 10-0
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
Richard Phibel 307406
License:        LGPL-2.1-or-later AND MIT
09f814
Requires:       %{name}-libs%{_isa} = %{version}-%{release}
Richard Phibel 025743
Requires:       (%{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
Richard Phibel 307406
License:        LGPL-2.1-or-later
d0811f
09f814
Requires:       systemd%{_isa} = %{version}-%{release}
d0811f
Requires(post):   systemd
d0811f
Requires(preun):  systemd
d0811f
Requires(postun): systemd
d0811f
Requires(post): grep
d0811f
Requires:       kmod >= 18-4
7172f2
%if 0%{?facebook} == 0
d0811f
# https://bodhi.fedoraproject.org/updates/FEDORA-2020-dd43dd05b1
d0811f
Obsoletes:      systemd < 245.6-1
7172f2
%endif
d0811f
Provides:       udev = %{version}
d0811f
Provides:       udev%{_isa} = %{version}
d0811f
Obsoletes:      udev < 183
7172f2
Conflicts:      systemd-timesyncd < %{version}-%{release}
7172f2
Obsoletes:      systemd-timesyncd < %{version}-%{release}
7172f2
Provides:       systemd-timesyncd = %{version}-%{release}
505ca8
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
Richard Phibel 307406
# used by home, cryptsetup, cryptenroll, logind
Richard Phibel 307406
Recommends:     libfido2.so.1%{?elf_suffix}
Richard Phibel 307406
Recommends:     libp11-kit.so.0%{?elf_suffix}
Richard Phibel 307406
Recommends:     libtss2-esys.so.0%{?elf_suffix}
Richard Phibel 307406
Recommends:     libtss2-mu.so.0%{?elf_suffix}
Richard Phibel 307406
Recommends:     libtss2-rc.so.0%{?elf_suffix}
Richard Phibel 307406
Richard Phibel 307406
# Recommends to replace normal Requires deps for stuff that is dlopen()ed
Richard Phibel 307406
# used by dissect, integritysetup, veritysetyp, growfs, repart, cryptenroll, home
Richard Phibel 307406
Recommends:     libcryptsetup.so.12%{?elf_suffix}
Richard Phibel 307406
Recommends:     libcryptsetup.so.12(CRYPTSETUP_2.4)%{?elf_bits}
Richard Phibel 307406
Richard Phibel 307406
# used by systemd-coredump and systemd-analyze
Richard Phibel 307406
Recommends:     libdw.so.1%{?elf_suffix}
Richard Phibel 307406
Recommends:     libdw.so.1(ELFUTILS_0.186)%{?elf_bits}
Richard Phibel 307406
Recommends:     libelf.so.1%{?elf_suffix}
Richard Phibel 307406
Recommends:     libelf.so.1(ELFUTILS_1.7)%{?elf_bits}
Richard Phibel 307406
9e3166
# used by home, cryptsetup, cryptenroll
9e3166
Recommends:     libfido2.so.1%{?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
Richard Phibel 307406
# self-obsoletes to install both packages after split of systemd-boot
Richard Phibel 307406
Obsoletes:      systemd-udev < 252.2^
Richard Phibel 307406
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
09f814
%if 0%{?have_gnu_efi}
Richard Phibel 307406
%package ukify
Richard Phibel 307406
Summary:        Tool to build Unified Kernel Images
Richard Phibel 307406
Requires:       %{name} = %{version}-%{release}
Richard Phibel 307406
Richard Phibel 307406
# We prefer llvm-objcopy over objcopy.
Richard Phibel 307406
Requires:       (llvm or binutils)
Richard Phibel 307406
Recommends:     llvm
Richard Phibel 307406
Richard Phibel 307406
Requires:       python3dist(pefile)
Richard Phibel 307406
Requires:       python3dist(zstd)
Richard Phibel 307406
Recommends:     python3dist(pillow)
Richard Phibel 307406
Richard Phibel 307406
BuildArch:      noarch
Richard Phibel 307406
Richard Phibel 307406
%description ukify
Richard Phibel 307406
This package provides ukify, a script that combines a kernel image, an initrd,
Richard Phibel 307406
with a command line, and possibly PCR measurements and other metadata, into a
Richard Phibel 307406
Unified Kernel Image (UKI).
Richard Phibel 307406
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
Richard Phibel 307406
# A provides with just the version, no release or dist, used to build systemd-boot
Richard Phibel 307406
Provides: version(systemd-boot-unsigned) = %version
Richard Phibel 307406
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}
d0811f
Requires(post):   systemd
d0811f
Requires(preun):  systemd
d0811f
Requires(postun): systemd
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
Richard Phibel 307406
License:        LGPL-2.1-or-later
d0811f
d0811f
%description container
d0811f
Systemd tools to spawn and manage containers and virtual machines.
d0811f
9e3166
This package contains systemd-nspawn, machinectl, systemd-machined, and
9e3166
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}
Richard Phibel 307406
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}
Richard Phibel 307406
License:        LGPL-2.1-or-later
7172f2
%if 0%{?facebook} == 0
d2f4df
# https://src.fedoraproject.org/rpms/systemd/pull-request/34
d2f4df
Obsoletes:      systemd < 246.6-2
7172f2
%endif
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
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
ae4880
Requires:       %{name} = %{version}-%{release}
Richard Phibel 307406
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}
Richard Phibel 307406
License:       LGPL-2.1-or-later
d0811f
d0811f
%description tests
9e3166
"Installed tests" that are usually run as part of the build system. They can be
9e3166
useful to test systemd internals.
d0811f
Richard Phibel 307406
%package standalone-repart
Richard Phibel 307406
Summary:       Standalone systemd-repart binary for use on systems without systemd
Richard Phibel 307406
Provides:      %{name}-tmpfiles = %{version}-%{release}
Richard Phibel 307406
RemovePathPostfixes: .standalone
Richard Phibel 307406
Richard Phibel 307406
%description standalone-repart
Richard Phibel 307406
Standalone systemd-repart binary with no dependencies on the systemd-shared library or
Richard Phibel 307406
other libraries from systemd-libs. This package conflicts with the main systemd
Richard Phibel 307406
package and is meant for use on systems without systemd.
Richard Phibel 307406
d2f4df
%package standalone-tmpfiles
Richard Phibel 307406
Summary:       Standalone systemd-tmpfiles binary for use on systems without systemd
d2f4df
Provides:      %{name}-tmpfiles = %{version}-%{release}
d2f4df
RemovePathPostfixes: .standalone
36c356
d2f4df
%description standalone-tmpfiles
Richard Phibel 307406
Standalone systemd-tmpfiles binary with no dependencies on the systemd-shared library or
d2f4df
other libraries from systemd-libs. This package conflicts with the main systemd
Richard Phibel 307406
package and is meant for use on systems without systemd.
d0811f
d2f4df
%package standalone-sysusers
Richard Phibel 307406
Summary:       Standalone systemd-sysusers binary for use on systems without systemd
d2f4df
Provides:      %{name}-sysusers = %{version}-%{release}
d2f4df
RemovePathPostfixes: .standalone
d2f4df
d2f4df
%description standalone-sysusers
Richard Phibel 307406
Standalone systemd-sysusers binary with no dependencies on the systemd-shared library or
d2f4df
other libraries from systemd-libs. This package conflicts with the main systemd
Richard Phibel 307406
package and is meant for use on systems without systemd.
d2f4df
Richard Phibel 307406
%package standalone-shutdown
Richard Phibel 307406
Summary:       Standalone systemd-shutdown binary for use on systems without systemd
Richard Phibel 307406
Provides:      %{name}-sysusers = %{version}-%{release}
Richard Phibel 307406
RemovePathPostfixes: .standalone
Richard Phibel 307406
Richard Phibel 307406
%description standalone-shutdown
Richard Phibel 307406
Standalone systemd-shutdown binary with no dependencies on the systemd-shared library or
Richard Phibel 307406
other libraries from systemd-libs. This package conflicts with the main systemd
Richard Phibel 307406
package and is meant for use in exitrds.
7172f2
d2f4df
%prep
7172f2
# pagure strips the '+' from 'hs+fb' for the top directory in the tar archive so
7172f2
# the top directory is hsfb-250.3 instead of hs+fb-250.3.
7172f2
%autosetup -n %{name}-hs%{?facebook:fb}-%{version} -p1
7172f2
7172f2
%if %{with selinux}
7172f2
mkdir selinux
10eaf0
cp %SOURCE100 %SOURCE101 %SOURCE102 %SOURCE103 selinux
7172f2
%endif
36c356
Richard Phibel 307406
# We want to update sd-boot from packaging scriptlets after package update.
Richard Phibel 307406
# Let's disable the service.
Richard Phibel 307406
sed -r -i '/^enable systemd-boot-update.service/d' presets/90-systemd.preset
Richard Phibel 307406
Richard Phibel 307406
sed -r 's|/system/|/user/|g' %{SOURCE16} >10-timeout-abort.conf.user
Richard Phibel 307406
Richard Phibel 307406
%generate_buildrequires
Richard Phibel 307406
%if 0%{?have_gnu_efi}
Richard Phibel 307406
if grep -q gnu-efi meson_options.txt; then
Richard Phibel 307406
  echo 'gnu-efi'
Richard Phibel 307406
  echo 'gnu-efi-devel'
Richard Phibel 307406
else
Richard Phibel 307406
  echo 'python3dist(pyelftools)'
Richard Phibel 307406
fi
Richard Phibel 307406
%endif
Richard Phibel 307406
d0811f
%build
9e3166
%global ntpvendor %(source /etc/os-release; echo ${ID})
d0811f
%{!?ntpvendor: echo 'NTP vendor zone is not set!'; exit 1}
d0811f
d0811f
CONFIGURE_OPTS=(
505ca8
        -Dmode=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
d0811f
        -Dkmod=true
d0811f
        -Dxkbcommon=true
d0811f
        -Dblkid=true
b93eb7
        -Dfdisk=true
d0811f
        -Dseccomp=true
d0811f
        -Dima=true
d0811f
        -Dselinux=true
Richard Phibel 307406
        -Dbpf-framework=%[0%{?have_bpf}?"true":"false"]
d0811f
        -Dapparmor=false
d0811f
        -Dpolkit=true
d0811f
        -Dxz=true
d0811f
        -Dzlib=true
d0811f
        -Dbzip2=true
d0811f
        -Dlz4=true
d0811f
        -Dzstd=true
d0811f
        -Dpam=true
d0811f
        -Dacl=true
d0811f
        -Dsmack=true
505ca8
        -Dopenssl=true
9e3166
        -Dcryptolib=openssl
9e3166
        -Dp11kit=true
d2f4df
        -Dgcrypt=false
d0811f
        -Daudit=true
d0811f
        -Delfutils=true
Richard Phibel 307406
        -Dlibcryptsetup=%[%{with bootstrap}?"false":"true"]
d0811f
        -Delfutils=true
9e3166
        -Dpwquality=true
09f814
        -Dqrencode=true
d0811f
        -Dgnutls=true
d0811f
        -Dmicrohttpd=true
d0811f
        -Dlibidn2=true
3a8f06
        -Dlibiptc=false
d0811f
        -Dlibcurl=true
09f814
        -Dlibfido2=true
d0811f
        -Defi=true
d0811f
        -Dtpm=true
167d2b
        -Dtpm2=true
d0811f
        -Dhwdb=true
d0811f
        -Dsysusers=true
09f814
        -Dstandalone-binaries=true
d0811f
        -Ddefault-kill-user-processes=false
09f814
        -Dfirst-boot-full-preset=true
d0811f
        -Dtests=unsafe
d0811f
        -Dinstall-tests=true
d0811f
        -Dtty-gid=5
d0811f
        -Dusers-gid=100
d0811f
        -Dnobody-user=nobody
d0811f
        -Dnobody-group=nobody
505ca8
        -Dcompat-mutable-uid-boundaries=true
d0811f
        -Dsplit-usr=false
d0811f
        -Dsplit-bin=true
Richard Phibel 307406
        -Db_lto=%[%{with lto}?"true":"false"]
d0811f
        -Db_ndebug=false
d0811f
        -Dman=true
Richard Phibel 307406
        -Dversion-tag=%{version}-%{release}
d2f4df
        # https://bugzilla.redhat.com/show_bug.cgi?id=1906010
Richard Phibel 307406
        -Dshared-lib-tag=%{version_no_tilde}-%{release}
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
Richard Phibel 307406
        # https://fedoraproject.org/wiki/Changes/Shorter_Shutdown_Timer
Richard Phibel 307406
        -Ddefault-timeout-sec=45
Richard Phibel 307406
        -Ddefault-user-timeout-sec=45
167d2b
        -Doomd=true
ae4880
        -Dadm-gid=4
ae4880
        -Daudio-gid=63
ae4880
        -Dcdrom-gid=11
ae4880
        -Ddialout-gid=18
ae4880
        -Ddisk-gid=6
9e3166
        -Dinput-gid=104
ae4880
        -Dkmem-gid=9
ae4880
        -Dkvm-gid=36
ae4880
        -Dlp-gid=7
9e3166
        -Drender-gid=105
9e3166
        -Dsgx-gid=106
ae4880
        -Dtape-gid=33
ae4880
        -Dtty-gid=5
ae4880
        -Dusers-gid=100
ae4880
        -Dutmp-gid=22
ae4880
        -Dvideo-gid=39
ae4880
        -Dwheel-gid=10
ae4880
        -Dsystemd-journal-gid=190
ae4880
        -Dsystemd-network-uid=192
ae4880
        -Dsystemd-resolve-uid=193
ae4880
        # -Dsystemd-timesync-uid=, not set yet
7172f2
)
7172f2
Richard Phibel 307406
if grep gnu-efi meson_options.txt; then
Richard Phibel 307406
  CONFIGURE_OPTS+=( -Dgnu-efi=%[%{?have_gnu_efi}?"true":"false"] )
Richard Phibel 307406
else
Richard Phibel 307406
  # For now, let's build the bootloader in the same places where we
Richard Phibel 307406
  # built with gnu-efi. Later on, we might want to extend coverage, but
Richard Phibel 307406
  # considering that that support is untested, let's not do this now.
Richard Phibel 307406
  CONFIGURE_OPTS+=( -Dbootloader=%[%{?have_gnu_efi}?"true":"false"] )
Richard Phibel 307406
fi
Richard Phibel 307406
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::'
7172f2
        -Dsupport-url='https://www.facebook.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
ae4880
# Do configuration. If doing an inplace build, try to do
ae4880
# reconfiguration to pick up new options.
ae4880
%if %{with inplace}
ae4880
  command -v ccache 2>/dev/null && { CC="${CC:-ccache %__cc}"; CXX="${CXX:-ccache %__cxx}"; }
ae4880
ae4880
  [ -e %{_vpath_builddir}/build.ninja ] &&
ae4880
  %__meson configure %{_vpath_builddir} "${CONFIGURE_OPTS[@]}" ||
ae4880
%endif
ae4880
{ %meson "${CONFIGURE_OPTS[@]}"; }
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
d0811f
%install
d0811f
%meson_install
d0811f
d0811f
# udev links
d0811f
mkdir -p %{buildroot}/%{_sbindir}
d0811f
ln -sf ../bin/udevadm %{buildroot}%{_sbindir}/udevadm
d0811f
d0811f
# Compatiblity and documentation files
d0811f
touch %{buildroot}/etc/crypttab
d0811f
chmod 600 %{buildroot}/etc/crypttab
d0811f
09f814
# /etc/initab
09f814
install -Dm0644 -t %{buildroot}/etc/ %{SOURCE5}
09f814
d0811f
# /etc/sysctl.conf compat
09f814
install -Dm0644 %{SOURCE6} %{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
d0811f
# Install yum protection fragment
d0811f
install -Dm0644 %{SOURCE4} %{buildroot}/etc/dnf/protected.d/systemd.conf
d0811f
09f814
install -Dm0644 -t %{buildroot}/usr/lib/firewalld/services/ %{SOURCE7} %{SOURCE8}
09f814
d0811f
# Install additional docs
d0811f
# https://bugzilla.redhat.com/show_bug.cgi?id=1234951
d0811f
install -Dm0644 -t %{buildroot}%{_pkgdocdir}/ %{SOURCE9}
d0811f
d0811f
# https://bugzilla.redhat.com/show_bug.cgi?id=1378974
d0811f
install -Dm0644 -t %{buildroot}%{system_unit_dir}/systemd-udev-trigger.service.d/ %{SOURCE10}
d0811f
ae4880
install -Dm0644 -t %{buildroot}%{_prefix}/lib/systemd/ %{SOURCE13}
ae4880
d0811f
install -D -t %{buildroot}/usr/lib/systemd/ %{SOURCE3}
d0811f
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}
Richard Phibel 307406
# https://fedoraproject.org/wiki/Changes/Shorter_Shutdown_Timer
Richard Phibel 307406
install -Dm0644 -t %{buildroot}%{system_unit_dir}/service.d/ %{SOURCE16}
Richard Phibel 307406
install -Dm0644 10-timeout-abort.conf.user %{buildroot}%{user_unit_dir}/service.d/10-timeout-abort.conf
04a488
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}
d0811f
install -m 0644 -D -t %{buildroot}%{_rpmconfigdir}/fileattrs/ %{SOURCE22}
d0811f
install -m 0755 -D -t %{buildroot}%{_rpmconfigdir}/ %{SOURCE23}
d0811f
install -m 0755 -D -t %{buildroot}%{_rpmconfigdir}/ %{SOURCE24}
d0811f
Richard Phibel 307406
# https://bugzilla.redhat.com/show_bug.cgi?id=2107754
Richard Phibel 307406
install -Dm0644 -t %{buildroot}%{_prefix}/lib/systemd/network/ %{SOURCE25}
Richard Phibel 307406
d0811f
%find_lang %{name}
d0811f
d0811f
# Split files in build root into rpms. See split-files.py for the
d0811f
# rules towards the end, anything which is an exception needs a line
d0811f
# here.
7172f2
python3 %{SOURCE2} %buildroot "%{rhel}" <
d0811f
%ghost %config(noreplace) /etc/crypttab
09f814
%ghost %attr(0444,root,root) /etc/udev/hwdb.bin
d0811f
/etc/inittab
d0811f
/usr/lib/systemd/purge-nobody-user
d0811f
%ghost %config(noreplace) /etc/vconsole.conf
d0811f
%ghost %config(noreplace) /etc/X11/xorg.conf.d/00-keyboard.conf
9e3166
%ghost %attr(0664,root,root) %verify(not group) /run/utmp
9e3166
%ghost %attr(0664,root,root) %verify(not group) /var/log/wtmp
9e3166
%ghost %attr(0660,root,root) %verify(not group) /var/log/btmp
9e3166
%ghost %attr(0664,root,root) %verify(not md5 size mtime group) /var/log/lastlog
d0811f
%ghost %config(noreplace) /etc/hostname
d0811f
%ghost %config(noreplace) /etc/localtime
d0811f
%ghost %config(noreplace) /etc/locale.conf
167d2b
%ghost %attr(0444,root,root) %config(noreplace) /etc/machine-id
d0811f
%ghost %config(noreplace) /etc/machine-info
d0811f
%ghost %attr(0700,root,root) %dir /var/cache/private
d0811f
%ghost %attr(0700,root,root) %dir /var/lib/private
d0811f
%ghost %dir /var/lib/private/systemd
d0811f
%ghost %dir /var/lib/private/systemd/journal-upload
d0811f
%ghost /var/lib/private/systemd/journal-upload/state
d0811f
%ghost %dir /var/lib/systemd/timesync
d0811f
%ghost /var/lib/systemd/timesync/clock
d0811f
%ghost %dir /var/lib/systemd/backlight
d0811f
%ghost /var/lib/systemd/catalog/database
d0811f
%ghost %dir /var/lib/systemd/coredump
d0811f
%ghost /var/lib/systemd/journal-upload
d0811f
%ghost %dir /var/lib/systemd/linger
09f814
%ghost %attr(0600,root,root) /var/lib/systemd/random-seed
d0811f
%ghost %dir /var/lib/systemd/rfkill
9e3166
%ghost %dir %verify(not mode group) /var/log/journal
d0811f
%ghost %dir /var/log/journal/remote
d0811f
%ghost %attr(0700,root,root) %dir /var/log/private
d0811f
EOF
d0811f
7172f2
%if %{with selinux}
7172f2
install -d -p %{buildroot}%{_datadir}/selinux/devel/include/contrib
7172f2
install -p -m 0644 selinux/systemd_hs.if %{buildroot}%{_datadir}/selinux/devel/include/contrib
7172f2
install -d -p %{buildroot}%{_datadir}/selinux/packages
7172f2
install -p -m 0644 selinux/systemd_hs.pp.bz2 %{buildroot}%{_datadir}/selinux/packages
7172f2
%endif
7172f2
d0811f
%check
d0811f
%if %{with tests}
d0811f
meson test -C %{_vpath_builddir} -t 6 --print-errorlogs
d0811f
%endif
d0811f
d0811f
#############################################################################################
d0811f
d0811f
%include %{SOURCE1}
d0811f
d0811f
%post
d0811f
systemd-machine-id-setup &>/dev/null || :
d0811f
ae4880
# FIXME: move to %postun. We want to restart systemd *after* removing
ae4880
# files from the old rpm. Right now we may still have bits the old
ae4880
# setup if the files are not present in the new version. But before
ae4880
# implement restarting of *other* services after the transaction, moving
ae4880
# this would make things worse, increasing the number of warnings we get
ae4880
# about needed daemon-reload.
ae4880
ae4880
oomd_state=$(systemctl is-active systemd-oomd 2>/dev/null || :)
ae4880
d2f4df
# Work-around for #1931034. Remove after F34 is released.
d2f4df
if [ "$oomd_state" == "active" ]; then
d2f4df
   systemctl stop -q systemd-oomd 2>/dev/null || :
d2f4df
fi
d2f4df
d0811f
systemctl daemon-reexec &>/dev/null || {
d0811f
  # systemd v239 had bug #9553 in D-Bus authentication of the private socket,
d0811f
  # which was later fixed in v240 by #9625.
d0811f
  #
d0811f
  # The end result is that a `systemctl daemon-reexec` call as root will fail
d0811f
  # when upgrading from systemd v239, which means the system will not start
d0811f
  # running the new version of systemd after this post install script runs.
d0811f
  #
d0811f
  # To work around this issue, let's fall back to using a `kill -TERM 1` to
d0811f
  # re-execute the daemon when the `systemctl daemon-reexec` call fails.
d0811f
  #
d0811f
  # In order to prevent issues when the reason why the daemon-reexec failed is
d0811f
  # not the aforementioned bug, let's only use this fallback when:
d0811f
  #   - we're upgrading this RPM package; and
d0811f
  #   - we confirm that systemd is running as PID1 on this system.
d0811f
  if [ $1 -gt 1 ] && [ -d /run/systemd/system ] ; then
d0811f
    kill -TERM 1 &>/dev/null || :
d0811f
  fi
d0811f
}
d0811f
ae4880
if [ "$oomd_state" == "active" ]; then
ae4880
   systemctl start -q systemd-oomd 2>/dev/null || :
d0811f
fi
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
ae4880
%postun
ae4880
if [ $1 -eq 1 ]; then
ae4880
   [ -w %{_localstatedir} ] && journalctl --update-catalog || :
ae4880
   systemd-tmpfiles --create &>/dev/null || :
d0811f
fi
d0811f
ae4880
%systemd_postun_with_restart systemd-timedated.service systemd-portabled.service systemd-homed.service systemd-hostnamed.service systemd-journald.service systemd-localed.service systemd-userdbd.service systemd-oomd.service
ae4880
ae4880
# FIXME: systemd-logind.service is excluded (https://github.com/systemd/systemd/pull/17558)
ae4880
# FIXME: user@*.service needs to be restarted, but using systemctl --user daemon-reexec
ae4880
09f814
%triggerun resolved -- systemd < 246.1-1
09f814
# This is for upgrades from previous versions before systemd-resolved became the default.
09f814
systemctl --no-reload preset systemd-resolved.service &>/dev/null || :
09f814
09f814
if systemctl -q is-enabled systemd-resolved.service &>/dev/null; then
09f814
  systemctl -q is-enabled NetworkManager.service 2>/dev/null && \
09f814
  ! test -L /etc/resolv.conf 2>/dev/null && \
09f814
  ! mountpoint /etc/resolv.conf &>/dev/null && \
09f814
  grep -q 'Generated by NetworkManager' /etc/resolv.conf 2>/dev/null && \
09f814
  echo -e '/etc/resolv.conf was generated by NetworkManager.\nRemoving it to let systemd-resolved manage this file.' && \
09f814
  mv -v /etc/resolv.conf /etc/resolv.conf.orig-with-nm && \
09f814
  ln -sv ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf 2>/dev/null || :
09f814
09f814
  systemctl start systemd-resolved.service &>/dev/null || :
09f814
fi
09f814
Richard Phibel 307406
%triggerun -- systemd < 247.3-2
ae4880
# This is for upgrades from previous versions before oomd-defaults is available.
Richard Phibel 307406
systemctl --no-reload preset systemd-oomd.service &>/dev/null || :
Richard Phibel 307406
Richard Phibel 307406
%triggerpostun -- systemd < 253~rc1-2
Richard Phibel 307406
# This is for upgrades from previous versions where systemd-journald-audit.socket
Richard Phibel 307406
# had a static enablement symlink.
ae4880
# We use %%triggerpostun here because rpm doesn't allow a second %%triggerun with
ae4880
# a different package version.
Richard Phibel 307406
systemctl --no-reload preset systemd-journald-audit.socket &>/dev/null || :
Richard Phibel 307406
ae4880
9e3166
%global udev_services systemd-udev{d,-settle,-trigger}.service systemd-udevd-{control,kernel}.socket systemd-timesyncd.service %{?have_gnu_efi:systemd-boot-update.service}
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
d0811f
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
d0811f
%postun udev
167d2b
# Restart some services.
d0811f
# Others are either oneshot services, or sockets, and restarting them causes issues (#1378974)
167d2b
%systemd_postun_with_restart systemd-udevd.service systemd-timesyncd.service
d0811f
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
d0811f
%postun journal-remote
ae4880
%systemd_postun_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
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
ae4880
%post resolved
d2f4df
[ $1 -eq 1 ] || exit 0
d2f4df
# Initial installation
ae4880
09f814
touch %{_localstatedir}/lib/rpm-state/systemd-resolved.initial-installation
09f814
ae4880
# Related to https://bugzilla.redhat.com/show_bug.cgi?id=1943263
ae4880
if ls /usr/lib/systemd/libsystemd-shared-24[0-8].so &>/dev/null; then
ae4880
    echo "Skipping presets for systemd-resolved.service, seems we are upgrading from old systemd."
ae4880
    exit 0
ae4880
fi
ae4880
ae4880
%systemd_post systemd-resolved.service
ae4880
9e3166
%posttrans resolved
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.
d0811f
%license LICENSE.GPL2 LICENSE.LGPL2.1
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
09f814
%if 0%{?have_gnu_efi}
Richard Phibel 307406
%files ukify -f .file-list-ukify
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
04a488
%files oomd-defaults -f .file-list-oomd-defaults
04a488
d0811f
%files tests -f .file-list-tests
d0811f
Richard Phibel 307406
%files standalone-repart -f .file-list-standalone-repart
Richard Phibel 307406
09f814
%files standalone-tmpfiles -f .file-list-standalone-tmpfiles
09f814
09f814
%files standalone-sysusers -f .file-list-standalone-sysusers
09f814
Richard Phibel 307406
%files standalone-shutdown -f .file-list-standalone-shutdown
36c356
d0811f
%changelog
Richard Phibel 307406
%autochangelog