summaryrefslogtreecommitdiff
path: root/net-vpn
diff options
context:
space:
mode:
authorSergey Popov <pinkbyte@gentoo.org>2017-03-27 18:12:34 +0300
committerSergey Popov <pinkbyte@gentoo.org>2017-03-27 18:17:14 +0300
commit83d3fb92ea9656e8f856c68f643ce2ca984f72cf (patch)
treee321bc68f3c3eb30aba868dd1c04e1151db6977d /net-vpn
parent753a2195c705e218af38b58fe2fcd703a4a4c466 (diff)
downloadgentoo-83d3fb92ea9656e8f856c68f643ce2ca984f72cf.tar.gz
gentoo-83d3fb92ea9656e8f856c68f643ce2ca984f72cf.tar.xz
net-dialup/pptpd: move to net-vpn/pptpd
Package-Manager: portage-2.3.3 RepoMan-Options: --force
Diffstat (limited to 'net-vpn')
-rw-r--r--net-vpn/pptpd/Manifest1
-rw-r--r--net-vpn/pptpd/files/pptpd-1.4.0-gentoo.patch59
-rw-r--r--net-vpn/pptpd/files/pptpd-1.4.0-pidfile.patch33
-rw-r--r--net-vpn/pptpd/files/pptpd-1.4.0-sandbox-fix.patch21
-rw-r--r--net-vpn/pptpd/files/pptpd-confd5
-rw-r--r--net-vpn/pptpd/files/pptpd-init-r219
-rw-r--r--net-vpn/pptpd/metadata.xml15
-rw-r--r--net-vpn/pptpd/pptpd-1.4.0-r2.ebuild79
8 files changed, 232 insertions, 0 deletions
diff --git a/net-vpn/pptpd/Manifest b/net-vpn/pptpd/Manifest
new file mode 100644
index 00000000000..5a62976fcde
--- /dev/null
+++ b/net-vpn/pptpd/Manifest
@@ -0,0 +1 @@
+DIST pptpd-1.4.0.tar.gz 252167 SHA256 8fcd8b8a42de2af59e9fe8cbaa9f894045c977f4d038bbd6346a8522bb7f06c0 SHA512 cfb4caef3025c0721e7fabf8b7bf595739f2d3048555b30616cdadc37e70ba9e1c50561c25091dd617b5448da2816aeaf83aea0fc2ef6b0dd5e3fe35d9591484 WHIRLPOOL 8296818e05cb01339b83a68d149413fd5bd76b435cfa56c3e16a8136b531743468953279d44339fd0f8125fb25172a3ee9a10ec14bb9f801eb54133b665dab3b
diff --git a/net-vpn/pptpd/files/pptpd-1.4.0-gentoo.patch b/net-vpn/pptpd/files/pptpd-1.4.0-gentoo.patch
new file mode 100644
index 00000000000..9e7db7ea345
--- /dev/null
+++ b/net-vpn/pptpd/files/pptpd-1.4.0-gentoo.patch
@@ -0,0 +1,59 @@
+diff -Naur pptpd-1.3.4.orig/Makefile.am pptpd-1.3.4/Makefile.am
+--- pptpd-1.3.4.orig/Makefile.am 2007-04-16 04:53:53.000000000 +0400
++++ pptpd-1.3.4/Makefile.am 2007-05-01 21:29:15.000000000 +0400
+@@ -11,7 +11,7 @@
+ ## warning with -Wmissing-prototypes).
+ ## -Wmissing-prototypes removed (eg, Linux 2.2.6 headers
+ ## aren't up to it).
+-CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"'
++CFLAGS += -fno-builtin -Wall -DSBINDIR='"$(sbindir)"'
+ #CFLAGS = -O2 -fno-builtin -Wall -ansi -DSBINDIR='"$(sbindir)"'
+ #CFLAGS = -O2 -fno-builtin -Wall -ansi -pedantic -Wmissing-prototypes -Werror -DSBINDIR='"$(sbindir)"'
+
+diff -Naur pptpd-1.3.4.orig/plugins/Makefile pptpd-1.3.4/plugins/Makefile
+--- pptpd-1.3.4.orig/plugins/Makefile 2006-08-03 06:02:01.000000000 +0400
++++ pptpd-1.3.4/plugins/Makefile 2007-05-01 21:29:15.000000000 +0400
+@@ -1,6 +1,5 @@
+-CC = gcc
++CC ?= gcc
+-COPTS = -O2 -g
+-CFLAGS = $(COPTS) -I.. -I../../include -fPIC
++CFLAGS += -I.. -I../../include -fPIC
+-LDFLAGS = -shared
++LDFLAGS += -shared
+ LDADD = -lutil
+ INSTALL = install -o root
+diff -Naur pptpd-1.3.4.orig/pptpgre.c pptpd-1.3.4/pptpgre.c
+--- pptpd-1.3.4.orig/pptpgre.c 2007-04-16 04:21:02.000000000 +0400
++++ pptpd-1.3.4/pptpgre.c 2007-05-01 21:29:50.000000000 +0400
+@@ -326,9 +326,11 @@
+ "GRE: timeout waiting for %d packets",
+ head->seq - gre.seq_recv - 1);
+ }
++#ifdef LOG_DEBUG_GRE_ACCEPTING_PACKET
+ if (pptpctrl_debug)
+ syslog(LOG_DEBUG, "GRE: accepting #%d from queue",
+ head->seq);
++#endif
+ gre.seq_recv = head->seq;
+ status = callback(cl, head->packet, head->packlen);
+ pqueue_del(head);
+diff -Naur pptpd-1.3.4.orig/pqueue.c pptpd-1.3.4/pqueue.c
+--- pptpd-1.3.4.orig/pqueue.c 2005-08-03 12:53:22.000000000 +0400
++++ pptpd-1.3.4/pqueue.c 2007-05-01 21:29:15.000000000 +0400
+@@ -7,13 +7,11 @@
+ #include "pqueue.h"
+
+ #ifdef DEBUG_PQUEUE
+-#define DEBUG_ON 1
++# define DEBUG_CMD(_a) { _a }
+ #else
+-#define DEBUG_ON 0
++# define DEBUG_CMD(_a)
+ #endif
+
+-#define DEBUG_CMD(_a) if (DEBUG_ON) { _a }
+-
+ #define MIN_CAPACITY 128 /* min allocated buffer for a packet */
+
+ static int pqueue_alloc (int seq, unsigned char *packet, int packlen, pqueue_t **new);
diff --git a/net-vpn/pptpd/files/pptpd-1.4.0-pidfile.patch b/net-vpn/pptpd/files/pptpd-1.4.0-pidfile.patch
new file mode 100644
index 00000000000..59bc4a43ecd
--- /dev/null
+++ b/net-vpn/pptpd/files/pptpd-1.4.0-pidfile.patch
@@ -0,0 +1,33 @@
+--- a/pptpd.c 2016-08-16 15:35:51.660000000 +0300
++++ b/pptpd.c 2016-08-16 15:36:01.010000000 +0300
+@@ -115,7 +115,7 @@
+ printf(" (default is /etc/ppp/options).\n");
+ #endif
+ printf(" [-p] [--pidfile file] Specifies the file to write the process ID to\n");
+- printf(" (default is /var/run/pptpd.pid).\n");
++ printf(" (default is /run/pptpd.pid).\n");
+ #if !defined(BSDUSER_PPP)
+ printf(" [-s] [--speed baud] Specifies the baud speed for the PPP daemon\n");
+ printf(" (default is 115200).\n");
+--- a/pptpd.8 2016-08-16 15:34:53.480000000 +0300
++++ b/pptpd.8 2016-08-16 15:35:11.650000000 +0300
+@@ -72,7 +72,7 @@
+ .TP
+ \fB-p\fR|\fB--pidfile \fIpid-file
+ specifies an alternate location to store the process ID file (default
+-.IR /var/run/pptpd.pid ).
++.IR /run/pptpd.pid ).
+
+ .TP
+ \fB-s\fR|\fB--speed \fIbaud
+--- a/defaults.h 2016-08-16 15:35:01.050000000 +0300
++++ b/defaults.h 2016-08-16 15:35:20.190000000 +0300
+@@ -43,7 +43,7 @@
+ #else
+ #define PPTPD_CONFIG_FILE_DEFAULT "/etc/pptpd.conf"
+ #endif
+-#define PIDFILE_DEFAULT "/var/run/pptpd.pid"
++#define PIDFILE_DEFAULT "/run/pptpd.pid"
+
+ #define STIMEOUT_DEFAULT 10 /* seconds */
+
diff --git a/net-vpn/pptpd/files/pptpd-1.4.0-sandbox-fix.patch b/net-vpn/pptpd/files/pptpd-1.4.0-sandbox-fix.patch
new file mode 100644
index 00000000000..2162509d7d4
--- /dev/null
+++ b/net-vpn/pptpd/files/pptpd-1.4.0-sandbox-fix.patch
@@ -0,0 +1,21 @@
+--- a/plugins/Makefile 2013-05-15 14:36:33.994231829 +0400
++++ b/plugins/Makefile 2013-05-15 14:37:06.686234429 +0400
+@@ -17,14 +17,14 @@
+ %.so: %.c
+ $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^ $(LDADD)
+
+-LIBDIR ?= $(DESTDIR)$(prefix)/lib/pptpd
++LIBDIR ?= $(prefix)/lib/pptpd
+
+ install: $(PLUGINS)
+- $(INSTALL) -d $(LIBDIR)
+- $(INSTALL) $? $(LIBDIR)
++ $(INSTALL) -d $(DESTDIR)$(LIBDIR)
++ $(INSTALL) $? $(DESTDIR)$(LIBDIR)
+
+ uninstall:
+- rm -f $(LIBDIR)$(PLUGINS)
++ rm -f $(DESTDIR)$(LIBDIR)$(PLUGINS)
+
+ clean:
+ rm -f *.o *.so *.a
diff --git a/net-vpn/pptpd/files/pptpd-confd b/net-vpn/pptpd/files/pptpd-confd
new file mode 100644
index 00000000000..1169e57f1c7
--- /dev/null
+++ b/net-vpn/pptpd/files/pptpd-confd
@@ -0,0 +1,5 @@
+# Config file for /etc/init.d/pptpd
+
+# Any extra options you want to pass to pptpd
+# on start-up should be put here.
+PPTPD_OPTS=""
diff --git a/net-vpn/pptpd/files/pptpd-init-r2 b/net-vpn/pptpd/files/pptpd-init-r2
new file mode 100644
index 00000000000..6bbf9d68143
--- /dev/null
+++ b/net-vpn/pptpd/files/pptpd-init-r2
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting pptpd"
+ start-stop-daemon --start --quiet --exec /usr/sbin/pptpd -- ${PPTPD_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping pptpd"
+ start-stop-daemon --stop --quiet --pidfile /run/pptpd.pid
+ result=$?
+ killall -SIGTERM pptpctrl &>/dev/null
+ eend $result
+}
diff --git a/net-vpn/pptpd/metadata.xml b/net-vpn/pptpd/metadata.xml
new file mode 100644
index 00000000000..32a22c503fb
--- /dev/null
+++ b/net-vpn/pptpd/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>pinkbyte@gentoo.org</email>
+ <name>Sergey Popov</name>
+ </maintainer>
+ <use>
+ <flag name="gre-extreme-debug">Log all GRE accepted packages when in debug
+ mode (required if you want upstream support)</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">poptop</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-vpn/pptpd/pptpd-1.4.0-r2.ebuild b/net-vpn/pptpd/pptpd-1.4.0-r2.ebuild
new file mode 100644
index 00000000000..95a0ffb046d
--- /dev/null
+++ b/net-vpn/pptpd/pptpd-1.4.0-r2.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic
+
+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"
+)
+
+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
+}