]>
Commit | Line | Data |
---|---|---|
465f8f11 | 1 | Summary: Ban IPs that make too many password failures |
2 | Name: fail2ban | |
3 | Version: 0.6.0 | |
4 | Release: 1 | |
5 | License: GPL | |
6 | Group: Daemons | |
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 | |
13 | BuildArch: noarch | |
14 | ||
15 | %description | |
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. | |
20 | ||
21 | %prep | |
22 | %setup -q | |
23 | ||
24 | %build | |
25 | rm setup.cfg | |
26 | %{__python} setup.py build | |
27 | ||
28 | %install | |
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 | |
32 | ||
33 | python setup.py install \ | |
34 | --optimize=2 \ | |
35 | --root=$RPM_BUILD_ROOT | |
36 | ||
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 | |
41 | ||
42 | %clean | |
43 | rm -rf $RPM_BUILD_ROOT | |
44 | ||
45 | %post | |
46 | /sbin/chkconfig --add %{name} | |
47 | %service %{name} restart | |
48 | ||
49 | %preun | |
50 | if [ "$1" = "0" ]; then | |
51 | %service -q %{name} stop | |
52 | /sbin/chkconfig --del %{name} | |
53 | fi | |
54 | ||
55 | %files | |
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 | |
61 | %{py_sitescriptdir}/* |