]> git.pld-linux.org Git - packages/fail2ban.git/blob - fail2ban.spec
- rel 4
[packages/fail2ban.git] / fail2ban.spec
1 Summary:        Ban IPs that make too many password failures
2 Summary(pl.UTF-8):      Blokowanie IP powodujących zbyt dużo prób logowań z błędnym hasłem
3 Name:           fail2ban
4 Version:        0.8.11
5 Release:        4
6 License:        GPL
7 Group:          Daemons
8 Source0:        http://download.sourceforge.net/fail2ban/%{name}-%{version}.tar.gz
9 # Source0-md5:  2182a21c7efd885f373ffc941d11914d
10 Source1:        %{name}.init
11 Source2:        %{name}.logrotate
12 Patch0:         ipv6.patch
13 Patch1:         private-scriptdir.patch
14 Patch2:         logifiles.patch
15 URL:            http://fail2ban.sourceforge.net/
16 BuildRequires:  python-devel
17 BuildRequires:  python-modules
18 BuildRequires:  rpm-pythonprov
19 BuildRequires:  rpmbuild(macros) >= 1.671
20 Requires(post,preun):   /sbin/chkconfig
21 Requires(post,preun,postun):    systemd-units >= 38
22 Requires:       python-log4py
23 Requires:       rc-scripts
24 Requires:       systemd-units >= 38
25 BuildArch:      noarch
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %description
29 Fail2Ban scans log files like /var/log/secure and bans IP that makes
30 too many password failures. It updates firewall rules to reject the IP
31 address. These rules can be defined by the user. Fail2Ban can read
32 multiple log files including sshd or Apache web server logs.
33
34 %description -l pl.UTF-8
35 Fail2Ban skanuje pliki logów takie jak /var/log/secure i blokuje IP
36 powodujące zbyt dużo prób logowań z błędnym hasłem. Uaktualnia regułki
37 firewalla, aby odrzucić adres IP. Regułki te mogą być definiowane
38 przez użytkownika. Fail2Ban potrafi czytać wiele plików logów włącznie
39 z sshd czy plikami logów serwera WWW Apache.
40
41 %prep
42 %setup -q
43 %patch0 -p1
44 %patch1 -p1
45 %patch2 -p1
46 rm setup.cfg
47
48 # we don't want very generic named dirs directly in py_sitescriptdir
49 sed -i -e 's|@@SCRIPTDIR@@|"%{py_sitescriptdir}/%{name}"|' fail2ban-{client,regex,server}
50
51 %build
52 %{__python} setup.py build
53
54 %install
55 rm -rf $RPM_BUILD_ROOT
56 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d} \
57         $RPM_BUILD_ROOT{%{_mandir}/man1,/var/log} \
58         $RPM_BUILD_ROOT{%{systemdunitdir},%{systemdtmpfilesdir}}
59
60 %{__python} setup.py install \
61         --optimize=2 \
62         --install-lib=%{py_sitescriptdir}/%{name} \
63         --root=$RPM_BUILD_ROOT
64
65 install -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
66
67 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/fail2ban
68 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/fail2ban
69
70 install -p files/fail2ban-tmpfiles.conf $RPM_BUILD_ROOT%{systemdtmpfilesdir}/fail2ban.conf
71 install -p files/fail2ban.service $RPM_BUILD_ROOT%{systemdunitdir}/fail2ban.service
72
73 :> $RPM_BUILD_ROOT/var/log/fail2ban.log
74
75 %py_postclean
76
77 %clean
78 rm -rf $RPM_BUILD_ROOT
79
80 %post
81 /sbin/chkconfig --add %{name}
82 %service %{name} restart
83 %systemd_post fail2ban.service
84
85 %preun
86 if [ "$1" = "0" ]; then
87         %service -q %{name} stop
88         /sbin/chkconfig --del %{name}
89 fi
90 %systemd_preun fail2ban.service
91
92 %postun
93 %systemd_reload
94
95 %triggerpostun -- fail2ban < 0.8.11-3
96 %systemd_trigger fail2ban.service
97
98 %files
99 %defattr(644,root,root,755)
100 %doc ChangeLog README.md TODO COPYING
101 %attr(754,root,root) /etc/rc.d/init.d/fail2ban
102 %attr(755,root,root) %{_bindir}/fail2ban-client
103 %attr(755,root,root) %{_bindir}/fail2ban-iptables
104 %attr(755,root,root) %{_bindir}/fail2ban-regex
105 %attr(755,root,root) %{_bindir}/fail2ban-server
106 %{systemdunitdir}/fail2ban.service
107 %{systemdtmpfilesdir}/fail2ban.conf
108 %dir /var/run/fail2ban
109 %dir %{_sysconfdir}/fail2ban
110 %dir %{_sysconfdir}/fail2ban/action.d
111 %dir %{_sysconfdir}/fail2ban/fail2ban.d
112 %dir %{_sysconfdir}/fail2ban/filter.d
113 %dir %{_sysconfdir}/fail2ban/jail.d
114 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/*.conf
115 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/*/*.conf
116 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/fail2ban
117 %{py_sitescriptdir}/%{name}
118 %{_mandir}/man1/fail2ban-client.1*
119 %{_mandir}/man1/fail2ban-regex.1*
120 %{_mandir}/man1/fail2ban-server.1*
121 %{_mandir}/man1/fail2ban.1*
122 %attr(640,root,logs) %ghost /var/log/fail2ban.log
This page took 0.038506 seconds and 3 git commands to generate.