X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=fail2ban.spec;h=9c678bb8f896687dce6821258406c666fd2c46bb;hb=50db387a94f81dc5915cfa5f90d3074bc1ebb03e;hp=575dfa683837dc99494dec92061f957c96fcf47b;hpb=465f8f11698538d89b30edc4af9750a74aceac99;p=packages%2Ffail2ban.git diff --git a/fail2ban.spec b/fail2ban.spec index 575dfa6..9c678bb 100644 --- a/fail2ban.spec +++ b/fail2ban.spec @@ -1,16 +1,31 @@ +# TODO: +# - resurrect ipv6 support Summary: Ban IPs that make too many password failures +Summary(pl.UTF-8): Blokowanie IP powodujących zbyt dużo prób logowań z błędnym hasłem Name: fail2ban -Version: 0.6.0 -Release: 1 +Version: 0.9.1 +Release: 0.1 License: GPL Group: Daemons +Source0: https://github.com/fail2ban/fail2ban/archive/%{version}.tar.gz +# Source0-md5: 3554cc3de3f06ddfd7f90f8305b765b8 +Source1: %{name}.init +Source2: %{name}.logrotate +Source3: paths-pld.conf +Patch0: ipv6.patch +Patch1: logifiles.patch URL: http://fail2ban.sourceforge.net/ -Source0: http://dl.sourceforge.net/fail2ban/%{name}-%{version}.tar.bz2 -# Source0-md5: 129c4e76539a22ab60d025fbf137f962 -BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) -BuildRequires: dos2unix +BuildRequires: python-devel +BuildRequires: python-modules +BuildRequires: rpm-pythonprov +BuildRequires: rpmbuild(macros) >= 1.671 +Requires(post,preun): /sbin/chkconfig +Requires(post,preun,postun): systemd-units >= 38 Requires: python-log4py +Requires: rc-scripts +Requires: systemd-units >= 38 BuildArch: noarch +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description Fail2Ban scans log files like /var/log/secure and bans IP that makes @@ -18,26 +33,45 @@ too many password failures. It updates firewall rules to reject the IP address. These rules can be defined by the user. Fail2Ban can read multiple log files including sshd or Apache web server logs. +%description -l pl.UTF-8 +Fail2Ban skanuje pliki logów takie jak /var/log/secure i blokuje IP +powodujące zbyt dużo prób logowań z błędnym hasłem. Uaktualnia regułki +firewalla, aby odrzucić adres IP. Regułki te mogą być definiowane +przez użytkownika. Fail2Ban potrafi czytać wiele plików logów włącznie +z sshd czy plikami logów serwera WWW Apache. + %prep %setup -q +#%patch0 -p1 +%patch1 -p1 +rm setup.cfg %build -rm setup.cfg %{__python} setup.py build %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT/etc/rc.d/init.d/ -PYTHONPATH=$RPM_BUILD_ROOT%{py_sitescriptdir}; export PYTHONPATH +install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d} \ + $RPM_BUILD_ROOT{%{_mandir}/man1,/var/{log,run/fail2ban}} \ + $RPM_BUILD_ROOT{%{systemdunitdir},%{systemdtmpfilesdir}} -python setup.py install \ - --optimize=2 \ +%{__python} setup.py install \ + --optimize=2 \ + --install-lib=%{py_sitescriptdir} \ --root=$RPM_BUILD_ROOT -find $RPM_BUILD_ROOT%{py_sitescriptdir} -name \*.py -exec rm {} \; -dos2unix config/redhat-initd -install config/redhat-initd $RPM_BUILD_ROOT/etc/rc.d/init.d/fail2ban -install config/fail2ban.conf.default $RPM_BUILD_ROOT%{_sysconfdir}/fail2ban.conf +install -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 + +install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/fail2ban +install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/fail2ban +install -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/fail2ban/paths-pld.conf + +install -p files/fail2ban-tmpfiles.conf $RPM_BUILD_ROOT%{systemdtmpfilesdir}/fail2ban.conf +install -p files/fail2ban.service $RPM_BUILD_ROOT%{systemdunitdir}/fail2ban.service + +:> $RPM_BUILD_ROOT/var/log/fail2ban.log + +%py_postclean %clean rm -rf $RPM_BUILD_ROOT @@ -45,17 +79,46 @@ rm -rf $RPM_BUILD_ROOT %post /sbin/chkconfig --add %{name} %service %{name} restart +%systemd_post fail2ban.service %preun if [ "$1" = "0" ]; then %service -q %{name} stop /sbin/chkconfig --del %{name} fi +%systemd_preun fail2ban.service + +%postun +%systemd_reload + +%triggerpostun -- fail2ban < 0.8.11-3 +%systemd_trigger fail2ban.service %files -%doc CHANGELOG README TODO %defattr(644,root,root,755) -%attr(755,root,root) /etc/rc.d/init.d/%{name} -%attr(755,root,root) %{_bindir}/%{name} -%config(noreplace) %{_sysconfdir}/%{name}.conf -%{py_sitescriptdir}/* +%doc CONTRIBUTING.md ChangeLog DEVELOP FILTERS README.md RELEASE THANKS TODO COPYING +%attr(754,root,root) /etc/rc.d/init.d/fail2ban +%attr(755,root,root) %{_bindir}/fail2ban-client +%attr(755,root,root) %{_bindir}/fail2ban-regex +%attr(755,root,root) %{_bindir}/fail2ban-server +%attr(755,root,root) %{_bindir}/fail2ban-testcases +%{systemdunitdir}/fail2ban.service +%{systemdtmpfilesdir}/fail2ban.conf +%dir /var/run/fail2ban +%dir %{_sysconfdir}/fail2ban +%dir %{_sysconfdir}/fail2ban/action.d +%attr(755,root,root) %{_sysconfdir}/fail2ban/action.d/badips.py +%attr(755,root,root) %{_sysconfdir}/fail2ban/action.d/smtp.py +%dir %{_sysconfdir}/fail2ban/fail2ban.d +%dir %{_sysconfdir}/fail2ban/filter.d +%dir %{_sysconfdir}/fail2ban/jail.d +%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/*.conf +%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fail2ban/*/*.conf +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/fail2ban +%{py_sitescriptdir}/%{name} +%{py_sitescriptdir}/%{name}-%{version}-py*.egg-info +%{_mandir}/man1/fail2ban-client.1* +%{_mandir}/man1/fail2ban-regex.1* +%{_mandir}/man1/fail2ban-server.1* +%{_mandir}/man1/fail2ban.1* +%attr(640,root,logs) %ghost /var/log/fail2ban.log