summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacho Ramos <pacho@gentoo.org>2013-07-07 06:53:32 +0000
committerPacho Ramos <pacho@gentoo.org>2013-07-07 06:53:32 +0000
commit6687b2520487cf8e559e3ddc7e4f4f8f6ff905a6 (patch)
treef22472d356d200069adc8bae7a60c2666855abf3 /app-admin
parentFix broken Manifest entry for rdtool-0.6.38.ebuild. (diff)
downloadgentoo-2-6687b2520487cf8e559e3ddc7e4f4f8f6ff905a6.tar.gz
gentoo-2-6687b2520487cf8e559e3ddc7e4f4f8f6ff905a6.tar.bz2
gentoo-2-6687b2520487cf8e559e3ddc7e4f4f8f6ff905a6.zip
Install unit file, move to distutils-r1 eclass and readme.gentoo.
(Portage version: 2.1.12.11/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)
Diffstat (limited to 'app-admin')
-rw-r--r--app-admin/denyhosts/ChangeLog10
-rw-r--r--app-admin/denyhosts/denyhosts-2.6-r7.ebuild92
-rw-r--r--app-admin/denyhosts/files/denyhosts.service12
3 files changed, 112 insertions, 2 deletions
diff --git a/app-admin/denyhosts/ChangeLog b/app-admin/denyhosts/ChangeLog
index e6167d98347b..56b458d605db 100644
--- a/app-admin/denyhosts/ChangeLog
+++ b/app-admin/denyhosts/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-admin/denyhosts
-# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/denyhosts/ChangeLog,v 1.57 2012/12/03 13:13:31 kensington Exp $
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/denyhosts/ChangeLog,v 1.58 2013/07/07 06:53:32 pacho Exp $
+
+*denyhosts-2.6-r7 (07 Jul 2013)
+
+ 07 Jul 2013; Pacho Ramos <pacho@gentoo.org> +denyhosts-2.6-r7.ebuild,
+ +files/denyhosts.service:
+ Install unit file, move to distutils-r1 eclass and readme.gentoo.
03 Dec 2012; Michael Palimaka <kensington@gentoo.org>
-denyhosts-2.6-r5.ebuild:
diff --git a/app-admin/denyhosts/denyhosts-2.6-r7.ebuild b/app-admin/denyhosts/denyhosts-2.6-r7.ebuild
new file mode 100644
index 000000000000..e56f0995bea2
--- /dev/null
+++ b/app-admin/denyhosts/denyhosts-2.6-r7.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/denyhosts/denyhosts-2.6-r7.ebuild,v 1.1 2013/07/07 06:53:32 pacho Exp $
+
+EAPI=5
+PYTHON_COMPAT=( python{2_6,2_7} )
+
+inherit distutils-r1 eutils readme.gentoo systemd
+
+MY_PN="DenyHosts"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="DenyHosts is a utility to help sys admins thwart ssh hackers"
+HOMEPAGE="http://www.denyhosts.net"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~sparc ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+PYTHON_MODNAME="${MY_PN}"
+
+S="${WORKDIR}/${MY_P}"
+
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+You can configure DenyHosts to run as a daemon by running:
+# rc-update add denyhosts default
+or:
+# systemctl enable denyhosts.service
+(if you use systemd)
+
+To run DenyHosts as a cronjob instead of a daemon add the following
+to /etc/crontab
+# run DenyHosts every 10 minutes
+*/10 * * * * root /usr/bin/denyhosts.py -c /etc/denyhosts.conf
+
+More information can be found at http://denyhosts.sourceforge.net/faq.html"
+
+src_prepare() {
+ # changes default file installations
+ epatch "${FILESDIR}"/${P}-gentoo.patch
+ epatch "${FILESDIR}"/${P}-log-injection-regex.patch
+
+ # Multiple patches from Fedora and Debian
+ epatch "${FILESDIR}"/${P}-daemon-control.patch
+ epatch "${FILESDIR}"/${P}-defconffile.patch
+ epatch "${FILESDIR}"/${P}-foreground_mode.patch
+ epatch "${FILESDIR}"/${P}-hostname.patch
+ epatch "${FILESDIR}"/${P}-plugin_deny.patch
+ epatch "${FILESDIR}"/${P}-single_config_switch.patch
+
+ sed -i -e 's:DENY_THRESHOLD_VALID = 10:DENY_THRESHOLD_VALID = 5:' \
+ denyhosts.cfg-dist || die "sed failed"
+
+ distutils-r1_src_prepare
+}
+
+src_install() {
+ readme.gentoo_create_doc
+
+ dodoc CHANGELOG.txt README.txt PKG-INFO
+ distutils-r1_src_install
+
+ insinto /etc
+ insopts -m0640
+ newins denyhosts.cfg-dist denyhosts.conf
+
+ dodir /etc/logrotate.d
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/${PN}.logrotate ${PN}
+
+ newinitd "${FILESDIR}"/denyhosts.init denyhosts
+ systemd_dounit "${FILESDIR}"/${PN}.service
+
+ # build system installs docs that we installed above
+ rm -f "${D}"/usr/share/denyhosts/*.txt
+
+ keepdir /var/lib/denyhosts
+}
+
+pkg_postinst() {
+ if [[ ! -f "${ROOT}etc/hosts.deny" ]]; then
+ touch "${ROOT}etc/hosts.deny"
+ fi
+
+ readme.gentoo_print_elog
+}
diff --git a/app-admin/denyhosts/files/denyhosts.service b/app-admin/denyhosts/files/denyhosts.service
new file mode 100644
index 000000000000..212e0cce3109
--- /dev/null
+++ b/app-admin/denyhosts/files/denyhosts.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=SSH log watcher
+Before=sshd.service
+
+[Service]
+Type=forking
+ExecStartPre=/bin/rm -f /run/lock/subsys/denyhosts
+ExecStart=/usr/bin/denyhosts.py --daemon --config=/etc/denyhosts.conf
+PIDFile=/run/lock/subsys/denyhosts
+
+[Install]
+WantedBy=multi-user.target