[PATCH] move systemd/sysv dependencies into more generic logic

Evan Kinney evan at evan.cat
Wed Mar 2 16:07:15 UTC 2016


# HG changeset patch
# User Evan Kinney <evan at evan.cat>
# Date 1456933417 18000
#      Wed Mar 02 10:43:37 2016 -0500
# Node ID 484ae92864c7881246fdcbd6c4a7197041050ac3
# Parent  748331201a69b0e7ac6938588b32da6f3e7be138
move systemd/sysv dependencies into more generic logic

Without this, RPMs fail to build on Fedora 18 and above.

diff -r 748331201a69 -r 484ae92864c7 rpm/SPECS/nginx.spec
--- a/rpm/SPECS/nginx.spec	Thu Feb 25 21:03:16 2016 +0300
+++ b/rpm/SPECS/nginx.spec	Wed Mar 02 10:43:37 2016 -0500
@@ -10,8 +10,6 @@
 %if 0%{?rhel}  == 5
 Group: System Environment/Daemons
 Requires(pre): shadow-utils
-Requires: initscripts >= 8.36
-Requires(post): chkconfig
 Requires: openssl
 BuildRequires: openssl-devel
 %endif
@@ -19,8 +17,6 @@
 %if 0%{?rhel}  == 6
 Group: System Environment/Daemons
 Requires(pre): shadow-utils
-Requires: initscripts >= 8.36
-Requires(post): chkconfig
 Requires: openssl >= 1.0.1
 BuildRequires: openssl-devel >= 1.0.1
 %define with_http2 1
@@ -29,9 +25,7 @@
 %if 0%{?rhel}  == 7
 Group: System Environment/Daemons
 Requires(pre): shadow-utils
-Requires: systemd
 Requires: openssl >= 1.0.1
-BuildRequires: systemd
 BuildRequires: openssl-devel >= 1.0.1
 %define epoch 1
 Epoch: %{epoch}
@@ -41,13 +35,19 @@
 %if 0%{?suse_version} == 1315
 Group: Productivity/Networking/Web/Servers
 BuildRequires: libopenssl-devel
-BuildRequires: systemd
 Requires(pre): shadow
-Requires: systemd
 %define with_http2 1
 %define nginx_loggroup trusted
 %endif
 
+%if %{use_systemd}
+BuildRequires: systemd
+Requires: systemd
+%else
+Requires: initscripts >= 8.36
+Requires(post): chkconfig
+%endif
+
 # end of distribution specific definitions
 
 %define WITH_CC_OPT $(echo %{optflags} $(pcre-config --cflags))
@@ -399,6 +399,9 @@
 fi
 
 %changelog
+* Wed Mar  2 2016 Evan Kinney <evan at evan.cat>
+- move systemd/sysv dependencies into more generic logic
+
 * Wed Feb 24 2016 Sergey Budnevitch <sb at nginx.com>
 - common configure args are now in macros
 - xslt, image-filter and geoip dynamic modules added



More information about the nginx-devel mailing list