From 767274370e81c510d2561decd45e63eae18d19d7 Mon Sep 17 00:00:00 2001 From: autodist Date: Sat, 30 Dec 2023 11:39:36 +0100 Subject: [PATCH] Release 247-3mamba --- systemd.spec | 37 +++++++----- triggers.systemd | 143 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 165 insertions(+), 15 deletions(-) create mode 100644 triggers.systemd diff --git a/systemd.spec b/systemd.spec index de4dbe8..0cea079 100644 --- a/systemd.spec +++ b/systemd.spec @@ -27,7 +27,7 @@ Name: systemd Epoch: 2 Version: 247 -Release: 2mamba +Release: 3mamba Summary: A system and service manager compatible with SysV and LSB init scripts Group: System/Configuration Vendor: openmamba @@ -40,6 +40,7 @@ Source1: udev-initscript Source2: udev-permissions.rules Source4: udev-openmamba.rules Source8: udev-check-cdrom.sh +Source10: triggers.systemd Source11: udev-MAKEDEV Source13: udev-blacklist Source14: udev-ifupdown.rules @@ -223,12 +224,11 @@ This package include development files for building software using udev librarie sed -i "s|@bindir@|/bin|g" src/core/macros.systemd.in %build -#:<< _EOF # LANG Workaround for meson error export LANG="en_US.UTF-8" export LC_ALL="en_US.UTF-8" -meson build \ +%meson \ --prefix=%{_prefix} \ --bindir=%{_bindir} \ --sbindir=%{_sbindir} \ @@ -259,22 +259,18 @@ meson build \ -Dntp-servers="0.europe.pool.ntp.org 1.europe.pool.ntp.org 2.europe.pool.ntp.org 3.europe.pool.ntp.org" \ -Ddefault-hierarchy=hybrid -# --build=release \ -# KMOD=/sbin/kmod -# --enable-compat-libs \ +%meson_build - -#sed -i "s|@rootlibdir@|/%{_lib}|" src/libudev/libudev.pc - -# TODO? -# --enable-terminal \ -# --enable-kdbus \ - -make +if ! diff -u %{SOURCE10} build/src/core/triggers.systemd; then + echo -e "\n\n\nWARNING: triggers.systemd in Source10 is different!" + echo -e " cp build/src/core/triggers.systemd %{SOURCE10}\n\n\n" + sleep 5 +fi %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" -%makeinstall rpmmacrosdir=%{_sysconfdir}/rpm +%meson_install +#rpmmacrosdir=%{_sysconfdir}/rpm install -D -m644 %{S:2} \ %{buildroot}/lib/udev/rules.d/60-permissions.rules @@ -319,6 +315,8 @@ install -d -m0755 %{buildroot}%{_prefix}/lib/repart.d %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%include %{SOURCE10} + %pre core [ -e %{_sysconfdir}/mtab -a ! -L %{_sysconfdir}/mtab ] && rm -f %{_sysconfdir}/mtab [ -L /var/lib/systemd/timesync ] && rm -f /var/lib/systemd/timesync @@ -453,6 +451,12 @@ if [ $1 -ge 1 ]; then fi : +%transfiletriggerin -- %{_unitdir} /etc/systemd/system +systemctl daemon-reload &>/dev/null || : + +%transfiletriggerun -- %{_unitdir} /etc/systemd/system +systemctl daemon-reload &>/dev/null || : + %files %defattr(-,root,root) %{_initrddir}/README @@ -694,6 +698,9 @@ fi %{_libdir}/pkgconfig/libudev.pc %changelog +* Sat Mar 06 2021 Silvan Calarco 247-3mamba +- include rpm triggers file + * Sat Dec 26 2020 Silvan Calarco 247-2mamba - added patch with upstream fixes diff --git a/triggers.systemd b/triggers.systemd new file mode 100644 index 0000000..d0dc5a2 --- /dev/null +++ b/triggers.systemd @@ -0,0 +1,143 @@ +# -*- Mode: rpm-spec; indent-tabs-mode: nil -*- */ +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# This file is part of systemd. +# Copyright © 2018 Neal Gompa + +# The contents of this are an example to be copied into systemd.spec. +# +# Minimum rpm version supported: 4.13.0 + +%transfiletriggerin -P 900900 -p -- /lib/systemd/system /etc/systemd/system +-- This script will run after any package is initially installed or +-- upgraded. We care about the case where a package is initially +-- installed, because other cases are covered by the *un scriptlets, +-- so sometimes we will reload needlessly. + +if posix.access("/run/systemd/system") then + pid = posix.fork() + if pid == 0 then + assert(posix.exec("%{_bindir}/systemctl", "daemon-reload")) + elseif pid > 0 then + posix.wait(pid) + end +end + +%transfiletriggerun -p -- /lib/systemd/system /etc/systemd/system +-- On removal, we need to run daemon-reload after any units have been +-- removed. %transfiletriggerpostun would be ideal, but it does not get +-- executed for some reason. +-- On upgrade, we need to run daemon-reload after any new unit files +-- have been installed, but before %postun scripts in packages get +-- executed. %transfiletriggerun gets the right list of files +-- but it is invoked too early (before changes happen). +-- %filetriggerpostun happens at the right time, but it fires for +-- every package. +-- To execute the reload at the right time, we create a state +-- file in %transfiletriggerun and execute the daemon-reload in +-- the first %filetriggerpostun. + +if posix.access("/run/systemd/system") then + posix.mkdir("%{_localstatedir}/lib") + posix.mkdir("%{_localstatedir}/lib/rpm-state") + posix.mkdir("%{_localstatedir}/lib/rpm-state/systemd") + io.open("%{_localstatedir}/lib/rpm-state/systemd/needs-reload", "w") +end + +%filetriggerpostun -P 1000100 -p -- /lib/systemd/system /etc/systemd/system +if posix.access("%{_localstatedir}/lib/rpm-state/systemd/needs-reload") then + posix.unlink("%{_localstatedir}/lib/rpm-state/systemd/needs-reload") + posix.rmdir("%{_localstatedir}/lib/rpm-state/systemd") + pid = posix.fork() + if pid == 0 then + assert(posix.exec("%{_bindir}/systemctl", "daemon-reload")) + elseif pid > 0 then + posix.wait(pid) + end +end + +%transfiletriggerin -P 100700 -p -- /usr/lib/sysusers.d +-- This script will process files installed in /usr/lib/sysusers.d to create +-- specified users automatically. The priority is set such that it +-- will run before the tmpfiles file trigger. +if posix.access("/run/systemd/system") then + pid = posix.fork() + if pid == 0 then + assert(posix.exec("%{_bindir}/systemd-sysusers")) + elseif pid > 0 then + posix.wait(pid) + end +end + +%transfiletriggerin -P 100500 -p -- /usr/lib/tmpfiles.d +-- This script will process files installed in /usr/lib/tmpfiles.d to create +-- tmpfiles automatically. The priority is set such that it will run +-- after the sysusers file trigger, but before any other triggers. +if posix.access("/run/systemd/system") then + pid = posix.fork() + if pid == 0 then + assert(posix.exec("%{_bindir}/systemd-tmpfiles", "--create")) + elseif pid > 0 then + posix.wait(pid) + end +end + +%transfiletriggerin -p -- /lib/udev/hwdb.d +-- This script will automatically invoke hwdb update if files have been +-- installed or updated in /lib/udev/hwdb.d. +if posix.access("/run/systemd/system") then + pid = posix.fork() + if pid == 0 then + assert(posix.exec("%{_bindir}/systemd-hwdb", "update")) + elseif pid > 0 then + posix.wait(pid) + end +end + +%transfiletriggerin -p -- /usr/lib/systemd/catalog +-- This script will automatically invoke journal catalog update if files +-- have been installed or updated in /usr/lib/systemd/catalog. +if posix.access("/run/systemd/system") then + pid = posix.fork() + if pid == 0 then + assert(posix.exec("%{_bindir}/journalctl", "--update-catalog")) + elseif pid > 0 then + posix.wait(pid) + end +end + +%transfiletriggerin -p -- /lib/udev/rules.d +-- This script will automatically update udev with new rules if files +-- have been installed or updated in /lib/udev/rules.d. +if posix.access("/run/systemd/system") then + pid = posix.fork() + if pid == 0 then + assert(posix.exec("%{_bindir}/udevadm", "control", "--reload")) + elseif pid > 0 then + posix.wait(pid) + end +end + +%transfiletriggerin -p -- /usr/lib/sysctl.d +-- This script will automatically apply sysctl rules if files have been +-- installed or updated in /usr/lib/sysctl.d. +if posix.access("/run/systemd/system") then + pid = posix.fork() + if pid == 0 then + assert(posix.exec("/lib/systemd/systemd-sysctl")) + elseif pid > 0 then + posix.wait(pid) + end +end + +%transfiletriggerin -p -- /usr/lib/binfmt.d +-- This script will automatically apply binfmt rules if files have been +-- installed or updated in /usr/lib/binfmt.d. +if posix.access("/run/systemd/system") then + pid = posix.fork() + if pid == 0 then + assert(posix.exec("/lib/systemd/systemd-binfmt")) + elseif pid > 0 then + posix.wait(pid) + end +end