From ac04ee13497368fd2d2ab575a33e37414226d70a Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Mon, 21 Jul 2014 16:20:39 -0600 Subject: [PATCH] Use systemd for EL7 --- fail2ban.spec | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/fail2ban.spec b/fail2ban.spec index fa25872..37b3d73 100644 --- a/fail2ban.spec +++ b/fail2ban.spec @@ -1,7 +1,7 @@ Summary: Daemon to ban hosts that cause multiple authentication errors Name: fail2ban Version: 0.9 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2+ URL: http://fail2ban.sourceforge.net/ Source0: https://github.com/%{name}/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz @@ -19,7 +19,7 @@ BuildRequires: python2-devel # For testcases BuildRequires: python-inotify BuildArch: noarch -%if 0%{?fedora} >= 19 +%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 BuildRequires: systemd %endif # Default components @@ -46,7 +46,7 @@ configurations. %package server Summary: Core server component for Fail2Ban -%if 0%{?fedora} >= 19 +%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 Requires: systemd-python Requires(post): systemd Requires(preun): systemd @@ -158,7 +158,7 @@ python setup.py build %install python setup.py install -O1 --root %{buildroot} -%if 0%{?fedora} >= 19 +%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 mkdir -p %{buildroot}%{_unitdir} cp -p files/fail2ban.service %{buildroot}%{_unitdir}/ %else @@ -202,14 +202,14 @@ rm -r %{buildroot}%{_docdir}/%{name} ./fail2ban-testcases-all --no-network %post server -%if 0%{?fedora} >= 19 +%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 %systemd_post fail2ban.service %else /sbin/chkconfig --add %{name} %endif %preun server -%if 0%{?fedora} >= 19 +%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 %systemd_preun fail2ban.service %else if [ $1 = 0 ]; then @@ -218,7 +218,7 @@ if [ $1 = 0 ]; then fi %endif -%if 0%{?fedora} >= 19 +%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 %postun server %systemd_postun_with_restart fail2ban.service %endif @@ -232,7 +232,7 @@ fi %{_bindir}/fail2ban-regex %{_bindir}/fail2ban-testcases %{python_sitelib}/* -%if 0%{?fedora} >= 19 +%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 %{_unitdir}/fail2ban.service %else %{_initddir}/fail2ban @@ -274,6 +274,9 @@ fi %changelog +* Mon Jul 21 2014 Orion Poplawski - 0.9-7 +- Use systemd for EL7 + * Sat Jun 07 2014 Fedora Release Engineering - 0.9-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild