Update to 0.9.3

- Cleanup spec, use new python macros
i9ce
Orion Poplawski 9 years ago
parent eb19baa3e3
commit 1896da9386

1
.gitignore vendored

@ -8,3 +8,4 @@ fail2ban-0.8.4.tar.bz2
/fail2ban-0.9.tar.gz /fail2ban-0.9.tar.gz
/fail2ban-0.9.1.tar.gz /fail2ban-0.9.1.tar.gz
/fail2ban-0.9.2.tar.gz /fail2ban-0.9.2.tar.gz
/fail2ban-0.9.3.tar.gz

@ -0,0 +1,50 @@
From 3187de29336b4a01e4dcd20f98253e1db913ee7a Mon Sep 17 00:00:00 2001
From: Yaroslav Halchenko <debian@onerussian.com>
Date: Sat, 12 Sep 2015 14:15:10 -0400
Subject: [PATCH] BF(TST): allow exception and False for executeCmd due to
inconsistent behavior across bash/dash
Temporary minimalistic fix to the test
---
fail2ban/tests/actiontestcase.py | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/fail2ban/tests/actiontestcase.py b/fail2ban/tests/actiontestcase.py
index febbc61..73dee12 100644
--- a/fail2ban/tests/actiontestcase.py
+++ b/fail2ban/tests/actiontestcase.py
@@ -222,17 +222,28 @@ def getnastypid():
return int(f.read())
# First test if can kill the bastard
- self.assertRaises(
- RuntimeError, CommandAction.executeCmd, 'bash %s' % tmpFilename, timeout=.1)
+ try:
+ self.assertFalse(
+ CommandAction.executeCmd('bash %s' % tmpFilename, timeout=.1))
+ except RuntimeError:
+ # this one is expected behavior, see
+ # https://github.com/fail2ban/fail2ban/issues/1155#issuecomment-139799958
+ pass
# Verify that the proccess itself got killed
self.assertFalse(pid_exists(getnastypid())) # process should have been killed
self.assertTrue(self._is_logged('timed out'))
- self.assertTrue(self._is_logged('killed with SIGTERM'))
+ self.assertTrue(self._is_logged('Terminated'))
# A bit evolved case even though, previous test already tests killing children processes
- self.assertRaises(
- RuntimeError, CommandAction.executeCmd, 'out=`bash %s`; echo ALRIGHT' % tmpFilename,
- timeout=.2)
+ try:
+ self.assertFalse(
+ CommandAction.executeCmd('out=`bash %s`; echo ALRIGHT' % tmpFilename,
+ timeout=.2))
+ except RuntimeError:
+ # this one is expected behavior, see
+ # https://github.com/fail2ban/fail2ban/issues/1155#issuecomment-139799958
+ pass
+
# Verify that the proccess itself got killed
self.assertFalse(pid_exists(getnastypid()))
self.assertTrue(self._is_logged('timed out'))

@ -1,23 +1,26 @@
Summary: Daemon to ban hosts that cause multiple authentication errors Summary: Daemon to ban hosts that cause multiple authentication errors
Name: fail2ban Name: fail2ban
Version: 0.9.2 Version: 0.9.3
Release: 2%{?dist} Release: 1%{?dist}
License: GPLv2+ License: GPLv2+
URL: http://fail2ban.sourceforge.net/ URL: http://fail2ban.sourceforge.net/
Source0: https://github.com/%{name}/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source0: https://github.com/%{name}/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
# Fix failing test
# https://github.com/fail2ban/fail2ban/issues/1155
Patch0: https://github.com/yarikoptic/fail2ban/commit/3187de29336b4a01e4dcd20f98253e1db913ee7a.patch
BuildRequires: python2-devel BuildRequires: python-devel
# For testcases # For testcases
BuildRequires: python-inotify BuildRequires: python-inotify
BuildArch: noarch BuildArch: noarch
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 %if 0%{?fedora} || 0%{?rhel} >= 7
BuildRequires: systemd BuildRequires: systemd
%endif %endif
# Default components # Default components
Requires: %{name}-firewalld = %{version}-%{release} Requires: %{name}-firewalld = %{version}-%{release}
Requires: %{name}-sendmail = %{version}-%{release} Requires: %{name}-sendmail = %{version}-%{release}
Requires: %{name}-server = %{version}-%{release} Requires: %{name}-server = %{version}-%{release}
# Currently this breaks jaila that don't log to the journal # Currently this breaks jails that don't log to the journal
#Requires: %{name}-systemd = %{version}-%{release} #Requires: %{name}-systemd = %{version}-%{release}
%description %description
@ -38,7 +41,7 @@ configurations.
%package server %package server
Summary: Core server component for Fail2Ban Summary: Core server component for Fail2Ban
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 %if 0%{?fedora} || 0%{?rhel} >= 7
Requires: systemd-python Requires: systemd-python
Requires(post): systemd Requires(post): systemd
Requires(preun): systemd Requires(preun): systemd
@ -137,22 +140,19 @@ by default.
%prep %prep
%setup -q %setup -q
%patch0 -p1 -b .test
# Use Fedora paths # Use Fedora paths
sed -i -e 's/^before = paths-.*/before = paths-fedora.conf/' config/jail.conf sed -i -e 's/^before = paths-.*/before = paths-fedora.conf/' config/jail.conf
# Start after firewalld (https://bugzilla.redhat.com/show_bug.cgi?id=1067147) # Start after firewalld (https://bugzilla.redhat.com/show_bug.cgi?id=1067147)
sed -i -e '/^After=/s/$/ firewalld.service/' files/fail2ban.service sed -i -e '/^After=/s/$/ firewalld.service/' files/fail2ban.service
%build %build
python setup.py build %py_build
%install %install
python setup.py install -O1 --root %{buildroot} %py_install
# Do not load user paths %if 0%{?fedora} || 0%{?rhel} >= 7
# https://bugzilla.redhat.com/show_bug.cgi?id=1202151
sed -i -e '1s/python$/python -Es/' %{buildroot}%{_bindir}/fail2ban-{client,server}
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
mkdir -p %{buildroot}%{_unitdir} mkdir -p %{buildroot}%{_unitdir}
cp -p files/fail2ban.service %{buildroot}%{_unitdir}/ cp -p files/fail2ban.service %{buildroot}%{_unitdir}/
%else %else
@ -198,14 +198,14 @@ export LANG=en_US.UTF-8
./fail2ban-testcases-all --no-network ./fail2ban-testcases-all --no-network
%post server %post server
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 %if 0%{?fedora} || 0%{?rhel} >= 7
%systemd_post fail2ban.service %systemd_post fail2ban.service
%else %else
/sbin/chkconfig --add %{name} /sbin/chkconfig --add %{name}
%endif %endif
%preun server %preun server
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 %if 0%{?fedora} || 0%{?rhel} >= 7
%systemd_preun fail2ban.service %systemd_preun fail2ban.service
%else %else
if [ $1 = 0 ]; then if [ $1 = 0 ]; then
@ -214,7 +214,7 @@ if [ $1 = 0 ]; then
fi fi
%endif %endif
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 %if 0%{?fedora} || 0%{?rhel} >= 7
%postun server %postun server
%systemd_postun_with_restart fail2ban.service %systemd_postun_with_restart fail2ban.service
%endif %endif
@ -228,7 +228,7 @@ fi
%{_bindir}/fail2ban-regex %{_bindir}/fail2ban-regex
%{_bindir}/fail2ban-testcases %{_bindir}/fail2ban-testcases
%{python_sitelib}/* %{python_sitelib}/*
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 %if 0%{?fedora} || 0%{?rhel} >= 7
%{_unitdir}/fail2ban.service %{_unitdir}/fail2ban.service
%else %else
%{_initddir}/fail2ban %{_initddir}/fail2ban
@ -270,6 +270,10 @@ fi
%changelog %changelog
* Sat Sep 12 2015 Orion Poplawski <orion@cora.nwra.com> - 0.9.3-1
- Update to 0.9.3
- Cleanup spec, use new python macros
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-2 * Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

@ -1 +1 @@
bcdc9ef9f02c6fe8e43bb391835c65d6 fail2ban-0.9.2.tar.gz 73c87c545cc6474de984b5a05e64ecab fail2ban-0.9.3.tar.gz

Loading…
Cancel
Save