summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weber <xmw@gentoo.org>2012-02-15 18:21:36 +0000
committerMichael Weber <xmw@gentoo.org>2012-02-15 18:21:36 +0000
commit5d14aebd6d2369da6b59f470eb7a34627f6474c7 (patch)
tree324e411df653fb885b0c7d27a3b994e66e727bf1 /net-misc/knock
parentAdd long description (diff)
downloadgentoo-2-5d14aebd6d2369da6b59f470eb7a34627f6474c7.tar.gz
gentoo-2-5d14aebd6d2369da6b59f470eb7a34627f6474c7.tar.bz2
gentoo-2-5d14aebd6d2369da6b59f470eb7a34627f6474c7.zip
Revbump to fix buildsystem problems and adept to openrc (thanks Diego Elio Pettenò for the updates, bug 403925)
(Portage version: 2.1.10.44/cvs/Linux x86_64)
Diffstat (limited to 'net-misc/knock')
-rw-r--r--net-misc/knock/ChangeLog11
-rw-r--r--net-misc/knock/files/knockd.confd.29
-rw-r--r--net-misc/knock/files/knockd.initd.225
-rw-r--r--net-misc/knock/knock-0.5-r2.ebuild57
4 files changed, 100 insertions, 2 deletions
diff --git a/net-misc/knock/ChangeLog b/net-misc/knock/ChangeLog
index f853a9eefb7f..f65ce317f198 100644
--- a/net-misc/knock/ChangeLog
+++ b/net-misc/knock/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-misc/knock
-# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/knock/ChangeLog,v 1.41 2011/12/21 08:39:56 phajdan.jr Exp $
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/knock/ChangeLog,v 1.42 2012/02/15 18:21:36 xmw Exp $
+
+*knock-0.5-r2 (15 Feb 2012)
+
+ 15 Feb 2012; Michael Weber <xmw@gentoo.org> +knock-0.5-r2.ebuild,
+ +files/knockd.confd.2, +files/knockd.initd.2:
+ Revbump to fix buildsystem problems and adept to openrc (thanks Diego Elio
+ Pettenò for the updates, bug 403925)
21 Dec 2011; Pawel Hajdan jr <phajdan.jr@gentoo.org> knock-0.5-r1.ebuild:
x86 stable wrt bug #393985
diff --git a/net-misc/knock/files/knockd.confd.2 b/net-misc/knock/files/knockd.confd.2
new file mode 100644
index 000000000000..8aafe7551086
--- /dev/null
+++ b/net-misc/knock/files/knockd.confd.2
@@ -0,0 +1,9 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/knock/files/knockd.confd.2,v 1.1 2012/02/15 18:21:36 xmw Exp $
+
+# interface to listen to
+IFACE="eth0"
+
+# extra options for knockd daemon
+OPTS=""
diff --git a/net-misc/knock/files/knockd.initd.2 b/net-misc/knock/files/knockd.initd.2
new file mode 100644
index 000000000000..447a2de59af7
--- /dev/null
+++ b/net-misc/knock/files/knockd.initd.2
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/net-misc/knock/files/knockd.initd.2,v 1.1 2012/02/15 18:21:36 xmw Exp $
+
+: ${CONFIGFILE:=/etc/knockd.conf}
+: ${IFACE:=eth0}
+
+get_config() {
+ [ -f ${CONFIGFILE} ] && conf=$(awk 'tolower($1) == "'$1'" { print $3 }' ${CONFIGFILE})
+
+ echo ${conf:-$2}
+}
+
+depend() {
+ need net
+ use net.${IFACE}
+
+ [ "$(get_config usesyslog no)" != "no" ] && use logger
+}
+
+pidfile=$(get_config pidfile /var/run/knockd.pid)
+
+command=/usr/sbin/knockd
+command_args="-d -i ${IFACE} ${OPTS}"
diff --git a/net-misc/knock/knock-0.5-r2.ebuild b/net-misc/knock/knock-0.5-r2.ebuild
new file mode 100644
index 000000000000..21f00e68e905
--- /dev/null
+++ b/net-misc/knock/knock-0.5-r2.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/knock/knock-0.5-r2.ebuild,v 1.1 2012/02/15 18:21:36 xmw Exp $
+
+EAPI=4
+
+inherit eutils
+
+DESCRIPTION="A simple port-knocking daemon"
+HOMEPAGE="http://www.zeroflux.org/projects/knock"
+SRC_URI="http://www.zeroflux.org/proj/knock/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+IUSE="+server"
+
+DEPEND="server? ( net-libs/libpcap )"
+RDEPEND="${DEPEND}
+ server? ( sys-apps/openrc )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gcc-4.3.patch
+
+ sed -i -e "s:/usr/sbin/iptables:/sbin/iptables:g" knockd.conf || die
+
+ if ! use server ; then
+ sed -i -e '/^all:/s:knockd::' \
+ -e '/$(INSTALL).*knockd/d' Makefile.in || die
+ fi
+}
+
+src_compile() {
+ # package does stupid stuff with CXXFLAGS, and is actually pure C.
+ export CXXFLAGS="${CFLAGS}"
+ default_src_compile
+}
+
+DOCS=( ChangeLog README TODO )
+
+src_install() {
+ default_src_install
+
+ if use server ; then
+ newinitd "${FILESDIR}"/knockd.initd.2 knock
+ newconfd "${FILESDIR}"/knockd.confd.2 knock
+ fi
+}
+
+pkg_postinst() {
+ if use server && ! has_version net-firewall/iptables ; then
+ einfo
+ elog "You're really encouraged to install net-firewall/iptables to"
+ elog "actually modify your firewall and use the example configuration."
+ einfo
+ fi
+}