commit:     25e131ac86f3f6ba433a4d0d01b216de8036940d
Author:     Robert Förster <Dessa <AT> gmake <DOT> de>
AuthorDate: Mon May 29 11:13:26 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul 14 22:05:22 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25e131ac

net-misc/oidentd: bump to EAPI 6, add fedora masquerading patches

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

 .../files/oidentd-2.0.8-bind-to-ipv6-too.patch     |  4 +-
 .../files/oidentd-2.0.8-log-conntrack-fails.patch  | 52 ++++++++++++++++++++++
 .../oidentd-2.0.8-no-conntrack-masquerading.patch  | 41 +++++++++++++++++
 net-misc/oidentd/metadata.xml                      | 20 ++++++---
 net-misc/oidentd/oidentd-2.0.8-r5.ebuild           | 12 +++--
 ...ntd-2.0.8-r5.ebuild => oidentd-2.0.8-r6.ebuild} | 38 +++++++++++-----
 6 files changed, 143 insertions(+), 24 deletions(-)

diff --git a/net-misc/oidentd/files/oidentd-2.0.8-bind-to-ipv6-too.patch 
b/net-misc/oidentd/files/oidentd-2.0.8-bind-to-ipv6-too.patch
index b3b0e510033..2652622cdd4 100644
--- a/net-misc/oidentd/files/oidentd-2.0.8-bind-to-ipv6-too.patch
+++ b/net-misc/oidentd/files/oidentd-2.0.8-bind-to-ipv6-too.patch
@@ -1,7 +1,7 @@
 Patch to bind to ipv6 socket as well
 Patch supplied by Fabian Knittel <[email protected]>
---- 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
index 00000000000..d29479ec028
--- /dev/null
+++ b/net-misc/oidentd/files/oidentd-2.0.8-log-conntrack-fails.patch
@@ -0,0 +1,52 @@
+From 612f1d85dd59fc39b124392df38586769ebc8add Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <[email protected]>
+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ř <[email protected]>
+---
+ 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
index 00000000000..92ef0252316
--- /dev/null
+++ b/net-misc/oidentd/files/oidentd-2.0.8-no-conntrack-masquerading.patch
@@ -0,0 +1,41 @@
+From 20a63ad8a90c36397cceedd34887298890dbafa3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <[email protected]>
+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ř <[email protected]>
+---
+ 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
+

diff --git a/net-misc/oidentd/metadata.xml b/net-misc/oidentd/metadata.xml
index d2a75a6ff73..3be9f1f5f13 100644
--- a/net-misc/oidentd/metadata.xml
+++ b/net-misc/oidentd/metadata.xml
@@ -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>[email protected]</email>
+               <name>Robert Förster</name>
+       </maintainer>
+       <maintainer type="project">
+               <email>[email protected]</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>

diff --git a/net-misc/oidentd/oidentd-2.0.8-r5.ebuild 
b/net-misc/oidentd/oidentd-2.0.8-r5.ebuild
index 52eef485cdc..1a328a04f7a 100644
--- a/net-misc/oidentd/oidentd-2.0.8-r5.ebuild
+++ b/net-misc/oidentd/oidentd-2.0.8-r5.ebuild
@@ -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-r5.ebuild 
b/net-misc/oidentd/oidentd-2.0.8-r6.ebuild
similarity index 52%
copy from net-misc/oidentd/oidentd-2.0.8-r5.ebuild
copy to net-misc/oidentd/oidentd-2.0.8-r6.ebuild
index 52eef485cdc..5330a191234 100644
--- a/net-misc/oidentd/oidentd-2.0.8-r5.ebuild
+++ b/net-misc/oidentd/oidentd-2.0.8-r6.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=6
 
-inherit eutils systemd
+inherit linux-info systemd
 
 DESCRIPTION="Another (RFC1413 compliant) ident daemon"
 HOMEPAGE="http://ojnk.sourceforge.net/";
@@ -11,13 +11,30 @@ 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"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~s390 ~sh ~sparc ~x86 
~x86-fbsd"
+IUSE="debug ipv6 masquerade selinux"
 
-src_prepare() {
-       epatch "${FILESDIR}/${P}-masquerading.patch" \
-               "${FILESDIR}/${P}-bind-to-ipv6-too.patch" \
-               "${FILESDIR}/${P}-gcc5.patch"
+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() {
@@ -31,9 +48,6 @@ src_configure() {
 src_install() {
        default
 
-       dodoc AUTHORS ChangeLog README TODO NEWS \
-               "${FILESDIR}"/${PN}_masq.conf "${FILESDIR}"/${PN}.conf
-
        newinitd "${FILESDIR}"/${PN}-2.0.7-init ${PN}
        newconfd "${FILESDIR}"/${PN}-2.0.7-confd ${PN}
 

Reply via email to