app-admin/denyhosts: ppc stable wrt bug #556522
[gentoo.git] / app-admin / denyhosts / denyhosts-3.0.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 PYTHON_COMPAT=( python2_7 )
7
8 inherit distutils-r1 eutils readme.gentoo systemd
9
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"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~sparc ~x86"
17 IUSE=""
18
19 DEPEND=""
20 RDEPEND=""
21
22 DISABLE_AUTOFORMATTING="yes"
23 DOC_CONTENTS="
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.
27
28 You can configure DenyHosts to run as a daemon by running:
29 # rc-update add denyhosts default
30 or:
31 # systemctl enable denyhosts.service
32 (if you use systemd)
33
34 To run DenyHosts as a cronjob instead of a daemon add the following
35 to /etc/crontab
36 # run DenyHosts every 10 minutes
37 */10  *  * * *    root    /usr/bin/denyhosts.py -c /etc/denyhosts.conf
38
39 More information can be found at ${HOMEPAGE}faq.html"
40
41 src_prepare() {
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"
46
47         distutils-r1_src_prepare
48 }
49
50 src_install() {
51         readme.gentoo_create_doc
52
53         dodoc CHANGELOG.txt README.md
54         distutils-r1_src_install
55
56         dodir /etc/logrotate.d
57         insinto /etc/logrotate.d
58         newins "${FILESDIR}"/${PN}.logrotate-r2 ${PN}
59
60         newinitd "${FILESDIR}"/denyhosts.init-r2 denyhosts
61         systemd_dounit "${FILESDIR}"/${PN}.service
62
63         keepdir /var/lib/denyhosts
64 }