1 Summary: Ban IPs that make too many password failures
7 URL: http://fail2ban.sourceforge.net/
8 Source0: http://dl.sourceforge.net/fail2ban/%{name}-%{version}.tar.bz2
9 # Source0-md5: 129c4e76539a22ab60d025fbf137f962
10 BuildRequires: dos2unix
11 Requires: python-log4py
13 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
16 Fail2Ban scans log files like /var/log/secure and bans IP that makes
17 too many password failures. It updates firewall rules to reject the IP
18 address. These rules can be defined by the user. Fail2Ban can read
19 multiple log files including sshd or Apache web server logs.
26 %{__python} setup.py build
29 rm -rf $RPM_BUILD_ROOT
31 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d/
32 PYTHONPATH=$RPM_BUILD_ROOT%{py_sitescriptdir}; export PYTHONPATH
34 python setup.py install \
36 --root=$RPM_BUILD_ROOT
38 find $RPM_BUILD_ROOT%{py_sitescriptdir} -name \*.py -exec rm {} \;
39 dos2unix config/redhat-initd
40 install config/redhat-initd $RPM_BUILD_ROOT/etc/rc.d/init.d/fail2ban
41 install config/fail2ban.conf.default $RPM_BUILD_ROOT%{_sysconfdir}/fail2ban.conf
44 rm -rf $RPM_BUILD_ROOT
47 /sbin/chkconfig --add %{name}
48 %service %{name} restart
51 if [ "$1" = "0" ]; then
52 %service -q %{name} stop
53 /sbin/chkconfig --del %{name}
57 %defattr(644,root,root,755)
58 %doc CHANGELOG README TODO
59 %attr(754,root,root) /etc/rc.d/init.d/%{name}
60 %attr(755,root,root) %{_bindir}/%{name}
61 %config(noreplace) %{_sysconfdir}/%{name}.conf