1 # -*- Mode: rpm-spec; indent-tabs-mode: nil -*- */
3 # This file is part of systemd.
5 # Copyright 2012 Lennart Poettering
7 # systemd is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU Lesser General Public License as published by
9 # the Free Software Foundation; either version 2.1 of the License, or
10 # (at your option) any later version.
12 # systemd is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public License
18 # along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 # RPM macros for packages installing systemd unit files
22 %_unitdir @systemunitdir@
23 %_userunitdir @userunitdir@
24 %_presetdir @systempresetdir@
25 %_userpresetdir @userpresetdir@
26 %_udevhwdbdir @udevhwdbdir@
27 %_udevrulesdir @udevrulesdir@
28 %_journalcatalogdir @catalogdir@
29 %_tmpfilesdir @tmpfilesdir@
30 %_sysusersdir @sysusersdir@
31 %_sysctldir @sysctldir@
32 %_binfmtdir @binfmtdir@
33 %_systemdgeneratordir @systemgeneratordir@
34 %_systemdusergeneratordir @usergeneratordir@
35 %_systemd_system_env_generator_dir @systemenvgeneratordir@
36 %_systemd_user_env_generator_dir @userenvgeneratordir@
39 Requires(post): systemd \
40 Requires(preun): systemd \
41 Requires(postun): systemd \
45 OrderWithRequires(post): systemd \
46 OrderWithRequires(preun): systemd \
47 OrderWithRequires(postun): systemd \
51 if [ $1 -eq 1 ] ; then \
52 # Initial installation \
53 systemctl --no-reload preset %{?*} >/dev/null 2>&1 || : \
57 %systemd_user_post() %{expand:%systemd_post \\--user \\--global %%{?*}}
60 if [ $1 -eq 0 ] ; then \
61 # Package removal, not upgrade \
62 systemctl --no-reload disable --now %{?*} > /dev/null 2>&1 || : \
66 %systemd_user_preun() \
67 if [ $1 -eq 0 ] ; then \
68 # Package removal, not upgrade \
69 systemctl --no-reload --user --global disable %{?*} > /dev/null 2>&1 || : \
73 %systemd_postun() %{nil}
75 %systemd_user_postun() %{nil}
77 %systemd_postun_with_restart() \
78 if [ $1 -ge 1 ] ; then \
79 # Package upgrade, not uninstall \
80 systemctl try-restart %{?*} >/dev/null 2>&1 || : \
84 %systemd_user_postun_with_restart() %{nil}
87 systemd-hwdb update >/dev/null 2>&1 || : \
90 %udev_rules_update() \
91 udevadm control --reload >/dev/null 2>&1 || : \
94 %journal_catalog_update() \
95 journalctl --update-catalog >/dev/null 2>&1 || : \
99 systemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \
103 systemd-sysusers %{?*} >/dev/null 2>&1 || : \
106 %sysusers_create_inline() \
107 echo %{?*} | systemd-sysusers - >/dev/null 2>&1 || : \
111 @rootlibexecdir@/systemd-sysctl %{?*} >/dev/null 2>&1 || : \
115 @rootlibexecdir@/systemd-binfmt %{?*} >/dev/null 2>&1 || : \