]> git.pld-linux.org Git - packages/fail2ban.git/blob - fail2ban.spec
fd08247b362c989b7781851f913485d9d1cbcb01
[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.2
5 Release:        1
6 License:        GPL
7 Group:          Daemons
8 Source0:        https://github.com/fail2ban/fail2ban/archive/%{version}.tar.gz
9 # Source0-md5:  dbeaad971a1127320b949b0f29d7b1f9
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 rm $RPM_BUILD_ROOT%{_bindir}/fail2ban-testcases
89
90 %clean
91 rm -rf $RPM_BUILD_ROOT
92
93 %post
94 /sbin/chkconfig --add %{name}
95 %service %{name} restart
96 %systemd_post fail2ban.service
97
98 %preun
99 if [ "$1" = "0" ]; then
100         %service -q %{name} stop
101         /sbin/chkconfig --del %{name}
102 fi
103 %systemd_preun fail2ban.service
104
105 %postun
106 %systemd_reload
107
108 %triggerpostun -- fail2ban < 0.8.11-3
109 %systemd_trigger fail2ban.service
110
111 %files
112 %defattr(644,root,root,755)
113 %doc CONTRIBUTING.md ChangeLog DEVELOP FILTERS README.md RELEASE THANKS TODO COPYING doc/run-rootless.txt
114 %attr(754,root,root) /etc/rc.d/init.d/fail2ban
115 %attr(755,root,root) %{_bindir}/fail2ban-client
116 %attr(755,root,root) %{_bindir}/fail2ban-python
117 %attr(755,root,root) %{_bindir}/fail2ban-regex
118 %attr(755,root,root) %{_bindir}/fail2ban-server
119 %{systemdunitdir}/fail2ban.service
120 %{systemdtmpfilesdir}/fail2ban.conf
121 %dir /var/run/fail2ban
122 %dir %{_sysconfdir}/fail2ban
123 %dir %{_sysconfdir}/fail2ban/action.d
124 %attr(755,root,root) %{_sysconfdir}/fail2ban/action.d/badips.py
125 %attr(755,root,root) %{_sysconfdir}/fail2ban/action.d/smtp.py
126 %dir %{_sysconfdir}/fail2ban/fail2ban.d
127 %dir %{_sysconfdir}/fail2ban/filter.d
128 %dir %{_sysconfdir}/fail2ban/filter.d/ignorecommands
129 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/filter.d/ignorecommands/apache-fakegooglebot
130 %dir %{_sysconfdir}/fail2ban/jail.d
131 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/*.conf
132 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/*/*.conf
133 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/fail2ban
134 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
135 %{py_sitescriptdir}/%{name}
136 %{py_sitescriptdir}/%{name}-%{version}-py*.egg-info
137 %{_mandir}/man1/fail2ban-client.1*
138 %{_mandir}/man1/fail2ban-python.1*
139 %{_mandir}/man1/fail2ban-regex.1*
140 %{_mandir}/man1/fail2ban-server.1*
141 %{_mandir}/man1/fail2ban-testcases.1*
142 %{_mandir}/man1/fail2ban.1*
143 %attr(750,root,root) %dir /var/lib/%{name}
144 %attr(640,root,logs) %ghost /var/log/fail2ban.log
This page took 0.105288 seconds and 2 git commands to generate.