From 1fcdb7f80277af859c01c07065f7efe410c9b3b8 Mon Sep 17 00:00:00 2001
From: Milind Changire <mchangir@redhat.com>
Date: Fri, 2 Dec 2016 10:42:32 +0530
Subject: [PATCH 213/227] build: add systemd dependency to the glusterfs
sub-package
Problem:
/bin/systemctl is not available at install time of primary glusterfs
package.
Solution:
Add %{?systemd_requires} to the glusterfs sub-package install time
requirements.
Replace all "Requires: systemd" and "Requires: systemd-units" with
%{?systemd_requires}. %systemd_requires is defined in
/usr/lib/rpm/macros.d/macros.systemd
systemd-units is provided by systemd.
Add BuildRequires: systemd for the definition of %systemd_requires
as well.
> BUG: 1399031
> Reviewed-on: http://review.gluster.org/15936
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
> Smoke: Gluster Build System <jenkins@build.gluster.org>
(cherry picked from commit 6138f4a2fc835bc94aa66543f5aee4f92081f1c7)
> BUG: 1400635
> Reviewed-on: http://review.gluster.org/15999
(cherry picked from commit 27c13f3c2b87f83bedd52be3ac16651e37310c9d)
Change-Id: I980ece7d538ea177ca6b0e70c1c169e6f04c46d4
BUG: 1377062
Signed-off-by: Milind Changire <mchangir@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/91958
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
---
glusterfs.spec.in | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index cc797b4..f2231b3 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -212,10 +212,13 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires: python-simplejson
%endif
%if ( 0%{?_with_systemd:1} )
-BuildRequires: systemd-units
+BuildRequires: systemd
%endif
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
+%if ( 0%{?_with_systemd:1} )
+%{?systemd_requires}
+%endif
BuildRequires: bison flex
BuildRequires: gcc make libtool
BuildRequires: ncurses-devel readline-devel
@@ -569,9 +572,7 @@ Requires: psmisc
Requires: lvm2
Requires: nfs-utils
%if ( 0%{?_with_systemd:1} )
-Requires(post): systemd-units, systemd
-Requires(preun): systemd-units
-Requires(postun): systemd-units
+%{?systemd_requires}
%else
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/service
@@ -630,7 +631,7 @@ Requires: python-gluster = %{version}-%{release}
Requires: python-argparse
%endif
%if ( 0%{?_with_systemd:1} )
-Requires(post): systemd
+%{?systemd_requires}
%endif
%description events
--
2.9.3