|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
# -*- Mode: rpm-spec; indent-tabs-mode: nil -*- */
|
|
Zbigniew Jędrzejewski-Szmek |
98ea23 |
# SPDX-License-Identifier: LGPL-2.1+
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
#
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
# This file is part of systemd.
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
#
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
# Copyright 2015 Zbigniew Jędrzejewski-Szmek
|
|
Zbigniew Jędrzejewski-Szmek |
98ea23 |
# Copyright 2018 Neal Gompa
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
#
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
#
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
# Lesser General Public License for more details.
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
#
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
98ea23 |
#
|
|
Zbigniew Jędrzejewski-Szmek |
98ea23 |
# Minimum rpm version supported: 4.13.0
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Colin Walters |
8e6b39 |
%transfiletriggerin -P 900900 -- /usr/lib/systemd/system /etc/systemd/system
|
|
Colin Walters |
8e6b39 |
|
|
Colin Walters |
8e6b39 |
# upgraded. We care about the case where a package is initially
|
|
Colin Walters |
8e6b39 |
|
|
Colin Walters |
8e6b39 |
|
|
Colin Walters |
8e6b39 |
if test -d /run/systemd/system; then
|
|
Colin Walters |
8e6b39 |
%{_bindir}/systemctl daemon-reload
|
|
Colin Walters |
8e6b39 |
fi
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Colin Walters |
8e6b39 |
%transfiletriggerun -- /usr/lib/systemd/system /etc/systemd/system
|
|
Colin Walters |
8e6b39 |
# On removal, we need to run daemon-reload after any units have been
|
|
Colin Walters |
8e6b39 |
|
|
Colin Walters |
8e6b39 |
# executed for some reason.
|
|
Colin Walters |
8e6b39 |
# On upgrade, we need to run daemon-reload after any new unit files
|
|
Colin Walters |
8e6b39 |
# have been installed, but before %postun scripts in packages get
|
|
Colin Walters |
8e6b39 |
|
|
Colin Walters |
8e6b39 |
|
|
Colin Walters |
8e6b39 |
|
|
Colin Walters |
8e6b39 |
# every package.
|
|
Colin Walters |
8e6b39 |
|
|
Colin Walters |
8e6b39 |
# file in %transfiletriggerun and execute the daemon-reload in
|
|
Colin Walters |
8e6b39 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Colin Walters |
8e6b39 |
if test -d "/run/systemd/system"; then
|
|
Zbigniew Jędrzejewski-Szmek |
e8a954 |
mkdir -p "%{_localstatedir}/lib/rpm-state/systemd"
|
|
Zbigniew Jędrzejewski-Szmek |
e8a954 |
touch "%{_localstatedir}/lib/rpm-state/systemd/needs-reload"
|
|
Colin Walters |
8e6b39 |
fi
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Colin Walters |
8e6b39 |
%filetriggerpostun -P 1000100 -- /usr/lib/systemd/system /etc/systemd/system
|
|
Colin Walters |
8e6b39 |
if test -f "%{_localstatedir}/lib/rpm-state/systemd/needs-reload"; then
|
|
Colin Walters |
8e6b39 |
rm -rf "%{_localstatedir}/lib/rpm-state/systemd"
|
|
Colin Walters |
8e6b39 |
%{_bindir}/systemctl daemon-reload
|
|
Colin Walters |
8e6b39 |
fi
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Colin Walters |
8e6b39 |
%transfiletriggerin -P 100700 -- /usr/lib/sysusers.d
|
|
Colin Walters |
8e6b39 |
# This script will process files installed in /usr/lib/sysusers.d to create
|
|
Colin Walters |
8e6b39 |
# specified users automatically. The priority is set such that it
|
|
Colin Walters |
8e6b39 |
|
|
Colin Walters |
8e6b39 |
if test -d /run/systemd/system; then
|
|
Zbigniew Jędrzejewski-Szmek |
89aa08 |
%{_bindir}/systemd-sysusers || :
|
|
Colin Walters |
8e6b39 |
fi
|
|
Zbigniew Jędrzejewski-Szmek |
98ea23 |
|
|
Colin Walters |
8e6b39 |
%transfiletriggerin -P 100500 -- /usr/lib/tmpfiles.d
|
|
Colin Walters |
8e6b39 |
# This script will process files installed in /usr/lib/tmpfiles.d to create
|
|
Colin Walters |
8e6b39 |
|
|
Colin Walters |
8e6b39 |
|
|
Colin Walters |
8e6b39 |
if test -d /run/systemd/system; then
|
|
Zbigniew Jędrzejewski-Szmek |
89aa08 |
%{_bindir}/systemd-tmpfiles --create || :
|
|
Colin Walters |
8e6b39 |
fi
|
|
Zbigniew Jędrzejewski-Szmek |
98ea23 |
|
|
Zbigniew Jędrzejewski-Szmek |
3c9433 |
%transfiletriggerin udev -- /usr/lib/udev/hwdb.d
|
|
Colin Walters |
8e6b39 |
# This script will automatically invoke hwdb update if files have been
|
|
Colin Walters |
8e6b39 |
# installed or updated in /usr/lib/udev/hwdb.d.
|
|
Colin Walters |
8e6b39 |
if test -d /run/systemd/system; then
|
|
Zbigniew Jędrzejewski-Szmek |
89aa08 |
%{_bindir}/systemd-hwdb update || :
|
|
Colin Walters |
8e6b39 |
fi
|
|
Zbigniew Jędrzejewski-Szmek |
98ea23 |
|
|
Colin Walters |
8e6b39 |
%transfiletriggerin -- /usr/lib/systemd/catalog
|
|
Colin Walters |
8e6b39 |
# This script will automatically invoke journal catalog update if files
|
|
Colin Walters |
8e6b39 |
# have been installed or updated in /usr/lib/systemd/catalog.
|
|
Colin Walters |
8e6b39 |
if test -d /run/systemd/system; then
|
|
Zbigniew Jędrzejewski-Szmek |
89aa08 |
%{_bindir}/journalctl --update-catalog || :
|
|
Colin Walters |
8e6b39 |
fi
|
|
Zbigniew Jędrzejewski-Szmek |
98ea23 |
|
|
Zbigniew Jędrzejewski-Szmek |
3c9433 |
%transfiletriggerin udev -- /usr/lib/udev/rules.d
|
|
Colin Walters |
8e6b39 |
# This script will automatically update udev with new rules if files
|
|
Colin Walters |
8e6b39 |
# have been installed or updated in /usr/lib/udev/rules.d.
|
|
Zbigniew Jędrzejewski-Szmek |
89aa08 |
if test -e /run/udev/control; then
|
|
Zbigniew Jędrzejewski-Szmek |
89aa08 |
%{_bindir}/udevadm control --reload || :
|
|
Colin Walters |
8e6b39 |
fi
|
|
Zbigniew Jędrzejewski-Szmek |
98ea23 |
|
|
Colin Walters |
8e6b39 |
%transfiletriggerin -- /usr/lib/sysctl.d
|
|
Colin Walters |
8e6b39 |
# This script will automatically apply sysctl rules if files have been
|
|
Colin Walters |
8e6b39 |
# installed or updated in /usr/lib/sysctl.d.
|
|
Colin Walters |
8e6b39 |
if test -d /run/systemd/system; then
|
|
Zbigniew Jędrzejewski-Szmek |
89aa08 |
/usr/lib/systemd/systemd-sysctl || :
|
|
Colin Walters |
8e6b39 |
fi
|
|
Zbigniew Jędrzejewski-Szmek |
98ea23 |
|
|
Colin Walters |
8e6b39 |
%transfiletriggerin -- /usr/lib/binfmt.d
|
|
Colin Walters |
8e6b39 |
# This script will automatically apply binfmt rules if files have been
|
|
Colin Walters |
8e6b39 |
# installed or updated in /usr/lib/binfmt.d.
|
|
Colin Walters |
8e6b39 |
if test -d /run/systemd/system; then
|
|
Zbigniew Jędrzejewski-Szmek |
e7883a |
# systemd-binfmt might fail if binfmt_misc kernel module is not loaded
|
|
Zbigniew Jędrzejewski-Szmek |
e7883a |
# during install
|
|
Zbigniew Jędrzejewski-Szmek |
e7883a |
/usr/lib/systemd/systemd-binfmt || :
|
|
Colin Walters |
8e6b39 |
fi
|