net-vpn/isatapd: Fix compilation with current kernels
authorPacho Ramos <pacho@gentoo.org>
Sun, 24 Feb 2019 09:48:36 +0000 (10:48 +0100)
committerPacho Ramos <pacho@gentoo.org>
Sun, 24 Feb 2019 10:53:05 +0000 (11:53 +0100)
Closes: https://bugs.gentoo.org/599756
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Pacho Ramos <pacho@gentoo.org>
net-vpn/isatapd/files/isatapd-linux-4.8.patch [new file with mode: 0644]
net-vpn/isatapd/isatapd-0.9.7-r2.ebuild

diff --git a/net-vpn/isatapd/files/isatapd-linux-4.8.patch b/net-vpn/isatapd/files/isatapd-linux-4.8.patch
new file mode 100644 (file)
index 0000000..a95fe15
--- /dev/null
@@ -0,0 +1,25 @@
+From: Bernhard Schmidt <berni@debian.org>
+Subject: Fix FTBFS with headers from Linux 4.8+
+Bug-Debian: https://bugs.debian.org/844869
+
+Linux 4.8+ adds a few includes to linux/if_tunnel.h, which conflict with
+concurrent use of netinet/ip.h. Drop the latter and manually define IP_DF
+which is not found anywhere else
+--- a/src/tunnel.c
++++ b/src/tunnel.c
+@@ -18,10 +18,13 @@
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+ #include <arpa/inet.h>
+-#include <netinet/ip.h>
+ #include <net/if.h>
+ #include <linux/if_tunnel.h>
+ 
++#ifndef IP_DF
++      #define IP_DF   0x4000          /* dont fragment flag */
++#endif
++
+ #ifdef HAVE_CONFIG_H
+       #include <config.h>
+ #endif
+
index 9474bf9461e8a64d28863198f7dc44d783fff953..210a012e953262a6f1566e35b72f09194e752ef3 100644 (file)
@@ -1,10 +1,10 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=7
 inherit linux-info systemd
 
-DESCRIPTION="creates and maintains an ISATAP tunnel (rfc5214)"
+DESCRIPTION="Creates and maintains an ISATAP tunnel (rfc5214)"
 HOMEPAGE="http://www.saschahlusiak.de/linux/isatap.htm"
 SRC_URI="http://www.saschahlusiak.de/linux/${P}.tar.gz"
 
@@ -19,9 +19,14 @@ RDEPEND=""
 CONFIG_CHECK="~TUN"
 ERROR_TUN="CONFIG_TUN is needed for isatapd to work"
 
+PATCHES=( "${FILESDIR}"/${PN}-linux-4.8.patch )
+
 src_prepare() {
+       default
        sed -e '/^opts/s:opts:extra_started_commands:' \
                -i openrc/isatapd.init.d || die
+       sed -e 's:#!/sbin/runscript:#!/sbin/openrc-run:' \
+               -i openrc/isatapd.init.d || die
 }
 
 src_install() {