public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-vpn/vtun/, net-vpn/vtun/files/
@ 2019-07-14  7:18 Hans de Graaff
  0 siblings, 0 replies; 3+ messages in thread
From: Hans de Graaff @ 2019-07-14  7:18 UTC (permalink / raw
  To: gentoo-commits

commit:     ce831f8c08bc53e1d1cd6af329f7bcd902aa7b9d
Author:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 14 07:18:16 2019 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Sun Jul 14 07:18:32 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce831f8c

net-vpn/vtun: fix openssl 1.1 compatibility

Fixes: https://bugs.gentoo.org/674280
Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>
Package-Manager: Portage-2.3.66, Repoman-2.3.11

 net-vpn/vtun/files/vtun-libssl-1.1.patch | 229 +++++++++++++++++++++++++++++++
 net-vpn/vtun/vtun-3.0.3-r1.ebuild        |  59 ++++++++
 2 files changed, 288 insertions(+)

diff --git a/net-vpn/vtun/files/vtun-libssl-1.1.patch b/net-vpn/vtun/files/vtun-libssl-1.1.patch
new file mode 100644
index 00000000000..76a3c027d88
--- /dev/null
+++ b/net-vpn/vtun/files/vtun-libssl-1.1.patch
@@ -0,0 +1,229 @@
+--- vtun-3.0.3/lfd_encrypt.c.orig       2019-02-25 18:43:39.310480427 -0500
++++ vtun-3.0.3/lfd_encrypt.c    2019-02-25 18:55:26.956441285 -0500
+@@ -96,11 +96,11 @@
+ char * pkey;
+ char * iv_buf;
+
+-EVP_CIPHER_CTX ctx_enc;        /* encrypt */
+-EVP_CIPHER_CTX ctx_dec;        /* decrypt */
++EVP_CIPHER_CTX *ctx_enc;       /* encrypt */
++EVP_CIPHER_CTX *ctx_dec;       /* decrypt */
+
+-EVP_CIPHER_CTX ctx_enc_ecb;    /* sideband ecb encrypt */
+-EVP_CIPHER_CTX ctx_dec_ecb;    /* sideband ecb decrypt */
++EVP_CIPHER_CTX *ctx_enc_ecb;   /* sideband ecb encrypt */
++EVP_CIPHER_CTX *ctx_dec_ecb;   /* sideband ecb decrypt */
+
+ int prep_key(char **key, int size, struct vtun_host *host)
+ {
+@@ -152,6 +152,11 @@
+    EVP_CIPHER_CTX *pctx_enc;
+    EVP_CIPHER_CTX *pctx_dec;
+
++   ctx_enc = EVP_CIPHER_CTX_new();
++   ctx_dec = EVP_CIPHER_CTX_new();
++   ctx_enc_ecb = EVP_CIPHER_CTX_new();
++   ctx_dec_ecb = EVP_CIPHER_CTX_new();
++
+    enc_init_first_time = 1;
+    dec_init_first_time = 1;
+
+@@ -178,15 +183,15 @@
+          keysize = 32;
+          sb_init = 1;
+          cipher_type = EVP_aes_256_ecb();
+-         pctx_enc = &ctx_enc_ecb;
+-         pctx_dec = &ctx_dec_ecb;
++         pctx_enc = ctx_enc_ecb;
++         pctx_dec = ctx_dec_ecb;
+       break;
+
+       case VTUN_ENC_AES256ECB:
+          blocksize = 16;
+          keysize = 32;
+-         pctx_enc = &ctx_enc;
+-         pctx_dec = &ctx_dec;
++         pctx_enc = ctx_enc;
++         pctx_dec = ctx_dec;
+          cipher_type = EVP_aes_256_ecb();
+          strcpy(cipher_name,"AES-256-ECB");
+       break;
+@@ -197,14 +202,14 @@
+          keysize = 16;
+          sb_init=1;
+          cipher_type = EVP_aes_128_ecb();
+-         pctx_enc = &ctx_enc_ecb;
+-         pctx_dec = &ctx_dec_ecb;
++         pctx_enc = ctx_enc_ecb;
++         pctx_dec = ctx_dec_ecb;
+       break;
+       case VTUN_ENC_AES128ECB:
+          blocksize = 16;
+          keysize = 16;
+-         pctx_enc = &ctx_enc;
+-         pctx_dec = &ctx_dec;
++         pctx_enc = ctx_enc;
++         pctx_dec = ctx_dec;
+          cipher_type = EVP_aes_128_ecb();
+          strcpy(cipher_name,"AES-128-ECB");
+       break;
+@@ -217,16 +222,16 @@
+          var_key = 1;
+          sb_init = 1;
+          cipher_type = EVP_bf_ecb();
+-         pctx_enc = &ctx_enc_ecb;
+-         pctx_dec = &ctx_dec_ecb;
++         pctx_enc = ctx_enc_ecb;
++         pctx_dec = ctx_dec_ecb;
+       break;
+
+       case VTUN_ENC_BF256ECB:
+          blocksize = 8;
+          keysize = 32;
+          var_key = 1;
+-         pctx_enc = &ctx_enc;
+-         pctx_dec = &ctx_dec;
++         pctx_enc = ctx_enc;
++         pctx_dec = ctx_dec;
+          cipher_type = EVP_bf_ecb();
+          strcpy(cipher_name,"Blowfish-256-ECB");
+       break;
+@@ -239,16 +244,16 @@
+          var_key = 1;
+          sb_init = 1;
+          cipher_type = EVP_bf_ecb();
+-         pctx_enc = &ctx_enc_ecb;
+-         pctx_dec = &ctx_dec_ecb;
++         pctx_enc = ctx_enc_ecb;
++         pctx_dec = ctx_dec_ecb;
+       break;
+       case VTUN_ENC_BF128ECB: /* blowfish 128 ecb is the default */
+       default:
+          blocksize = 8;
+          keysize = 16;
+          var_key = 1;
+-         pctx_enc = &ctx_enc;
+-         pctx_dec = &ctx_dec;
++         pctx_enc = ctx_enc;
++         pctx_dec = ctx_dec;
+          cipher_type = EVP_bf_ecb();
+          strcpy(cipher_name,"Blowfish-128-ECB");
+       break;
+@@ -290,10 +295,10 @@
+    lfd_free(enc_buf); enc_buf = NULL;
+    lfd_free(dec_buf); dec_buf = NULL;
+
+-   EVP_CIPHER_CTX_cleanup(&ctx_enc);
+-   EVP_CIPHER_CTX_cleanup(&ctx_dec);
+-   EVP_CIPHER_CTX_cleanup(&ctx_enc_ecb);
+-   EVP_CIPHER_CTX_cleanup(&ctx_dec_ecb);
++   EVP_CIPHER_CTX_free(ctx_enc);
++   EVP_CIPHER_CTX_free(ctx_dec);
++   EVP_CIPHER_CTX_free(ctx_enc_ecb);
++   EVP_CIPHER_CTX_free(ctx_dec_ecb);
+
+    return 0;
+ }
+@@ -319,7 +324,7 @@
+    outlen=len+pad;
+    if (pad == blocksize)
+       RAND_bytes(in_ptr+len, blocksize-1);
+-   EVP_EncryptUpdate(&ctx_enc, out_ptr, &outlen, in_ptr, len+pad);
++   EVP_EncryptUpdate(ctx_enc, out_ptr, &outlen, in_ptr, len+pad);
+    *out = enc_buf;
+
+    sequence_num++;
+@@ -339,7 +344,7 @@
+
+    outlen=len;
+    if (!len) return 0;
+-   EVP_DecryptUpdate(&ctx_dec, out_ptr, &outlen, in_ptr, len);
++   EVP_DecryptUpdate(ctx_dec, out_ptr, &outlen, in_ptr, len);
+    recv_ib_mesg(&outlen, &out_ptr);
+    if (!outlen) return 0;
+    tmp_ptr = out_ptr + outlen; tmp_ptr--;
+@@ -427,13 +432,13 @@
+       break;
+    } /* switch(cipher) */
+
+-   EVP_CIPHER_CTX_init(&ctx_enc);
+-   EVP_EncryptInit_ex(&ctx_enc, cipher_type, NULL, NULL, NULL);
++   EVP_CIPHER_CTX_init(ctx_enc);
++   EVP_EncryptInit_ex(ctx_enc, cipher_type, NULL, NULL, NULL);
+    if (var_key)
+-      EVP_CIPHER_CTX_set_key_length(&ctx_enc, keysize);
+-   EVP_EncryptInit_ex(&ctx_enc, NULL, NULL, pkey, NULL);
+-   EVP_EncryptInit_ex(&ctx_enc, NULL, NULL, NULL, iv);
+-   EVP_CIPHER_CTX_set_padding(&ctx_enc, 0);
++      EVP_CIPHER_CTX_set_key_length(ctx_enc, keysize);
++   EVP_EncryptInit_ex(ctx_enc, NULL, NULL, pkey, NULL);
++   EVP_EncryptInit_ex(ctx_enc, NULL, NULL, NULL, iv);
++   EVP_CIPHER_CTX_set_padding(ctx_enc, 0);
+    if (enc_init_first_time)
+    {
+       sprintf(tmpstr,"%s encryption initialized", cipher_name);
+@@ -517,13 +522,13 @@
+       break;
+    } /* switch(cipher) */
+
+-   EVP_CIPHER_CTX_init(&ctx_dec);
+-   EVP_DecryptInit_ex(&ctx_dec, cipher_type, NULL, NULL, NULL);
++   EVP_CIPHER_CTX_init(ctx_dec);
++   EVP_DecryptInit_ex(ctx_dec, cipher_type, NULL, NULL, NULL);
+    if (var_key)
+-      EVP_CIPHER_CTX_set_key_length(&ctx_dec, keysize);
+-   EVP_DecryptInit_ex(&ctx_dec, NULL, NULL, pkey, NULL);
+-   EVP_DecryptInit_ex(&ctx_dec, NULL, NULL, NULL, iv);
+-   EVP_CIPHER_CTX_set_padding(&ctx_dec, 0);
++      EVP_CIPHER_CTX_set_key_length(ctx_dec, keysize);
++   EVP_DecryptInit_ex(ctx_dec, NULL, NULL, pkey, NULL);
++   EVP_DecryptInit_ex(ctx_dec, NULL, NULL, NULL, iv);
++   EVP_CIPHER_CTX_set_padding(ctx_dec, 0);
+    if (dec_init_first_time)
+    {
+       sprintf(tmpstr,"%s decryption initialized", cipher_name);
+@@ -555,7 +560,7 @@
+
+          in_ptr = in - blocksize*2;
+          outlen = blocksize*2;
+-         EVP_EncryptUpdate(&ctx_enc_ecb, in_ptr,
++         EVP_EncryptUpdate(ctx_enc_ecb, in_ptr,
+             &outlen, in_ptr, blocksize*2);
+          *out = in_ptr;
+          len = outlen;
+@@ -582,7 +587,7 @@
+          in_ptr = in;
+          iv = malloc(blocksize);
+          outlen = blocksize*2;
+-         EVP_DecryptUpdate(&ctx_dec_ecb, in_ptr, &outlen, in_ptr, blocksize*2);
++         EVP_DecryptUpdate(ctx_dec_ecb, in_ptr, &outlen, in_ptr, blocksize*2);
+
+          if ( !strncmp(in_ptr, "ivec", 4) )
+          {
+@@ -625,7 +630,7 @@
+                if (cipher_enc_state != CIPHER_INIT)
+                {
+                   cipher_enc_state = CIPHER_INIT;
+-                  EVP_CIPHER_CTX_cleanup(&ctx_enc);
++                  EVP_CIPHER_CTX_cleanup(ctx_enc);
+ #ifdef LFD_ENCRYPT_DEBUG
+                   vtun_syslog(LOG_INFO,
+                      "Forcing local encryptor re-init");
+@@ -706,7 +711,7 @@
+          if (cipher_enc_state != CIPHER_INIT)
+          {
+             cipher_enc_state = CIPHER_INIT;
+-            EVP_CIPHER_CTX_cleanup(&ctx_enc);
++            EVP_CIPHER_CTX_cleanup(ctx_enc);
+          }
+ #ifdef LFD_ENCRYPT_DEBUG
+          vtun_syslog(LOG_INFO, "Remote requests encryptor re-init");
+@@ -720,7 +725,7 @@
+              cipher_enc_state != CIPHER_REQ_INIT &&
+              cipher_enc_state != CIPHER_INIT)
+          {
+-            EVP_CIPHER_CTX_cleanup (&ctx_dec);
++            EVP_CIPHER_CTX_cleanup (ctx_dec);
+             cipher_dec_state = CIPHER_INIT;
+             cipher_enc_state = CIPHER_REQ_INIT;
+          }

diff --git a/net-vpn/vtun/vtun-3.0.3-r1.ebuild b/net-vpn/vtun/vtun-3.0.3-r1.ebuild
new file mode 100644
index 00000000000..d56bcd52fbd
--- /dev/null
+++ b/net-vpn/vtun/vtun-3.0.3-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit linux-info
+
+DESCRIPTION="Create tunnels over TCP/IP networks with shaping, encryption, and compression"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+HOMEPAGE="http://vtun.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
+IUSE="lzo socks5 ssl zlib"
+
+RDEPEND="ssl? ( dev-libs/openssl:0 )
+	lzo? ( dev-libs/lzo:2 )
+	zlib? ( sys-libs/zlib )
+	socks5? ( net-proxy/dante )"
+DEPEND="${RDEPEND}
+	sys-devel/bison"
+
+DOCS="ChangeLog Credits FAQ README README.Setup README.Shaper TODO"
+
+CONFIG_CHECK="~TUN"
+
+src_prepare() {
+	sed -i Makefile.in \
+		-e '/^LDFLAGS/s|=|+=|g' \
+		|| die "sed Makefile"
+	eapply "${FILESDIR}"/${P}-includes.patch
+	# remove unneeded checking for /etc/vtund.conf
+	eapply -p0 "${FILESDIR}"/${PN}-3.0.2-remove-config-presence-check.patch
+	# GCC 5 compatibility, patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=778164
+	eapply "${FILESDIR}"/${P}-gcc5.patch
+	# openssl 1.1 compatibility, bug 674280
+	eapply -l "${FILESDIR}"/${PN}-libssl-1.1.patch
+	# portage takes care about striping binaries itself
+	sed -i 's:$(BIN_DIR)/strip $(DESTDIR)$(SBIN_DIR)/vtund::' Makefile.in || die
+
+	eapply_user
+}
+
+src_configure() {
+	econf \
+		$(use_enable ssl) \
+		$(use_enable zlib) \
+		$(use_enable lzo) \
+		$(use_enable socks5 socks) \
+		--enable-shaper
+}
+
+src_install() {
+	default
+	newinitd "${FILESDIR}"/vtun.rc vtun
+	insinto etc
+	doins "${FILESDIR}"/vtund-start.conf
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-vpn/vtun/, net-vpn/vtun/files/
@ 2021-01-12 10:49 David Seifert
  0 siblings, 0 replies; 3+ messages in thread
From: David Seifert @ 2021-01-12 10:49 UTC (permalink / raw
  To: gentoo-commits

commit:     fe3fa62844449e6a4c6d013aa06abf609f628a10
Author:     Jakov Smolic <jakov.smolic <AT> sartura <DOT> hr>
AuthorDate: Tue Jan 12 10:48:46 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Tue Jan 12 10:48:46 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe3fa628

net-vpn/vtun: Port to EAPI 7

Closes: https://bugs.gentoo.org/708372
Signed-off-by: Jakov Smolic <jakov.smolic <AT> sartura.hr>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../vtun-3.0.2-remove-config-presence-check.patch  |   4 +-
 net-vpn/vtun/files/vtun-3.0.3-C99-inline.patch     |  49 +++
 net-vpn/vtun/files/vtun-3.0.3-fno-common.patch     |  25 ++
 net-vpn/vtun/files/vtun-3.0.3-gcc5.patch           |   6 +-
 net-vpn/vtun/files/vtun-3.0.3-includes.patch       |  24 +-
 net-vpn/vtun/files/vtun-libssl-1.1.patch           | 458 ++++++++++-----------
 .../{vtun-3.0.3-r1.ebuild => vtun-3.0.3-r2.ebuild} |  44 +-
 7 files changed, 342 insertions(+), 268 deletions(-)

diff --git a/net-vpn/vtun/files/vtun-3.0.2-remove-config-presence-check.patch b/net-vpn/vtun/files/vtun-3.0.2-remove-config-presence-check.patch
index 15b3bf273c3..c2d9e7d999a 100644
--- a/net-vpn/vtun/files/vtun-3.0.2-remove-config-presence-check.patch
+++ b/net-vpn/vtun/files/vtun-3.0.2-remove-config-presence-check.patch
@@ -1,5 +1,5 @@
---- Makefile.in.orig	2012-06-11 23:31:11.416075337 +0400
-+++ Makefile.in	2012-06-11 23:31:21.247324839 +0400
+--- a/Makefile.in
++++ b/Makefile.in
 @@ -86,9 +86,7 @@
  
  install_config: 

diff --git a/net-vpn/vtun/files/vtun-3.0.3-C99-inline.patch b/net-vpn/vtun/files/vtun-3.0.3-C99-inline.patch
new file mode 100644
index 00000000000..0e7c68be8f1
--- /dev/null
+++ b/net-vpn/vtun/files/vtun-3.0.3-C99-inline.patch
@@ -0,0 +1,49 @@
+--- a/lfd_shaper.c
++++ b/lfd_shaper.c
+@@ -69,7 +69,7 @@ int shaper_counter(int len, char *in, char **out)
+ }
+ 
+ /* Convert tv struct to milisec */
+-unsigned long inline tv2ms(struct timeval tv)
++unsigned long tv2ms(struct timeval tv)
+ {
+      register unsigned long ms = (tv.tv_sec * 1000)+(tv.tv_usec / 1000); 
+      return  ms ? ms : 1;
+--- a/linkfd.c
++++ b/linkfd.c
+@@ -105,7 +105,7 @@ int lfd_free_mod(void)
+ }
+ 
+  /* Run modules down (from head to tail) */
+-inline int lfd_run_down(int len, char *in, char **out)
++int lfd_run_down(int len, char *in, char **out)
+ {
+      register struct lfd_mod *mod;
+      
+@@ -119,7 +119,7 @@ inline int lfd_run_down(int len, char *in, char **out)
+ }
+ 
+ /* Run modules up (from tail to head) */
+-inline int lfd_run_up(int len, char *in, char **out)
++int lfd_run_up(int len, char *in, char **out)
+ {
+      register struct lfd_mod *mod;
+      
+@@ -133,7 +133,7 @@ inline int lfd_run_up(int len, char *in, char **out)
+ }
+ 
+ /* Check if modules are accepting the data(down) */
+-inline int lfd_check_down(void)
++int lfd_check_down(void)
+ {
+      register struct lfd_mod *mod;
+      int err = 1;
+@@ -145,7 +145,7 @@ inline int lfd_check_down(void)
+ }
+ 
+ /* Check if modules are accepting the data(up) */
+-inline int lfd_check_up(void)
++int lfd_check_up(void)
+ {
+      register struct lfd_mod *mod;
+      int err = 1;

diff --git a/net-vpn/vtun/files/vtun-3.0.3-fno-common.patch b/net-vpn/vtun/files/vtun-3.0.3-fno-common.patch
new file mode 100644
index 00000000000..2dd6dd2e334
--- /dev/null
+++ b/net-vpn/vtun/files/vtun-3.0.3-fno-common.patch
@@ -0,0 +1,25 @@
+https://bugs.gentoo.org/708372
+--- a/auth.c
++++ b/auth.c
+@@ -70,7 +70,7 @@ void gen_chal(char *buf)
+ void encrypt_chal(char *chal, char *pwd)
+ { 
+    register int i;
+-   BF_KEY key;
++   extern BF_KEY key;
+ 
+    BF_set_key(&key, 16, MD5(pwd,strlen(pwd),NULL));
+ 
+--- a/lfd_encrypt.c
++++ b/lfd_encrypt.c
+@@ -64,8 +64,8 @@
+ #define ENC_BUF_SIZE VTUN_FRAME_SIZE + 128 
+ #define ENC_KEY_SIZE 16
+ 
+-BF_KEY key;
+-char * enc_buf;
++extern BF_KEY key;
++extern char * enc_buf;
+ char * dec_buf;
+ 
+ #define CIPHER_INIT		0

diff --git a/net-vpn/vtun/files/vtun-3.0.3-gcc5.patch b/net-vpn/vtun/files/vtun-3.0.3-gcc5.patch
index 99c6531d726..8270f7a4d9e 100644
--- a/net-vpn/vtun/files/vtun-3.0.3-gcc5.patch
+++ b/net-vpn/vtun/files/vtun-3.0.3-gcc5.patch
@@ -1,7 +1,5 @@
-Index: vtun-3.0.3/cfg_file.y
-===================================================================
---- vtun-3.0.3.orig/cfg_file.y
-+++ vtun-3.0.3/cfg_file.y
+--- a/cfg_file.y
++++ b/cfg_file.y
 @@ -624,7 +624,7 @@ int clear_nat_hack_client(void *d, void
  }
 

diff --git a/net-vpn/vtun/files/vtun-3.0.3-includes.patch b/net-vpn/vtun/files/vtun-3.0.3-includes.patch
index cd7cf6a2a2e..46ff5eca90a 100644
--- a/net-vpn/vtun/files/vtun-3.0.3-includes.patch
+++ b/net-vpn/vtun/files/vtun-3.0.3-includes.patch
@@ -1,5 +1,5 @@
---- a/lfd_encrypt.c	2008-01-07 23:35:32.000000000 +0100
-+++ b/lfd_encrypt.c	2010-09-18 04:53:31.000000000 +0200
+--- a/lfd_encrypt.c
++++ b/lfd_encrypt.c
 @@ -44,6 +44,7 @@
  #include <strings.h>
  #include <string.h>
@@ -8,8 +8,8 @@
  
  #include "vtun.h"
  #include "linkfd.h"
---- a/lib.c	2008-01-07 23:35:40.000000000 +0100
-+++ b/lib.c	2010-09-18 04:52:51.000000000 +0200
+--- a/lib.c
++++ b/lib.c
 @@ -34,6 +34,7 @@
  #include <sys/wait.h>
  #include <syslog.h>
@@ -18,8 +18,8 @@
  
  #include "vtun.h"
  #include "linkfd.h"
---- a/lib.h	2008-01-07 23:35:41.000000000 +0100
-+++ b/lib.h	2010-09-18 04:56:50.000000000 +0200
+--- a/lib.h
++++ b/lib.h
 @@ -26,6 +26,7 @@
  #include <sys/types.h>
  #include <signal.h>
@@ -28,8 +28,8 @@
  
  #ifdef HAVE_LIBUTIL_H
  #include <libutil.h>
---- a/vtun.h	2008-01-07 23:36:07.000000000 +0100
-+++ b/vtun.h	2010-09-18 04:56:08.000000000 +0200
+--- a/vtun.h
++++ b/vtun.h
 @@ -232,5 +232,9 @@
  int  read_config(char *file);
  struct vtun_host * find_host(char *host);
@@ -40,8 +40,8 @@
 +int recv_ib_mesg(int *len, char **in);
  
  #endif
---- a/lock.c	2008-01-07 23:35:50.000000000 +0100
-+++ b/lock.c	2010-09-18 05:01:21.000000000 +0200
+--- a/lock.c
++++ b/lock.c
 @@ -32,6 +32,7 @@
  #include <sys/types.h>
  #include <signal.h>
@@ -50,8 +50,8 @@
  
  #include "vtun.h"
  #include "linkfd.h"
---- a/lfd_shaper.c	2008-01-07 23:35:36.000000000 +0100
-+++ b/lfd_shaper.c	2010-09-18 05:07:12.000000000 +0200
+--- a/lfd_shaper.c
++++ b/lfd_shaper.c
 @@ -27,6 +27,7 @@
  #include <stdlib.h>
  #include <sys/time.h>

diff --git a/net-vpn/vtun/files/vtun-libssl-1.1.patch b/net-vpn/vtun/files/vtun-libssl-1.1.patch
index 76a3c027d88..f2bf0c1fa82 100644
--- a/net-vpn/vtun/files/vtun-libssl-1.1.patch
+++ b/net-vpn/vtun/files/vtun-libssl-1.1.patch
@@ -1,229 +1,229 @@
---- vtun-3.0.3/lfd_encrypt.c.orig       2019-02-25 18:43:39.310480427 -0500
-+++ vtun-3.0.3/lfd_encrypt.c    2019-02-25 18:55:26.956441285 -0500
-@@ -96,11 +96,11 @@
- char * pkey;
- char * iv_buf;
-
--EVP_CIPHER_CTX ctx_enc;        /* encrypt */
--EVP_CIPHER_CTX ctx_dec;        /* decrypt */
-+EVP_CIPHER_CTX *ctx_enc;       /* encrypt */
-+EVP_CIPHER_CTX *ctx_dec;       /* decrypt */
-
--EVP_CIPHER_CTX ctx_enc_ecb;    /* sideband ecb encrypt */
--EVP_CIPHER_CTX ctx_dec_ecb;    /* sideband ecb decrypt */
-+EVP_CIPHER_CTX *ctx_enc_ecb;   /* sideband ecb encrypt */
-+EVP_CIPHER_CTX *ctx_dec_ecb;   /* sideband ecb decrypt */
-
- int prep_key(char **key, int size, struct vtun_host *host)
- {
-@@ -152,6 +152,11 @@
-    EVP_CIPHER_CTX *pctx_enc;
-    EVP_CIPHER_CTX *pctx_dec;
-
-+   ctx_enc = EVP_CIPHER_CTX_new();
-+   ctx_dec = EVP_CIPHER_CTX_new();
-+   ctx_enc_ecb = EVP_CIPHER_CTX_new();
-+   ctx_dec_ecb = EVP_CIPHER_CTX_new();
-+
-    enc_init_first_time = 1;
-    dec_init_first_time = 1;
-
-@@ -178,15 +183,15 @@
-          keysize = 32;
-          sb_init = 1;
-          cipher_type = EVP_aes_256_ecb();
--         pctx_enc = &ctx_enc_ecb;
--         pctx_dec = &ctx_dec_ecb;
-+         pctx_enc = ctx_enc_ecb;
-+         pctx_dec = ctx_dec_ecb;
-       break;
-
-       case VTUN_ENC_AES256ECB:
-          blocksize = 16;
-          keysize = 32;
--         pctx_enc = &ctx_enc;
--         pctx_dec = &ctx_dec;
-+         pctx_enc = ctx_enc;
-+         pctx_dec = ctx_dec;
-          cipher_type = EVP_aes_256_ecb();
-          strcpy(cipher_name,"AES-256-ECB");
-       break;
-@@ -197,14 +202,14 @@
-          keysize = 16;
-          sb_init=1;
-          cipher_type = EVP_aes_128_ecb();
--         pctx_enc = &ctx_enc_ecb;
--         pctx_dec = &ctx_dec_ecb;
-+         pctx_enc = ctx_enc_ecb;
-+         pctx_dec = ctx_dec_ecb;
-       break;
-       case VTUN_ENC_AES128ECB:
-          blocksize = 16;
-          keysize = 16;
--         pctx_enc = &ctx_enc;
--         pctx_dec = &ctx_dec;
-+         pctx_enc = ctx_enc;
-+         pctx_dec = ctx_dec;
-          cipher_type = EVP_aes_128_ecb();
-          strcpy(cipher_name,"AES-128-ECB");
-       break;
-@@ -217,16 +222,16 @@
-          var_key = 1;
-          sb_init = 1;
-          cipher_type = EVP_bf_ecb();
--         pctx_enc = &ctx_enc_ecb;
--         pctx_dec = &ctx_dec_ecb;
-+         pctx_enc = ctx_enc_ecb;
-+         pctx_dec = ctx_dec_ecb;
-       break;
-
-       case VTUN_ENC_BF256ECB:
-          blocksize = 8;
-          keysize = 32;
-          var_key = 1;
--         pctx_enc = &ctx_enc;
--         pctx_dec = &ctx_dec;
-+         pctx_enc = ctx_enc;
-+         pctx_dec = ctx_dec;
-          cipher_type = EVP_bf_ecb();
-          strcpy(cipher_name,"Blowfish-256-ECB");
-       break;
-@@ -239,16 +244,16 @@
-          var_key = 1;
-          sb_init = 1;
-          cipher_type = EVP_bf_ecb();
--         pctx_enc = &ctx_enc_ecb;
--         pctx_dec = &ctx_dec_ecb;
-+         pctx_enc = ctx_enc_ecb;
-+         pctx_dec = ctx_dec_ecb;
-       break;
-       case VTUN_ENC_BF128ECB: /* blowfish 128 ecb is the default */
-       default:
-          blocksize = 8;
-          keysize = 16;
-          var_key = 1;
--         pctx_enc = &ctx_enc;
--         pctx_dec = &ctx_dec;
-+         pctx_enc = ctx_enc;
-+         pctx_dec = ctx_dec;
-          cipher_type = EVP_bf_ecb();
-          strcpy(cipher_name,"Blowfish-128-ECB");
-       break;
-@@ -290,10 +295,10 @@
-    lfd_free(enc_buf); enc_buf = NULL;
-    lfd_free(dec_buf); dec_buf = NULL;
-
--   EVP_CIPHER_CTX_cleanup(&ctx_enc);
--   EVP_CIPHER_CTX_cleanup(&ctx_dec);
--   EVP_CIPHER_CTX_cleanup(&ctx_enc_ecb);
--   EVP_CIPHER_CTX_cleanup(&ctx_dec_ecb);
-+   EVP_CIPHER_CTX_free(ctx_enc);
-+   EVP_CIPHER_CTX_free(ctx_dec);
-+   EVP_CIPHER_CTX_free(ctx_enc_ecb);
-+   EVP_CIPHER_CTX_free(ctx_dec_ecb);
-
-    return 0;
- }
-@@ -319,7 +324,7 @@
-    outlen=len+pad;
-    if (pad == blocksize)
-       RAND_bytes(in_ptr+len, blocksize-1);
--   EVP_EncryptUpdate(&ctx_enc, out_ptr, &outlen, in_ptr, len+pad);
-+   EVP_EncryptUpdate(ctx_enc, out_ptr, &outlen, in_ptr, len+pad);
-    *out = enc_buf;
-
-    sequence_num++;
-@@ -339,7 +344,7 @@
-
-    outlen=len;
-    if (!len) return 0;
--   EVP_DecryptUpdate(&ctx_dec, out_ptr, &outlen, in_ptr, len);
-+   EVP_DecryptUpdate(ctx_dec, out_ptr, &outlen, in_ptr, len);
-    recv_ib_mesg(&outlen, &out_ptr);
-    if (!outlen) return 0;
-    tmp_ptr = out_ptr + outlen; tmp_ptr--;
-@@ -427,13 +432,13 @@
-       break;
-    } /* switch(cipher) */
-
--   EVP_CIPHER_CTX_init(&ctx_enc);
--   EVP_EncryptInit_ex(&ctx_enc, cipher_type, NULL, NULL, NULL);
-+   EVP_CIPHER_CTX_init(ctx_enc);
-+   EVP_EncryptInit_ex(ctx_enc, cipher_type, NULL, NULL, NULL);
-    if (var_key)
--      EVP_CIPHER_CTX_set_key_length(&ctx_enc, keysize);
--   EVP_EncryptInit_ex(&ctx_enc, NULL, NULL, pkey, NULL);
--   EVP_EncryptInit_ex(&ctx_enc, NULL, NULL, NULL, iv);
--   EVP_CIPHER_CTX_set_padding(&ctx_enc, 0);
-+      EVP_CIPHER_CTX_set_key_length(ctx_enc, keysize);
-+   EVP_EncryptInit_ex(ctx_enc, NULL, NULL, pkey, NULL);
-+   EVP_EncryptInit_ex(ctx_enc, NULL, NULL, NULL, iv);
-+   EVP_CIPHER_CTX_set_padding(ctx_enc, 0);
-    if (enc_init_first_time)
-    {
-       sprintf(tmpstr,"%s encryption initialized", cipher_name);
-@@ -517,13 +522,13 @@
-       break;
-    } /* switch(cipher) */
-
--   EVP_CIPHER_CTX_init(&ctx_dec);
--   EVP_DecryptInit_ex(&ctx_dec, cipher_type, NULL, NULL, NULL);
-+   EVP_CIPHER_CTX_init(ctx_dec);
-+   EVP_DecryptInit_ex(ctx_dec, cipher_type, NULL, NULL, NULL);
-    if (var_key)
--      EVP_CIPHER_CTX_set_key_length(&ctx_dec, keysize);
--   EVP_DecryptInit_ex(&ctx_dec, NULL, NULL, pkey, NULL);
--   EVP_DecryptInit_ex(&ctx_dec, NULL, NULL, NULL, iv);
--   EVP_CIPHER_CTX_set_padding(&ctx_dec, 0);
-+      EVP_CIPHER_CTX_set_key_length(ctx_dec, keysize);
-+   EVP_DecryptInit_ex(ctx_dec, NULL, NULL, pkey, NULL);
-+   EVP_DecryptInit_ex(ctx_dec, NULL, NULL, NULL, iv);
-+   EVP_CIPHER_CTX_set_padding(ctx_dec, 0);
-    if (dec_init_first_time)
-    {
-       sprintf(tmpstr,"%s decryption initialized", cipher_name);
-@@ -555,7 +560,7 @@
-
-          in_ptr = in - blocksize*2;
-          outlen = blocksize*2;
--         EVP_EncryptUpdate(&ctx_enc_ecb, in_ptr,
-+         EVP_EncryptUpdate(ctx_enc_ecb, in_ptr,
-             &outlen, in_ptr, blocksize*2);
-          *out = in_ptr;
-          len = outlen;
-@@ -582,7 +587,7 @@
-          in_ptr = in;
-          iv = malloc(blocksize);
-          outlen = blocksize*2;
--         EVP_DecryptUpdate(&ctx_dec_ecb, in_ptr, &outlen, in_ptr, blocksize*2);
-+         EVP_DecryptUpdate(ctx_dec_ecb, in_ptr, &outlen, in_ptr, blocksize*2);
-
-          if ( !strncmp(in_ptr, "ivec", 4) )
-          {
-@@ -625,7 +630,7 @@
-                if (cipher_enc_state != CIPHER_INIT)
-                {
-                   cipher_enc_state = CIPHER_INIT;
--                  EVP_CIPHER_CTX_cleanup(&ctx_enc);
-+                  EVP_CIPHER_CTX_cleanup(ctx_enc);
- #ifdef LFD_ENCRYPT_DEBUG
-                   vtun_syslog(LOG_INFO,
-                      "Forcing local encryptor re-init");
-@@ -706,7 +711,7 @@
-          if (cipher_enc_state != CIPHER_INIT)
-          {
-             cipher_enc_state = CIPHER_INIT;
--            EVP_CIPHER_CTX_cleanup(&ctx_enc);
-+            EVP_CIPHER_CTX_cleanup(ctx_enc);
-          }
- #ifdef LFD_ENCRYPT_DEBUG
-          vtun_syslog(LOG_INFO, "Remote requests encryptor re-init");
-@@ -720,7 +725,7 @@
-              cipher_enc_state != CIPHER_REQ_INIT &&
-              cipher_enc_state != CIPHER_INIT)
-          {
--            EVP_CIPHER_CTX_cleanup (&ctx_dec);
-+            EVP_CIPHER_CTX_cleanup (ctx_dec);
-             cipher_dec_state = CIPHER_INIT;
-             cipher_enc_state = CIPHER_REQ_INIT;
-          }
+--- a/lfd_encrypt.c
++++ b/lfd_encrypt.c
+@@ -96,11 +96,11 @@ unsigned long sequence_num;
+ char * pkey;
+ char * iv_buf;
+ 
+-EVP_CIPHER_CTX ctx_enc;	/* encrypt */
+-EVP_CIPHER_CTX ctx_dec;	/* decrypt */
++EVP_CIPHER_CTX *ctx_enc;	/* encrypt */
++EVP_CIPHER_CTX *ctx_dec;	/* decrypt */
+ 
+-EVP_CIPHER_CTX ctx_enc_ecb;	/* sideband ecb encrypt */
+-EVP_CIPHER_CTX ctx_dec_ecb;	/* sideband ecb decrypt */
++EVP_CIPHER_CTX *ctx_enc_ecb;	/* sideband ecb encrypt */
++EVP_CIPHER_CTX *ctx_dec_ecb;	/* sideband ecb decrypt */
+ 
+ int prep_key(char **key, int size, struct vtun_host *host)
+ {
+@@ -151,6 +151,11 @@ int alloc_encrypt(struct vtun_host *host)
+    char cipher_name[32];
+    EVP_CIPHER_CTX *pctx_enc;
+    EVP_CIPHER_CTX *pctx_dec;
++   
++   ctx_enc = EVP_CIPHER_CTX_new();
++   ctx_dec = EVP_CIPHER_CTX_new();
++   ctx_enc_ecb = EVP_CIPHER_CTX_new();
++   ctx_dec_ecb = EVP_CIPHER_CTX_new();
+ 
+    enc_init_first_time = 1;   
+    dec_init_first_time = 1;   
+@@ -178,15 +183,15 @@ int alloc_encrypt(struct vtun_host *host)
+          keysize = 32;
+          sb_init = 1;
+          cipher_type = EVP_aes_256_ecb();
+-         pctx_enc = &ctx_enc_ecb;
+-         pctx_dec = &ctx_dec_ecb;
++         pctx_enc = ctx_enc_ecb;
++         pctx_dec = ctx_dec_ecb;
+       break;
+       
+       case VTUN_ENC_AES256ECB:
+          blocksize = 16;
+          keysize = 32;
+-         pctx_enc = &ctx_enc;
+-         pctx_dec = &ctx_dec;
++         pctx_enc = ctx_enc;
++         pctx_dec = ctx_dec;
+          cipher_type = EVP_aes_256_ecb();
+          strcpy(cipher_name,"AES-256-ECB");
+       break;      
+@@ -197,14 +202,14 @@ int alloc_encrypt(struct vtun_host *host)
+          keysize = 16;
+          sb_init=1;
+          cipher_type = EVP_aes_128_ecb();
+-         pctx_enc = &ctx_enc_ecb;
+-         pctx_dec = &ctx_dec_ecb;
++         pctx_enc = ctx_enc_ecb;
++         pctx_dec = ctx_dec_ecb;
+       break;
+       case VTUN_ENC_AES128ECB:
+          blocksize = 16;
+          keysize = 16;
+-         pctx_enc = &ctx_enc;
+-         pctx_dec = &ctx_dec;
++         pctx_enc = ctx_enc;
++         pctx_dec = ctx_dec;
+          cipher_type = EVP_aes_128_ecb();
+          strcpy(cipher_name,"AES-128-ECB");
+       break;
+@@ -217,16 +222,16 @@ int alloc_encrypt(struct vtun_host *host)
+          var_key = 1;
+          sb_init = 1;
+          cipher_type = EVP_bf_ecb();
+-         pctx_enc = &ctx_enc_ecb;
+-         pctx_dec = &ctx_dec_ecb;
++         pctx_enc = ctx_enc_ecb;
++         pctx_dec = ctx_dec_ecb;
+       break;
+ 
+       case VTUN_ENC_BF256ECB:
+          blocksize = 8;
+          keysize = 32;
+          var_key = 1;
+-         pctx_enc = &ctx_enc;
+-         pctx_dec = &ctx_dec;
++         pctx_enc = ctx_enc;
++         pctx_dec = ctx_dec;
+          cipher_type = EVP_bf_ecb();
+          strcpy(cipher_name,"Blowfish-256-ECB");
+       break;
+@@ -239,16 +244,16 @@ int alloc_encrypt(struct vtun_host *host)
+          var_key = 1;
+          sb_init = 1;
+          cipher_type = EVP_bf_ecb();
+-         pctx_enc = &ctx_enc_ecb;
+-         pctx_dec = &ctx_dec_ecb;
++         pctx_enc = ctx_enc_ecb;
++         pctx_dec = ctx_dec_ecb;
+       break;
+       case VTUN_ENC_BF128ECB: /* blowfish 128 ecb is the default */
+       default:
+          blocksize = 8;
+          keysize = 16;
+          var_key = 1;
+-         pctx_enc = &ctx_enc;
+-         pctx_dec = &ctx_dec;
++         pctx_enc = ctx_enc;
++         pctx_dec = ctx_dec;
+          cipher_type = EVP_bf_ecb();
+          strcpy(cipher_name,"Blowfish-128-ECB");
+       break;
+@@ -290,10 +295,10 @@ int free_encrypt()
+    lfd_free(enc_buf); enc_buf = NULL;
+    lfd_free(dec_buf); dec_buf = NULL;
+ 
+-   EVP_CIPHER_CTX_cleanup(&ctx_enc);
+-   EVP_CIPHER_CTX_cleanup(&ctx_dec);
+-   EVP_CIPHER_CTX_cleanup(&ctx_enc_ecb);
+-   EVP_CIPHER_CTX_cleanup(&ctx_dec_ecb);
++   EVP_CIPHER_CTX_cleanup(ctx_enc);
++   EVP_CIPHER_CTX_cleanup(ctx_dec);
++   EVP_CIPHER_CTX_cleanup(ctx_enc_ecb);
++   EVP_CIPHER_CTX_cleanup(ctx_dec_ecb);
+ 
+    return 0;
+ }
+@@ -319,7 +324,7 @@ int encrypt_buf(int len, char *in, char **out)
+    outlen=len+pad;
+    if (pad == blocksize)
+       RAND_bytes(in_ptr+len, blocksize-1);
+-   EVP_EncryptUpdate(&ctx_enc, out_ptr, &outlen, in_ptr, len+pad);
++   EVP_EncryptUpdate(&ctx_enc, out_ptr, outlen, in_ptr, len+pad);
+    *out = enc_buf;
+ 
+    sequence_num++;
+@@ -339,7 +344,7 @@ int decrypt_buf(int len, char *in, char **out)
+ 
+    outlen=len;
+    if (!len) return 0;
+-   EVP_DecryptUpdate(&ctx_dec, out_ptr, &outlen, in_ptr, len);
++   EVP_DecryptUpdate(ctx_dec, out_ptr, &outlen, in_ptr, len);
+    recv_ib_mesg(&outlen, &out_ptr);
+    if (!outlen) return 0;
+    tmp_ptr = out_ptr + outlen; tmp_ptr--;
+@@ -427,13 +432,13 @@ int cipher_enc_init(char * iv)
+       break;
+    } /* switch(cipher) */
+ 
+-   EVP_CIPHER_CTX_init(&ctx_enc);
+-   EVP_EncryptInit_ex(&ctx_enc, cipher_type, NULL, NULL, NULL);
++   EVP_CIPHER_CTX_init(ctx_enc);
++   EVP_EncryptInit_ex(ctx_enc, cipher_type, NULL, NULL, NULL);
+    if (var_key)
+-      EVP_CIPHER_CTX_set_key_length(&ctx_enc, keysize);
+-   EVP_EncryptInit_ex(&ctx_enc, NULL, NULL, pkey, NULL);
+-   EVP_EncryptInit_ex(&ctx_enc, NULL, NULL, NULL, iv);
+-   EVP_CIPHER_CTX_set_padding(&ctx_enc, 0);
++      EVP_CIPHER_CTX_set_key_length(ctx_enc, keysize);
++   EVP_EncryptInit_ex(ctx_enc, NULL, NULL, pkey, NULL);
++   EVP_EncryptInit_ex(ctx_enc, NULL, NULL, NULL, iv);
++   EVP_CIPHER_CTX_set_padding(ctx_enc, 0);
+    if (enc_init_first_time)
+    {
+       sprintf(tmpstr,"%s encryption initialized", cipher_name);
+@@ -517,13 +522,13 @@ int cipher_dec_init(char * iv)
+       break;
+    } /* switch(cipher) */
+ 
+-   EVP_CIPHER_CTX_init(&ctx_dec);
+-   EVP_DecryptInit_ex(&ctx_dec, cipher_type, NULL, NULL, NULL);
++   EVP_CIPHER_CTX_init(ctx_dec);
++   EVP_DecryptInit_ex(ctx_dec, cipher_type, NULL, NULL, NULL);
+    if (var_key)
+-      EVP_CIPHER_CTX_set_key_length(&ctx_dec, keysize);
+-   EVP_DecryptInit_ex(&ctx_dec, NULL, NULL, pkey, NULL);
+-   EVP_DecryptInit_ex(&ctx_dec, NULL, NULL, NULL, iv);
+-   EVP_CIPHER_CTX_set_padding(&ctx_dec, 0);
++      EVP_CIPHER_CTX_set_key_length(ctx_dec, keysize);
++   EVP_DecryptInit_ex(ctx_dec, NULL, NULL, pkey, NULL);
++   EVP_DecryptInit_ex(ctx_dec, NULL, NULL, NULL, iv);
++   EVP_CIPHER_CTX_set_padding(ctx_dec, 0);
+    if (dec_init_first_time)
+    {
+       sprintf(tmpstr,"%s decryption initialized", cipher_name);
+@@ -555,7 +560,7 @@ int send_msg(int len, char *in, char **out)
+ 
+          in_ptr = in - blocksize*2;
+          outlen = blocksize*2;
+-         EVP_EncryptUpdate(&ctx_enc_ecb, in_ptr, 
++         EVP_EncryptUpdate(ctx_enc_ecb, in_ptr, 
+             &outlen, in_ptr, blocksize*2);
+          *out = in_ptr;
+          len = outlen;
+@@ -582,7 +587,7 @@ int recv_msg(int len, char *in, char **out)
+          in_ptr = in;
+          iv = malloc(blocksize);
+          outlen = blocksize*2;
+-         EVP_DecryptUpdate(&ctx_dec_ecb, in_ptr, &outlen, in_ptr, blocksize*2);
++         EVP_DecryptUpdate(ctx_dec_ecb, in_ptr, &outlen, in_ptr, blocksize*2);
+          
+          if ( !strncmp(in_ptr, "ivec", 4) )
+          {
+@@ -625,7 +630,7 @@ int recv_msg(int len, char *in, char **out)
+                if (cipher_enc_state != CIPHER_INIT)
+                {
+                   cipher_enc_state = CIPHER_INIT;
+-                  EVP_CIPHER_CTX_cleanup(&ctx_enc);
++                  EVP_CIPHER_CTX_cleanup(ctx_enc);
+ #ifdef LFD_ENCRYPT_DEBUG
+                   vtun_syslog(LOG_INFO, 
+                      "Forcing local encryptor re-init");
+@@ -706,7 +711,7 @@ int recv_ib_mesg(int *len, char **in)
+          if (cipher_enc_state != CIPHER_INIT)
+          {
+             cipher_enc_state = CIPHER_INIT;
+-            EVP_CIPHER_CTX_cleanup(&ctx_enc);
++            EVP_CIPHER_CTX_cleanup(ctx_enc);
+          }
+ #ifdef LFD_ENCRYPT_DEBUG
+          vtun_syslog(LOG_INFO, "Remote requests encryptor re-init");
+@@ -720,7 +725,7 @@ int recv_ib_mesg(int *len, char **in)
+              cipher_enc_state != CIPHER_REQ_INIT &&
+              cipher_enc_state != CIPHER_INIT)
+          {
+-            EVP_CIPHER_CTX_cleanup (&ctx_dec);
++            EVP_CIPHER_CTX_cleanup (ctx_dec);
+             cipher_dec_state = CIPHER_INIT;
+             cipher_enc_state = CIPHER_REQ_INIT;
+          }

diff --git a/net-vpn/vtun/vtun-3.0.3-r1.ebuild b/net-vpn/vtun/vtun-3.0.3-r2.ebuild
similarity index 60%
rename from net-vpn/vtun/vtun-3.0.3-r1.ebuild
rename to net-vpn/vtun/vtun-3.0.3-r2.ebuild
index 48ca1ccaade..2152bb74e3c 100644
--- a/net-vpn/vtun/vtun-3.0.3-r1.ebuild
+++ b/net-vpn/vtun/vtun-3.0.3-r2.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 
 inherit linux-info
 
@@ -14,32 +14,33 @@ SLOT="0"
 KEYWORDS="~alpha amd64 ppc ~sparc x86"
 IUSE="lzo socks5 ssl zlib"
 
-RDEPEND="ssl? ( dev-libs/openssl:0 )
+RDEPEND="
 	lzo? ( dev-libs/lzo:2 )
-	zlib? ( sys-libs/zlib )
-	socks5? ( net-proxy/dante )"
-DEPEND="${RDEPEND}
-	sys-devel/bison"
-
-DOCS="ChangeLog Credits FAQ README README.Setup README.Shaper TODO"
+	socks5? ( net-proxy/dante )
+	ssl? ( dev-libs/openssl:0= )
+	zlib? ( sys-libs/zlib )"
+DEPEND="${RDEPEND}"
+BDEPEND="sys-devel/bison"
 
+DOCS=( ChangeLog Credits FAQ README README.Setup README.Shaper TODO )
 CONFIG_CHECK="~TUN"
 
-src_prepare() {
-	sed -i Makefile.in \
-		-e '/^LDFLAGS/s|=|+=|g' \
-		|| die "sed Makefile"
-	eapply "${FILESDIR}"/${P}-includes.patch
+PATCHES=(
+	"${FILESDIR}"/${P}-includes.patch
 	# remove unneeded checking for /etc/vtund.conf
-	eapply -p0 "${FILESDIR}"/${PN}-3.0.2-remove-config-presence-check.patch
+	"${FILESDIR}"/${PN}-3.0.2-remove-config-presence-check.patch
 	# GCC 5 compatibility, patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=778164
-	eapply "${FILESDIR}"/${P}-gcc5.patch
+	"${FILESDIR}"/${P}-gcc5.patch
 	# openssl 1.1 compatibility, bug 674280
-	eapply -l "${FILESDIR}"/${PN}-libssl-1.1.patch
-	# portage takes care about striping binaries itself
-	sed -i 's:$(BIN_DIR)/strip $(DESTDIR)$(SBIN_DIR)/vtund::' Makefile.in || die
+	"${FILESDIR}"/${PN}-libssl-1.1.patch
+	"${FILESDIR}"/${P}-fno-common.patch
+	"${FILESDIR}"/${P}-C99-inline.patch
+)
 
-	eapply_user
+src_prepare() {
+	default
+	sed -i -e '/^LDFLAGS/s|=|+=|g' Makefile.in || die
+	sed -i 's:$(BIN_DIR)/strip $(DESTDIR)$(SBIN_DIR)/vtund::' Makefile.in || die
 }
 
 src_configure() {
@@ -54,6 +55,7 @@ src_configure() {
 src_install() {
 	default
 	newinitd "${FILESDIR}"/vtun.rc vtun
-	insinto etc
+	insinto /etc
 	doins "${FILESDIR}"/vtund-start.conf
+	rm -r "${ED}"/var || die
 }


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-vpn/vtun/, net-vpn/vtun/files/
@ 2023-06-10 21:36 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2023-06-10 21:36 UTC (permalink / raw
  To: gentoo-commits

commit:     ce94e4574d13d9a3bdd78114d9df75a938ad62d4
Author:     Jan-Espen Oversand <sigsegv <AT> radiotube <DOT> org>
AuthorDate: Sat Jun 10 21:14:06 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 10 21:36:33 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce94e457

net-vpn/vtun: add 3.0.4-r4

explicit bdep bison due to using extension features

Closes: https://bugs.gentoo.org/907988
Signed-off-by: Jan-Espen Oversand <sigsegv <AT> radiotube.org>
Closes: https://github.com/gentoo/gentoo/pull/31379
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../vtun/files/vtun-3.0.4-use-bison-for-yacc.patch | 40 ++++++++++++++
 net-vpn/vtun/vtun-3.0.4-r4.ebuild                  | 62 ++++++++++++++++++++++
 2 files changed, 102 insertions(+)

diff --git a/net-vpn/vtun/files/vtun-3.0.4-use-bison-for-yacc.patch b/net-vpn/vtun/files/vtun-3.0.4-use-bison-for-yacc.patch
new file mode 100644
index 000000000000..40c934c7ea81
--- /dev/null
+++ b/net-vpn/vtun/files/vtun-3.0.4-use-bison-for-yacc.patch
@@ -0,0 +1,40 @@
+--- a/configure.in	2016-10-01 23:46:01.000000000 +0200
++++ b/configure.in	2023-06-10 22:44:20.873592074 +0200
+@@ -82,11 +82,14 @@
+ AC_CANONICAL_SYSTEM
+ 
+ dnl Check for programs.
+-AC_PROG_YACC
+ AC_PROG_LEX
+ AC_PROG_CC
+ AC_PROG_INSTALL
+ 
++AC_ARG_VAR([BISON], [bison command for yacc parsing])
++AC_CHECK_PROG([BISON], [bison -y], [bison -y], [no])
++AS_IF([test "x$BISON" = "xno"], [AC_MSG_ERROR([bison not found])])
++
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+ AC_C_INLINE
+--- a/Makefile.in	2016-10-01 23:46:00.000000000 +0200
++++ b/Makefile.in	2023-06-10 23:00:25.278904190 +0200
+@@ -21,8 +21,8 @@
+ CFLAGS = @CFLAGS@ @CPPFLAGS@
+ LDFLAGS = @LDFLAGS@ @LIBS@
+ 
+-YACC = @YACC@
+-YACCFLAGS = -d
++BISON = @BISON@
++BISONFLAGS = -d
+ 
+ LEX = @LEX@
+ LEXFLAGS = -t 
+@@ -62,7 +62,7 @@
+ 	$(CC) $(CFLAGS) -o vtund $(OBJS) $(LFD_OBJS) $(LDFLAGS)
+ 
+ cfg_file.tab.h:
+-	$(YACC) $(YACCFLAGS) -b cfg_file cfg_file.y
++	$(BISON) $(BISONFLAGS) -b cfg_file cfg_file.y
+ 
+ cfg_file.tab.c: cfg_file.y cfg_kwords.h config.h cfg_file.tab.h
+ 

diff --git a/net-vpn/vtun/vtun-3.0.4-r4.ebuild b/net-vpn/vtun/vtun-3.0.4-r4.ebuild
new file mode 100644
index 000000000000..81eaa36bd9e3
--- /dev/null
+++ b/net-vpn/vtun/vtun-3.0.4-r4.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit linux-info autotools
+
+DESCRIPTION="Create tunnels over TCP/IP networks with shaping, encryption, and compression"
+SRC_URI="https://sourceforge.net/projects/vtun/files/${PN}/${PV}/${P}.tar.gz"
+HOMEPAGE="https://vtun.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
+IUSE="lzo socks5 ssl zlib"
+
+RDEPEND="
+	lzo? ( dev-libs/lzo:2 )
+	socks5? ( net-proxy/dante )
+	ssl? ( dev-libs/openssl:0= )
+	zlib? ( sys-libs/zlib )
+	dev-libs/libbsd"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	app-alternatives/lex
+	sys-devel/bison
+"
+
+DOCS=( ChangeLog Credits FAQ README README.Setup README.Shaper TODO )
+CONFIG_CHECK="~TUN"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-libssl-ctx.patch
+	"${FILESDIR}"/${P}-includes.patch
+	"${FILESDIR}"/${P}-naughty-inlines.patch
+	"${FILESDIR}"/${P}-autoconf-fork-not-working.patch
+	"${FILESDIR}"/${P}-use-bison-for-yacc.patch
+)
+
+src_prepare() {
+	default
+	eautoreconf
+	sed -i -e '/^LDFLAGS/s|=|+=|g' Makefile.in || die
+	sed -i 's:$(BIN_DIR)/strip $(DESTDIR)$(SBIN_DIR)/vtund::' Makefile.in || die
+}
+
+src_configure() {
+	econf \
+		$(use_enable ssl) \
+		$(use_enable zlib) \
+		$(use_enable lzo) \
+		$(use_enable socks5 socks) \
+		--enable-shaper
+}
+
+src_install() {
+	default
+	newinitd "${FILESDIR}"/vtun.rc vtun
+	insinto /etc
+	doins "${FILESDIR}"/vtund-start.conf
+	rm -r "${ED}"/var || die
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-10 21:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-14  7:18 [gentoo-commits] repo/gentoo:master commit in: net-vpn/vtun/, net-vpn/vtun/files/ Hans de Graaff
  -- strict thread matches above, loose matches on Subject: below --
2021-01-12 10:49 David Seifert
2023-06-10 21:36 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox