]> git.pld-linux.org Git - packages/fail2ban.git/blob - fail2ban.spec
ed6d077b73785fc62c55ce728a9b46e3e8c23927
[packages/fail2ban.git] / fail2ban.spec
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 BuildRequires:  dos2unix
11 Requires:       python-log4py
12 BuildArch:      noarch
13 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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
31 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d/
32 PYTHONPATH=$RPM_BUILD_ROOT%{py_sitescriptdir}; export PYTHONPATH
33
34 python setup.py install \
35   --optimize=2 \
36         --root=$RPM_BUILD_ROOT
37
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
42
43 %clean
44 rm -rf $RPM_BUILD_ROOT
45
46 %post
47 /sbin/chkconfig --add %{name}
48 %service %{name} restart
49
50 %preun
51 if [ "$1" = "0" ]; then
52         %service -q %{name} stop
53         /sbin/chkconfig --del %{name}
54 fi
55
56 %files
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
62 %{py_sitescriptdir}/*
This page took 0.077879 seconds and 2 git commands to generate.