2 # - resurrect ipv6 support
3 Summary: Ban IPs that make too many password failures
4 Summary(pl.UTF-8): Blokowanie IP powodujących zbyt dużo prób logowań z błędnym hasłem
10 Source0: https://github.com/fail2ban/fail2ban/archive/%{version}.tar.gz
11 # Source0-md5: 5e9deaea5237382940d5d58f22ca607a
13 Source2: %{name}.logrotate
14 Source3: paths-pld.conf
16 Patch1: logifiles.patch
17 URL: http://fail2ban.sourceforge.net/
18 BuildRequires: python-devel
19 BuildRequires: python-modules
20 BuildRequires: rpm-pythonprov
21 BuildRequires: rpmbuild(macros) >= 1.710
22 Requires(post,preun): /sbin/chkconfig
23 Requires(post,preun,postun): systemd-units >= 38
24 Requires: python-log4py
25 Requires: python-modules-sqlite
27 Requires: systemd-units >= 38
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 Fail2Ban scans log files like /var/log/secure and bans IP that makes
33 too many password failures. It updates firewall rules to reject the IP
34 address. These rules can be defined by the user. Fail2Ban can read
35 multiple log files including sshd or Apache web server logs.
37 %description -l pl.UTF-8
38 Fail2Ban skanuje pliki logów takie jak /var/log/secure i blokuje IP
39 powodujące zbyt dużo prób logowań z błędnym hasłem. Uaktualnia regułki
40 firewalla, aby odrzucić adres IP. Regułki te mogą być definiowane
41 przez użytkownika. Fail2Ban potrafi czytać wiele plików logów włącznie
42 z sshd czy plikami logów serwera WWW Apache.
54 rm -rf $RPM_BUILD_ROOT
55 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d} \
56 $RPM_BUILD_ROOT{%{_mandir}/man1,/var/{log,run/fail2ban}} \
57 $RPM_BUILD_ROOT{%{systemdunitdir},%{systemdtmpfilesdir}}
60 --install-lib=%{py_sitescriptdir} \
61 --root=$RPM_BUILD_ROOT
63 install -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
65 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/fail2ban
66 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/fail2ban
67 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/fail2ban/paths-pld.conf
69 install -p files/fail2ban-tmpfiles.conf $RPM_BUILD_ROOT%{systemdtmpfilesdir}/fail2ban.conf
70 install -p files/fail2ban.service $RPM_BUILD_ROOT%{systemdunitdir}/fail2ban.service
72 :> $RPM_BUILD_ROOT/var/log/fail2ban.log
77 rm -rf $RPM_BUILD_ROOT
80 /sbin/chkconfig --add %{name}
81 %service %{name} restart
82 %systemd_post fail2ban.service
85 if [ "$1" = "0" ]; then
86 %service -q %{name} stop
87 /sbin/chkconfig --del %{name}
89 %systemd_preun fail2ban.service
94 %triggerpostun -- fail2ban < 0.8.11-3
95 %systemd_trigger fail2ban.service
98 %defattr(644,root,root,755)
99 %doc CONTRIBUTING.md ChangeLog DEVELOP FILTERS README.md RELEASE THANKS TODO COPYING
100 %attr(754,root,root) /etc/rc.d/init.d/fail2ban
101 %attr(755,root,root) %{_bindir}/fail2ban-client
102 %attr(755,root,root) %{_bindir}/fail2ban-python
103 %attr(755,root,root) %{_bindir}/fail2ban-regex
104 %attr(755,root,root) %{_bindir}/fail2ban-server
105 %attr(755,root,root) %{_bindir}/fail2ban-testcases
106 %{systemdunitdir}/fail2ban.service
107 %{systemdtmpfilesdir}/fail2ban.conf
108 %dir /var/run/fail2ban
109 %dir %{_sysconfdir}/fail2ban
110 %dir %{_sysconfdir}/fail2ban/action.d
111 %attr(755,root,root) %{_sysconfdir}/fail2ban/action.d/badips.py
112 %attr(755,root,root) %{_sysconfdir}/fail2ban/action.d/smtp.py
113 %dir %{_sysconfdir}/fail2ban/fail2ban.d
114 %dir %{_sysconfdir}/fail2ban/filter.d
115 %dir %{_sysconfdir}/fail2ban/filter.d/ignorecommands
116 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/filter.d/ignorecommands/apache-fakegooglebot
117 %dir %{_sysconfdir}/fail2ban/jail.d
118 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/*.conf
119 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/*/*.conf
120 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/fail2ban
121 %{py_sitescriptdir}/%{name}
122 %{py_sitescriptdir}/%{name}-%{version}-py*.egg-info
123 %{_mandir}/man1/fail2ban-client.1*
124 %{_mandir}/man1/fail2ban-regex.1*
125 %{_mandir}/man1/fail2ban-server.1*
126 %{_mandir}/man1/fail2ban-testcases.1*
127 %{_mandir}/man1/fail2ban.1*
128 %attr(750,root,root) %dir /var/lib/%{name}
129 %attr(640,root,logs) %ghost /var/log/fail2ban.log