873e413323dfff4023604849c70944674ae5cd29Zbigniew Jędrzejewski-Szmek# -*- Mode: rpm-spec; indent-tabs-mode: nil -*- */
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering# This file is part of systemd.
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering# Copyright 2012 Lennart Poettering
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering# systemd is free software; you can redistribute it and/or modify it
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering# under the terms of the GNU Lesser General Public License as published by
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering# the Free Software Foundation; either version 2.1 of the License, or
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering# (at your option) any later version.
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering# systemd is distributed in the hope that it will be useful, but
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering# WITHOUT ANY WARRANTY; without even the implied warranty of
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering# Lesser General Public License for more details.
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering# You should have received a copy of the GNU Lesser General Public License
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering# along with systemd; If not, see <http://www.gnu.org/licenses/>.
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering# RPM macros for packages installing systemd unit files
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering%_unitdir @systemunitdir@
ed8086d119d8a996a0ad13d33eeb99b4d16d9492Lennart Poettering%_userunitdir @userunitdir@
a1d41e17a5c3861becd66f1c9dba7eb39ae4c478Lennart Poettering%_presetdir @systempresetdir@
1b0fcd7411da6ae2cdb9d72100333987ce1aef44Lennart Poettering%_udevhwdbdir @udevhwdbdir@
1b0fcd7411da6ae2cdb9d72100333987ce1aef44Lennart Poettering%_udevrulesdir @udevrulesdir@
1b0fcd7411da6ae2cdb9d72100333987ce1aef44Lennart Poettering%_journalcatalogdir @catalogdir@
1b0fcd7411da6ae2cdb9d72100333987ce1aef44Lennart Poettering%_tmpfilesdir @tmpfilesdir@
b532bdeae9b13fe93a54850f5e7f99c753bda6faLennart Poettering%_sysusersdir @sysusersdir@
1b0fcd7411da6ae2cdb9d72100333987ce1aef44Lennart Poettering%_sysctldir @sysctldir@
b532bdeae9b13fe93a54850f5e7f99c753bda6faLennart Poettering%_binfmtdir @binfmtdir@
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering%systemd_requires \
590f18a27c05524f5332819b9580afc327b95d84Lennart PoetteringRequires(post): systemd \
590f18a27c05524f5332819b9580afc327b95d84Lennart PoetteringRequires(preun): systemd \
590f18a27c05524f5332819b9580afc327b95d84Lennart PoetteringRequires(postun): systemd \
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering%systemd_post() \
590f18a27c05524f5332819b9580afc327b95d84Lennart Poetteringif [ $1 -eq 1 ] ; then \
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering # Initial installation \
873e413323dfff4023604849c70944674ae5cd29Zbigniew Jędrzejewski-Szmek systemctl --no-reload preset %{?*} >/dev/null 2>&1 || : \
e67ba783696f21782ad5c2ba00515d387016e785Tadej Janež%systemd_user_post() %{expand:%systemd_post \\--user \\--global %%{?*}}
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering%systemd_preun() \
590f18a27c05524f5332819b9580afc327b95d84Lennart Poetteringif [ $1 -eq 0 ] ; then \
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering # Package removal, not upgrade \
873e413323dfff4023604849c70944674ae5cd29Zbigniew Jędrzejewski-Szmek systemctl --no-reload disable --now %{?*} > /dev/null 2>&1 || : \
7c67f0f71a2a4e64264e925977645e306816a3abZbigniew Jędrzejewski-Szmek%systemd_user_preun() \
7c67f0f71a2a4e64264e925977645e306816a3abZbigniew Jędrzejewski-Szmekif [ $1 -eq 0 ] ; then \
7c67f0f71a2a4e64264e925977645e306816a3abZbigniew Jędrzejewski-Szmek # Package removal, not upgrade \
7c67f0f71a2a4e64264e925977645e306816a3abZbigniew Jędrzejewski-Szmek systemctl --no-reload --user --global disable %{?*} > /dev/null 2>&1 || : \
873e413323dfff4023604849c70944674ae5cd29Zbigniew Jędrzejewski-Szmek%systemd_postun() %{nil}
7c67f0f71a2a4e64264e925977645e306816a3abZbigniew Jędrzejewski-Szmek%systemd_user_postun() %{nil}
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering%systemd_postun_with_restart() \
590f18a27c05524f5332819b9580afc327b95d84Lennart Poetteringif [ $1 -ge 1 ] ; then \
590f18a27c05524f5332819b9580afc327b95d84Lennart Poettering # Package upgrade, not uninstall \
8cf7c96517c3688d29b30651adcda9e71e7fcb07Lennart Poettering systemctl try-restart %{?*} >/dev/null 2>&1 || : \
7c67f0f71a2a4e64264e925977645e306816a3abZbigniew Jędrzejewski-Szmek%systemd_user_postun_with_restart() %{nil}
1b0fcd7411da6ae2cdb9d72100333987ce1aef44Lennart Poettering%udev_hwdb_update() \
8cf7c96517c3688d29b30651adcda9e71e7fcb07Lennart Poetteringudevadm hwdb --update >/dev/null 2>&1 || : \
1b0fcd7411da6ae2cdb9d72100333987ce1aef44Lennart Poettering%udev_rules_update() \
8cf7c96517c3688d29b30651adcda9e71e7fcb07Lennart Poetteringudevadm control --reload >/dev/null 2>&1 || : \
1b0fcd7411da6ae2cdb9d72100333987ce1aef44Lennart Poettering%journal_catalog_update() \
8cf7c96517c3688d29b30651adcda9e71e7fcb07Lennart Poetteringjournalctl --update-catalog >/dev/null 2>&1 || : \
042e33ae3a7feb08c8105f1345fd244315109405Lennart Poettering%tmpfiles_create() \
8cf7c96517c3688d29b30651adcda9e71e7fcb07Lennart Poetteringsystemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \
b532bdeae9b13fe93a54850f5e7f99c753bda6faLennart Poettering%sysusers_create() \
b532bdeae9b13fe93a54850f5e7f99c753bda6faLennart Poetteringsystemd-sysusers %{?*} >/dev/null 2>&1 || : \
0e77023ea0ce315af6b0c4806b27c0140c91bbc7Lennart Poettering%sysusers_create_inline() \
0e77023ea0ce315af6b0c4806b27c0140c91bbc7Lennart Poetteringecho %{?*} | systemd-sysusers - >/dev/null 2>&1 || : \
b532bdeae9b13fe93a54850f5e7f99c753bda6faLennart Poettering%sysctl_apply() \
b532bdeae9b13fe93a54850f5e7f99c753bda6faLennart Poettering@rootlibexecdir@/systemd-sysctl %{?*} >/dev/null 2>&1 || : \
b532bdeae9b13fe93a54850f5e7f99c753bda6faLennart Poettering%binfmt_apply() \
b532bdeae9b13fe93a54850f5e7f99c753bda6faLennart Poettering@rootlibexecdir@/systemd-binfmt %{?*} >/dev/null 2>&1 || : \