1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 )
8 inherit distutils-r1 eutils readme.gentoo systemd
10 DESCRIPTION="DenyHosts is a utility to help sys admins thwart ssh hackers"
11 HOMEPAGE="https://github.com/denyhosts/denyhosts"
12 SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
16 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~sparc ~x86"
22 DISABLE_AUTOFORMATTING="yes"
24 >=net-misc/openssh-6.7p1 dropped support for sys-apps/tcp-wrappers
25 (see bug#531156) that means you either have patch openssh or use
26 denyhosts' iptables feature to get any protection.
28 You can configure DenyHosts to run as a daemon by running:
29 # rc-update add denyhosts default
31 # systemctl enable denyhosts.service
34 To run DenyHosts as a cronjob instead of a daemon add the following
36 # run DenyHosts every 10 minutes
37 */10 * * * * root /usr/bin/denyhosts.py -c /etc/denyhosts.conf
39 More information can be found at ${HOMEPAGE}faq.html"
42 sed -e '/^DENY_THRESHOLD_VALID =/s/=.*/= 5/' \
43 -e '/^SECURE_LOG/s/^/#/' \
44 -e '\@#SECURE_LOG.*/var/log/messages@s/^#//' \
45 -i denyhosts.conf || die "sed failed"
47 distutils-r1_src_prepare
51 readme.gentoo_create_doc
53 dodoc CHANGELOG.txt README.md
54 distutils-r1_src_install
56 dodir /etc/logrotate.d
57 insinto /etc/logrotate.d
58 newins "${FILESDIR}"/${PN}.logrotate-r2 ${PN}
60 newinitd "${FILESDIR}"/denyhosts.init-r2 denyhosts
61 systemd_dounit "${FILESDIR}"/${PN}.service
63 keepdir /var/lib/denyhosts