Sophie

Sophie

sources > fail2ban > fail2ban.spec > ace65d0ce33ef4c109d380137567ce13
Prev Next
%define python %{__python3}

# spec file based on and patches graciously taken from tpg@mandriva
Summary:	Ban IP-addresses that result in too many password failures
Name:		fail2ban
Version:	0.10.4
Release:	%mkrel 2
License:	GPLv2+
Group:		System/Networking
URL:		http://www.fail2ban.org/
Source0:	https://github.com/fail2ban/fail2ban/archive/%{version}/%{name}-%{version}.tar.gz
Source2:	%{name}.service
Source3:	%{name}.tmpfiles.conf
BuildArch:	noarch
BuildRequires:	pkgconfig(python3)
BuildRequires:	pkgconfig(gamin)
BuildRequires:	pkgconfig(sqlite3)
BuildRequires:	systemd-units
BuildRequires:	python3
BuildRequires:	python3dist(dnspython)
BuildRequires:	python3dist(pyinotify)
BuildRequires:	python3dist(ipdns)
BuildRequires:	python3dist(coverage)
BuildRequires:	python3-systemd
BuildRequires:	help2man

Requires:	python3
Requires:	tcp_wrappers	>= 7.6-29
Requires:	iptables	>= 1.3.5-3
Requires:	python3-systemd
Requires:       sqlite3-tools
Requires(post):	systemd >= %{systemd_required_version}
Requires(post):	rpm-helper >= 0.24.8-1
Requires(preun):rpm-helper >= 0.24.8-1
Requires(post):	systemd-units
Requires(preun):systemd-units
#(eatdirt):
#this guys does not exist and triggers that bug: https://github.com/fail2ban/fail2ban/issues/885
Recommends:	python3-gamin
#let's add this guy as a backup:
Recommends:     python3-pyinotify
Recommends:	python3-dnspython

Patch0:         generate-man.patch

%description
Fail2Ban scans log files like /var/log/secure and bans IP-addresses that have
too many password failures within a specified time frame. It updates firewall
rules to reject these IP addresses. The rules needed for this can be defined by
the user. Fail2Ban can read multiple log files including sshd and Apache web
server logs.

%prep
%autosetup -p1

%build
./fail2ban-2to3
%py3_build

pushd man
sh generate-man
popd

%install
%py3_install

install -d %{buildroot}%{_mandir}/man1
install man/*.1 %{buildroot}%{_mandir}/man1/
install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_tmpfilesdir}/%{name}.conf

install -d -m 0755 %{buildroot}%{_localstatedir}/run/fail2ban/
install -d -m 0755 %{buildroot}%{_localstatedir}/lib/fail2ban/

# Remove non-Linux actions
rm %{buildroot}%{_sysconfdir}/%{name}/action.d/*ipfw.conf
rm %{buildroot}%{_sysconfdir}/%{name}/action.d/{ipfilter,pf,ufw}.conf
rm %{buildroot}%{_sysconfdir}/%{name}/action.d/osx-*.conf

cat > %{buildroot}%{_sysconfdir}/%{name}/jail.d/00-systemd.conf <<EOF
# This file is part of the fail2ban-systemd package to configure the use of
# the systemd journal as the default backend.  You can remove this package
# (along with the empty fail2ban meta-package) if you do not want to use the
# journal backend
[DEFAULT]
backend=systemd
EOF

# Remove installed doc, use doc macro instead
rm -r %{buildroot}%{_docdir}/%{name}

%post
%_tmpfilescreate %{name}
%_post_service %{name}

%preun
%_preun_service %{name}

%files
%doc ChangeLog README.md TODO DEVELOP FILTERS
%{_unitdir}/%{name}.service
%{_tmpfilesdir}/%{name}.conf
%{_bindir}/%{name}-*
%config(noreplace) %{_sysconfdir}/%{name}/*.conf
%config(noreplace) %{_sysconfdir}/%{name}/action.d/*.conf
%config(noreplace) %{_sysconfdir}/%{name}/action.d/*.py*
%config(noreplace) %{_sysconfdir}/%{name}/filter.d/*.conf
%config(noreplace) %{_sysconfdir}/%{name}/jail.d/*.conf
%config(noreplace) %{_sysconfdir}/%{name}/filter.d/ignorecommands/*
%dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/action.d
%dir %{_sysconfdir}/%{name}/filter.d
%dir %{_sysconfdir}/%{name}/jail.d
%{_mandir}/man1/*
%{python3_sitelib}/%{name}
%{python3_sitelib}/%{name}*.egg-info
%dir %{_localstatedir}/lib/fail2ban/
%ghost %dir %{_localstatedir}/run/fail2ban/


%changelog
* Sun Jan 06 2019 kekepower <kekepower> 0.10.4-2.mga7
+ Revision: 1350231
- Rebuild for Python 3.7

* Sat Oct 06 2018 daviddavid <daviddavid> 0.10.4-1.mga7
+ Revision: 1318120
- new version: 0.10.4

* Thu Sep 20 2018 umeabot <umeabot> 0.10.3.1-2.mga7
+ Revision: 1278217
- Mageia 7 Mass Rebuild

* Thu Apr 05 2018 kekepower <kekepower> 0.10.3.1-1.mga7
+ Revision: 1215474
- Update to version 0.10.3.1

* Mon Mar 26 2018 kekepower <kekepower> 0.10.2-1.mga7
+ Revision: 1212614
- Update to version 0.10.2

* Sat Aug 05 2017 pterjan <pterjan> 0.9.5-2.mga7
+ Revision: 1135207
- Rebuild for python 3.6

* Wed Sep 21 2016 daviddavid <daviddavid> 0.9.5-1.mga6
+ Revision: 1054841
- new version: 0.9.5

* Thu Jul 14 2016 eatdirt <eatdirt> 0.9.4-2.mga6
+ Revision: 1042040
- Fix 100%%CPU bug, adding python3-pyinotify as Recommends

* Thu Mar 10 2016 daviddavid <daviddavid> 0.9.4-1.mga6
+ Revision: 988686
- new version: 0.9.4
- use new python macros
- update Source URL

* Fri Feb 19 2016 umeabot <umeabot> 0.9.3-2.mga6
+ Revision: 970804
- Mageia 6 Mass Rebuild

* Fri Oct 09 2015 ovitters <ovitters> 0.9.3-1.mga6
+ Revision: 888510
- new version 0.9.3

* Wed Oct 07 2015 ovitters <ovitters> 0.9.2-4.mga6
+ Revision: 887159
- rebuild for new python3

* Mon Aug 31 2015 ovitters <ovitters> 0.9.2-3.mga6
+ Revision: 871653
- require python3-systemd
- various cleanups from Fedora

* Mon Aug 24 2015 ovitters <ovitters> 0.9.2-1.mga6
+ Revision: 869079
- new version 0.9.2

* Wed Oct 15 2014 umeabot <umeabot> 0.8.13-5.mga5
+ Revision: 748693
- Second Mageia 5 Mass Rebuild

* Tue Sep 16 2014 umeabot <umeabot> 0.8.13-4.mga5
+ Revision: 679081
- Mageia 5 Mass Rebuild
+ tv <tv>
- s/uggests:/Recommends:/

* Sat May 31 2014 pterjan <pterjan> 0.8.13-3.mga5
+ Revision: 628174
- Rebuild for new Python

* Thu Apr 10 2014 remmy <remmy> 0.8.13-2.mga5
+ Revision: 613268
- Paths update for apache logfiles (mga#10617)
- Security fixes (mga#11569) for CVE-2013-7176 (postfix arbitrary IP-address
  blocking) and CVE-2013-7177 (cyrus-imap arbitrary IP-address blocking)

* Tue Oct 22 2013 umeabot <umeabot> 0.8.10-3.mga4
+ Revision: 542575
- Mageia 4 Mass Rebuild

* Mon Oct 14 2013 pterjan <pterjan> 0.8.10-2.mga4
+ Revision: 497749
- Rebuild to add different pythonegg provides for python 2 and 3

* Wed Jun 19 2013 remmy <remmy> 0.8.10-1.mga4
+ Revision: 444901
- New upstream version, also fixing a DoS vulnerability

* Tue Mar 26 2013 colin <colin> 0.8.8-6.mga3
+ Revision: 405410
- Require syslog-daemon (as basesystem doesn't technically need one now) mga#8028

* Sun Mar 24 2013 colin <colin> 0.8.8-5.mga3
+ Revision: 404859
- Add systemd requires and general post/pre fixes (mga#9302)

* Tue Jan 22 2013 fwang <fwang> 0.8.8-4.mga3
+ Revision: 390855
- update rpm group

* Sat Jan 12 2013 colin <colin> 0.8.8-3.mga3
+ Revision: 358973
- Tidy up tmpfiles support (don't ship /var/run folder in package)

* Fri Jan 11 2013 umeabot <umeabot> 0.8.8-2.mga3
+ Revision: 350037
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Sat Dec 29 2012 remmy <remmy> 0.8.8-1.mga3
+ Revision: 336004
- New upstream version: 0.8.8

* Fri Nov 23 2012 remmy <remmy> 0.8.7.1-3.mga3
+ Revision: 321218
- Remove init script, create systemd style tmpfile

* Sun Nov 11 2012 remmy <remmy> 0.8.7.1-2.mga3
+ Revision: 316938
- Create tmpfile on install, enabling fail2ban to start (closes mga#7871)

* Sat Aug 11 2012 remmy <remmy> 0.8.7.1-1.mga3
+ Revision: 280516
- New upstream version: 0.8.7.1

* Sat Apr 28 2012 tmb <tmb> 0.8.6-2.mga2
+ Revision: 233693
- Require rpm-helper >= 0.24.8-1 for systemd support

* Wed Mar 07 2012 remmy <remmy> 0.8.6-1.mga2
+ Revision: 221223
- Drop unneeded patches
- Provide systemd .service file
- Log to SYSLOG by default
- Moved to upstream release 0.8.6

* Wed May 04 2011 saispo <saispo> 0.8.4-5.mga1
+ Revision: 94760
- Add missing patch
- Fix fail2ban with running file in /tmp, see bug #908

* Sun Feb 20 2011 eandry <eandry> 0.8.4-4.mga1
+ Revision: 54755
- remove buildroot
- bump for upgrade
- imported package fail2ban