]> Pileus Git - ~andy/sunrise/blob - app-admin/blockhosts/blockhosts-2.2.0.ebuild
New upstream release, drop old
[~andy/sunrise] / app-admin / blockhosts / blockhosts-2.2.0.ebuild
1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 NEED_PYTHON=2.3
6
7 inherit distutils
8
9 MY_P="BlockHosts-${PV}"
10 DESCRIPTION="Blocks abusive IP hosts which probe your services (such as sshd, proftpd)"
11 HOMEPAGE="http://www.aczoom.com/cms/blockhosts/"
12 SRC_URI="http://www.aczoom.com/tools/blockhosts/${MY_P}.tar.gz"
13
14 LICENSE="public-domain"
15 SLOT="0"
16 KEYWORDS="~x86"
17 IUSE="logrotate logwatch"
18
19 DEPEND=""
20 RDEPEND="logrotate? ( app-admin/logrotate )"
21
22 DOCS="CHANGES"
23 S=${WORKDIR}/${MY_P}
24
25 src_unpack() {
26         unpack ${A}
27         cd "${S}"
28
29         # don't let setup.py install bhrss.py to /usr/bin
30         sed -i \
31                 -e "s/,.*bhrss\.py'//" \
32                 setup.py || die "sed failed"
33
34         # remove logrotate check if not in IUSE
35         if ! use logrotate; then
36                 sed -i \
37                         -e "/^if/d" \
38                         -e "/DATA_FILES\./d" \
39                         setup.py || die "sed failed"
40         fi
41 }
42
43 src_install() {
44         distutils_src_install
45
46         insinto /usr/share/${PN}
47         doins bhrss.py
48         # keep the test script
49         doins test_blockhosts.py
50
51         dohtml *.html
52
53         # not tested, but should work
54         if use logwatch; then
55                 insinto /etc/log.d/conf/services/
56                 doins logwatch/blockhosts.conf
57
58                 exeinto /etc/log.d/scripts/services/
59                 doexe logwatch/blockhosts
60         fi
61 }
62
63 pkg_postinst() {
64         echo
65         elog "This package isn't configured properly."
66         elog "Please refer to the homepage to do this!"
67         echo
68         elog "See also: http://gentoo-wiki.com/HOWTO_BlockHosts"
69         echo
70         elog "bhrss.py cgi-script is in /usr/share/${PN}."
71         elog "If you want to use it, put it in your cgi-bin,"
72         elog "emerge dev-python/pyxml and copy blockhosts.py"
73         elog "into your python module directory."
74         echo
75 }