Use systemd for EL7

i9ce
Orion Poplawski 11 years ago
parent 5e4615ac6d
commit ac04ee1349

@ -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 <orion@cora.nwra.com> - 0.9-7
- Use systemd for EL7
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

Loading…
Cancel
Save