# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit distutils eutils DESCRIPTION="DenyHosts is a utility to help sys admins thwart ssh hackers" HOMEPAGE="http://denyhosts.sourceforge.net/" SRC_URI="mirror://sourceforge/denyhosts/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" # I'm only able to test this on an x86 machine, but it should work on any architecture that # supports python. KEYWORDS="~x86" IUSE="" DEPEND=">dev-lang/python-2.3" src_unpack() { unpack ${A} cd ${S} #make sure that it doesn't try to install things where it shouldn't epatch ${FILESDIR}/${P}-gentoo.patch } src_install() { distutils_src_install #install the configuration file insinto /etc insopts -m0640 newins denyhosts.cfg-dist denyhosts.cfg #install the init script exeinto /usr/sbin newexe daemon-control-dist denyhosts-daemon-control newinitd ${FILESDIR}/denyhosts.rc6 denyhosts #install the documentation dodoc CHANGELOG.txt LICENSE.txt README.txt #make the directory where DenyHosts will store its working data dodir /var/lib/denyhosts keepdir /var/lib/denyhosts } pkg_postinst() { einfo "DenyHosts is now installed, but it will not run until you have configured it." einfo "You can configure it 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.cfg" echo einfo "For more information on configuration, you should read the FAQ at:" einfo "http://denyhosts.sourceforge.net/faq.html" echo ewarn "Be sure to edit /etc/denyhosts.cfg to suit your logging system." }