net-misc/oidentd: bump to EAPI 6, add fedora masquerading patches
authorRobert Förster <Dessa@gmake.de>
Mon, 29 May 2017 11:13:26 +0000 (13:13 +0200)
committerMichał Górny <mgorny@gentoo.org>
Fri, 14 Jul 2017 22:05:22 +0000 (00:05 +0200)
also adding a dependency on the selinux policy for this package,
as well as adding myself as maintainer

Closes: https://github.com/gentoo/gentoo/pull/4611
Package-Manager: Portage-2.3.6, Repoman-2.3.2

net-misc/oidentd/files/oidentd-2.0.8-bind-to-ipv6-too.patch
net-misc/oidentd/files/oidentd-2.0.8-log-conntrack-fails.patch [new file with mode: 0644]
net-misc/oidentd/files/oidentd-2.0.8-no-conntrack-masquerading.patch [new file with mode: 0644]
net-misc/oidentd/metadata.xml
net-misc/oidentd/oidentd-2.0.8-r5.ebuild
net-misc/oidentd/oidentd-2.0.8-r6.ebuild [new file with mode: 0644]

index b3b0e5100337434e61828acf4884b9bf41634f47..2652622cdd4f25125da0d8015519be2413c7f5b7 100644 (file)
@@ -1,7 +1,7 @@
 Patch to bind to ipv6 socket as well
 Patch supplied by Fabian Knittel <fabian.knittel@avona.com>
---- oidentd-2.0.8//src/oidentd_inet_util.c     2006-05-22 02:31:19.000000000 +0200
-+++ oidentd-2.0.8.new//src/oidentd_inet_util.c 2010-03-01 20:26:11.000000000 +0100
+--- oidentd-2.0.8/src/oidentd_inet_util.c      2006-05-22 02:31:19.000000000 +0200
++++ oidentd-2.0.8.new/src/oidentd_inet_util.c  2010-03-01 20:26:11.000000000 +0100
 @@ -60,6 +60,12 @@
  #ifdef WANT_IPV6
                case AF_INET6:
diff --git a/net-misc/oidentd/files/oidentd-2.0.8-log-conntrack-fails.patch b/net-misc/oidentd/files/oidentd-2.0.8-log-conntrack-fails.patch
new file mode 100644 (file)
index 0000000..d29479e
--- /dev/null
@@ -0,0 +1,52 @@
+From 612f1d85dd59fc39b124392df38586769ebc8add Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Fri, 11 Mar 2016 10:00:59 +0100
+Subject: [PATCH] Log Linux core_init failures as normal error
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Opening Linux conntracking table file failure for different reason than
+missing the file is fatal for deamon initizalization. But the failure
+was logged inly in debugging build.
+
+This patch makes the fatal error visible in normal log.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1316308
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ src/kernel/linux.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/kernel/linux.c b/src/kernel/linux.c
+index 8bf265f..9103dbf 100644
+--- a/src/kernel/linux.c
++++ b/src/kernel/linux.c
+@@ -73,21 +73,21 @@ bool core_init(void) {
+       masq_fp = fopen(MASQFILE, "r");
+       if (masq_fp == NULL) {
+               if (errno != ENOENT) {
+-                      debug("fopen: %s: %s", MASQFILE, strerror(errno));
++                      o_log(NORMAL, "fopen: %s: %s", MASQFILE, strerror(errno));
+                       return false;
+               }
+ 
+               masq_fp = fopen(CONNTRACK, "r");
+               if (masq_fp == NULL) {
+                       if (errno != ENOENT) {
+-                              debug("fopen: %s: %s", CONNTRACK, strerror(errno));
++                              o_log(NORMAL, "fopen: %s: %s", CONNTRACK, strerror(errno));
+                               return false;
+                       }
+ 
+                       masq_fp = fopen(NFCONNTRACK, "r");
+                       if (masq_fp == NULL) {
+                               if (errno != ENOENT) {
+-                                      debug("fopen: %s: %s", NFCONNTRACK, strerror(errno));
++                                      o_log(NORMAL, "fopen: %s: %s", NFCONNTRACK, strerror(errno));
+                                       return false;
+                               }
+                               masq_fp = fopen("/dev/null", "r");
+-- 
+2.5.0
+
diff --git a/net-misc/oidentd/files/oidentd-2.0.8-no-conntrack-masquerading.patch b/net-misc/oidentd/files/oidentd-2.0.8-no-conntrack-masquerading.patch
new file mode 100644 (file)
index 0000000..92ef025
--- /dev/null
@@ -0,0 +1,41 @@
+From 20a63ad8a90c36397cceedd34887298890dbafa3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Fri, 11 Mar 2016 10:38:10 +0100
+Subject: [PATCH] Linux: Do not open conntracking table if masquerading is not
+ enabled
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The contracking table was always opened. This is unnecessary because
+the table is used only when masquerading feature is requested on run
+time.
+
+This patch skips opening the conntracking table on Linux if
+masquerading is not requested.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1316308
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ src/kernel/linux.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/kernel/linux.c b/src/kernel/linux.c
+index 9103dbf..859f554 100644
+--- a/src/kernel/linux.c
++++ b/src/kernel/linux.c
+@@ -70,6 +70,11 @@ bool netfilter;
+ */
+ bool core_init(void) {
+ #ifdef MASQ_SUPPORT
++      if (!opt_enabled(MASQ)) {
++          masq_fp = NULL;
++          return true;
++      }
++
+       masq_fp = fopen(MASQFILE, "r");
+       if (masq_fp == NULL) {
+               if (errno != ENOENT) {
+-- 
+2.5.0
+
index d2a75a6ff73b55f1436d5fdf4c3b64794608afdc..3be9f1f5f13d2b641d41197ade4cad5928212ab8 100644 (file)
@@ -1,10 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-  <use>
-    <flag name="masquerade">Enable support for masqueraded/NAT connections</flag>
-  </use>
-  <upstream>
-    <remote-id type="sourceforge">ojnk</remote-id>
-  </upstream>
+       <maintainer type="person">
+               <email>Dessa@gmake.de</email>
+               <name>Robert Förster</name>
+       </maintainer>
+       <maintainer type="project">
+               <email>proxy-maint@gentoo.org</email>
+               <name>Proxy Maintainers</name>
+       </maintainer>
+       <use>
+               <flag name="masquerade">Enable support for masqueraded/NAT connections</flag>
+       </use>
+       <upstream>
+               <remote-id type="sourceforge">ojnk</remote-id>
+       </upstream>
 </pkgmetadata>
index 52eef485cdc280d3cbd4f29a47984bc8f9308b40..1a328a04f7ab54f87ad5d46f52799a1394ec26cc 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=5
@@ -14,10 +14,14 @@ SLOT="0"
 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ~s390 ~sh sparc x86 ~x86-fbsd"
 IUSE="debug ipv6 masquerade"
 
+PATCHES=(
+       "${FILESDIR}/${P}-masquerading.patch"
+       "${FILESDIR}/${P}-bind-to-ipv6-too.patch"
+       "${FILESDIR}/${P}-gcc5.patch"
+)
+
 src_prepare() {
-       epatch "${FILESDIR}/${P}-masquerading.patch" \
-               "${FILESDIR}/${P}-bind-to-ipv6-too.patch" \
-               "${FILESDIR}/${P}-gcc5.patch"
+       epatch -p1 "${PATCHES[@]}"
 }
 
 src_configure() {
diff --git a/net-misc/oidentd/oidentd-2.0.8-r6.ebuild b/net-misc/oidentd/oidentd-2.0.8-r6.ebuild
new file mode 100644 (file)
index 0000000..5330a19
--- /dev/null
@@ -0,0 +1,63 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit linux-info systemd
+
+DESCRIPTION="Another (RFC1413 compliant) ident daemon"
+HOMEPAGE="http://ojnk.sourceforge.net/"
+SRC_URI="mirror://sourceforge/ojnk/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="debug ipv6 masquerade selinux"
+
+DEPEND=""
+
+RDEPEND="${DEPEND}
+       selinux? ( sec-policy/selinux-oident )"
+
+DOCS=( AUTHORS ChangeLog README TODO NEWS "${FILESDIR}"/${PN}_masq.conf "${FILESDIR}"/${PN}.conf )
+
+PATCHES=(
+       "${FILESDIR}/${P}-masquerading.patch"
+       "${FILESDIR}/${P}-bind-to-ipv6-too.patch"
+       "${FILESDIR}/${P}-gcc5.patch"
+       "${FILESDIR}/${P}-log-conntrack-fails.patch"
+       "${FILESDIR}/${P}-no-conntrack-masquerading.patch"
+)
+
+pkg_setup() {
+       local CONFIG_CHECK="~INET_TCP_DIAG"
+
+       if use kernel_linux; then
+               linux-info_pkg_setup
+       fi
+}
+
+src_configure() {
+       econf \
+               $(use_enable debug) \
+               $(use_enable ipv6) \
+               $(use_enable masquerade masq) \
+               $(use_enable masquerade nat)
+}
+
+src_install() {
+       default
+
+       newinitd "${FILESDIR}"/${PN}-2.0.7-init ${PN}
+       newconfd "${FILESDIR}"/${PN}-2.0.7-confd ${PN}
+
+       systemd_newunit "${FILESDIR}"/${PN}_at.service ${PN}@.service
+       systemd_dounit "${FILESDIR}"/${PN}.socket
+       systemd_dounit "${FILESDIR}"/${PN}.service
+}
+
+pkg_postinst() {
+       echo
+       elog "Example configuration files are in /usr/share/doc/${PF}"
+       echo
+}