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-dialup/rp-pppoe
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-dialup/rp-pppoe')
-rw-r--r--net-dialup/rp-pppoe/Manifest4
-rw-r--r--net-dialup/rp-pppoe/files/rp-pppoe-3.10-autotools.patch115
-rw-r--r--net-dialup/rp-pppoe/files/rp-pppoe-3.10-gentoo-netscripts.patch150
-rw-r--r--net-dialup/rp-pppoe/files/rp-pppoe-3.10-linux-headers.patch31
-rw-r--r--net-dialup/rp-pppoe/files/rp-pppoe-3.10-plugin-options.patch39
-rw-r--r--net-dialup/rp-pppoe/files/rp-pppoe-3.10-posix-source-sigaction.patch18
-rw-r--r--net-dialup/rp-pppoe/files/rp-pppoe-3.10-session-offset.patch21
-rw-r--r--net-dialup/rp-pppoe/files/rp-pppoe-3.10-username-charset.patch58
-rw-r--r--net-dialup/rp-pppoe/files/rp-pppoe-3.11-gentoo.patch11
-rw-r--r--net-dialup/rp-pppoe/files/rp-pppoe-3.11-kmode.patch10
-rw-r--r--net-dialup/rp-pppoe/files/rp-pppoe-3.8-autoheader.patch46
-rw-r--r--net-dialup/rp-pppoe/files/rp-pppoe-3.8-configure.patch70
-rw-r--r--net-dialup/rp-pppoe/files/rp-pppoe-3.8-gentoo-netscripts.patch150
-rw-r--r--net-dialup/rp-pppoe/files/rp-pppoe-3.8-plugin-options.patch33
-rw-r--r--net-dialup/rp-pppoe/files/rp-pppoe-3.8-session-offset.patch21
-rw-r--r--net-dialup/rp-pppoe/files/rp-pppoe-3.8-username-charset.patch58
-rw-r--r--net-dialup/rp-pppoe/metadata.xml5
-rw-r--r--net-dialup/rp-pppoe/rp-pppoe-3.11-r2.ebuild92
-rw-r--r--net-dialup/rp-pppoe/rp-pppoe-3.11-r3.ebuild99
-rw-r--r--net-dialup/rp-pppoe/rp-pppoe-3.8-r2.ebuild81
20 files changed, 1112 insertions, 0 deletions
diff --git a/net-dialup/rp-pppoe/Manifest b/net-dialup/rp-pppoe/Manifest
new file mode 100644
index 000000000000..df03efafcfb7
--- /dev/null
+++ b/net-dialup/rp-pppoe/Manifest
@@ -0,0 +1,4 @@
+DIST ppp-2.4.3.tar.gz 688092 SHA256 1e0fddb5f53613dd14ab10b25435e88092fed1eff09b4ac4448d5be01f3b0b11 SHA512 221f0925ec8bb73df740cd563a34f387ce8bf2417d2797e7f360563d8de6524e1cdf058c185eaefc9cb3703828d32c6f1b74595916683e08168ce792c5f8333e WHIRLPOOL c6a7538f107adca4f7fcdfccec5aef4ebba248958c05b94badcf0f1a2ebde667cf55f9adf3bd8eae8c0e6a37ed54c1f836117412d1135363bdfa279197981c6e
+DIST ppp-2.4.7.tar.gz 688117 SHA256 02e0a3dd3e4799e33103f70ec7df75348c8540966ee7c948e4ed8a42bbccfb30 SHA512 e34ce24020af6a73e7a26c83c4f73a9c83fa455b7b363794dba27bf01f70368be06bff779777843949bd77f4bc9385d6ad455ea48bf8fff4e0d73cc8fef16ae2 WHIRLPOOL 48f3251e6b955ecfdaf9260b9ea5220d9e355fff836e2f5217ee0b15bf2c93e43f8207005f58bf1f97fb8ff0c76c56df8ecd8536f63c4d84d5940458ba0ba5c3
+DIST rp-pppoe-3.11.tar.gz 223234 SHA256 86a1a4d92fcea74fa6dd45516c5975933fa978b36fafe71f76ea70b4b4747720 SHA512 cb9579ad94f6b6cfd709e8061aacac0a007f1f58ffd50bd0603f5a2b612c0cf4831febdbfeee290b97932fd30f8ae7f707d532a291124c4aeae2333131d53905 WHIRLPOOL 5e0580b469973726696adc8754f4490877b748e04395873b63a7f6b87b682e0fe4d75f53b1cab674932fe7dcf4d7c99458979926f74589e6d4e15b07505720f6
+DIST rp-pppoe-3.8.tar.gz 212931 SHA256 d916e9cfe1e62395f63a5361936fa855f6d0f0a37dc7227b394cdb725f553479 SHA512 fd929978790645639800164ad1855862f2b2ec4597a2c4c76ea7691aafd7f6ab5797fc64034eefb574dcf6dd51c51eda91c461f70bf4f557d46fee656143effc WHIRLPOOL 048789a83cfcd50d95779c2eb5f31553500288138e70c6daa511e91edcf4010e17d9d106e8f1338741b1be7b5a9bf058a6bfafea0ff27665d2e53667d5bf3427
diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.10-autotools.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.10-autotools.patch
new file mode 100644
index 000000000000..265d15db0936
--- /dev/null
+++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.10-autotools.patch
@@ -0,0 +1,115 @@
+diff -Nru rp-pppoe-3.10.orig/gui/Makefile.in rp-pppoe-3.10/gui/Makefile.in
+--- rp-pppoe-3.10.orig/gui/Makefile.in 2008-06-30 16:00:41.000000000 +0200
++++ rp-pppoe-3.10/gui/Makefile.in 2008-06-30 22:30:56.000000000 +0200
+@@ -46,7 +46,7 @@
+ -mkdir -p $(DESTDIR)$(sbindir)
+ -mkdir -p $(DESTDIR)$(bindir)
+ -mkdir -p $(DESTDIR)/etc/ppp/rp-pppoe-gui
+- $(install) -m 4755 -s pppoe-wrapper $(DESTDIR)$(sbindir)
++ $(install) -m 4755 pppoe-wrapper $(DESTDIR)$(sbindir)
+ $(install) -m 755 tkpppoe $(DESTDIR)$(bindir)
+ -mkdir -p $(DESTDIR)$(mandir)/man1
+ $(install) -m 644 pppoe-wrapper.1 $(DESTDIR)$(mandir)/man1
+diff -Nru rp-pppoe-3.10.orig/src/configure.in rp-pppoe-3.10/src/configure.in
+--- rp-pppoe-3.10.orig/src/configure.in 2008-06-30 16:00:42.000000000 +0200
++++ rp-pppoe-3.10/src/configure.in 2008-06-30 22:29:53.000000000 +0200
+@@ -45,7 +45,7 @@
+ AC_MSG_RESULT($ac_cv_struct_sockaddr_ll)
+
+ if test "$ac_cv_struct_sockaddr_ll" = yes ; then
+-AC_DEFINE(HAVE_STRUCT_SOCKADDR_LL)
++AC_DEFINE(HAVE_STRUCT_SOCKADDR_LL, 1, [Define if you have struct sockaddr_ll])
+ fi
+
+ dnl Check for N_HDLC line discipline
+@@ -56,7 +56,7 @@
+ ac_cv_n_hdlc=no)
+ AC_MSG_RESULT($ac_cv_n_hdlc)
+ if test "$ac_cv_n_hdlc" = yes ; then
+-AC_DEFINE(HAVE_N_HDLC)
++AC_DEFINE(HAVE_N_HDLC, 1, [Define if you have the N_HDLC line discipline in linux/termios.h])
+ fi
+
+ AC_ARG_ENABLE(plugin, [ --enable-plugin=pppd_src_path build pppd plugin], ac_cv_pluginpath=$enableval, ac_cv_pluginpath=no)
+@@ -104,7 +104,7 @@
+ if test "$ac_cv_header_linux_if_pppox_h" = yes ; then
+ if test "$ac_cv_pluginpath" != no ; then
+ LINUX_KERNELMODE_PLUGIN=rp-pppoe.so
+- AC_DEFINE(HAVE_LINUX_KERNEL_PPPOE)
++ AC_DEFINE(HAVE_LINUX_KERNEL_PPPOE, 1, [Define if you have kernel-mode PPPoE in Linux file])
+ PPPD_INCDIR=$ac_cv_pluginpath
+ fi
+ fi
+@@ -114,7 +114,7 @@
+ fi
+
+ if test "$ac_cv_debugging" = "yes" ; then
+- AC_DEFINE(DEBUGGING_ENABLED)
++ AC_DEFINE(DEBUGGING_ENABLED, 1, [Define to include debugging code])
+ fi
+
+ AC_SUBST(LINUX_KERNELMODE_PLUGIN)
+@@ -154,15 +154,15 @@
+ AC_MSG_CHECKING(for Linux 2.4.X kernel-mode PPPoE support)
+ AC_CACHE_VAL(ac_cv_linux_kernel_pppoe,[
+ if test "`uname -s`" = "Linux" ; then
+-if test $cross_compiling = "no"; then
++dnl if test $cross_compiling = "no"; then
+
+ dnl Do a bunch of modprobes. Can't hurt; might help.
+-modprobe ppp_generic > /dev/null 2>&1
+-modprobe ppp_async > /dev/null 2>&1
+-modprobe n_hdlc > /dev/null 2>&1
+-modprobe ppp_synctty > /dev/null 2>&1
+-modprobe pppoe > /dev/null 2>&1
+-fi
++dnl modprobe ppp_generic > /dev/null 2>&1
++dnl modprobe ppp_async > /dev/null 2>&1
++dnl modprobe n_hdlc > /dev/null 2>&1
++dnl modprobe ppp_synctty > /dev/null 2>&1
++dnl modprobe pppoe > /dev/null 2>&1
++dnl fi
+ AC_TRY_RUN([#include <sys/socket.h>
+ #include <net/ethernet.h>
+ #include <linux/if.h>
+@@ -204,7 +204,7 @@
+ dnl Figure out pppd version. 2.3.7 to 2.3.9 -- issue warning. Less than
+ dnl 2.3.7 -- stop
+
+-PPPD_VERSION=`$PPPD --version 2>&1 | awk ' /version/ {print $NF}'`
++PPPD_VERSION=2.4.4
+
+ case "$PPPD_VERSION" in
+ 1.*|2.0.*|2.1.*|2.2.*|2.3.0|2.3.1|2.3.2|2.3.3|2.3.4|2.3.5|2.3.6)
+@@ -258,7 +258,7 @@
+
+ if test "$rpppoe_cv_pack_bitfields" = "rev" ; then
+ AC_MSG_RESULT(reversed)
+- AC_DEFINE(PACK_BITFIELDS_REVERSED)
++ AC_DEFINE(PACK_BITFIELDS_REVERSED, 1, [Define if bitfields are packed in reverse order])
+ else
+ AC_MSG_RESULT(normal)
+ fi
+diff -Nru rp-pppoe-3.10.orig/src/plugin.c rp-pppoe-3.10/src/plugin.c
+--- rp-pppoe-3.10.orig/src/plugin.c 2008-06-30 16:00:43.000000000 +0200
++++ rp-pppoe-3.10/src/plugin.c 2008-06-30 22:27:18.000000000 +0200
+@@ -27,7 +27,6 @@
+ static char const RCSID[] =
+ "$Id$";
+
+-#define _GNU_SOURCE 1
+ #include "pppoe.h"
+
+ #include "pppd/pppd.h"
+diff -Nru rp-pppoe-3.10.orig/src/relay.c rp-pppoe-3.10/src/relay.c
+--- rp-pppoe-3.10.orig/src/relay.c 2008-06-30 16:00:43.000000000 +0200
++++ rp-pppoe-3.10/src/relay.c 2008-06-30 22:27:18.000000000 +0200
+@@ -17,8 +17,6 @@
+ static char const RCSID[] =
+ "$Id$";
+
+-#define _GNU_SOURCE 1 /* For SA_RESTART */
+-
+ #include "relay.h"
+
+ #include <signal.h>
diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.10-gentoo-netscripts.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.10-gentoo-netscripts.patch
new file mode 100644
index 000000000000..f45557a0d6f0
--- /dev/null
+++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.10-gentoo-netscripts.patch
@@ -0,0 +1,150 @@
+diff -Nru rp-pppoe-3.10.orig/configs/pppoe.conf rp-pppoe-3.10/configs/pppoe.conf
+--- rp-pppoe-3.10.orig/configs/pppoe.conf 2008-06-30 16:00:42.000000000 +0200
++++ rp-pppoe-3.10/configs/pppoe.conf 2008-06-30 22:22:32.000000000 +0200
+@@ -21,6 +21,9 @@
+ # When you configure a variable, DO NOT leave spaces around the "=" sign.
+
+ # Ethernet card connected to DSL modem
++#
++# NB: Gentoo overrides ETH when pppoe-start is called from the
++# networking scripts. This setting has no effect in that case.
+ ETH=eth1
+
+ # PPPoE user name. You may have to supply "@provider.com" Sympatico
+@@ -86,8 +89,10 @@
+ # $PIDFILE contains PID of pppoe-connect script
+ # $PIDFILE.pppoe contains PID of pppoe process
+ # $PIDFILE.pppd contains PID of pppd process
+-CF_BASE=`basename $CONFIG`
+-PIDFILE="/var/run/$CF_BASE-pppoe.pid"
++#
++# NB: Gentoo overrides PIDFILE when pppoe-start is run from the
++# networking scripts. This setting has no effect in that case.
++PIDFILE="/var/run/rp-pppoe.pid"
+
+ # Do you want to use synchronous PPP? "yes" or "no". "yes" is much
+ # easier on CPU usage, but may not work for you. It is safer to use
+diff -Nru rp-pppoe-3.10.orig/scripts/pppoe-connect.in rp-pppoe-3.10/scripts/pppoe-connect.in
+--- rp-pppoe-3.10.orig/scripts/pppoe-connect.in 2008-06-30 16:00:42.000000000 +0200
++++ rp-pppoe-3.10/scripts/pppoe-connect.in 2008-06-30 22:22:32.000000000 +0200
+@@ -62,12 +62,17 @@
+ ;;
+ esac
+
+-if test ! -f "$CONFIG" -o ! -r "$CONFIG" ; then
++# In Gentoo, CONFIG is a named pipe when pppoe is started by the
++# network scripts. Testing -r is allowed; testing -f is not.
++if test ! -r "$CONFIG" ; then
+ echo "$0: Cannot read configuration file '$CONFIG'" >& 2
+ exit 1
+ fi
+-export CONFIG
+-. $CONFIG
++
++# Read the named pipe (/dev/fd/foo) into a variable so we can use it
++# again later (since reading once from the pipe will exhaust it)
++CONFREAD=$(<$CONFIG)
++eval "$CONFREAD"
+
+ PPPOE_PIDFILE="$PIDFILE.pppoe"
+ PPPD_PIDFILE="$PIDFILE.pppd"
+diff -Nru rp-pppoe-3.10.orig/scripts/pppoe-start.in rp-pppoe-3.10/scripts/pppoe-start.in
+--- rp-pppoe-3.10.orig/scripts/pppoe-start.in 2008-06-30 16:00:42.000000000 +0200
++++ rp-pppoe-3.10/scripts/pppoe-start.in 2008-06-30 22:22:32.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ # @configure_input@
+ #***********************************************************************
+ #
+@@ -113,12 +113,17 @@
+ ;;
+ esac
+
+-if [ ! -f "$CONFIG" -o ! -r "$CONFIG" ] ; then
++# In Gentoo, CONFIG is a named pipe when pppoe is started by the
++# network scripts. Testing -r is allowed; testing -f is not.
++if [ ! -r "$CONFIG" ] ; then
+ $ECHO "$ME: Cannot read configuration file '$CONFIG'" >& 2
+ exit 1
+ fi
+-export CONFIG
+-. $CONFIG
++
++# Read the named pipe (/dev/fd/foo) into a variable so we can use it
++# again later (since reading once from the pipe will exhaust it)
++CONFREAD=$(<$CONFIG)
++eval "$CONFREAD"
+
+ # Check for command-line overriding of ETH and USER
+ case "$#" in
+@@ -145,11 +150,11 @@
+
+ # Start the connection in the background unless we're debugging
+ if [ "$DEBUG" != "" ] ; then
+- $CONNECT "$@"
++ $CONNECT <(echo "$CONFREAD")
+ exit 0
+ fi
+
+-$CONNECT "$@" > /dev/null 2>&1 &
++$CONNECT <(echo "$CONFREAD") >/dev/null 2>&1 &
+ CONNECT_PID=$!
+
+ if [ "$CONNECT_TIMEOUT" = "" -o "$CONNECT_TIMEOUT" = 0 ] ; then
+@@ -164,7 +169,7 @@
+ # Monitor connection
+ TIME=0
+ while [ true ] ; do
+- @sbindir@/pppoe-status $CONFIG > /dev/null 2>&1
++ @sbindir@/pppoe-status <(echo "$CONFREAD") >/dev/null 2>&1
+
+ # Looks like the interface came up
+ if [ $? = 0 ] ; then
+diff -Nru rp-pppoe-3.10.orig/scripts/pppoe-status rp-pppoe-3.10/scripts/pppoe-status
+--- rp-pppoe-3.10.orig/scripts/pppoe-status 2008-06-30 16:00:42.000000000 +0200
++++ rp-pppoe-3.10/scripts/pppoe-status 2008-06-30 22:22:32.000000000 +0200
+@@ -28,12 +28,17 @@
+ ;;
+ esac
+
+-if [ ! -f "$CONFIG" -o ! -r "$CONFIG" ] ; then
++# In Gentoo, CONFIG is a named pipe when pppoe is started by the
++# network scripts. Testing -r is allowed; testing -f is not.
++if [ ! -r "$CONFIG" ] ; then
+ echo "$0: Cannot read configuration file '$CONFIG'" >& 2
+ exit 1
+ fi
+
+-. $CONFIG
++# Read the named pipe (/dev/fd/foo) into a variable so we can use it
++# again later (since reading once from the pipe will exhaust it)
++CONFREAD=$(<$CONFIG)
++eval "$CONFREAD"
+
+ PPPOE_PIDFILE="$PIDFILE.pppoe"
+ PPPD_PIDFILE="$PIDFILE.pppd"
+diff -Nru rp-pppoe-3.10.orig/scripts/pppoe-stop.in rp-pppoe-3.10/scripts/pppoe-stop.in
+--- rp-pppoe-3.10.orig/scripts/pppoe-stop.in 2008-06-30 16:00:42.000000000 +0200
++++ rp-pppoe-3.10/scripts/pppoe-stop.in 2008-06-30 22:22:32.000000000 +0200
+@@ -31,12 +31,17 @@
+ CONFIG=/etc/ppp/pppoe.conf
+ fi
+
+-if [ ! -f "$CONFIG" -o ! -r "$CONFIG" ] ; then
++# In Gentoo, CONFIG is a named pipe when pppoe is started by the
++# network scripts. Testing -r is allowed; testing -f is not.
++if [ ! -r "$CONFIG" ] ; then
+ echo "$ME: Cannot read configuration file '$CONFIG'" >& 2
+ exit 1
+ fi
+-export CONFIG
+-. $CONFIG
++
++# Read the named pipe (/dev/fd/foo) into a variable so we can use it
++# again later (since reading once from the pipe will exhaust it)
++CONFREAD=$(<$CONFIG)
++eval "$CONFREAD"
+
+ PPPOE_PIDFILE="$PIDFILE.pppoe"
+ PPPD_PIDFILE="$PIDFILE.pppd"
diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.10-linux-headers.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.10-linux-headers.patch
new file mode 100644
index 000000000000..47e504bf7835
--- /dev/null
+++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.10-linux-headers.patch
@@ -0,0 +1,31 @@
+diff -Nru rp-pppoe-3.10.orig/src/pppoe.h rp-pppoe-3.10/src/pppoe.h
+--- rp-pppoe-3.10.orig/src/pppoe.h 2008-06-30 16:00:43.000000000 +0200
++++ rp-pppoe-3.10/src/pppoe.h 2008-06-30 23:25:54.000000000 +0200
+@@ -19,6 +19,13 @@
+
+ extern int IsSetID;
+
++/* Ugly header files on some Linux boxes... */
++#if defined(HAVE_LINUX_IF_H)
++#include <linux/if.h>
++#elif defined(HAVE_NET_IF_H)
++#include <net/if.h>
++#endif
++
+ #if defined(HAVE_NETPACKET_PACKET_H) || defined(HAVE_LINUX_IF_PACKET_H)
+ #define _POSIX_SOURCE 1 /* For sigaction defines */
+ #endif
+@@ -51,13 +58,6 @@
+ #include <sys/socket.h>
+ #endif
+
+-/* Ugly header files on some Linux boxes... */
+-#if defined(HAVE_LINUX_IF_H)
+-#include <linux/if.h>
+-#elif defined(HAVE_NET_IF_H)
+-#include <net/if.h>
+-#endif
+-
+ #ifdef HAVE_NET_IF_TYPES_H
+ #include <net/if_types.h>
+ #endif
diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.10-plugin-options.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.10-plugin-options.patch
new file mode 100644
index 000000000000..0d447748a1bc
--- /dev/null
+++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.10-plugin-options.patch
@@ -0,0 +1,39 @@
+diff -ur rp-pppoe-3.10.orig/configs/pppoe.conf rp-pppoe-3.10/configs/pppoe.conf
+--- rp-pppoe-3.10.orig/configs/pppoe.conf 2008-08-23 03:40:56.000000000 +0000
++++ rp-pppoe-3.10/configs/pppoe.conf 2008-08-23 03:42:20.000000000 +0000
+@@ -120,7 +120,7 @@
+ FIREWALL=NONE
+
+ # Linux kernel-mode plugin for pppd. If you want to try the kernel-mode
+-# plugin, use LINUX_PLUGIN=/etc/ppp/plugins/rp-pppoe.so
++# plugin, use LINUX_PLUGIN=rp-pppoe.so
+ LINUX_PLUGIN=
+
+ # Any extra arguments to pass to pppoe. Normally, use a blank string
+diff -ur rp-pppoe-3.10.orig/scripts/pppoe-connect.in rp-pppoe-3.10/scripts/pppoe-connect.in
+--- rp-pppoe-3.10.orig/scripts/pppoe-connect.in 2008-08-23 03:40:56.000000000 +0000
++++ rp-pppoe-3.10/scripts/pppoe-connect.in 2008-08-23 03:45:43.000000000 +0000
+@@ -202,10 +202,13 @@
+
+ # If we're using kernel-mode PPPoE on Linux...
+ if test "$LINUX_PLUGIN" != "" ; then
+- PLUGIN_OPTS="plugin $LINUX_PLUGIN nic-$ETH"
++ PLUGIN_OPTS="plugin $LINUX_PLUGIN"
+ if test -n "$SERVICENAME" ; then
+ PLUGIN_OPTS="$PLUGIN_OPTS rp_pppoe_service $SERVICENAME"
+ fi
++
++ # Interface name MUST BE LAST!!
++ PLUGIN_OPTS="$PLUGIN_OPTS $ETH"
+ modprobe pppoe > /dev/null 2>&1
+ fi
+
+@@ -297,7 +300,7 @@
+ $SETSID $OVERRIDE_PPPD_COMMAND &
+ echo "$!" > $PPPD_PIDFILE
+ elif test "$LINUX_PLUGIN" != "" ; then
+- $SETSID $PPPD $PPP_STD_OPTIONS $DEMAND &
++ $SETSID $PPPD $DEMAND $PPP_STD_OPTIONS &
+ echo "$!" > $PPPD_PIDFILE
+ else
+ $SETSID $PPPD pty "$PPPOE_CMD" \
diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.10-posix-source-sigaction.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.10-posix-source-sigaction.patch
new file mode 100644
index 000000000000..bd19170a99c5
--- /dev/null
+++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.10-posix-source-sigaction.patch
@@ -0,0 +1,18 @@
+glibc does not define SA_RESTART when _POSIX_SOURCE is defined, so we
+have to just assume the default signal.h include defines SA_RESTART
+
+http://sourceware.org/bugzilla/show_bug.cgi?id=12252
+
+--- rp-pppoe-3.10/src/pppoe.h
++++ rp-pppoe-3.10/src/pppoe.h
+@@ -19,10 +19,6 @@
+
+ extern int IsSetID;
+
+-#if defined(HAVE_NETPACKET_PACKET_H) || defined(HAVE_LINUX_IF_PACKET_H)
+-#define _POSIX_SOURCE 1 /* For sigaction defines */
+-#endif
+-
+ #include <stdio.h> /* For FILE */
+ #include <sys/types.h> /* For pid_t */
+
diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.10-session-offset.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.10-session-offset.patch
new file mode 100644
index 000000000000..303ecfa9e4b7
--- /dev/null
+++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.10-session-offset.patch
@@ -0,0 +1,21 @@
+diff -Nru rp-pppoe-3.10.orig/src/pppoe-server.c rp-pppoe-3.10/src/pppoe-server.c
+--- rp-pppoe-3.10.orig/src/pppoe-server.c 2008-06-30 16:00:43.000000000 +0200
++++ rp-pppoe-3.10/src/pppoe-server.c 2008-06-30 22:35:11.000000000 +0200
+@@ -1751,7 +1751,7 @@
+ }
+ if (PassUnitOptionToPPPD) {
+ argv[c++] = "unit";
+- sprintf(buffer, "%u", (unsigned int) (ntohs(session->sess) - 1 - SessOffset));
++ sprintf(buffer, "%u", (unsigned int) (ntohs(session->sess) - 1));
+ argv[c++] = buffer;
+ }
+ argv[c++] = NULL;
+@@ -1834,7 +1834,7 @@
+ argv[c++] = "default-asyncmap";
+ if (PassUnitOptionToPPPD) {
+ argv[c++] = "unit";
+- sprintf(buffer, "%u", (unsigned int) (ntohs(session->sess) - 1 - SessOffset));
++ sprintf(buffer, "%u", (unsigned int) (ntohs(session->sess) - 1));
+ argv[c++] = buffer;
+ }
+ argv[c++] = NULL;
diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.10-username-charset.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.10-username-charset.patch
new file mode 100644
index 000000000000..8ef99a4b7aa9
--- /dev/null
+++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.10-username-charset.patch
@@ -0,0 +1,58 @@
+diff -Nru rp-pppoe-3.10.orig/scripts/pppoe-setup.in rp-pppoe-3.10/scripts/pppoe-setup.in
+--- rp-pppoe-3.10.orig/scripts/pppoe-setup.in 2008-06-30 16:00:42.000000000 +0200
++++ rp-pppoe-3.10/scripts/pppoe-setup.in 2008-06-30 22:23:40.000000000 +0200
+@@ -86,11 +86,13 @@
+ $ECHO "USER NAME"
+ $ECHO ""
+ printf "%s" ">>> Enter your PPPoE user name (default $USER): "
+- read U
++ read Uu
+
+- if [ "$U" = "" ] ; then
+- U="$USER"
++ if [ "$Uu" = "" ] ; then
++ Uu="$USER"
+ fi
++
++ U=`echo $Uu | sed -e "s/&/\\\\\&/g"`
+
+ # Under Linux, "fix" the default interface if eth1 is not available
+ if test `uname -s` = "Linux" ; then
+@@ -221,7 +223,7 @@
+ $ECHO "** Summary of what you entered **"
+ $ECHO ""
+ $ECHO "Ethernet Interface: $E"
+- $ECHO "User name: $U"
++ $ECHO "User name: $Uu"
+ if [ "$D" = "no" ] ; then
+ $ECHO "Activate-on-demand: No"
+ else
+@@ -288,7 +290,12 @@
+ fi
+
+ # Some #$(*& ISP's use a slash in the user name...
+-sed -e "s&^USER=.*&USER='$U'&" \
++for SEP in ':' ';' '/' '!' '|' '_' '-' '@' ; do
++ if [ "$U" = `echo $U | sed "sI${SEP}II"` ]; then
++ break;
++ fi
++done
++sed -e "s${SEP}^USER=.*${SEP}USER='$U'${SEP}"\
+ -e "s&^ETH=.*&ETH='$E'&" \
+ -e "s&^PIDFILE=.*&PIDFILE=\"$VARRUN/\$CF_BASE-pppoe.pid\"&" \
+ -e "s/^FIREWALL=.*/FIREWALL=$FIREWALL/" \
+@@ -337,10 +344,10 @@
+ cp /dev/null /etc/ppp/chap-secrets-bak
+ fi
+
+-egrep -v "^$U|^\"$U\"" /etc/ppp/pap-secrets-bak > /etc/ppp/pap-secrets
+-$ECHO "\"$U\" * \"$PWD1\"" >> /etc/ppp/pap-secrets
+-egrep -v "^$U|^\"$U\"" /etc/ppp/chap-secrets-bak > /etc/ppp/chap-secrets
+-$ECHO "\"$U\" * \"$PWD1\"" >> /etc/ppp/chap-secrets
++egrep -v "^$Uu|^\"$Uu\"" /etc/ppp/pap-secrets-bak > /etc/ppp/pap-secrets
++$ECHO "\"$Uu\" * \"$PWD1\"" >> /etc/ppp/pap-secrets
++egrep -v "^$Uu|^\"$Uu\"" /etc/ppp/chap-secrets-bak > /etc/ppp/chap-secrets
++$ECHO "\"$Uu\" * \"$PWD1\"" >> /etc/ppp/chap-secrets
+
+ $ECHO ""
+ $ECHO ""
diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.11-gentoo.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.11-gentoo.patch
new file mode 100644
index 000000000000..9f03a0cf8b1f
--- /dev/null
+++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.11-gentoo.patch
@@ -0,0 +1,11 @@
+--- rp-pppoe-3.11/gui/Makefile.in
++++ rp-pppoe-3.11/gui/Makefile.in
+@@ -37,7 +37,7 @@
+ @echo "Type 'make install' as root to install the software."
+
+ pppoe-wrapper: wrapper.o
+- @CC@ -o pppoe-wrapper wrapper.o
++ @CC@ $(CFLAGS) $(LDFLAGS) -o pppoe-wrapper wrapper.o
+
+ wrapper.o: wrapper.c
+ @CC@ $(CFLAGS) -c -o wrapper.o wrapper.c
diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.11-kmode.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.11-kmode.patch
new file mode 100644
index 000000000000..039abd487793
--- /dev/null
+++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.11-kmode.patch
@@ -0,0 +1,10 @@
+--- src/configure.in.old 2015-01-07 13:08:18.929959937 +0100
++++ src/configure.in 2015-01-07 13:08:38.253406302 +0100
+@@ -26,6 +26,7 @@
+ #include<net/ethernet.h>
+ #include<linux/if.h>
+ #include<linux/in.h>
++#include <linux/in6.h>
+ ])
+
+ dnl Checks for typedefs, structures, and compiler characteristics.
diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.8-autoheader.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.8-autoheader.patch
new file mode 100644
index 000000000000..1c902600afcc
--- /dev/null
+++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.8-autoheader.patch
@@ -0,0 +1,46 @@
+diff -Nru rp-pppoe-3.8.orig/src/configure.in rp-pppoe-3.8/src/configure.in
+--- rp-pppoe-3.8.orig/src/configure.in 2008-06-15 16:59:01.000000000 +0300
++++ rp-pppoe-3.8/src/configure.in 2008-06-15 17:12:02.000000000 +0300
+@@ -44,7 +44,7 @@
+ AC_MSG_RESULT($ac_cv_struct_sockaddr_ll)
+
+ if test "$ac_cv_struct_sockaddr_ll" = yes ; then
+-AC_DEFINE(HAVE_STRUCT_SOCKADDR_LL)
++AC_DEFINE(HAVE_STRUCT_SOCKADDR_LL, 1, [Define if you have struct sockaddr_ll])
+ fi
+
+ dnl Check for N_HDLC line discipline
+@@ -55,7 +55,7 @@
+ ac_cv_n_hdlc=no)
+ AC_MSG_RESULT($ac_cv_n_hdlc)
+ if test "$ac_cv_n_hdlc" = yes ; then
+-AC_DEFINE(HAVE_N_HDLC)
++AC_DEFINE(HAVE_N_HDLC, 1, [Define if you have the N_HDLC line discipline in linux/termios.h])
+ fi
+
+ AC_ARG_ENABLE(plugin, [ --enable-plugin=pppd_src_path build pppd plugin], ac_cv_pluginpath=$enableval, ac_cv_pluginpath=no)
+@@ -100,13 +100,13 @@
+ if test "$ac_cv_header_linux_if_pppox_h" = yes ; then
+ if test "$ac_cv_pluginpath" != no ; then
+ LINUX_KERNELMODE_PLUGIN=rp-pppoe.so
+- AC_DEFINE(HAVE_LINUX_KERNEL_PPPOE)
++ AC_DEFINE(HAVE_LINUX_KERNEL_PPPOE, 1, [Define if you have kernel-mode PPPoE in Linux file])
+ PPPD_INCDIR=$ac_cv_pluginpath
+ fi
+ fi
+
+ if test "$ac_cv_debugging" = "yes" ; then
+- AC_DEFINE(DEBUGGING_ENABLED)
++ AC_DEFINE(DEBUGGING_ENABLED, 1, [Define to include debugging code])
+ fi
+
+ AC_SUBST(LINUX_KERNELMODE_PLUGIN)
+@@ -248,7 +248,7 @@
+
+ if test "$rpppoe_cv_pack_bitfields" = "rev" ; then
+ AC_MSG_RESULT(reversed)
+- AC_DEFINE(PACK_BITFIELDS_REVERSED)
++ AC_DEFINE(PACK_BITFIELDS_REVERSED, 1, [Define if bitfields are packed in reverse order])
+ else
+ AC_MSG_RESULT(normal)
+ fi
diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.8-configure.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.8-configure.patch
new file mode 100644
index 000000000000..054d419bb1ab
--- /dev/null
+++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.8-configure.patch
@@ -0,0 +1,70 @@
+diff -Nru rp-pppoe-3.8.orig/gui/Makefile.in rp-pppoe-3.8/gui/Makefile.in
+--- rp-pppoe-3.8.orig/gui/Makefile.in 2006-09-23 18:05:31.000000000 +0300
++++ rp-pppoe-3.8/gui/Makefile.in 2006-09-23 18:16:02.623018000 +0300
+@@ -46,7 +46,7 @@
+ -mkdir -p $(RPM_INSTALL_ROOT)$(sbindir)
+ -mkdir -p $(RPM_INSTALL_ROOT)$(bindir)
+ -mkdir -p $(RPM_INSTALL_ROOT)/etc/ppp/rp-pppoe-gui
+- $(install) -m 4755 -s pppoe-wrapper $(RPM_INSTALL_ROOT)$(sbindir)
++ $(install) -m 4755 pppoe-wrapper $(RPM_INSTALL_ROOT)$(sbindir)
+ $(install) -m 755 tkpppoe $(RPM_INSTALL_ROOT)$(bindir)
+ -mkdir -p $(RPM_INSTALL_ROOT)$(mandir)/man1
+ $(install) -m 644 pppoe-wrapper.1 $(RPM_INSTALL_ROOT)$(mandir)/man1
+diff -Nru rp-pppoe-3.8.orig/src/configure.in rp-pppoe-3.8/src/configure.in
+--- rp-pppoe-3.8.orig/src/configure.in 2006-04-02 17:29:42.000000000 +0300
++++ rp-pppoe-3.8/src/configure.in 2007-01-05 00:12:48.000000000 +0200
+@@ -145,15 +145,15 @@
+ AC_MSG_CHECKING(for Linux 2.4.X kernel-mode PPPoE support)
+ AC_CACHE_VAL(ac_cv_linux_kernel_pppoe,[
+ if test "`uname -s`" = "Linux" ; then
+-if test $cross_compiling = "no"; then
++dnl if test $cross_compiling = "no"; then
+
+ dnl Do a bunch of modprobes. Can't hurt; might help.
+-modprobe ppp_generic > /dev/null 2>&1
+-modprobe ppp_async > /dev/null 2>&1
+-modprobe n_hdlc > /dev/null 2>&1
+-modprobe ppp_synctty > /dev/null 2>&1
+-modprobe pppoe > /dev/null 2>&1
+-fi
++dnl modprobe ppp_generic > /dev/null 2>&1
++dnl modprobe ppp_async > /dev/null 2>&1
++dnl modprobe n_hdlc > /dev/null 2>&1
++dnl modprobe ppp_synctty > /dev/null 2>&1
++dnl modprobe pppoe > /dev/null 2>&1
++dnl fi
+ AC_TRY_RUN([#include <sys/socket.h>
+ #include <net/ethernet.h>
+ #include <linux/if.h>
+@@ -180,7 +180,7 @@
+
+ dnl GCC warning level
+ if test "$GCC" = yes; then
+- CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -ansi"
++ CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -D_GNU_SOURCE"
+ fi
+
+ dnl If we couldn't find pppd, die
+diff -Nru rp-pppoe-3.8.orig/src/plugin.c rp-pppoe-3.8/src/plugin.c
+--- rp-pppoe-3.8.orig/src/plugin.c 2006-04-02 17:29:42.000000000 +0300
++++ rp-pppoe-3.8/src/plugin.c 2007-01-05 00:08:41.000000000 +0200
+@@ -27,7 +27,6 @@
+ static char const RCSID[] =
+ "$Id$";
+
+-#define _GNU_SOURCE 1
+ #include "pppoe.h"
+
+ #include "pppd/pppd.h"
+diff -Nru rp-pppoe-3.8.orig/src/relay.c rp-pppoe-3.8/src/relay.c
+--- rp-pppoe-3.8.orig/src/relay.c 2006-04-02 17:29:42.000000000 +0300
++++ rp-pppoe-3.8/src/relay.c 2007-01-05 00:08:46.000000000 +0200
+@@ -17,8 +17,6 @@
+ static char const RCSID[] =
+ "$Id$";
+
+-#define _GNU_SOURCE 1 /* For SA_RESTART */
+-
+ #include "relay.h"
+
+ #include <signal.h>
diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.8-gentoo-netscripts.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.8-gentoo-netscripts.patch
new file mode 100644
index 000000000000..c39e2014bd65
--- /dev/null
+++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.8-gentoo-netscripts.patch
@@ -0,0 +1,150 @@
+diff -Nru rp-pppoe-3.8.orig/configs/pppoe.conf rp-pppoe-3.8/configs/pppoe.conf
+--- rp-pppoe-3.8.orig/configs/pppoe.conf 2006-04-02 17:29:41.000000000 +0300
++++ rp-pppoe-3.8/configs/pppoe.conf 2006-04-21 10:04:20.369308000 +0300
+@@ -21,6 +21,9 @@
+ # When you configure a variable, DO NOT leave spaces around the "=" sign.
+
+ # Ethernet card connected to DSL modem
++#
++# NB: Gentoo overrides ETH when pppoe-start is called from the
++# networking scripts. This setting has no effect in that case.
+ ETH=eth1
+
+ # PPPoE user name. You may have to supply "@provider.com" Sympatico
+@@ -86,8 +89,10 @@
+ # $PIDFILE contains PID of pppoe-connect script
+ # $PIDFILE.pppoe contains PID of pppoe process
+ # $PIDFILE.pppd contains PID of pppd process
+-CF_BASE=`basename $CONFIG`
+-PIDFILE="/var/run/$CF_BASE-pppoe.pid"
++#
++# NB: Gentoo overrides PIDFILE when pppoe-start is run from the
++# networking scripts. This setting has no effect in that case.
++PIDFILE="/var/run/rp-pppoe.pid"
+
+ # Do you want to use synchronous PPP? "yes" or "no". "yes" is much
+ # easier on CPU usage, but may not work for you. It is safer to use
+diff -Nru rp-pppoe-3.8.orig/scripts/pppoe-connect.in rp-pppoe-3.8/scripts/pppoe-connect.in
+--- rp-pppoe-3.8.orig/scripts/pppoe-connect.in 2006-04-02 17:29:42.000000000 +0300
++++ rp-pppoe-3.8/scripts/pppoe-connect.in 2006-04-21 10:04:20.369308000 +0300
+@@ -62,12 +62,17 @@
+ ;;
+ esac
+
+-if test ! -f "$CONFIG" -o ! -r "$CONFIG" ; then
++# In Gentoo, CONFIG is a named pipe when pppoe is started by the
++# network scripts. Testing -r is allowed; testing -f is not.
++if test ! -r "$CONFIG" ; then
+ echo "$0: Cannot read configuration file '$CONFIG'" >& 2
+ exit 1
+ fi
+-export CONFIG
+-. $CONFIG
++
++# Read the named pipe (/dev/fd/foo) into a variable so we can use it
++# again later (since reading once from the pipe will exhaust it)
++CONFREAD=$(<$CONFIG)
++eval "$CONFREAD"
+
+ PPPOE_PIDFILE="$PIDFILE.pppoe"
+ PPPD_PIDFILE="$PIDFILE.pppd"
+diff -Nru rp-pppoe-3.8.orig/scripts/pppoe-start.in rp-pppoe-3.8/scripts/pppoe-start.in
+--- rp-pppoe-3.8.orig/scripts/pppoe-start.in 2006-04-02 17:29:42.000000000 +0300
++++ rp-pppoe-3.8/scripts/pppoe-start.in 2006-04-21 10:04:20.369308000 +0300
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ # @configure_input@
+ #***********************************************************************
+ #
+@@ -113,12 +113,17 @@
+ ;;
+ esac
+
+-if [ ! -f "$CONFIG" -o ! -r "$CONFIG" ] ; then
++# In Gentoo, CONFIG is a named pipe when pppoe is started by the
++# network scripts. Testing -r is allowed; testing -f is not.
++if [ ! -r "$CONFIG" ] ; then
+ $ECHO "$ME: Cannot read configuration file '$CONFIG'" >& 2
+ exit 1
+ fi
+-export CONFIG
+-. $CONFIG
++
++# Read the named pipe (/dev/fd/foo) into a variable so we can use it
++# again later (since reading once from the pipe will exhaust it)
++CONFREAD=$(<$CONFIG)
++eval "$CONFREAD"
+
+ # Check for command-line overriding of ETH and USER
+ case "$#" in
+@@ -145,11 +150,11 @@
+
+ # Start the connection in the background unless we're debugging
+ if [ "$DEBUG" != "" ] ; then
+- $CONNECT "$@"
++ $CONNECT <(echo "$CONFREAD")
+ exit 0
+ fi
+
+-$CONNECT "$@" > /dev/null 2>&1 &
++$CONNECT <(echo "$CONFREAD") >/dev/null 2>&1 &
+ CONNECT_PID=$!
+
+ if [ "$CONNECT_TIMEOUT" = "" -o "$CONNECT_TIMEOUT" = 0 ] ; then
+@@ -164,7 +169,7 @@
+ # Monitor connection
+ TIME=0
+ while [ true ] ; do
+- @sbindir@/pppoe-status $CONFIG > /dev/null 2>&1
++ @sbindir@/pppoe-status <(echo "$CONFREAD") >/dev/null 2>&1
+
+ # Looks like the interface came up
+ if [ $? = 0 ] ; then
+diff -Nru rp-pppoe-3.8.orig/scripts/pppoe-status rp-pppoe-3.8/scripts/pppoe-status
+--- rp-pppoe-3.8.orig/scripts/pppoe-status 2006-04-02 17:29:42.000000000 +0300
++++ rp-pppoe-3.8/scripts/pppoe-status 2006-04-21 10:04:20.369308000 +0300
+@@ -28,12 +28,17 @@
+ ;;
+ esac
+
+-if [ ! -f "$CONFIG" -o ! -r "$CONFIG" ] ; then
++# In Gentoo, CONFIG is a named pipe when pppoe is started by the
++# network scripts. Testing -r is allowed; testing -f is not.
++if [ ! -r "$CONFIG" ] ; then
+ echo "$0: Cannot read configuration file '$CONFIG'" >& 2
+ exit 1
+ fi
+
+-. $CONFIG
++# Read the named pipe (/dev/fd/foo) into a variable so we can use it
++# again later (since reading once from the pipe will exhaust it)
++CONFREAD=$(<$CONFIG)
++eval "$CONFREAD"
+
+ PPPOE_PIDFILE="$PIDFILE.pppoe"
+ PPPD_PIDFILE="$PIDFILE.pppd"
+diff -Nru rp-pppoe-3.8.orig/scripts/pppoe-stop.in rp-pppoe-3.8/scripts/pppoe-stop.in
+--- rp-pppoe-3.8.orig/scripts/pppoe-stop.in 2006-04-02 17:29:42.000000000 +0300
++++ rp-pppoe-3.8/scripts/pppoe-stop.in 2006-04-21 10:04:20.369308000 +0300
+@@ -31,12 +31,17 @@
+ CONFIG=/etc/ppp/pppoe.conf
+ fi
+
+-if [ ! -f "$CONFIG" -o ! -r "$CONFIG" ] ; then
++# In Gentoo, CONFIG is a named pipe when pppoe is started by the
++# network scripts. Testing -r is allowed; testing -f is not.
++if [ ! -r "$CONFIG" ] ; then
+ echo "$ME: Cannot read configuration file '$CONFIG'" >& 2
+ exit 1
+ fi
+-export CONFIG
+-. $CONFIG
++
++# Read the named pipe (/dev/fd/foo) into a variable so we can use it
++# again later (since reading once from the pipe will exhaust it)
++CONFREAD=$(<$CONFIG)
++eval "$CONFREAD"
+
+ PPPOE_PIDFILE="$PIDFILE.pppoe"
+ PPPD_PIDFILE="$PIDFILE.pppd"
diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.8-plugin-options.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.8-plugin-options.patch
new file mode 100644
index 000000000000..dec2276aa0d1
--- /dev/null
+++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.8-plugin-options.patch
@@ -0,0 +1,33 @@
+diff -Nru rp-pppoe-3.8.orig/configs/pppoe.conf rp-pppoe-3.8/configs/pppoe.conf
+--- rp-pppoe-3.8.orig/configs/pppoe.conf 2006-04-02 17:29:41.000000000 +0300
++++ rp-pppoe-3.8/configs/pppoe.conf 2006-04-21 10:06:46.170420000 +0300
+@@ -115,7 +115,7 @@
+ FIREWALL=NONE
+
+ # Linux kernel-mode plugin for pppd. If you want to try the kernel-mode
+-# plugin, use LINUX_PLUGIN=/etc/ppp/plugins/rp-pppoe.so
++# plugin, use LINUX_PLUGIN=rp-pppoe.so
+ LINUX_PLUGIN=
+
+ # Any extra arguments to pass to pppoe. Normally, use a blank string
+diff -Nru rp-pppoe-3.8.orig/scripts/pppoe-connect.in rp-pppoe-3.8/scripts/pppoe-connect.in
+--- rp-pppoe-3.8.orig/scripts/pppoe-connect.in 2006-04-02 17:29:42.000000000 +0300
++++ rp-pppoe-3.8/scripts/pppoe-connect.in 2006-04-21 10:06:58.951218750 +0300
+@@ -197,7 +197,7 @@
+
+ # If we're using kernel-mode PPPoE on Linux...
+ if test "$LINUX_PLUGIN" != "" ; then
+- PLUGIN_OPTS="plugin $LINUX_PLUGIN nic-$ETH"
++ PLUGIN_OPTS="plugin $LINUX_PLUGIN"
+ if test -n "$SERVICENAME" ; then
+ PLUGIN_OPTS="$PLUGIN_OPTS rp_pppoe_service $SERVICENAME"
+ fi
+@@ -295,7 +295,7 @@
+ $SETSID $OVERRIDE_PPPD_COMMAND &
+ echo "$!" > $PPPD_PIDFILE
+ elif test "$LINUX_PLUGIN" != "" ; then
+- $SETSID $PPPD $PPP_STD_OPTIONS $DEMAND &
++ $SETSID $PPPD $DEMAND $PPP_STD_OPTIONS &
+ echo "$!" > $PPPD_PIDFILE
+ else
+ $SETSID $PPPD pty "$PPPOE_CMD" \
diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.8-session-offset.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.8-session-offset.patch
new file mode 100644
index 000000000000..8f53a1af4239
--- /dev/null
+++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.8-session-offset.patch
@@ -0,0 +1,21 @@
+diff -Nru rp-pppoe-3.8.orig/src/pppoe-server.c rp-pppoe-3.8/src/pppoe-server.c
+--- rp-pppoe-3.8.orig/src/pppoe-server.c 2006-04-02 17:29:42.000000000 +0300
++++ rp-pppoe-3.8/src/pppoe-server.c 2008-01-06 14:43:39.000000000 +0200
+@@ -1693,7 +1693,7 @@
+ }
+ if (PassUnitOptionToPPPD) {
+ argv[c++] = "unit";
+- sprintf(buffer, "%u", (unsigned int) (ntohs(session->sess) - 1 - SessOffset));
++ sprintf(buffer, "%u", (unsigned int) (ntohs(session->sess) - 1));
+ argv[c++] = buffer;
+ }
+ argv[c++] = NULL;
+@@ -1776,7 +1776,7 @@
+ argv[c++] = "default-asyncmap";
+ if (PassUnitOptionToPPPD) {
+ argv[c++] = "unit";
+- sprintf(buffer, "%u", (unsigned int) (ntohs(session->sess) - 1 - SessOffset));
++ sprintf(buffer, "%u", (unsigned int) (ntohs(session->sess) - 1));
+ argv[c++] = buffer;
+ }
+ argv[c++] = NULL;
diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.8-username-charset.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.8-username-charset.patch
new file mode 100644
index 000000000000..b504e849cf31
--- /dev/null
+++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.8-username-charset.patch
@@ -0,0 +1,58 @@
+diff -Nru rp-pppoe-3.8.orig/scripts/pppoe-setup.in rp-pppoe-3.8/scripts/pppoe-setup.in
+--- rp-pppoe-3.8.orig/scripts/pppoe-setup.in 2006-04-02 17:29:42.000000000 +0300
++++ rp-pppoe-3.8/scripts/pppoe-setup.in 2006-04-21 10:09:08.411309500 +0300
+@@ -86,11 +86,13 @@
+ $ECHO "USER NAME"
+ $ECHO ""
+ printf "%s" ">>> Enter your PPPoE user name (default $USER): "
+- read U
++ read Uu
+
+- if [ "$U" = "" ] ; then
+- U="$USER"
++ if [ "$Uu" = "" ] ; then
++ Uu="$USER"
+ fi
++
++ U=`echo $Uu | sed -e "s/&/\\\\\&/g"`
+
+ # Under Linux, "fix" the default interface if eth1 is not available
+ if test `uname -s` = "Linux" ; then
+@@ -221,7 +223,7 @@
+ $ECHO "** Summary of what you entered **"
+ $ECHO ""
+ $ECHO "Ethernet Interface: $E"
+- $ECHO "User name: $U"
++ $ECHO "User name: $Uu"
+ if [ "$D" = "no" ] ; then
+ $ECHO "Activate-on-demand: No"
+ else
+@@ -288,7 +290,12 @@
+ fi
+
+ # Some #$(*& ISP's use a slash in the user name...
+-sed -e "s&^USER=.*&USER='$U'&" \
++for SEP in ':' ';' '/' '!' '|' '_' '-' '@' ; do
++ if [ "$U" = `echo $U | sed "sI${SEP}II"` ]; then
++ break;
++ fi
++done
++sed -e "s${SEP}^USER=.*${SEP}USER='$U'${SEP}"\
+ -e "s&^ETH=.*&ETH='$E'&" \
+ -e "s&^PIDFILE=.*&PIDFILE=\"$VARRUN/\$CF_BASE-pppoe.pid\"&" \
+ -e "s/^FIREWALL=.*/FIREWALL=$FIREWALL/" \
+@@ -337,10 +344,10 @@
+ cp /dev/null /etc/ppp/chap-secrets-bak
+ fi
+
+-egrep -v "^$U|^\"$U\"" /etc/ppp/pap-secrets-bak > /etc/ppp/pap-secrets
+-$ECHO "\"$U\" * \"$PWD1\"" >> /etc/ppp/pap-secrets
+-egrep -v "^$U|^\"$U\"" /etc/ppp/chap-secrets-bak > /etc/ppp/chap-secrets
+-$ECHO "\"$U\" * \"$PWD1\"" >> /etc/ppp/chap-secrets
++egrep -v "^$Uu|^\"$Uu\"" /etc/ppp/pap-secrets-bak > /etc/ppp/pap-secrets
++$ECHO "\"$Uu\" * \"$PWD1\"" >> /etc/ppp/pap-secrets
++egrep -v "^$Uu|^\"$Uu\"" /etc/ppp/chap-secrets-bak > /etc/ppp/chap-secrets
++$ECHO "\"$Uu\" * \"$PWD1\"" >> /etc/ppp/chap-secrets
+
+ $ECHO ""
+ $ECHO ""
diff --git a/net-dialup/rp-pppoe/metadata.xml b/net-dialup/rp-pppoe/metadata.xml
new file mode 100644
index 000000000000..1e11e7bbd01b
--- /dev/null
+++ b/net-dialup/rp-pppoe/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>net-dialup</herd>
+</pkgmetadata>
diff --git a/net-dialup/rp-pppoe/rp-pppoe-3.11-r2.ebuild b/net-dialup/rp-pppoe/rp-pppoe-3.11-r2.ebuild
new file mode 100644
index 000000000000..8e8b122dd679
--- /dev/null
+++ b/net-dialup/rp-pppoe/rp-pppoe-3.11-r2.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic autotools
+
+PPP_P="ppp-2.4.7"
+
+DESCRIPTION="A user-mode PPPoE client and server suite for Linux"
+HOMEPAGE="http://www.roaringpenguin.com/pppoe/"
+SRC_URI="http://www.roaringpenguin.com/files/download/${P}.tar.gz
+ ftp://ftp.samba.org/pub/ppp/${PPP_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="X"
+
+RDEPEND="net-dialup/ppp
+ X? ( dev-lang/tk )"
+# see bug #230491
+DEPEND="|| ( <sys-kernel/linux-headers-2.6.24 >=sys-kernel/linux-headers-2.6.25 )
+ ${RDEPEND}"
+
+src_prepare() {
+ # Patch to enable integration of pppoe-start and pppoe-stop with
+ # baselayout-1.11.x so that the pidfile can be found reliably per interface
+ epatch "${FILESDIR}/${PN}-3.10-gentoo-netscripts.patch"
+
+ epatch "${FILESDIR}/${PN}-3.10-username-charset.patch" # bug 82410
+ epatch "${FILESDIR}/${PN}-3.10-plugin-options.patch"
+ epatch "${FILESDIR}/${PN}-3.10-autotools.patch"
+ epatch "${FILESDIR}/${PN}-3.10-session-offset.patch" # bug 204476
+ has_version '<sys-kernel/linux-headers-2.6.35' && \
+ epatch "${FILESDIR}/${PN}-3.10-linux-headers.patch" #334197
+ epatch "${FILESDIR}/${PN}-3.10-posix-source-sigaction.patch"
+ epatch "${FILESDIR}/${PN}-3.11-gentoo.patch"
+
+ cd "${S}"/src || die
+ eautoreconf
+}
+
+src_configure() {
+ addpredict /dev/ppp
+
+ cd "${S}/src" || die
+ econf --enable-plugin=../../${PPP_P}
+}
+
+src_compile() {
+ cd "${S}/src" || die
+ emake
+
+ if use X; then
+ make -C "${S}/gui" || die "gui make failed"
+ fi
+}
+
+src_install () {
+ cd "${S}/src" || die
+ emake DESTDIR="${D}" docdir=/usr/share/doc/${PF} install
+
+ #Don't use compiled rp-pppoe plugin - see pkg_preinst below
+ local pppoe_plugin="${D}/etc/ppp/plugins/rp-pppoe.so"
+ if [ -f "${pppoe_plugin}" ] ; then
+ rm "${pppoe_plugin}" || die
+ fi
+
+ if use X; then
+ emake -C "${S}/gui" \
+ DESTDIR="${D}" \
+ datadir=/usr/share/doc/${PF}/ \
+ install
+ dosym /usr/share/doc/${PF}/tkpppoe /usr/share/tkpppoe
+ fi
+}
+
+pkg_preinst() {
+ # Use the rp-pppoe plugin that comes with net-dialup/pppd
+ local PPPD_VER=$(best_version net-dialup/ppp)
+ PPPD_VER=${PPPD_VER#*/*-} #reduce it to ${PV}-${PR}
+ PPPD_VER=${PPPD_VER%%-*} #reduce it to ${PV}
+ if [ -n "${PPPD_VER}" ] && [ -f "${ROOT}/usr/lib/pppd/${PPPD_VER}/rp-pppoe.so" ] ; then
+ dosym /usr/lib/pppd/${PPPD_VER}/rp-pppoe.so /etc/ppp/plugins/rp-pppoe.so
+ fi
+}
+
+pkg_postinst() {
+ elog "Use pppoe-setup to configure your dialup connection."
+}
diff --git a/net-dialup/rp-pppoe/rp-pppoe-3.11-r3.ebuild b/net-dialup/rp-pppoe/rp-pppoe-3.11-r3.ebuild
new file mode 100644
index 000000000000..d86143f91be8
--- /dev/null
+++ b/net-dialup/rp-pppoe/rp-pppoe-3.11-r3.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic autotools readme.gentoo
+
+PPP_P="ppp-2.4.7"
+
+DESCRIPTION="A user-mode PPPoE client and server suite for Linux"
+HOMEPAGE="http://www.roaringpenguin.com/pppoe/"
+SRC_URI="http://www.roaringpenguin.com/files/download/${P}.tar.gz
+ ftp://ftp.samba.org/pub/ppp/${PPP_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="tk"
+
+RDEPEND="
+ net-dialup/ppp:=
+ tk? ( dev-lang/tk )
+"
+# see bug #230491
+DEPEND="|| ( <sys-kernel/linux-headers-2.6.24 >=sys-kernel/linux-headers-2.6.25 )
+ ${RDEPEND}"
+
+DOC_CONTENTS="Use pppoe-setup to configure your dialup connection"
+
+pkg_setup() {
+ # This is needed in multiple phases
+ PPPD_VER=$(best_version net-dialup/ppp)
+ PPPD_VER=${PPPD_VER#*/*-} #reduce it to ${PV}-${PR}
+ PPPD_VER=${PPPD_VER%%-*} #reduce it to ${PV}
+}
+
+src_prepare() {
+ # Patch to enable integration of pppoe-start and pppoe-stop with
+ # baselayout-1.11.x so that the pidfile can be found reliably per interface
+ epatch "${FILESDIR}/${PN}-3.10-gentoo-netscripts.patch"
+
+ epatch "${FILESDIR}/${PN}-3.10-username-charset.patch" # bug 82410
+ epatch "${FILESDIR}/${PN}-3.10-plugin-options.patch"
+ epatch "${FILESDIR}/${PN}-3.10-autotools.patch"
+ epatch "${FILESDIR}/${PN}-3.10-session-offset.patch" # bug 204476
+ has_version '<sys-kernel/linux-headers-2.6.35' && \
+ epatch "${FILESDIR}/${PN}-3.10-linux-headers.patch" #334197
+ epatch "${FILESDIR}/${PN}-3.10-posix-source-sigaction.patch"
+ epatch "${FILESDIR}/${PN}-3.11-gentoo.patch"
+ epatch "${FILESDIR}/${PN}-3.11-kmode.patch" #364941
+
+ cd "${S}"/src || die
+ eautoreconf
+}
+
+src_configure() {
+ addpredict /dev/ppp
+
+ cd "${S}/src" || die
+ econf --enable-plugin=../../ppp-${PPPD_VER}
+}
+
+src_compile() {
+ cd "${S}/src" || die
+ emake
+
+ if use tk; then
+ emake -C "${S}/gui" || die "gui make failed"
+ fi
+}
+
+src_install () {
+ cd "${S}/src" || die
+ emake DESTDIR="${D}" docdir=/usr/share/doc/${PF} install
+
+ #Don't use compiled rp-pppoe plugin - see pkg_preinst below
+ local pppoe_plugin="${D}/etc/ppp/plugins/rp-pppoe.so"
+ if [ -f "${pppoe_plugin}" ] ; then
+ rm "${pppoe_plugin}" || die
+ fi
+
+ if use tk; then
+ emake -C "${S}/gui" \
+ DESTDIR="${D}" \
+ datadir=/usr/share/doc/${PF}/ \
+ install
+ dosym /usr/share/doc/${PF}/tkpppoe /usr/share/tkpppoe
+ fi
+
+ readme.gentoo_create_doc
+}
+
+pkg_preinst() {
+ # Use the rp-pppoe plugin that comes with net-dialup/pppd
+ if [ -n "${PPPD_VER}" ] && [ -f "${ROOT}/usr/lib/pppd/${PPPD_VER}/rp-pppoe.so" ] ; then
+ dosym /usr/lib/pppd/${PPPD_VER}/rp-pppoe.so /etc/ppp/plugins/rp-pppoe.so
+ fi
+}
diff --git a/net-dialup/rp-pppoe/rp-pppoe-3.8-r2.ebuild b/net-dialup/rp-pppoe/rp-pppoe-3.8-r2.ebuild
new file mode 100644
index 000000000000..75b928e8271c
--- /dev/null
+++ b/net-dialup/rp-pppoe/rp-pppoe-3.8-r2.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic autotools
+
+DESCRIPTION="A user-mode PPPoE client and server suite for Linux"
+HOMEPAGE="http://www.roaringpenguin.com/pppoe/"
+SRC_URI="http://www.roaringpenguin.com/penguin/pppoe/${P}.tar.gz
+ ftp://ftp.samba.org/pub/ppp/ppp-2.4.3.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ~mips ppc ppc64 sh sparc x86"
+IUSE="X"
+
+RDEPEND="net-dialup/ppp
+ X? ( dev-lang/tk )"
+# see bug #230491
+DEPEND="|| ( <sys-kernel/linux-headers-2.6.24 >=sys-kernel/linux-headers-2.6.25 )
+ ${RDEPEND}"
+
+src_unpack() {
+ unpack ${A} || die "failed to unpack"
+
+ # Patch to enable integration of pppoe-start and pppoe-stop with
+ # baselayout-1.11.x so that the pidfile can be found reliably per interface
+ epatch "${FILESDIR}/${P}-gentoo-netscripts.patch"
+
+ epatch "${FILESDIR}/${P}-username-charset.patch" # bug 82410
+ epatch "${FILESDIR}/${P}-plugin-options.patch"
+ epatch "${FILESDIR}/${P}-configure.patch"
+ epatch "${FILESDIR}/${P}-autoheader.patch"
+ epatch "${FILESDIR}/${P}-session-offset.patch" # bug 204476
+
+ cd "${S}"/src
+ eautoreconf
+}
+
+src_compile() {
+ addpredict /dev/ppp
+
+ cd "${S}/src"
+ econf --enable-plugin=../../ppp-2.4.3 || die "econf failed"
+ emake || die "emake failed"
+
+ if use X; then
+ make -C "${S}/gui" || die "gui make failed"
+ fi
+}
+
+src_install () {
+ cd "${S}/src"
+ make RPM_INSTALL_ROOT="${D}" docdir=/usr/share/doc/${PF} install \
+ || die "install failed"
+
+ #Don't use compiled rp-pppoe plugin - see pkg_preinst below
+ rm "${D}/etc/ppp/plugins/rp-pppoe.so"
+
+ prepalldocs
+
+ if use X; then
+ make -C "${S}/gui" install RPM_INSTALL_ROOT="${D}" \
+ datadir=/usr/share/doc/${PF}/ || die "gui install failed"
+ dosym /usr/share/doc/${PF}/tkpppoe /usr/share/tkpppoe
+ fi
+}
+
+pkg_preinst() {
+ # Use the rp-pppoe plugin that comes with net-dialup/pppd
+ local PPPD_VER=`best_version net-dialup/ppp`
+ PPPD_VER=${PPPD_VER#*/*-} #reduce it to ${PV}-${PR}
+ PPPD_VER=${PPPD_VER%%-*} #reduce it to ${PV}
+ if [ -n "${PPPD_VER}" ] && [ -f "${ROOT}/usr/lib/pppd/${PPPD_VER}/rp-pppoe.so" ] ; then
+ dosym /usr/lib/pppd/${PPPD_VER}/rp-pppoe.so /etc/ppp/plugins/rp-pppoe.so
+ fi
+}
+
+pkg_postinst() {
+ elog "Use pppoe-setup to configure your dialup connection."
+}