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