summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-firewall/fwknop
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-firewall/fwknop')
-rw-r--r--net-firewall/fwknop/Manifest1
-rw-r--r--net-firewall/fwknop/files/fwknopd.confd21
-rw-r--r--net-firewall/fwknop/files/fwknopd.init92
-rw-r--r--net-firewall/fwknop/files/fwknopd.service12
-rw-r--r--net-firewall/fwknop/files/fwknopd.tmpfiles.conf1
-rw-r--r--net-firewall/fwknop/fwknop-2.6.6-r1.ebuild105
-rw-r--r--net-firewall/fwknop/metadata.xml20
7 files changed, 252 insertions, 0 deletions
diff --git a/net-firewall/fwknop/Manifest b/net-firewall/fwknop/Manifest
new file mode 100644
index 000000000000..ae32b6f25adc
--- /dev/null
+++ b/net-firewall/fwknop/Manifest
@@ -0,0 +1 @@
+DIST fwknop-2.6.6.tar.gz 2433846 SHA256 724e986b6bc47d3b6f5ba5c9232e2b411ae8ef4b2e8f7fffd16210c20d3be932 SHA512 ccd25701908a1bc653b59571013f0953ee40c967537b68cfaff48e1eea4fde11402712f70f07db308f7a37cfd49ef8ad11b1535d3012cf32e09cc677673c067f WHIRLPOOL df8025e8a2551e0485473715bc10fef31b373f38293b8f8f678aa7ec03f9fbe353a089cfbdbb783e5972b917313f4a90edfac4557e53bd962df6d8ba0e9fca2e
diff --git a/net-firewall/fwknop/files/fwknopd.confd b/net-firewall/fwknop/files/fwknopd.confd
new file mode 100644
index 000000000000..63bcd01dd82f
--- /dev/null
+++ b/net-firewall/fwknop/files/fwknopd.confd
@@ -0,0 +1,21 @@
+# /etc/conf.d/fwknopd: config file for /etc/init.d/fwknopd
+
+# Path to the fwknopd config directory (needs to be an absolute path).
+
+FWKNOPD_CONFDIR="/etc/fwknop"
+
+
+# Additional options to pass to fwknopd.
+# Refer to the fwknopd(8) manpage for more information.
+
+#FWKNOPD_OPTS=""
+
+
+# Pid file to use (needs to be an absolute path).
+
+#FWKNOPD_PIDFILE="/run/fwknop/fwknopd.pid"
+
+
+# Path to the fwknopd binary (needs to be an absolute path).
+
+#FWKNOPD_BINARY="/usr/sbin/fwknopd"
diff --git a/net-firewall/fwknop/files/fwknopd.init b/net-firewall/fwknop/files/fwknopd.init
new file mode 100644
index 000000000000..232e1fc7b053
--- /dev/null
+++ b/net-firewall/fwknop/files/fwknopd.init
@@ -0,0 +1,92 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_commands="checkconfig"
+extra_started_commands="reload"
+
+: ${FWKNOPD_BINARY:=/usr/sbin/fwknopd}
+: ${FWKNOPD_CONFDIR:=/etc/fwknop}
+: ${FWKNOPD_CONFIG:=${FWKNOPD_CONFDIR}/fwknopd.conf}
+: ${FWKNOPD_PIDFILE:=/run/fwknop/${SVCNAME}.pid}
+
+depend() {
+ after iptables ip6tables ebtables firewall
+ use logger
+ if [ "${rc_need+set}" = "set" ]; then
+ : # Do nothing, the user has explicitly set rc_need
+ else
+ local x warn_intf
+ for x in $(awk '/^PCAP_INTF/{ sub(";$", ""); print $2 }' "${FWKNOPD_CONFIG}" 2>/dev/null); do
+ warn_intf="${warn_intf} ${x}"
+ done
+ if [ -n "${warn_intf}" ]; then
+ need net
+ ewarn "You are binding an interface in PCAP_INTF statement in your fwknopd.conf!"
+ ewarn "You must add rc_need=\"net.FOO\" to your /etc/conf.d/${SVCNAME},"
+ ewarn "where FOO is the following interface(s):"
+ ewarn "${warn_intf}"
+ else
+ # if PCAP_INTF and PCAP_FILE are not set, then fwknopd uses eth0
+ if ! grep -q '^PCAP_FILE' "${FWKNOPD_CONFIG}"; then
+ need net
+ ewarn "You are not binding any interface in PCAP_INTF statement in your fwknopd.conf,"
+ ewarn "neither you are providing PCAP_FILE option. Thus fwknopd will listen on eth0."
+ ewarn "You must add rc_need=\"net.eth0\" to your /etc/conf.d/${SVCNAME}."
+ fi
+ fi
+ fi
+}
+
+checkconfig() {
+ if [ ! -e "${FWKNOPD_CONFDIR}"/fwknopd.conf ]; then
+ eerror "You need ${FWKNOPD_CONFDIR}/fwknopd.conf file to run fwknopd"
+ eerror "Example is located at /etc/fwknop/fwknopd.conf.example"
+ return 1
+ fi
+
+ if [ ! -e "${FWKNOPD_CONFDIR}"/access.conf ]; then
+ eerror "You need ${FWKNOPD_CONFDIR}/access.conf file to run fwknopd"
+ eerror "Example is located at /etc/fwknop/access.conf.example"
+ return 1
+ fi
+
+ [ "${FWKNOPD_PIDFILE}" != "/run/fwknop/${SVCNAME}.pid" ] \
+ && FWKNOPD_OPTS="${FWKNOPD_OPTS} --pid-file=${FWKNOPD_PIDFILE}"
+
+ [ "${FWKNOPD_CONFDIR}" != "/etc/fwknop" ] \
+ && FWKNOPD_OPTS="${FWKNOPD_OPTS} \
+ --config=${FWKNOPD_CONFDIR}/fwknopd.conf \
+ --access-file=${FWKNOPD_CONFDIR}/access.conf"
+
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start \
+ --exec ${FWKNOPD_BINARY} --pidfile ${FWKNOPD_PIDFILE} \
+ -- ${FWKNOPD_OPTS}
+ eend $?
+}
+
+stop() {
+ if [ "${RC_CMD}" = "restart" ]; then
+ checkconfig || return 1
+ fi
+
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --pidfile ${FWKNOPD_PIDFILE}
+ eend $?
+}
+
+reload() {
+ checkconfig || return 1
+
+ ebegin "Reloading ${SVCNAME} configuration"
+ start-stop-daemon --signal HUP --pidfile ${FWKNOPD_PIDFILE}
+ eend $?
+}
diff --git a/net-firewall/fwknop/files/fwknopd.service b/net-firewall/fwknop/files/fwknopd.service
new file mode 100644
index 000000000000..d2e8c3125200
--- /dev/null
+++ b/net-firewall/fwknop/files/fwknopd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Firewall Knock Operator Daemon
+After=network-online.target
+
+[Service]
+Type=forking
+PIDFile=/run/fwknop/fwknopd.pid
+ExecStart=/usr/sbin/fwknopd
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-firewall/fwknop/files/fwknopd.tmpfiles.conf b/net-firewall/fwknop/files/fwknopd.tmpfiles.conf
new file mode 100644
index 000000000000..b7cb3856b056
--- /dev/null
+++ b/net-firewall/fwknop/files/fwknopd.tmpfiles.conf
@@ -0,0 +1 @@
+d /run/fwknop 0700 root root -
diff --git a/net-firewall/fwknop/fwknop-2.6.6-r1.ebuild b/net-firewall/fwknop/fwknop-2.6.6-r1.ebuild
new file mode 100644
index 000000000000..7fcc35d6ce5f
--- /dev/null
+++ b/net-firewall/fwknop/fwknop-2.6.6-r1.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+# Does work with python2_7, does not work with python3_3 on my machine
+# More feedback is welcome, since setup.py does not provide any info
+PYTHON_COMPAT=( python2_7 )
+DISTUTILS_OPTIONAL=1
+DISTUTILS_SINGLE_IMPL=1
+AUTOTOOLS_AUTORECONF=1
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+inherit autotools-utils distutils-r1 systemd
+
+DESCRIPTION="Single Packet Authorization and Port Knocking application"
+HOMEPAGE="http://www.cipherdyne.org/fwknop/"
+SRC_URI="https://github.com/mrash/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="client extras gdbm gpg python server udp-server"
+
+RDEPEND="
+ client? ( net-misc/wget[ssl] )
+ gpg? (
+ dev-libs/libassuan
+ dev-libs/libgpg-error
+ )
+ python? ( ${PYTHON_DEPS} )
+"
+DEPEND="${RDEPEND}
+ gdbm? ( sys-libs/gdbm )
+ gpg? ( app-crypt/gpgme )
+ server? (
+ !udp-server? ( net-libs/libpcap )
+ net-firewall/iptables
+ )
+"
+
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ udp-server? ( server )
+"
+
+DOCS=( ChangeLog README.md )
+
+src_prepare() {
+ # Install example configs with .example suffix
+ if use server; then
+ sed -i 's/conf;/conf.example;/g' "${S}"/Makefile.am || die
+ fi
+
+ autotools-utils_src_prepare
+
+ if use python; then
+ cd "${S}"/python || die
+ distutils-r1_src_prepare
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ --localstatedir=/run
+ --enable-digest-cache
+ $(use_enable client)
+ $(use_enable !gdbm file-cache)
+ $(use_enable server)
+ $(use_enable udp-server)
+ $(use_with gpg gpgme)
+ )
+ autotools-utils_src_configure
+}
+
+src_compile() {
+ autotools-utils_src_compile
+
+ if use python; then
+ cd "${S}"/python || die
+ distutils-r1_src_compile
+ fi
+}
+
+src_install() {
+ autotools-utils_src_install
+ prune_libtool_files --modules
+
+ if use server; then
+ newinitd "${FILESDIR}/fwknopd.init" fwknopd
+ newconfd "${FILESDIR}/fwknopd.confd" fwknopd
+ systemd_dounit "${FILESDIR}/fwknopd.service"
+ systemd_newtmpfilesd "${FILESDIR}/fwknopd.tmpfiles.conf" fwknopd.conf
+ fi
+
+ use extras && dodoc "${S}/extras/apparmor/usr.sbin.fwknopd"
+
+ if use python; then
+ # Unset DOCS since distutils-r1.eclass interferes
+ local DOCS=()
+ cd "${S}"/python || die
+ distutils-r1_src_install
+ fi
+}
diff --git a/net-firewall/fwknop/metadata.xml b/net-firewall/fwknop/metadata.xml
new file mode 100644
index 000000000000..79031c2f7e61
--- /dev/null
+++ b/net-firewall/fwknop/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>itumaykin@gmail.com</email>
+ <name>Coacher</name>
+ </maintainer>
+ <use>
+ <flag name="client">Build fwknop client</flag>
+ <flag name="gdbm">Replace file digest-cache with gdbm</flag>
+ <flag name="gpg">Enable GPG support via <pkg>app-crypt/gpgme</pkg></flag>
+ <flag name="server">Build fwknopd server</flag>
+ <flag name="extras">Install example apparmor policy</flag>
+ <flag name="udp-server">Build fwknopd with UDP server mode only</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">mrash/fwknop</remote-id>
+ </upstream>
+</pkgmetadata>