Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/fail2ban/
Date: Fri, 10 Jan 2020 13:20:26
Message-Id: 1578662407.240bcf47695d4bbf1698df8f6257b98bc9137191.jer@gentoo
1 commit: 240bcf47695d4bbf1698df8f6257b98bc9137191
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 10 13:15:42 2020 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 10 13:20:07 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=240bcf47
7
8 net-analyzer/fail2ban: Version 0.10.5
9
10 Package-Manager: Portage-2.3.84, Repoman-2.3.20
11 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
12
13 net-analyzer/fail2ban/Manifest | 1 +
14 net-analyzer/fail2ban/fail2ban-0.10.5.ebuild | 113 +++++++++++++++++++++++++++
15 2 files changed, 114 insertions(+)
16
17 diff --git a/net-analyzer/fail2ban/Manifest b/net-analyzer/fail2ban/Manifest
18 index 8ae35bf6701..96d52fcf26f 100644
19 --- a/net-analyzer/fail2ban/Manifest
20 +++ b/net-analyzer/fail2ban/Manifest
21 @@ -1 +1,2 @@
22 DIST fail2ban-0.10.4.tar.gz 493104 BLAKE2B 3a58ab114cf25172c77b229ce53bf6dd009d4fb8c700142480ba0212072d8820126bfabf5dd417835bdac5f5b65d599c6dde859d8c57267e90cfb569dc4a2073 SHA512 ee53f2e8dc3cda4f588c60da5227d3d71550496ddfdf5bdbffced25bafd442b8e2352a9ad9f27bf76489903b5b779cdb9614963342de907c1036ae9268b8f35f
23 +DIST fail2ban-0.10.5.tar.gz 520460 BLAKE2B 872b1b2d96d5c79b228cf7c38923161336e452c33fddce75d25004454a5b5d119d435aeb789d55576de4e24bbf8d8288d9fc2fb3f17323074a27857a08e3c6a4 SHA512 d2ad64999031537f2adfc01efd02d2db0718485e38745736339c2e3a1792cd82147fb6cf5a3d371d83dbe91d1afe34e741e038ed4d84d6f444ea1922dc4bb658
24
25 diff --git a/net-analyzer/fail2ban/fail2ban-0.10.5.ebuild b/net-analyzer/fail2ban/fail2ban-0.10.5.ebuild
26 new file mode 100644
27 index 00000000000..85730ff0b68
28 --- /dev/null
29 +++ b/net-analyzer/fail2ban/fail2ban-0.10.5.ebuild
30 @@ -0,0 +1,113 @@
31 +# Copyright 1999-2020 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +PYTHON_COMPAT=( python{2_7,3_6} )
36 +DISTUTILS_SINGLE_IMPL=1
37 +
38 +inherit distutils-r1 systemd
39 +
40 +DESCRIPTION="scans log files and bans IPs that show malicious signs"
41 +HOMEPAGE="https://www.fail2ban.org/"
42 +SRC_URI="https://github.com/${PN}/${PN}/tarball/${PV} -> ${P}.tar.gz"
43 +
44 +LICENSE="GPL-2"
45 +SLOT="0"
46 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86"
47 +IUSE="selinux systemd"
48 +
49 +RDEPEND="
50 + virtual/logger
51 + virtual/mta
52 + selinux? ( sec-policy/selinux-fail2ban )
53 + systemd? ( $(python_gen_cond_dep '|| (
54 + dev-python/python-systemd[${PYTHON_USEDEP}]
55 + sys-apps/systemd[python(-),${PYTHON_USEDEP}]
56 + )' 'python*' ) )
57 +"
58 +
59 +RESTRICT="test"
60 +DOCS=( ChangeLog DEVELOP README.md THANKS TODO doc/run-rootless.txt )
61 +
62 +src_unpack() {
63 + default
64 + mv ${PN}-${PN}-* ${P} || die
65 +}
66 +
67 +python_prepare_all() {
68 + default
69 +
70 + # Replace /var/run with /run, but not in the top source directory
71 + find . -mindepth 2 -type f -exec \
72 + sed -i -e 's|/var\(/run/fail2ban\)|\1|g' {} + || die
73 +
74 + sed -i -e 's|runscript|openrc-run|g' files/gentoo-initd || die
75 +
76 + distutils-r1_python_prepare_all
77 +}
78 +
79 +python_compile() {
80 + if python_is_python3; then
81 + ./fail2ban-2to3 || die
82 + fi
83 + distutils-r1_python_compile
84 +}
85 +
86 +python_install_all() {
87 + distutils-r1_python_install_all
88 +
89 + rm -rf "${D}"/usr/share/doc/${PN} "${D}"/run || die
90 +
91 + # not FILESDIR
92 + newconfd files/gentoo-confd ${PN}
93 + newinitd files/gentoo-initd ${PN}
94 + sed -e "s:@BINDIR@:${EPREFIX}/usr/bin:g" files/${PN}.service.in > "${T}/${PN}.service" || die
95 + systemd_dounit "${T}/${PN}.service"
96 + systemd_dotmpfilesd files/${PN}-tmpfiles.conf
97 + doman man/*.{1,5}
98 +
99 + # Use INSTALL_MASK if you do not want to touch /etc/logrotate.d.
100 + # See http://thread.gmane.org/gmane.linux.gentoo.devel/35675
101 + insinto /etc/logrotate.d
102 + newins files/${PN}-logrotate ${PN}
103 +
104 + keepdir /var/lib/${PN}
105 +}
106 +
107 +pkg_preinst() {
108 + has_version "<${CATEGORY}/${PN}-0.7"
109 + previous_less_than_0_7=$?
110 +}
111 +
112 +pkg_postinst() {
113 + if [[ $previous_less_than_0_7 = 0 ]] ; then
114 + elog
115 + elog "Configuration files are now in /etc/fail2ban/"
116 + elog "You probably have to manually update your configuration"
117 + elog "files before restarting Fail2ban!"
118 + elog
119 + elog "Fail2ban is not installed under /usr/lib anymore. The"
120 + elog "new location is under /usr/share."
121 + elog
122 + elog "You are upgrading from version 0.6.x, please see:"
123 + elog "http://www.fail2ban.org/wiki/index.php/HOWTO_Upgrade_from_0.6_to_0.8"
124 + fi
125 +
126 + if ! has_version dev-python/pyinotify && ! has_version app-admin/gamin; then
127 + elog "For most jail.conf configurations, it is recommended you install either"
128 + elog "dev-python/pyinotify or app-admin/gamin (in order of preference)"
129 + elog "to control how log file modifications are detected"
130 + fi
131 +
132 + if ! has_version dev-lang/python[sqlite]; then
133 + elog "If you want to use ${PN}'s persistent database, then reinstall"
134 + elog "dev-lang/python with USE=sqlite. If you do not use the"
135 + elog "persistent database feature, then you should set"
136 + elog "dbfile = :memory: in fail2ban.conf accordingly."
137 + fi
138 +
139 + if has_version sys-apps/systemd[-python]; then
140 + elog "If you want to track logins through sys-apps/systemd's"
141 + elog "journal backend, then reinstall sys-apps/systemd with USE=python"
142 + fi
143 +}