Gentoo Archives: gentoo-security

From: Christophe Garault <christophe@×××××××.org>
To: gentoo-security@l.g.o
Subject: Re: [gentoo-security] If your interested
Date: Tue, 11 Oct 2005 09:19:27
Message-Id: 434B8288.2090708@garault.org
In Reply to: Re: [gentoo-security] If your interested by Danny
1 Danny a écrit :
2
3 > I don't see it in portage, is it under a different name?
4
5 I'm really sorry for that Danny, it's my mistake. Portage is so
6 incredibly powerfull I thought fail2ban was in it. ;)
7 In fact I didn't remember that it is in my overlay as Chris mentionned.
8 So what you have to do is:
9
10 - create a local overlay: /usr/local/portage and then net-firewall/fail2ban
11 - declare this overlay in you make.conf
12 - copy fail2ban-0.5.4.ebuild (see below) into
13 /usr/local/portage/net-firewall/fail2ban/
14 - create an new directory under fail2ban called 'files'
15 - copy fail2ban-0.5.4.tar.bz2 from sourceforge into this new directory
16 - run "ebuild fail2ban-0.5.4.ebuild digest"
17 And then simply emerge fail2ban.
18
19 Here is the ebuild:
20
21 -----------------------------
22 # Distributed under the terms of the GNU General Public License v2
23
24 DESCRIPTION="Bans IP that make too many password failures"
25 HOMEPAGE="http://sourceforge.net/projects/fail2ban"
26 SRC_URI="mirror://sourceforge/fail2ban/${P}.tar.bz2"
27 LICENSE="GPL-2"
28 SLOT="0"
29 KEYWORDS="~x86 ~amd64"
30 IUSE=""
31 DEPEND=">=dev-lang/python-2.3"
32
33 src_install() {
34 # Use python setup
35 python setup.py install --root=${D} || die
36
37 # Use fail2ban.conf.default as default config file
38 insinto /etc
39 newins config/fail2ban.conf.default fail2ban.conf
40 # Install initd scripts
41 exeinto /etc/init.d
42 newexe config/gentoo-initd fail2ban
43 insinto /etc/conf.d
44 newins config/gentoo-confd fail2ban
45 # Doc
46 doman man/*.[0-9]
47 dodoc CHANGELOG README TODO
48 }
49
50 pkg_postinst() {
51 # The user must edit the config file
52 echo ""
53 einfo "Please edit /etc/fail2ban.conf with parameters"
54 einfo "which correspond to your system."
55 echo ""
56 }
57
58 --
59 Christophe Garault
60
61
62 --
63 gentoo-security@g.o mailing list