# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit distutils eutils my_PN="DenyHosts" my_P="${my_PN}-${PV}" DESCRIPTION="DenyHosts is a utility to help sys admins thwart ssh hackers" HOMEPAGE="http://denyhosts.sourceforge.net/" SRC_URI="mirror://sourceforge/${PN}/${my_P}.tar.gz" LICENSE="GPL-2" SLOT="0" # It should work on any architecture that supports python. KEYWORDS="~x86" IUSE="" DEPEND=">=dev-lang/python-2.3" S="${WORKDIR}/${my_P}" src_unpack() { unpack ${A} cd "${S}" #This patch makes changes in setup.py in order that distutils doesn't #try to install things where it shouldn't. #In the config file the patch changes the default log file where #DenyHosts reads its sshd data from to /var/log/messages. It also defines #/var/lib/denyhosts as workdir and makes /var/run/denyhosts the lockfile. epatch "${FILESDIR}"/${PN}-gentoo.patch } src_install() { distutils_src_install #install the configuration file insinto /etc insopts -m0640 newins denyhosts.cfg-dist denyhosts.conf newinitd "${FILESDIR}"/denyhosts.init denyhosts #install the executable exeinto /usr/bin newexe denyhosts.py denyhosts #install the documentation dodoc CHANGELOG.txt README.txt #make the directory where DenyHosts will store its working data keepdir /var/lib/denyhosts } pkg_postinst() { einfo "You can configure DenyHosts to run as a daemon by running" einfo "rc-update add denyhosts default" einfo einfo "or as a cronjob, by adding the following to /etc/crontab" einfo "# run DenyHosts every 10 minutes" einfo "*/10 * * * * root python /usr/bin/denyhosts.py -c /etc/denyhosts.conf" einfo einfo "For more information on configuration, you should read the FAQ at:" einfo "http://denyhosts.sourceforge.net/faq.html" einfo ewarn "Be sure to edit /etc/denyhosts.conf to suit your logging system." }