summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity/openconnect
diff options
context:
space:
mode:
authorMax Krummenacher <max.oss.09@gmail.com>2020-02-15 16:59:34 +0100
committerKhem Raj <raj.khem@gmail.com>2020-02-16 12:52:19 -0800
commitc24a06107d739d2496779951eeaca54f2ba9fe68 (patch)
treeabdbcf8123489b3b3ceb61151209c22e213e7994 /meta-networking/recipes-connectivity/openconnect
parent546b7900f6694a7df4d6d33c798da91d621ef393 (diff)
downloadmeta-openembedded-c24a06107d739d2496779951eeaca54f2ba9fe68.tar.gz
openconnect: build with python3
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-connectivity/openconnect')
-rw-r--r--meta-networking/recipes-connectivity/openconnect/openconnect/0001-trojans-tncc-wrapper.py-convert-to-python3.patch71
-rw-r--r--meta-networking/recipes-connectivity/openconnect/openconnect_8.03.bb12
2 files changed, 76 insertions, 7 deletions
diff --git a/meta-networking/recipes-connectivity/openconnect/openconnect/0001-trojans-tncc-wrapper.py-convert-to-python3.patch b/meta-networking/recipes-connectivity/openconnect/openconnect/0001-trojans-tncc-wrapper.py-convert-to-python3.patch
new file mode 100644
index 000000000..623ec101d
--- /dev/null
+++ b/meta-networking/recipes-connectivity/openconnect/openconnect/0001-trojans-tncc-wrapper.py-convert-to-python3.patch
@@ -0,0 +1,71 @@
1From de78bcac5e1fd13de0371c8e14b062b8786ade56 Mon Sep 17 00:00:00 2001
2From: Max Krummenacher <max.krummenacher@toradex.com>
3Date: Sun, 2 Feb 2020 15:53:05 +0000
4Subject: [PATCH] trojans/tncc-wrapper.py: convert to python3
5
6Use 2to3 to convert the script to python3.
7
8Upstream-Status: Pending
9
10Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
11---
12 trojans/tncc-wrapper.py | 14 +++++++-------
13 1 file changed, 7 insertions(+), 7 deletions(-)
14
15diff --git a/trojans/tncc-wrapper.py b/trojans/tncc-wrapper.py
16index 0d4587bf..1a9a1f4d 100755
17--- a/trojans/tncc-wrapper.py
18+++ b/trojans/tncc-wrapper.py
19@@ -1,4 +1,4 @@
20-#!/usr/bin/python2
21+#!/usr/bin/python3
22
23 # Lifted from Russ Dill's juniper-vpn-wrap.py, thus:
24 #
25@@ -18,19 +18,19 @@
26
27 import subprocess
28 import mechanize
29-import cookielib
30+import http.cookiejar
31 import getpass
32 import sys
33 import os
34 import zipfile
35-import urllib
36+import urllib.request, urllib.parse, urllib.error
37 import socket
38 import ssl
39 import errno
40 import argparse
41 import atexit
42 import signal
43-import ConfigParser
44+import configparser
45 import time
46 import binascii
47 import hmac
48@@ -39,7 +39,7 @@ import hashlib
49 def mkdir_p(path):
50 try:
51 os.mkdir(path)
52- except OSError, exc:
53+ except OSError as exc:
54 if exc.errno == errno.EEXIST and os.path.isdir(path):
55 pass
56 else:
57@@ -64,9 +64,9 @@ class Tncc:
58 if zipfile.ZipFile(self.tncc_jar, 'r').testzip() is not None:
59 raise Exception()
60 except:
61- print 'Downloading tncc.jar...'
62+ print('Downloading tncc.jar...')
63 mkdir_p(os.path.expanduser('~/.juniper_networks'))
64- urllib.urlretrieve('https://' + self.vpn_host
65+ urllib.request.urlretrieve('https://' + self.vpn_host
66 + '/dana-cached/hc/tncc.jar', self.tncc_jar)
67
68 with zipfile.ZipFile(self.tncc_jar, 'r') as jar:
69--
702.20.1
71
diff --git a/meta-networking/recipes-connectivity/openconnect/openconnect_8.03.bb b/meta-networking/recipes-connectivity/openconnect/openconnect_8.03.bb
index ec36a375a..974ff4547 100644
--- a/meta-networking/recipes-connectivity/openconnect/openconnect_8.03.bb
+++ b/meta-networking/recipes-connectivity/openconnect/openconnect_8.03.bb
@@ -2,11 +2,14 @@ SUMMARY = "Open client for Cisco AnyConnect VPN"
2LICENSE = "LGPLv2.1" 2LICENSE = "LGPLv2.1"
3LIC_FILES_CHKSUM = "file://COPYING.LGPL;md5=243b725d71bb5df4a1e5920b344b86ad" 3LIC_FILES_CHKSUM = "file://COPYING.LGPL;md5=243b725d71bb5df4a1e5920b344b86ad"
4 4
5SRC_URI = "git://git.infradead.org/users/dwmw2/openconnect.git" 5SRC_URI = " \
6 git://git.infradead.org/users/dwmw2/openconnect.git \
7 file://0001-trojans-tncc-wrapper.py-convert-to-python3.patch \
8"
6SRCREV = "ea73851969ae7a6ea54fdd2d2b8c94776af24b2a" 9SRCREV = "ea73851969ae7a6ea54fdd2d2b8c94776af24b2a"
7 10
8DEPENDS = "vpnc libxml2 krb5 gettext-native" 11DEPENDS = "vpnc libxml2 krb5 gettext-native"
9RDEPENDS_${PN} = "bash python" 12RDEPENDS_${PN} = "bash python3-core"
10 13
11PACKAGECONFIG ??= "gnutls lz4 libproxy" 14PACKAGECONFIG ??= "gnutls lz4 libproxy"
12 15
@@ -24,8 +27,3 @@ inherit autotools pkgconfig
24 27
25EXTRA_OECONF += "--with-vpnc-script=${SYSROOT_DESTDIR}${sysconfdir}/vpnc/vpnc-script \ 28EXTRA_OECONF += "--with-vpnc-script=${SYSROOT_DESTDIR}${sysconfdir}/vpnc/vpnc-script \
26 --disable-static" 29 --disable-static"
27
28do_configure_append() {
29 # script has /usr/bin/python2 path hardcoded
30 sed -i -e 's=python2\.*=python=g' ${S}/trojans/tncc-wrapper.py
31}