1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 SUPPORT_PYTHON_ABIS="1"
9 RESTRICT_PYTHON_ABIS="3.*"
11 inherit python distutils
13 MY_P="BlockHosts-${PV}"
14 DESCRIPTION="Blocks abusive IP hosts which probe your services (such as sshd, proftpd)"
15 HOMEPAGE="http://www.aczoom.com/blockhosts/"
16 SRC_URI="http://www.aczoom.com/tools/${PN}/${MY_P}.tar.gz"
18 LICENSE="public-domain"
20 KEYWORDS="~amd64 ~x86"
21 IUSE="logrotate logwatch test"
23 DEPEND="dev-python/pyxml"
25 logrotate? ( app-admin/logrotate )"
27 S="${WORKDIR}"/${MY_P}
34 python_convert_shebangs -r 2 .
36 # don't let setup.py install bhrss.py to /usr/bin
37 sed -i -e "s/,.*bhrss\.py'//" setup.py || die
39 # remove logrotate check if not in IUSE
40 if ! use logrotate; then
41 sed -i -e "/^if/d ; /DATA_FILES\./d" setup.py || die
49 $(PYTHON) test_blockhosts.py || die
51 python_execute_function testing
57 exeinto /usr/share/${PN}
60 # not tested, but should work
62 insinto /etc/log.d/conf/services/
63 doins logwatch/blockhosts.conf || die
65 exeinto /etc/log.d/scripts/services/
66 doexe logwatch/blockhosts || die
74 elog "This package isn't configured properly."
75 elog "Please refer to the homepage to do this!"
77 elog "See also: http://www.gentoo-wiki.info/BlockHosts"
79 elog "bhrss.py cgi-script is in /usr/share/${PN}."
80 elog "If you want to use it, put it in your cgi-bin,"