summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkos Chandras <hwoarang@gentoo.org>2010-12-02 21:53:04 +0000
committerMarkos Chandras <hwoarang@gentoo.org>2010-12-02 21:53:04 +0000
commit61582b6dae979427599c8b73527e5ba99c7b86d6 (patch)
treeaf2bc19b6b569f3965ab74dcbeff0e4fe3751d8b /net-analyzer
parentInstall pc files for threads (diff)
downloadgentoo-2-61582b6dae979427599c8b73527e5ba99c7b86d6.tar.gz
gentoo-2-61582b6dae979427599c8b73527e5ba99c7b86d6.tar.bz2
gentoo-2-61582b6dae979427599c8b73527e5ba99c7b86d6.zip
Create /var/run/fail2ban on runtime and remove stalled sock file in case of system crash. Thanks to Michael Lorant <mikel@mlvision.com.au>. Bug #347477. Taking over maintainership
(Portage version: 2.2.0_alpha6/cvs/Linux x86_64)
Diffstat (limited to 'net-analyzer')
-rw-r--r--net-analyzer/fail2ban/ChangeLog10
-rw-r--r--net-analyzer/fail2ban/fail2ban-0.8.4-r2.ebuild63
-rw-r--r--net-analyzer/fail2ban/files/gentoo-initd_create_run_dir.patch19
-rw-r--r--net-analyzer/fail2ban/metadata.xml4
4 files changed, 95 insertions, 1 deletions
diff --git a/net-analyzer/fail2ban/ChangeLog b/net-analyzer/fail2ban/ChangeLog
index fb3f027070c5..18fa8cf590fa 100644
--- a/net-analyzer/fail2ban/ChangeLog
+++ b/net-analyzer/fail2ban/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-analyzer/fail2ban
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/fail2ban/ChangeLog,v 1.59 2010/11/05 15:05:51 hwoarang Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/fail2ban/ChangeLog,v 1.60 2010/12/02 21:53:01 hwoarang Exp $
+
+*fail2ban-0.8.4-r2 (02 Dec 2010)
+
+ 02 Dec 2010; Markos Chandras <hwoarang@gentoo.org> +fail2ban-0.8.4-r2.ebuild,
+ +files/gentoo-initd_create_run_dir.patch, metadata.xml:
+ Create /var/run/fail2ban on runtime and remove stalled sock file in case of
+ system crash. Thanks to Michael Lorant <mikel@mlvision.com.au>. Bug #347477.
+ Taking over maintainership
*fail2ban-0.8.4-r1 (05 Nov 2010)
diff --git a/net-analyzer/fail2ban/fail2ban-0.8.4-r2.ebuild b/net-analyzer/fail2ban/fail2ban-0.8.4-r2.ebuild
new file mode 100644
index 000000000000..a923a9edac7a
--- /dev/null
+++ b/net-analyzer/fail2ban/fail2ban-0.8.4-r2.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/fail2ban/fail2ban-0.8.4-r2.ebuild,v 1.1 2010/12/02 21:53:03 hwoarang Exp $
+
+EAPI=2
+
+PYTHON_DEPEND="2"
+
+inherit distutils eutils
+
+DESCRIPTION="Bans IP that make too many password failures"
+HOMEPAGE="http://fail2ban.sourceforge.net/"
+SRC_URI="mirror://sourceforge/fail2ban/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+IUSE=""
+
+RDEPEND="net-misc/whois
+ virtual/mta
+ net-firewall/iptables"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-hashlib.patch \
+ "${FILESDIR}"/${P}-sshd-breakin.patch \
+ "${FILESDIR}"/gentoo-initd_create_run_dir.patch
+ distutils_src_prepare
+}
+
+src_install() {
+ distutils_src_install
+
+ newconfd files/gentoo-confd fail2ban
+ newinitd files/gentoo-initd fail2ban
+ dodoc ChangeLog README TODO || die "dodoc failed"
+ doman man/*.1 || die "doman failed"
+
+ # Use INSTALL_MASK if you do not want to touch /etc/logrotate.d.
+ # See http://thread.gmane.org/gmane.linux.gentoo.devel/35675
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/${PN}-logrotate ${PN} || die
+}
+
+pkg_preinst() {
+ has_version "<${CATEGORY}/${PN}-0.7"
+ previous_less_than_0_7=$?
+}
+
+pkg_postinst() {
+ if [[ $previous_less_than_0_7 = 0 ]] ; then
+ elog
+ elog "Configuration files are now in /etc/fail2ban/"
+ elog "You probably have to manually update your configuration"
+ elog "files before restarting Fail2ban!"
+ elog
+ elog "Fail2ban is not installed under /usr/lib anymore. The"
+ elog "new location is under /usr/share."
+ elog
+ elog "You are upgrading from version 0.6.x, please see:"
+ elog "http://www.fail2ban.org/wiki/index.php/HOWTO_Upgrade_from_0.6_to_0.8"
+ fi
+}
diff --git a/net-analyzer/fail2ban/files/gentoo-initd_create_run_dir.patch b/net-analyzer/fail2ban/files/gentoo-initd_create_run_dir.patch
new file mode 100644
index 000000000000..79a947956e37
--- /dev/null
+++ b/net-analyzer/fail2ban/files/gentoo-initd_create_run_dir.patch
@@ -0,0 +1,19 @@
+Index: fail2ban-0.8.4/files/gentoo-initd
+===================================================================
+--- fail2ban-0.8.4.orig/files/gentoo-initd
++++ fail2ban-0.8.4/files/gentoo-initd
+@@ -31,6 +31,14 @@ depend() {
+
+ start() {
+ ebegin "Starting fail2ban"
++ if [ ! -d /var/run/fail2ban ]; then
++ mkdir /var/run/fail2ban || return 1
++ fi
++ if [ -e /var/run/fail2ban/fail2ban.sock ]; then
++ # remove stalled sock file after system crash
++ # bug 347477
++ rm -rf /var/run/fail2ban/fail2ban.sock || return 1
++ fi
+ ${FAIL2BAN} start &> /dev/null
+ eend $? "Failed to start fail2ban"
+ }
diff --git a/net-analyzer/fail2ban/metadata.xml b/net-analyzer/fail2ban/metadata.xml
index 03aa50bab7e3..9a576395d83e 100644
--- a/net-analyzer/fail2ban/metadata.xml
+++ b/net-analyzer/fail2ban/metadata.xml
@@ -2,4 +2,8 @@
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<herd>netmon</herd>
+<maintainer>
+ <email>hwoarang@gentoo.org</email>
+ <name>Markos Chandras</name>
+</maintainer>
</pkgmetadata>