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