macros.systemd.in: add %systemd_ordering (#3776)
authorHarald Hoyer <harald@redhat.com>
Fri, 22 Jul 2016 13:33:13 +0000 (15:33 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 22 Jul 2016 13:33:13 +0000 (09:33 -0400)
To remove the hard dependency on systemd, for packages, which function
without a running systemd the %systemd_ordering macro can be used to
ensure ordering in the rpm transaction. %systemd_ordering makes sure,
the systemd rpm is installed prior to the package, so the %pre/%post
scripts can execute the systemd parts.

Installing systemd afterwards though, does not result in the same outcome.

src/core/macros.systemd.in

index 028db1c..6e8a3b3 100644 (file)
@@ -38,6 +38,12 @@ Requires(preun): systemd \
 Requires(postun): systemd \
 %{nil}
 
+%systemd_ordering \
+OrderWithRequires(post): systemd \
+OrderWithRequires(preun): systemd \
+OrderWithRequires(postun): systemd \
+%{nil}
+
 %systemd_post() \
 if [ $1 -eq 1 ] ; then \
         # Initial installation \