]> git.pld-linux.org Git - packages/fail2ban.git/blob - fail2ban.spec
7c88e49bea1d653c033ea92d6739528aca78b9c8
[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.11.1
5 Release:        1
6 License:        GPL
7 Group:          Daemons
8 Source0:        https://github.com/fail2ban/fail2ban/archive/%{version}.tar.gz
9 # Source0-md5:  0be308ad62826030ba342b6b6012d523
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-dns
23 Requires:       python-log4py
24 Requires:       python-modules-sqlite
25 Requires:       python-pyinotify >= 0.8.3
26 Requires:       rc-scripts
27 Requires:       systemd-units >= 38
28 BuildArch:      noarch
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %description
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.
36
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.
43
44 %prep
45 %setup -q
46 %patch0 -p1
47 rm setup.cfg
48
49 sed -E -i -e '1s,#!\s*/usr/bin/env\s+python2(\s|$),#!%{__python}\1,' -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python}\1,' -e '1s,#!\s*/usr/bin/python(\s|$),#!%{__python}\1,' \
50       bin/fail2ban-client \
51       bin/fail2ban-regex \
52       bin/fail2ban-server \
53       bin/fail2ban-testcases \
54       setup.py
55
56 sed -E -i -e '1s,#!\s*/usr/bin/env\s+(.*),#!%{__bindir}\1,' \
57       config/filter.d/ignorecommands/apache-fakegooglebot \
58       fail2ban/tests/files/config/apache-auth/digest.py \
59       fail2ban/tests/files/ignorecommand.py
60
61 %build
62 %py_build
63
64 %install
65 rm -rf $RPM_BUILD_ROOT
66 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,sysconfig} \
67         $RPM_BUILD_ROOT{%{_mandir}/man1,/var/{log,run/fail2ban}} \
68         $RPM_BUILD_ROOT{%{systemdunitdir},%{systemdtmpfilesdir}}
69
70 %py_install \
71         --install-lib=%{py_sitescriptdir} \
72         --root=$RPM_BUILD_ROOT
73
74 install -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
75
76 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/fail2ban
77 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/fail2ban
78 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/fail2ban/paths-pld.conf
79 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
80
81 sed -e 's# /run# /var/run#g' files/fail2ban-tmpfiles.conf > $RPM_BUILD_ROOT%{systemdtmpfilesdir}/fail2ban.conf
82 install -p build-2/fail2ban.service $RPM_BUILD_ROOT%{systemdunitdir}/fail2ban.service
83
84 :> $RPM_BUILD_ROOT/var/log/fail2ban.log
85
86 %py_postclean
87
88 %clean
89 rm -rf $RPM_BUILD_ROOT
90
91 %post
92 /sbin/chkconfig --add %{name}
93 %service %{name} restart
94 %systemd_post fail2ban.service
95
96 %preun
97 if [ "$1" = "0" ]; then
98         %service -q %{name} stop
99         /sbin/chkconfig --del %{name}
100 fi
101 %systemd_preun fail2ban.service
102
103 %postun
104 %systemd_reload
105
106 %triggerpostun -- fail2ban < 0.8.11-3
107 %systemd_trigger fail2ban.service
108
109 %files
110 %defattr(644,root,root,755)
111 %doc CONTRIBUTING.md ChangeLog DEVELOP FILTERS README.md RELEASE THANKS TODO COPYING doc/run-rootless.txt
112 %attr(754,root,root) /etc/rc.d/init.d/fail2ban
113 %attr(755,root,root) %{_bindir}/fail2ban-client
114 %attr(755,root,root) %{_bindir}/fail2ban-python
115 %attr(755,root,root) %{_bindir}/fail2ban-regex
116 %attr(755,root,root) %{_bindir}/fail2ban-server
117 %{systemdunitdir}/fail2ban.service
118 %{systemdtmpfilesdir}/fail2ban.conf
119 %dir /var/run/fail2ban
120 %dir %{_sysconfdir}/fail2ban
121 %dir %{_sysconfdir}/fail2ban/action.d
122 %attr(755,root,root) %{_sysconfdir}/fail2ban/action.d/badips.py
123 %attr(755,root,root) %{_sysconfdir}/fail2ban/action.d/smtp.py
124 %dir %{_sysconfdir}/fail2ban/fail2ban.d
125 %dir %{_sysconfdir}/fail2ban/filter.d
126 %dir %{_sysconfdir}/fail2ban/filter.d/ignorecommands
127 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/filter.d/ignorecommands/apache-fakegooglebot
128 %dir %{_sysconfdir}/fail2ban/jail.d
129 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/*.conf
130 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/*/*.conf
131 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/fail2ban
132 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
133 %{py_sitescriptdir}/%{name}
134 %{py_sitescriptdir}/%{name}-%{version}-py*.egg-info
135 %{_mandir}/man1/fail2ban-client.1*
136 %{_mandir}/man1/fail2ban-python.1*
137 %{_mandir}/man1/fail2ban-regex.1*
138 %{_mandir}/man1/fail2ban-server.1*
139 %{_mandir}/man1/fail2ban-testcases.1*
140 %{_mandir}/man1/fail2ban.1*
141 %attr(750,root,root) %dir /var/lib/%{name}
142 %attr(640,root,logs) %ghost /var/log/fail2ban.log
This page took 0.093363 seconds and 2 git commands to generate.