commit:     79eb49c4b63ab163c6633247610596195f237bda
Author:     Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
AuthorDate: Wed Jul  8 09:30:29 2020 +0000
Commit:     Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
CommitDate: Wed Jul  8 09:43:38 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79eb49c4

net-vpn/pptpd: revision bump

Fix library path for plugins
Fix building with Musl

Closes: https://bugs.gentoo.org/716210
Closes: https://bugs.gentoo.org/730068
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Sergey Popov <pinkbyte <AT> gentoo.org>

 net-vpn/pptpd/files/pptpd-1.4.0-libdir.patch | 24 +++++++++
 net-vpn/pptpd/files/pptpd-1.4.0-musl.patch   | 16 ++++++
 net-vpn/pptpd/pptpd-1.4.0-r3.ebuild          | 81 ++++++++++++++++++++++++++++
 3 files changed, 121 insertions(+)

diff --git a/net-vpn/pptpd/files/pptpd-1.4.0-libdir.patch 
b/net-vpn/pptpd/files/pptpd-1.4.0-libdir.patch
new file mode 100644
index 00000000000..898c3aea89d
--- /dev/null
+++ b/net-vpn/pptpd/files/pptpd-1.4.0-libdir.patch
@@ -0,0 +1,24 @@
+diff -r -U 3 pptpd-1.4.0.orig/Makefile.am pptpd-1.4.0/Makefile.am
+--- pptpd-1.4.0.orig/Makefile.am       2020-06-29 00:24:23.301857353 +0300
++++ pptpd-1.4.0/Makefile.am    2020-06-29 00:25:16.072686760 +0300
+@@ -11,7 +11,7 @@
+ ##  warning with -Wmissing-prototypes).
+ ## -Wmissing-prototypes removed (eg, Linux 2.2.6 headers
+ ##  aren't up to it).
+-CFLAGS += -fno-builtin -Wall -DSBINDIR='"$(sbindir)"'
++CFLAGS += -fno-builtin -Wall -DSBINDIR='"$(sbindir)"' -DLIBDIR='"$(libdir)"'
+ #CFLAGS = -O2 -fno-builtin -Wall -ansi -DSBINDIR='"$(sbindir)"'
+ #CFLAGS = -O2 -fno-builtin -Wall -ansi -pedantic -Wmissing-prototypes -Werror 
-DSBINDIR='"$(sbindir)"'
+ 
+diff -r -U 3 pptpd-1.4.0.orig/pptpctrl.c pptpd-1.4.0/pptpctrl.c
+--- pptpd-1.4.0.orig/pptpctrl.c        2013-10-23 08:53:19.000000000 +0400
++++ pptpd-1.4.0/pptpctrl.c     2020-06-29 00:25:23.356525131 +0300
+@@ -786,7 +786,7 @@
+ 
+         if (pptp_logwtmp) {
+                  pppd_argv[an++] = "plugin";
+-                 pppd_argv[an++] = "/usr/lib/pptpd/pptpd-logwtmp.so";
++                 pppd_argv[an++] = LIBDIR "/pptpd/pptpd-logwtmp.so";
+                  pppd_argv[an++] = "pptpd-original-ip";
+                  pppd_argv[an++] = inet_ntoa(inetaddrs[1]);
+         }

diff --git a/net-vpn/pptpd/files/pptpd-1.4.0-musl.patch 
b/net-vpn/pptpd/files/pptpd-1.4.0-musl.patch
new file mode 100644
index 00000000000..998a07acf7e
--- /dev/null
+++ b/net-vpn/pptpd/files/pptpd-1.4.0-musl.patch
@@ -0,0 +1,16 @@
+Modified patch from Alpine Linux
+https://git.alpinelinux.org/aports/plain/main/pptpd/fix_MSG_TRYHARD.patch
+
+--- a/bcrelay.c
++++ b/bcrelay.c
+@@ -103,6 +103,10 @@
+ #include "our_syslog.h"
+ #include "our_getopt.h"
+ 
++#ifndef MSG_TRYHARD
++      #define MSG_TRYHARD    MSG_DONTROUTE
++#endif
++
+ //#define VERSION "1.0"
+ 
+ /* uncomment if you compile this without poptop's configure script */

diff --git a/net-vpn/pptpd/pptpd-1.4.0-r3.ebuild 
b/net-vpn/pptpd/pptpd-1.4.0-r3.ebuild
new file mode 100644
index 00000000000..17768c52b76
--- /dev/null
+++ b/net-vpn/pptpd/pptpd-1.4.0-r3.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Linux Point-to-Point Tunnelling Protocol Server"
+HOMEPAGE="http://poptop.sourceforge.net/";
+SRC_URI="mirror://sourceforge/poptop/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="gre-extreme-debug tcpd"
+
+DEPEND="net-dialup/ppp:=
+       tcpd? ( sys-apps/tcp-wrappers )"
+RDEPEND="${DEPEND}"
+
+DOCS=( AUTHORS ChangeLog NEWS README TODO )
+
+PATCHES=(
+       "${FILESDIR}/${P}-gentoo.patch"
+       "${FILESDIR}/${P}-sandbox-fix.patch"
+       "${FILESDIR}/${P}-pidfile.patch"
+       "${FILESDIR}/${P}-libdir.patch"
+       "${FILESDIR}/${P}-musl.patch"
+)
+
+src_prepare() {
+       # Match pptpd-logwtmp.so's version with pppd's version (#89895)
+       local PPPD_VER=`best_version net-dialup/ppp`
+       PPPD_VER=${PPPD_VER#*/*-} #reduce it to ${PV}-${PR}
+       PPPD_VER=${PPPD_VER%%[_-]*} # main version without 
beta/pre/patch/revision
+       sed -i -e "s:\\(#define[ \\t]*VERSION[ 
\\t]*\\)\".*\":\\1\"${PPPD_VER}\":" plugins/patchlevel.h || die
+
+       # configure.in is actually configure.ac
+       mv configure.in configure.ac || die
+
+       # Automake 1.13 compatibility, bug #469476
+       sed -i -e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADER/' configure.ac || die 
'sed on configure.ac failed'
+
+       # remove 'missing' script to prevent warnings
+       rm missing || die 'remove missing script failed'
+
+       # respect compiler, bug #461722
+       tc-export CC
+
+       # Call to default src_prepare to apply patches
+       default
+
+       eautoreconf
+}
+
+src_configure() {
+       use gre-extreme-debug && append-cppflags 
"-DLOG_DEBUG_GRE_ACCEPTING_PACKET"
+       econf \
+               --enable-bcrelay \
+               $(use tcpd && echo "--with-libwrap")
+}
+
+src_compile() {
+       emake COPTS="${CFLAGS}"
+}
+
+src_install() {
+       default
+
+       insinto /etc
+       doins samples/pptpd.conf
+
+       insinto /etc/ppp
+       doins samples/options.pptpd
+
+       newinitd "${FILESDIR}/pptpd-init-r2" pptpd
+       newconfd "${FILESDIR}/pptpd-confd" pptpd
+
+       dodoc README.*
+       dodoc -r samples
+}

Reply via email to