Skip to content

Commit

Permalink
net-analyzer/fail2ban: update live ebuild, drop useless patches
Browse files Browse the repository at this point in the history
Apply changes from the stable ebuild and drop the two patches
since they are not needed any more, as per:
fail2ban/fail2ban@294a779
fail2ban/fail2ban@869d99d

Pull-Request: gentoo#832
Acked-by: Mike Frysinger <[email protected]>
Signed-off-by: Patrice Clement <[email protected]>
Package-Manager: portage-2.2.27
  • Loading branch information
sbraz authored and monsieurp committed Mar 9, 2016
1 parent 0fa3969 commit 9e5135b
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions net-analyzer/fail2ban/fail2ban-99999999.ebuild
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5
PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy )
PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} pypy )
DISTUTILS_SINGLE_IMPL=1

inherit distutils-r1 eutils git-r3 systemd vcs-snapshot
inherit distutils-r1 eutils systemd git-r3

DESCRIPTION="scans log files and bans IPs that show malicious signs"
HOMEPAGE="http://www.fail2ban.org/"
EGIT_REPO_URI="https://github.com/${PN}/${PN}/"
EGIT_REPO_URI="https://github.com/${PN}/${PN}"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS=""
IUSE="selinux systemd"

# TODO support ipfw and ipfilter
RDEPEND="
net-firewall/iptables
kernel_linux? ( net-firewall/iptables )
kernel_FreeBSD? ( sys-freebsd/freebsd-pf )
net-misc/whois
virtual/logger
virtual/mta
Expand All @@ -29,33 +31,26 @@ RDEPEND="
)' 'python*' ) )
"

DOCS=( ChangeLog DEVELOP README.md THANKS TODO doc/run-rootless.txt )
REQUIRED_USE="systemd? ( !python_single_target_pypy )"

src_unpack() {
git-r3_src_unpack
}
DOCS=( ChangeLog DEVELOP README.md THANKS TODO doc/run-rootless.txt )

src_prepare() {
python_prepare_all() {
# Replace /var/run with /run, but not in the top source directory
sed -i -e 's|/var\(/run/fail2ban\)|\1|g' $( find . -type f -mindepth 2 ) || die
find . -mindepth 2 -type f -exec \
sed -i -e 's|/var\(/run/fail2ban\)|\1|g' {} + || die

# Fix bashisms and do not direct useful output to /dev/null (bug #536320)
# Remove global logrotate settings (bug #549856)
epatch \
"${FILESDIR}"/${PN}-0.9.2-initd.patch \
"${FILESDIR}"/${PN}-0.9.2-logrotate.patch

distutils-r1_src_prepare
distutils-r1_python_prepare_all
}

python_test() {
${EPYTHON} bin/${PN}-testcases
"${PYTHON}" "bin/${PN}-testcases" || die "tests failed with ${EPYTHON}"
}

src_install() {
distutils-r1_src_install
python_install_all() {
distutils-r1_python_install_all

rm -rf "${D}"/usr/share/doc/${PN}
rm -r "${D}"/usr/share/doc/${PN} "${D}"/run || die

# not FILESDIR
newconfd files/gentoo-confd ${PN}
Expand Down Expand Up @@ -98,7 +93,6 @@ pkg_postinst() {
elog "If you want to use ${PN}'s persistent database, then reinstall"
elog "dev-lang/python with USE=sqlite"
fi

if has_version sys-apps/systemd[-python]; then
elog "If you want to track logins through sys-apps/systemd's"
elog "journal backend, then reinstall sys-apps/systemd with USE=python"
Expand Down

0 comments on commit 9e5135b

Please sign in to comment.