]> git.pld-linux.org Git - packages/fail2ban.git/blob - fail2ban.spec
rel 3; insist on starting in case like: Fail2ban seems to be in unexpected state...
[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.10.1
5 Release:        1
6 License:        GPL
7 Group:          Daemons
8 Source0:        https://github.com/fail2ban/fail2ban/archive/%{version}.tar.gz
9 # Source0-md5:  bfcb1dec6d181d5996e00560bdcbfabf
10 Source1:        %{name}.init
11 Source2:        %{name}.logrotate
12 Source3:        paths-pld.conf
13 Source4:        %{name}.sysconfig
14 Patch0:         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.710
20 Requires(post,preun):   /sbin/chkconfig
21 Requires(post,preun,postun):    systemd-units >= 38
22 Requires:       python-log4py
23 Requires:       python-modules-sqlite
24 Requires:       rc-scripts
25 Requires:       systemd-units >= 38
26 BuildArch:      noarch
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %description
30 Fail2Ban scans log files like /var/log/secure and bans IP that makes
31 too many password failures. It updates firewall rules to reject the IP
32 address. These rules can be defined by the user. Fail2Ban can read
33 multiple log files including sshd or Apache web server logs.
34
35 %description -l pl.UTF-8
36 Fail2Ban skanuje pliki logów takie jak /var/log/secure i blokuje IP
37 powodujące zbyt dużo prób logowań z błędnym hasłem. Uaktualnia regułki
38 firewalla, aby odrzucić adres IP. Regułki te mogą być definiowane
39 przez użytkownika. Fail2Ban potrafi czytać wiele plików logów włącznie
40 z sshd czy plikami logów serwera WWW Apache.
41
42 %prep
43 %setup -q
44 %patch0 -p1
45 rm setup.cfg
46
47 %build
48 %py_build
49
50 %install
51 rm -rf $RPM_BUILD_ROOT
52 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
53         $RPM_BUILD_ROOT{%{_mandir}/man1,/var/{log,run/fail2ban}} \
54         $RPM_BUILD_ROOT{%{systemdunitdir},%{systemdtmpfilesdir}}
55
56 %py_install \
57         --install-lib=%{py_sitescriptdir} \
58         --root=$RPM_BUILD_ROOT
59
60 install -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
61
62 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/fail2ban
63 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/fail2ban
64 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/fail2ban/paths-pld.conf
65 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
66
67 install -p files/fail2ban-tmpfiles.conf $RPM_BUILD_ROOT%{systemdtmpfilesdir}/fail2ban.conf
68 install -p build-2/fail2ban.service $RPM_BUILD_ROOT%{systemdunitdir}/fail2ban.service
69
70 :> $RPM_BUILD_ROOT/var/log/fail2ban.log
71
72 %py_postclean
73
74 %clean
75 rm -rf $RPM_BUILD_ROOT
76
77 %post
78 /sbin/chkconfig --add %{name}
79 %service %{name} restart
80 %systemd_post fail2ban.service
81
82 %preun
83 if [ "$1" = "0" ]; then
84         %service -q %{name} stop
85         /sbin/chkconfig --del %{name}
86 fi
87 %systemd_preun fail2ban.service
88
89 %postun
90 %systemd_reload
91
92 %triggerpostun -- fail2ban < 0.8.11-3
93 %systemd_trigger fail2ban.service
94
95 %files
96 %defattr(644,root,root,755)
97 %doc CONTRIBUTING.md ChangeLog DEVELOP FILTERS README.md RELEASE THANKS TODO COPYING
98 %attr(754,root,root) /etc/rc.d/init.d/fail2ban
99 %attr(755,root,root) %{_bindir}/fail2ban-client
100 %attr(755,root,root) %{_bindir}/fail2ban-python
101 %attr(755,root,root) %{_bindir}/fail2ban-regex
102 %attr(755,root,root) %{_bindir}/fail2ban-server
103 %attr(755,root,root) %{_bindir}/fail2ban-testcases
104 %{systemdunitdir}/fail2ban.service
105 %{systemdtmpfilesdir}/fail2ban.conf
106 %dir /var/run/fail2ban
107 %dir %{_sysconfdir}/fail2ban
108 %dir %{_sysconfdir}/fail2ban/action.d
109 %attr(755,root,root) %{_sysconfdir}/fail2ban/action.d/badips.py
110 %attr(755,root,root) %{_sysconfdir}/fail2ban/action.d/smtp.py
111 %dir %{_sysconfdir}/fail2ban/fail2ban.d
112 %dir %{_sysconfdir}/fail2ban/filter.d
113 %dir %{_sysconfdir}/fail2ban/filter.d/ignorecommands
114 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/filter.d/ignorecommands/apache-fakegooglebot
115 %dir %{_sysconfdir}/fail2ban/jail.d
116 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/*.conf
117 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/*/*.conf
118 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/fail2ban
119 %attr(644,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
120 %{py_sitescriptdir}/%{name}
121 %{py_sitescriptdir}/%{name}-%{version}-py*.egg-info
122 %{_mandir}/man1/fail2ban-client.1*
123 %{_mandir}/man1/fail2ban-regex.1*
124 %{_mandir}/man1/fail2ban-server.1*
125 %{_mandir}/man1/fail2ban-testcases.1*
126 %{_mandir}/man1/fail2ban.1*
127 %attr(750,root,root) %dir /var/lib/%{name}
128 %attr(640,root,logs) %ghost /var/log/fail2ban.log
129
This page took 0.112113 seconds and 3 git commands to generate.