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 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
11 BuildRequires: dos2unix
12 Requires: python-log4py
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
30 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d/
31 PYTHONPATH=$RPM_BUILD_ROOT%{py_sitescriptdir}; export PYTHONPATH
33 python setup.py install \
35 --root=$RPM_BUILD_ROOT
37 find $RPM_BUILD_ROOT%{py_sitescriptdir} -name \*.py -exec rm {} \;
38 dos2unix config/redhat-initd
39 install config/redhat-initd $RPM_BUILD_ROOT/etc/rc.d/init.d/fail2ban
40 install config/fail2ban.conf.default $RPM_BUILD_ROOT%{_sysconfdir}/fail2ban.conf
43 rm -rf $RPM_BUILD_ROOT
46 /sbin/chkconfig --add %{name}
47 %service %{name} restart
50 if [ "$1" = "0" ]; then
51 %service -q %{name} stop
52 /sbin/chkconfig --del %{name}
56 %doc CHANGELOG README TODO
57 %defattr(644,root,root,755)
58 %attr(755,root,root) /etc/rc.d/init.d/%{name}
59 %attr(755,root,root) %{_bindir}/%{name}
60 %config(noreplace) %{_sysconfdir}/%{name}.conf