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-misc/openconnect
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-misc/openconnect')
-rw-r--r--net-misc/openconnect/Manifest7
-rw-r--r--net-misc/openconnect/files/openconnect.conf.in26
-rw-r--r--net-misc/openconnect/files/openconnect.init.in123
-rw-r--r--net-misc/openconnect/files/openconnect.init.in-r2144
-rw-r--r--net-misc/openconnect/files/openconnect.init.in-r3145
-rw-r--r--net-misc/openconnect/files/openconnect.init.in-r489
-rw-r--r--net-misc/openconnect/files/openconnect.logrotate8
-rw-r--r--net-misc/openconnect/metadata.xml20
-rw-r--r--net-misc/openconnect/openconnect-4.08.ebuild144
-rw-r--r--net-misc/openconnect/openconnect-6.00.ebuild153
-rw-r--r--net-misc/openconnect/openconnect-7.02.ebuild150
-rw-r--r--net-misc/openconnect/openconnect-7.06-r1.ebuild159
-rw-r--r--net-misc/openconnect/openconnect-7.06.ebuild158
13 files changed, 1326 insertions, 0 deletions
diff --git a/net-misc/openconnect/Manifest b/net-misc/openconnect/Manifest
new file mode 100644
index 000000000000..1d4ddc4661b1
--- /dev/null
+++ b/net-misc/openconnect/Manifest
@@ -0,0 +1,7 @@
+DIST openconnect-4.08.tar.gz 1214464 SHA256 114eef2b5a8087f26c7871db8700a293101e9626fc94fbef54ac6daef6ce1a77 SHA512 0731a2bb85f1f98c232a73c03962d8854e58b9aa9687a1521ed142e3aadbd9ba76e760a6fbc9fe3d61d5236fcb82af21aba0c50cb27b4c1a5b7f82f9bb9836a0 WHIRLPOOL fd4a52ceb804e2ef77939dcf8b111cf7dacf956dee6a1421b436b595961a14c038f3cf4bc3bb67e91b20a5b5a8473e27123d403c369864a78130ee9f5cd552ff
+DIST openconnect-6.00.tar.gz 1021981 SHA256 8a0c684dccac2447d204d544f6f466e41b21bce71e033ba58e2cb17b795ab81c SHA512 98c39fdbf6931bc20521de107752ffad1cd99381f4a221cc6ab3f43b6a779f5259ed082e05044c25d61bd32f7f3ade28adfdc3bc2535c2e6acb27375a9591e0c WHIRLPOOL dd3a037def1c192bb9c203b6a97185164f0a5f9ff224f64ab0b36482bd45d57ed4b83a79ac71186d93a29a6d4417c8fe0edd7fd08adf6df1f69f59cc807b6f2f
+DIST openconnect-7.02.tar.gz 1136137 SHA256 083626e6f2a87393dd13f379a222bf27b0d57fe1ca286d5f3731d4a444ee7169 SHA512 2452308913e5fabf6824dc46baee3ee8493153788b2f6ee0e2e2ab94fa0b00b1604e09140aba3f8a81e121addedd2ca20d3989509ac2d336b69e3c6a7b753757 WHIRLPOOL 0c10c572f0de0583dea746aff45d1ccab5e13623b854bdf665a55f60f74d135dcb2d94b98561985b0bac5fb923872e45f6fd1d3637209875390871cd7783e351
+DIST openconnect-7.06.tar.gz 1343870 SHA256 facf695368dc4537a6a30e2147be90b1d77ee3cb2d269eaef070b6d9ddab70f2 SHA512 d1af9efe4ac1f6671dc6b92db0df981e8cae3f2f50b8b4c35a112b42a76517b7c8ea9fd5da93352445dd61da3012bf34fdbcc3add9d8727cbaad7d311e516108 WHIRLPOOL b1b98bf8d900714eb7c7ab82bbd4371050f307b7872bd70b4b9c31f72bb15670842f41c381cbe31aad7e5e98bccbe0663e49b988d5c321c706719b8fa19a2654
+DIST openconnect-script-20121108205904.tar.gz 6380 SHA256 99fb6c72c13b5724766a952e392b75774771f220f59793e5d2576d7e3412555b SHA512 089650538f035875c205bed0190e44ed8176a138bbe2f635ac5335050c3b831fc85fbd61448ddaf7cb540c0a5d9b32f8f909e1fd5be188bfef07e721d4656545 WHIRLPOOL 3dc2b820afe49cc59c96d514f166d94fdbc3db9f3edbace69e41ae7e604263a834fff0a1fa7be806ff88c328a75de4306ec159e4022d43cd245addf34615efb2
+DIST openconnect-script-20140311.tar.xz 6240 SHA256 908c667507132ef0269b6d1511ee8b89ae22dfa272c9ffa7ea24c1fa1b31fceb SHA512 043443c615b076d61ea8c464a6b7b68ca526e636313488501459f6eca6974c276d3a60e165fb23f017858a18b255f9c9e1ad80736cb852756d7fe8f3bc5aa917 WHIRLPOOL ae5632be17d72bf7992814e0262cb862ee0bec48dbd119d33bc94b3647755087c2427418ea0064c7560be6e06dc83a2702587fab3403afccfc90d3df8acd0a9f
+DIST vpnc-scripts-20140806.tar.gz 20070 SHA256 1f61a6c5ec8a2dab7d5f12c9b438d931e41c6c1c258801ee978d5ed460f4d35f SHA512 bfa230d6eb2db0696a23228cef6e742dcf5e609c25de725c23e2c7bee96d00045ea656d6c7025cdf7785f70baeb8a8d79af6aec93d7285bcb3c029dc744e5380 WHIRLPOOL 78d0c5e23f408167904639a7804859a1d6b89668feab6834a589a3d9f7abf4f9d1da984553a8871b6a16af39a03e5a6f3f6506dd77f7f960c7fcdd56f0683e27
diff --git a/net-misc/openconnect/files/openconnect.conf.in b/net-misc/openconnect/files/openconnect.conf.in
new file mode 100644
index 000000000000..53b14e61378e
--- /dev/null
+++ b/net-misc/openconnect/files/openconnect.conf.in
@@ -0,0 +1,26 @@
+# Variables to configure vpn tunnels where "vpnname" is the name of your vpn tunnel:
+#
+# server_vpnname
+# password_vpnname
+# vpnopts_vpnname
+#
+# The tunnel will need to be started with a symbolic link to openconnect:
+#
+# ln -s /etc/init.d/openconnect /etc/init.d/openconnect.vpnname
+#
+# If you'd like to execute a script on preup, postup, predown and postdown of the vpn tunnel, you
+# need to create executable scripts in a directory with the same name as
+# the vpn tunnel (vpn0 can be replaced with the vpn name):
+#
+# mkdir /etc/openconnect/vpn0
+# cd /etc/openconnect/vpn0"
+# echo '#!/bin/sh' > preup.sh"
+# cp preup.sh predown.sh"
+# cp preup.sh postup.sh"
+# cp preup.sh postdown.sh"
+# chmod 755 /etc/openconnect/vpn0/*"
+
+server_vpn0="vpn.server.tld"
+password_vpn0="YOUR_PASSWORD"
+# Any OPENCONNECT options my go here (see openconnect --help)
+vpnopts_vpn0="-l --passwd-on-stdin --user=YOUR_USERNAME --script=/etc/openconnect/openconnect.sh"
diff --git a/net-misc/openconnect/files/openconnect.init.in b/net-misc/openconnect/files/openconnect.init.in
new file mode 100644
index 000000000000..939d02ffe8a5
--- /dev/null
+++ b/net-misc/openconnect/files/openconnect.init.in
@@ -0,0 +1,123 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+VPN="${RC_SVCNAME#*.}"
+VPNLOG="/var/log/openconnect/${VPN}"
+VPNLOGFILE="${VPNLOG}/openconnect.log"
+VPNERRFILE="${VPNLOG}/openconnect.err"
+VPNPID="/run/openconnect/${VPN}.pid"
+VPNDIR="/etc/openconnect/${VPN}"
+PREUPSCRIPT="${VPNDIR}/preup.sh"
+PREDOWNSCRIPT="${VPNDIR}/predown.sh"
+POSTUPSCRIPT="${VPNDIR}/postup.sh"
+POSTDOWNSCRIPT="${VPNDIR}/postdown.sh"
+SERVER="server_${VPN}"
+PASSWORD="password_${VPN}"
+VPNOPTS="vpnopts_${VPN}"
+
+depend() {
+ before netmount
+}
+
+checkconfig() {
+ if [ $VPN = "openconnect" ]; then
+ eerror "You cannot call openconnect directly. You must create a symbolic link to it with the vpn name:"
+ echo
+ eerror "ln -s /etc/init.d/openconnect /etc/init.d/openconnect.vpn0"
+ echo
+ eerror "And then call it instead:"
+ echo
+ eerror "/etc/init.d/openconnect.vpn0 start"
+ return 1
+ fi
+}
+
+checktuntap() {
+ if [ $(uname -s) = "Linux" ] ; then
+ if [ ! -e /dev/net/tun ]; then
+ if ! modprobe tun ; then
+ eerror "TUN/TAP support is not available in this kernel"
+ return 1
+ fi
+ fi
+ if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then
+ ebegin "Detected broken /dev/net/tun symlink, fixing..."
+ rm -f /dev/net/tun
+ ln -s /dev/misc/net/tun /dev/net/tun
+ eend $?
+ fi
+ fi
+}
+
+start() {
+ ebegin "Starting OpenConnect: ${VPN}"
+
+ checkconfig || return 1
+
+ checktuntap || return 1
+
+ if [ "${!SERVER}" == "vpn.server.tld" ]; then
+ eend 1 "${VPN} not configured"
+ return 1
+ fi
+
+ if [ ! -e "${VPNLOG}" ]; then
+ mkdir -p "${VPNLOG}"
+ fi
+
+ local piddir="${VPNPID%/*}"
+ if [ ! -d "$piddir" ] ; then
+ mkdir -p "$piddir"
+ if [ $? -ne 0 ]; then
+ eerror "Directory $piddir for pidfile does not exist and cannot be created"
+ return 1
+ fi
+ fi
+
+ if [ -x "${PREUPSCRIPT}" ] ; then
+ "${PREUPSCRIPT}"
+ fi
+
+ start-stop-daemon --start --make-pidfile --pidfile "${VPNPID}" --stderr "${VPNERRFILE}" --stdout "${VPNLOGFILE}" --background \
+ --exec /usr/sbin/openconnect \
+ -- --pid-file="${VPNPID}" ${!VPNOPTS} ${!SERVER} <<< ${!PASSWORD}
+
+ local retval=$?
+
+ if [ ! ${retval} -eq 0 ]; then
+ eend ${retval}
+ return ${retval}
+ fi
+
+ if [ -x "${POSTUPSCRIPT}" ] ; then
+ "${POSTUPSCRIPT}"
+ fi
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping OpenConnect: ${VPN}"
+
+ checkconfig || return 1
+
+ if [ -x "${PREDOWNSCRIPT}" ] ; then
+ "${PREDOWNSCRIPT}"
+ fi
+
+ start-stop-daemon --pidfile "${VPNPID}" --stop /usr/sbin/openconnect
+ local retval=$?
+
+ if [ ! ${retval} -eq 0 ]; then
+ eend ${retval}
+ return ${retval}
+ fi
+
+
+ if [ -x "${POSTDOWNSCRIPT}" ] ; then
+ "${POSTDOWNSCRIPT}"
+ fi
+ eend $?
+}
diff --git a/net-misc/openconnect/files/openconnect.init.in-r2 b/net-misc/openconnect/files/openconnect.init.in-r2
new file mode 100644
index 000000000000..a945a4b816ec
--- /dev/null
+++ b/net-misc/openconnect/files/openconnect.init.in-r2
@@ -0,0 +1,144 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+VPN="${RC_SVCNAME#*.}"
+VPNLOG="/var/log/openconnect/${VPN}"
+VPNLOGFILE="${VPNLOG}/openconnect.log"
+VPNERRFILE="${VPNLOG}/openconnect.err"
+VPNPID="/run/openconnect/${VPN}.pid"
+VPNDIR="/etc/openconnect/${VPN}"
+PREUPSCRIPT="${VPNDIR}/preup.sh"
+PREDOWNSCRIPT="${VPNDIR}/predown.sh"
+POSTUPSCRIPT="${VPNDIR}/postup.sh"
+POSTDOWNSCRIPT="${VPNDIR}/postdown.sh"
+SERVER="server_${VPN}"
+PASSWORD="password_${VPN}"
+VPNOPTS="vpnopts_${VPN}"
+
+depend() {
+ before netmount
+}
+
+checkconfig() {
+ if [ $VPN = "openconnect" ]; then
+ eerror "You cannot call openconnect directly. You must create a symbolic link to it with the vpn name:"
+ echo
+ eerror "ln -s /etc/init.d/openconnect /etc/init.d/openconnect.vpn0"
+ echo
+ eerror "And then call it instead:"
+ echo
+ eerror "/etc/init.d/openconnect.vpn0 start"
+ return 1
+ fi
+}
+
+checktuntap() {
+ if [ $(uname -s) = "Linux" ] ; then
+ if [ ! -e /dev/net/tun ]; then
+ if ! modprobe tun ; then
+ eerror "TUN/TAP support is not available in this kernel"
+ return 1
+ fi
+ fi
+ if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then
+ ebegin "Detected broken /dev/net/tun symlink, fixing..."
+ rm -f /dev/net/tun
+ ln -s /dev/misc/net/tun /dev/net/tun
+ eend $?
+ fi
+ fi
+}
+
+start() {
+ ebegin "Starting OpenConnect: ${VPN}"
+
+ local tmp_SERVER tmp_VPNOPTS tmp_PASSWORD
+ eval tmp_SERVER="\${${SERVER}}"
+ eval tmp_VPNOPTS="\${${VPNOPTS}}"
+ eval tmp_PASSWORD="\${${PASSWORD}}"
+
+ checkconfig || return 1
+
+ checktuntap || return 1
+
+ if [ "${tmp_SERVER}" = "vpn.server.tld" ]; then
+ eend 1 "${VPN} not configured"
+ return 1
+ fi
+
+ if [ ! -e "${VPNLOG}" ]; then
+ mkdir -p "${VPNLOG}"
+ fi
+
+ local piddir="${VPNPID%/*}"
+ if [ ! -d "$piddir" ] ; then
+ mkdir -p "$piddir"
+ if [ $? -ne 0 ]; then
+ eerror "Directory $piddir for pidfile does not exist and cannot be created"
+ return 1
+ fi
+ fi
+
+ if [ -x "${PREUPSCRIPT}" ] ; then
+ "${PREUPSCRIPT}"
+ fi
+
+ start-stop-daemon --start \
+ --make-pidfile \
+ --pidfile "${VPNPID}" \
+ --stderr "${VPNERRFILE}" \
+ --stdout "${VPNLOGFILE}" \
+ --background \
+ --exec /usr/sbin/openconnect -- \
+ --interface="${VPN}" \
+ --pid-file="${VPNPID}" \
+ ${tmp_VPNOPTS} \
+ ${tmp_SERVER} <<-E
+ ${tmp_PASSWORD}
+ E
+
+ local retval=$?
+
+ if [ ! ${retval} -eq 0 ]; then
+ eend ${retval}
+ return ${retval}
+ fi
+
+ if [ -x "${POSTUPSCRIPT}" ] ; then
+ # wait until the interface is up and an ip address is set before running postup
+ while true; do
+ if [ -n "$(ip addr show $VPN | grep inet)" ]; then
+ "${POSTUPSCRIPT}"
+ break
+ fi
+ done
+ fi
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping OpenConnect: ${VPN}"
+
+ checkconfig || return 1
+
+ if [ -x "${PREDOWNSCRIPT}" ] ; then
+ "${PREDOWNSCRIPT}"
+ fi
+
+ start-stop-daemon --pidfile "${VPNPID}" --stop /usr/sbin/openconnect
+ local retval=$?
+
+ if [ ! ${retval} -eq 0 ]; then
+ eend ${retval}
+ return ${retval}
+ fi
+
+
+ if [ -x "${POSTDOWNSCRIPT}" ] ; then
+ "${POSTDOWNSCRIPT}"
+ fi
+ eend $?
+}
diff --git a/net-misc/openconnect/files/openconnect.init.in-r3 b/net-misc/openconnect/files/openconnect.init.in-r3
new file mode 100644
index 000000000000..1f51fd47b18a
--- /dev/null
+++ b/net-misc/openconnect/files/openconnect.init.in-r3
@@ -0,0 +1,145 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+VPN="${RC_SVCNAME#*.}"
+VPNLOG="/var/log/openconnect/${VPN}"
+VPNLOGFILE="${VPNLOG}/openconnect.log"
+VPNERRFILE="${VPNLOG}/openconnect.err"
+VPNPID="/run/openconnect/${VPN}.pid"
+VPNDIR="/etc/openconnect/${VPN}"
+PREUPSCRIPT="${VPNDIR}/preup.sh"
+PREDOWNSCRIPT="${VPNDIR}/predown.sh"
+POSTUPSCRIPT="${VPNDIR}/postup.sh"
+POSTDOWNSCRIPT="${VPNDIR}/postdown.sh"
+SERVER="server_${VPN}"
+PASSWORD="password_${VPN}"
+VPNOPTS="vpnopts_${VPN}"
+
+depend() {
+ before netmount
+}
+
+checkconfig() {
+ if [ $VPN = "openconnect" ]; then
+ eerror "You cannot call openconnect directly. You must create a symbolic link to it with the vpn name:"
+ echo
+ eerror "ln -s /etc/init.d/openconnect /etc/init.d/openconnect.vpn0"
+ echo
+ eerror "And then call it instead:"
+ echo
+ eerror "/etc/init.d/openconnect.vpn0 start"
+ return 1
+ fi
+}
+
+checktuntap() {
+ if [ $(uname -s) = "Linux" ] ; then
+ if [ ! -e /dev/net/tun ]; then
+ if ! modprobe tun ; then
+ eerror "TUN/TAP support is not available in this kernel"
+ return 1
+ fi
+ fi
+ if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then
+ ebegin "Detected broken /dev/net/tun symlink, fixing..."
+ rm -f /dev/net/tun
+ ln -s /dev/misc/net/tun /dev/net/tun
+ eend $?
+ fi
+ fi
+}
+
+start() {
+ ebegin "Starting OpenConnect: ${VPN}"
+
+ local tmp_SERVER tmp_VPNOPTS tmp_PASSWORD
+ eval tmp_SERVER="\${${SERVER}}"
+ eval tmp_VPNOPTS="\${${VPNOPTS}}"
+ eval tmp_PASSWORD="\${${PASSWORD}}"
+
+ checkconfig || return 1
+
+ checktuntap || return 1
+
+ if [ "${tmp_SERVER}" = "vpn.server.tld" ]; then
+ eend 1 "${VPN} not configured"
+ return 1
+ fi
+
+ if [ ! -e "${VPNLOG}" ]; then
+ mkdir -p "${VPNLOG}"
+ fi
+
+ local piddir="${VPNPID%/*}"
+ if [ ! -d "$piddir" ] ; then
+ mkdir -p "$piddir"
+ if [ $? -ne 0 ]; then
+ eerror "Directory $piddir for pidfile does not exist and cannot be created"
+ return 1
+ fi
+ fi
+
+ if [ -x "${PREUPSCRIPT}" ] ; then
+ "${PREUPSCRIPT}"
+ fi
+
+ start-stop-daemon --start \
+ --make-pidfile \
+ --pidfile "${VPNPID}" \
+ --stderr "${VPNERRFILE}" \
+ --stdout "${VPNLOGFILE}" \
+ --background \
+ --exec /usr/sbin/openconnect -- \
+ --interface="${VPN}" \
+ --pid-file="${VPNPID}" \
+ ${tmp_VPNOPTS} \
+ ${tmp_SERVER} <<-E
+ ${tmp_PASSWORD}
+ E
+
+ local retval=$?
+
+ if [ ! ${retval} -eq 0 ]; then
+ eend ${retval}
+ return ${retval}
+ fi
+
+ if [ -x "${POSTUPSCRIPT}" ] ; then
+ # wait until the interface is up and an ip address is set before running postup
+ while true; do
+ sleep 0.5
+ if [ -n "$(ip addr show $VPN 2> /dev/null | grep inet)" ]; then
+ "${POSTUPSCRIPT}"
+ break
+ fi
+ done
+ fi
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping OpenConnect: ${VPN}"
+
+ checkconfig || return 1
+
+ if [ -x "${PREDOWNSCRIPT}" ] ; then
+ "${PREDOWNSCRIPT}"
+ fi
+
+ start-stop-daemon --pidfile "${VPNPID}" --stop /usr/sbin/openconnect
+ local retval=$?
+
+ if [ ! ${retval} -eq 0 ]; then
+ eend ${retval}
+ return ${retval}
+ fi
+
+
+ if [ -x "${POSTDOWNSCRIPT}" ] ; then
+ "${POSTDOWNSCRIPT}"
+ fi
+ eend $?
+}
diff --git a/net-misc/openconnect/files/openconnect.init.in-r4 b/net-misc/openconnect/files/openconnect.init.in-r4
new file mode 100644
index 000000000000..f1af83eae192
--- /dev/null
+++ b/net-misc/openconnect/files/openconnect.init.in-r4
@@ -0,0 +1,89 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+VPN="${RC_SVCNAME#*.}"
+VPNDIR="/etc/openconnect/${VPN}"
+VPNLOG="/var/log/openconnect/${VPN}"
+VPNLOGFILE="${VPNLOG}/openconnect.log"
+VPNERRFILE="${VPNLOG}/openconnect.err"
+
+command="/usr/sbin/openconnect"
+name="OpenConnect: ${VPN}"
+pidfile="/run/openconnect/${VPN}.pid"
+stopsig="SIGINT"
+
+depend() {
+ before netmount
+}
+
+checkconfig() {
+ if [ $VPN = "openconnect" ]; then
+ eerror "You cannot call openconnect directly. You must create a symbolic link to it with the vpn name:"
+ eerror
+ eerror "ln -s /etc/init.d/openconnect /etc/init.d/openconnect.vpn0"
+ eerror
+ eerror "And then call it instead:"
+ eerror
+ eerror "/etc/init.d/openconnect.vpn0 start"
+ return 1
+ fi
+}
+
+checktuntap() {
+ if [ "$RC_UNAME" = "Linux" -a ! -e /dev/net/tun ] ; then
+ if ! modprobe tun ; then
+ eerror "TUN/TAP support is not available in this kernel"
+ return 1
+ fi
+ fi
+}
+
+run_hook() {
+ if [ -x "$1" ]; then
+ "$@"
+ fi
+}
+
+start_pre() {
+ checkconfig || return
+ checktuntap || return
+ checkpath -d "${VPNLOG}" || return
+ checkpath -d /run/openconnect || return
+ run_hook "${VPNDIR}/preup.sh"
+}
+
+start() {
+ local server vpnopts password
+ eval server=\$server_${VPN}
+ eval vpnopts=\$vpnopts_${VPN}
+ eval password=\$password_${VPN}
+
+ ebegin "Starting ${name}"
+ start-stop-daemon --start --exec "${command}" -- \
+ --background \
+ --interface="${VPN}" \
+ --pid-file="${pidfile}" \
+ ${vpnopts} \
+ "${server}" \
+ >> "${VPNLOGFILE}" \
+ 2>> "${VPNERRFILE}" \
+ <<EOF
+${password}
+EOF
+ eend $?
+}
+
+start_post() {
+ run_hook "${VPNDIR}/postup.sh"
+}
+
+stop_pre() {
+ checkconfig || return
+ run_hook "${VPNDIR}/predown.sh"
+}
+
+stop_post() {
+ run_hook "${VPNDIR}/postdown.sh"
+}
diff --git a/net-misc/openconnect/files/openconnect.logrotate b/net-misc/openconnect/files/openconnect.logrotate
new file mode 100644
index 000000000000..0455e6845b28
--- /dev/null
+++ b/net-misc/openconnect/files/openconnect.logrotate
@@ -0,0 +1,8 @@
+# openconnect logrotate snipet for Gentoo Linux
+#
+/var/log/openconnect/*/* {
+ missingok
+ size 5M
+ notifempty
+}
+
diff --git a/net-misc/openconnect/metadata.xml b/net-misc/openconnect/metadata.xml
new file mode 100644
index 000000000000..00d9c55e8e37
--- /dev/null
+++ b/net-misc/openconnect/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>mattsch@gmail.com</email>
+ <name>Matthew Schultz</name>
+ <description>Proxied maintainer. Assign bugs to him.</description>
+ </maintainer>
+ <maintainer>
+ <email>floppym@gentoo.org</email>
+ <name>Mike Gilbert</name>
+ </maintainer>
+ <herd>proxy-maintainers</herd>
+ <use>
+ <flag name='gssapi'>Build GSSAPI support.</flag>
+ <flag name='java'>Build JNI bindings using jni.h</flag>
+ <flag name='libproxy'>Enable proxy support.</flag>
+ </use>
+</pkgmetadata>
+
diff --git a/net-misc/openconnect/openconnect-4.08.ebuild b/net-misc/openconnect/openconnect-4.08.ebuild
new file mode 100644
index 000000000000..5925f16ed1a0
--- /dev/null
+++ b/net-misc/openconnect/openconnect-4.08.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils linux-info python-any-r1
+
+DESCRIPTION="Free client for Cisco AnyConnect SSL VPN software"
+HOMEPAGE="http://www.infradead.org/openconnect.html"
+# New versions of openconnect-script can be found here:
+# http://git.infradead.org/users/dwmw2/vpnc-scripts.git/history/HEAD:/vpnc-script
+SRC_URI="ftp://ftp.infradead.org/pub/${PN}/${P}.tar.gz
+ http://dev.gentoo.org/~hwoarang/distfiles/openconnect-script-20121108205904.tar.gz"
+
+LICENSE="LGPL-2.1 GPL-2"
+SLOT="0/2"
+KEYWORDS="amd64 ppc64 x86"
+IUSE="doc static-libs nls -gnutls"
+ILINGUAS="ar as ast bg bg_BG bn bn_IN bs ca ca@valencia cs da de el en_GB en_US eo es es_CR
+ es_MX et eu fa fi fr gd gl gu he hi hi_IN hu id it ja km kn ko ku lo lt lv ml mr
+ ms nb nl nn no or pa pl pt pt_BR pt_PT ro ru sk sl sq sr sr@latin sv ta te
+ tg th tl tr ug uk ur_PK vi vi_VN wa zh_CN zh_HK zh_TW"
+for lang in $ILINGUAS; do
+ IUSE="${IUSE} linguas_${lang}"
+done
+
+DEPEND="dev-libs/libxml2
+ net-libs/libproxy
+ sys-libs/zlib
+ !gnutls? ( dev-libs/openssl[static-libs?] )
+ gnutls? (
+ || (
+ ( >=net-libs/gnutls-3[static-libs?] dev-libs/nettle )
+ ( =net-libs/gnutls-2.12*[nettle,static-libs?] dev-libs/nettle )
+ ( =net-libs/gnutls-2.12*[-nettle,static-libs?] dev-libs/libgcrypt:0[static-libs?] )
+ )
+ app-misc/ca-certificates
+ )
+ doc? ( ${PYTHON_DEPS} )"
+
+RDEPEND="${DEPEND}
+ sys-apps/iproute2"
+
+tun_tap_check() {
+ ebegin "Checking for TUN/TAP support"
+ if { ! linux_chkconfig_present TUN; }; then
+ eerror "Please enable TUN/TAP support in your kernel config, found at:"
+ eerror
+ eerror " Device Drivers --->"
+ eerror " [*] Network device support --->"
+ eerror " <*> Universal TUN/TAP device driver support"
+ eerror
+ eerror "and recompile your kernel ..."
+ die "no CONFIG_TUN support detected!"
+ fi
+ eend $?
+}
+
+pkg_setup() {
+ if use doc; then
+ python-any-r1_pkg_setup
+ fi
+
+ if use kernel_linux; then
+ get_version
+ if linux_config_exists; then
+ tun_tap_check
+ else
+ ewarn "Was unable to determine your kernel .config"
+ ewarn "Please note that OpenConnect requires CONFIG_TUN to be set in your"
+ ewarn "kernel .config, Without it, it will not work correctly."
+ # We don't die here, so it's possible to compile this package without
+ # kernel sources available. Required for cross-compilation.
+ fi
+ fi
+}
+
+src_configure() {
+ strip-linguas $ILINGUAS
+ echo ${LINGUAS} > po/LINGUAS
+ # Override vpn-script test since the build system violates the sandbox and
+ # needs the path set to the real default path after it's installed
+ sed -e "s#-x \"\$with_vpnc_script\"#-n \"${WORKDIR}/openconnect-script\"#" \
+ -i configure || die
+ if ! use doc; then
+ # If the python cannot be found, the docs will not build
+ sed -e 's#"${ac_cv_path_PYTHON}"#""#' -i configure || die
+ fi
+ econf \
+ --with-vpnc-script=/etc/openconnect/openconnect.sh \
+ $(use_enable static-libs static) \
+ $(use_enable nls ) \
+ $(use_with !gnutls openssl) \
+ $(use_with gnutls )
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc AUTHORS TODO
+ newinitd "${FILESDIR}"/openconnect.init.in openconnect
+ dodir /etc/openconnect
+ insinto /etc/openconnect
+ newconfd "${FILESDIR}"/openconnect.conf.in openconnect
+ exeinto /etc/openconnect
+ newexe "${WORKDIR}"/openconnect-script openconnect.sh
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openconnect.logrotate openconnect
+ keepdir /var/log/openconnect
+
+ # Remove useless .la files
+ find "${D}" -name '*.la' -delete || die "la file removal failed"
+}
+
+pkg_postinst() {
+ elog "The init script for openconnect has changed and now supports multiple vpn tunnels."
+ elog
+ elog "You need to create a symbolic link to /etc/init.d/openconnect in /etc/init.d"
+ elog "instead of calling it directly:"
+ elog
+ elog "ln -s /etc/init.d/openconnect /etc/init.d/openconnect.vpn0"
+ elog
+ elog "You can then start the vpn tunnel like this:"
+ elog
+ elog "/etc/init.d/openconnect.vpn0 start"
+ elog
+ elog "If you would like to run preup, postup, predown, and/or postdown scripts,"
+ elog "You need to create a directory in /etc/openconnect with the name of the vpn:"
+ elog
+ elog "mkdir /etc/openconnect/vpn0"
+ elog
+ elog "Then add executable shell files:"
+ elog
+ elog "mkdir /etc/openconnect/vpn0"
+ elog "cd /etc/openconnect/vpn0"
+ elog "echo '#!/bin/sh' > preup.sh"
+ elog "cp preup.sh predown.sh"
+ elog "cp preup.sh postup.sh"
+ elog "cp preup.sh postdown.sh"
+ elog "chmod 755 /etc/openconnect/vpn0/*"
+}
diff --git a/net-misc/openconnect/openconnect-6.00.ebuild b/net-misc/openconnect/openconnect-6.00.ebuild
new file mode 100644
index 000000000000..eaea25593759
--- /dev/null
+++ b/net-misc/openconnect/openconnect-6.00.ebuild
@@ -0,0 +1,153 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="xml"
+
+inherit eutils linux-info python-any-r1
+
+DESCRIPTION="Free client for Cisco AnyConnect SSL VPN software"
+HOMEPAGE="http://www.infradead.org/openconnect.html"
+# New versions of openconnect-script can be found here:
+# http://git.infradead.org/users/dwmw2/vpnc-scripts.git/history/HEAD:/vpnc-script
+SRC_URI="ftp://ftp.infradead.org/pub/${PN}/${P}.tar.gz
+ http://dev.gentoo.org/~hasufell/distfiles/openconnect-script-20140311.tar.xz"
+
+LICENSE="LGPL-2.1 GPL-2"
+SLOT="0/3"
+KEYWORDS="~amd64 ~ppc64 ~x86"
+IUSE="doc +gnutls gssapi java libproxy nls static-libs"
+ILINGUAS="ar cs de el en_GB en_US es eu fi fr gl id lt nl pa pl pt pt_BR sk sl tg ug uk zh_CN zh_TW"
+for lang in $ILINGUAS; do
+ IUSE="${IUSE} linguas_${lang}"
+done
+
+DEPEND="dev-libs/libxml2
+ sys-libs/zlib
+ !gnutls? (
+ >=dev-libs/openssl-1.0.1h:0[static-libs?]
+ )
+ gnutls? (
+ >=net-libs/gnutls-3[static-libs?] dev-libs/nettle
+ app-misc/ca-certificates
+ )
+ gssapi? ( virtual/krb5 )
+ libproxy? ( net-libs/libproxy )
+ nls? ( virtual/libintl )"
+RDEPEND="${DEPEND}
+ sys-apps/iproute2
+ java? ( virtual/jre )"
+DEPEND="${DEPEND}
+ virtual/pkgconfig
+ doc? ( ${PYTHON_DEPS} sys-apps/groff )
+ java? ( virtual/jdk )
+ nls? ( sys-devel/gettext )"
+
+tun_tap_check() {
+ ebegin "Checking for TUN/TAP support"
+ if { ! linux_chkconfig_present TUN; }; then
+ eerror "Please enable TUN/TAP support in your kernel config, found at:"
+ eerror
+ eerror " Device Drivers --->"
+ eerror " [*] Network device support --->"
+ eerror " <*> Universal TUN/TAP device driver support"
+ eerror
+ eerror "and recompile your kernel ..."
+ die "no CONFIG_TUN support detected!"
+ fi
+ eend $?
+}
+
+pkg_setup() {
+ if use doc; then
+ python-any-r1_pkg_setup
+ fi
+
+ if use kernel_linux; then
+ get_version
+ if linux_config_exists; then
+ tun_tap_check
+ else
+ ewarn "Was unable to determine your kernel .config"
+ ewarn "Please note that OpenConnect requires CONFIG_TUN to be set in your"
+ ewarn "kernel .config, Without it, it will not work correctly."
+ # We don't die here, so it's possible to compile this package without
+ # kernel sources available. Required for cross-compilation.
+ fi
+ fi
+}
+
+src_configure() {
+ strip-linguas $ILINGUAS
+ echo ${LINGUAS} > po/LINGUAS
+ # Override vpn-script test since the build system violates the sandbox and
+ # needs the path set to the real default path after it's installed
+ sed -e "s#-x \"\$with_vpnc_script\"#-n \"${WORKDIR}/openconnect-script\"#" \
+ -i configure || die
+ if ! use doc; then
+ # If the python cannot be found, the docs will not build
+ sed -e 's#"${ac_cv_path_PYTHON}"#""#' -i configure || die
+ fi
+
+ # stoken and liboath not in portage
+ econf \
+ --with-vpnc-script=/etc/openconnect/openconnect.sh \
+ $(use_enable static-libs static) \
+ $(use_enable nls ) \
+ $(use_with !gnutls openssl) \
+ $(use_with gnutls ) \
+ $(use_with libproxy) \
+ --without-stoken \
+ --without-liboath \
+ $(use_with gssapi) \
+ $(use_with java)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc AUTHORS TODO
+ newinitd "${FILESDIR}"/openconnect.init.in-r2 openconnect
+ dodir /etc/openconnect
+ insinto /etc/openconnect
+ newconfd "${FILESDIR}"/openconnect.conf.in openconnect
+ exeinto /etc/openconnect
+ newexe "${WORKDIR}"/openconnect-script openconnect.sh
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openconnect.logrotate openconnect
+ keepdir /var/log/openconnect
+
+ # Remove useless .la files
+ find "${D}" -name '*.la' -delete || die "la file removal failed"
+}
+
+pkg_postinst() {
+ elog "The init script for openconnect has changed and now supports multiple vpn tunnels."
+ elog
+ elog "You need to create a symbolic link to /etc/init.d/openconnect in /etc/init.d"
+ elog "instead of calling it directly:"
+ elog
+ elog "ln -s /etc/init.d/openconnect /etc/init.d/openconnect.vpn0"
+ elog
+ elog "You can then start the vpn tunnel like this:"
+ elog
+ elog "/etc/init.d/openconnect.vpn0 start"
+ elog
+ elog "If you would like to run preup, postup, predown, and/or postdown scripts,"
+ elog "You need to create a directory in /etc/openconnect with the name of the vpn:"
+ elog
+ elog "mkdir /etc/openconnect/vpn0"
+ elog
+ elog "Then add executable shell files:"
+ elog
+ elog "mkdir /etc/openconnect/vpn0"
+ elog "cd /etc/openconnect/vpn0"
+ elog "echo '#!/bin/sh' > preup.sh"
+ elog "cp preup.sh predown.sh"
+ elog "cp preup.sh postup.sh"
+ elog "cp preup.sh postdown.sh"
+ elog "chmod 755 /etc/openconnect/vpn0/*"
+}
diff --git a/net-misc/openconnect/openconnect-7.02.ebuild b/net-misc/openconnect/openconnect-7.02.ebuild
new file mode 100644
index 000000000000..b0ce96a44a9b
--- /dev/null
+++ b/net-misc/openconnect/openconnect-7.02.ebuild
@@ -0,0 +1,150 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="xml"
+
+inherit eutils linux-info python-any-r1
+
+DESCRIPTION="Free client for Cisco AnyConnect SSL VPN software"
+HOMEPAGE="http://www.infradead.org/openconnect.html"
+VPNC_VER=20140806
+SRC_URI="ftp://ftp.infradead.org/pub/${PN}/${P}.tar.gz
+ ftp://ftp.infradead.org/pub/vpnc-scripts/vpnc-scripts-${VPNC_VER}.tar.gz"
+
+LICENSE="LGPL-2.1 GPL-2"
+SLOT="0/5"
+KEYWORDS="~amd64 arm ~arm64 ~ppc64 ~x86"
+IUSE="doc +gnutls gssapi java libproxy nls static-libs"
+ILINGUAS="ar cs de el en_GB en_US es eu fi fr gl id lt nl pa pl pt pt_BR sk sl tg ug uk zh_CN zh_TW"
+for lang in $ILINGUAS; do
+ IUSE="${IUSE} linguas_${lang}"
+done
+
+DEPEND="dev-libs/libxml2
+ sys-libs/zlib
+ !gnutls? (
+ >=dev-libs/openssl-1.0.1h:0[static-libs?]
+ )
+ gnutls? (
+ >=net-libs/gnutls-3[static-libs?] dev-libs/nettle
+ app-misc/ca-certificates
+ )
+ gssapi? ( virtual/krb5 )
+ libproxy? ( net-libs/libproxy )
+ nls? ( virtual/libintl )"
+RDEPEND="${DEPEND}
+ sys-apps/iproute2
+ java? ( virtual/jre )"
+DEPEND="${DEPEND}
+ virtual/pkgconfig
+ doc? ( ${PYTHON_DEPS} sys-apps/groff )
+ java? ( virtual/jdk )
+ nls? ( sys-devel/gettext )"
+
+tun_tap_check() {
+ ebegin "Checking for TUN/TAP support"
+ if { ! linux_chkconfig_present TUN; }; then
+ eerror "Please enable TUN/TAP support in your kernel config, found at:"
+ eerror
+ eerror " Device Drivers --->"
+ eerror " [*] Network device support --->"
+ eerror " <*> Universal TUN/TAP device driver support"
+ eerror
+ eerror "and recompile your kernel ..."
+ die "no CONFIG_TUN support detected!"
+ fi
+ eend $?
+}
+
+pkg_setup() {
+ if use doc; then
+ python-any-r1_pkg_setup
+ fi
+
+ if use kernel_linux; then
+ get_version
+ if linux_config_exists; then
+ tun_tap_check
+ else
+ ewarn "Was unable to determine your kernel .config"
+ ewarn "Please note that OpenConnect requires CONFIG_TUN to be set in your"
+ ewarn "kernel .config, Without it, it will not work correctly."
+ # We don't die here, so it's possible to compile this package without
+ # kernel sources available. Required for cross-compilation.
+ fi
+ fi
+}
+
+src_configure() {
+ strip-linguas $ILINGUAS
+ echo ${LINGUAS} > po/LINGUAS
+ if ! use doc; then
+ # If the python cannot be found, the docs will not build
+ sed -e 's#"${ac_cv_path_PYTHON}"#""#' -i configure || die
+ fi
+
+ # stoken and liboath not in portage
+ econf \
+ --with-vpnc-script="${EPREFIX}/etc/openconnect/openconnect.sh" \
+ $(use_enable static-libs static) \
+ $(use_enable nls ) \
+ $(use_with !gnutls openssl) \
+ $(use_with gnutls ) \
+ $(use_with libproxy) \
+ --without-stoken \
+ --without-liboath \
+ $(use_with gssapi) \
+ $(use_with java)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc AUTHORS TODO
+ newinitd "${FILESDIR}"/openconnect.init.in-r3 openconnect
+ dodir /etc/openconnect
+ insinto /etc/openconnect
+ newconfd "${FILESDIR}"/openconnect.conf.in openconnect
+ exeinto /etc/openconnect
+ newexe "${WORKDIR}"/vpnc-scripts-${VPNC_VER}/vpnc-script openconnect.sh
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openconnect.logrotate openconnect
+ keepdir /var/log/openconnect
+
+ # Remove useless .la files
+ prune_libtool_files --all
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "The init script for openconnect has changed and now supports multiple vpn tunnels."
+ elog
+ elog "You need to create a symbolic link to /etc/init.d/openconnect in /etc/init.d"
+ elog "instead of calling it directly:"
+ elog
+ elog "ln -s /etc/init.d/openconnect /etc/init.d/openconnect.vpn0"
+ elog
+ elog "You can then start the vpn tunnel like this:"
+ elog
+ elog "/etc/init.d/openconnect.vpn0 start"
+ elog
+ elog "If you would like to run preup, postup, predown, and/or postdown scripts,"
+ elog "You need to create a directory in /etc/openconnect with the name of the vpn:"
+ elog
+ elog "mkdir /etc/openconnect/vpn0"
+ elog
+ elog "Then add executable shell files:"
+ elog
+ elog "mkdir /etc/openconnect/vpn0"
+ elog "cd /etc/openconnect/vpn0"
+ elog "echo '#!/bin/sh' > preup.sh"
+ elog "cp preup.sh predown.sh"
+ elog "cp preup.sh postup.sh"
+ elog "cp preup.sh postdown.sh"
+ elog "chmod 755 /etc/openconnect/vpn0/*"
+ fi
+}
diff --git a/net-misc/openconnect/openconnect-7.06-r1.ebuild b/net-misc/openconnect/openconnect-7.06-r1.ebuild
new file mode 100644
index 000000000000..ab33ab3a05cb
--- /dev/null
+++ b/net-misc/openconnect/openconnect-7.06-r1.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="xml"
+
+inherit eutils java-pkg-opt-2 linux-info python-any-r1 readme.gentoo
+
+DESCRIPTION="Free client for Cisco AnyConnect SSL VPN software"
+HOMEPAGE="http://www.infradead.org/openconnect.html"
+VPNC_VER=20140806
+SRC_URI="ftp://ftp.infradead.org/pub/${PN}/${P}.tar.gz
+ ftp://ftp.infradead.org/pub/vpnc-scripts/vpnc-scripts-${VPNC_VER}.tar.gz"
+
+LICENSE="LGPL-2.1 GPL-2"
+SLOT="0/5"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+IUSE="doc +gnutls gssapi java libproxy nls static-libs"
+ILINGUAS="ar cs de el en_GB en_US es eu fi fr gl id lt nl pa pl pt pt_BR sk sl tg ug uk zh_CN zh_TW"
+for lang in $ILINGUAS; do
+ IUSE="${IUSE} linguas_${lang}"
+done
+
+DEPEND="dev-libs/libxml2
+ sys-libs/zlib
+ !gnutls? (
+ >=dev-libs/openssl-1.0.1h:0[static-libs?]
+ )
+ gnutls? (
+ >=net-libs/gnutls-3[static-libs?] dev-libs/nettle
+ app-misc/ca-certificates
+ )
+ gssapi? ( virtual/krb5 )
+ libproxy? ( net-libs/libproxy )
+ nls? ( virtual/libintl )"
+RDEPEND="${DEPEND}
+ sys-apps/iproute2
+ !<sys-apps/openrc-0.13"
+DEPEND="${DEPEND}
+ virtual/pkgconfig
+ doc? ( ${PYTHON_DEPS} sys-apps/groff )
+ java? ( >=virtual/jdk-1.6 )
+ nls? ( sys-devel/gettext )"
+
+tun_tap_check() {
+ ebegin "Checking for TUN/TAP support"
+ if { ! linux_chkconfig_present TUN; }; then
+ eerror "Please enable TUN/TAP support in your kernel config, found at:"
+ eerror
+ eerror " Device Drivers --->"
+ eerror " [*] Network device support --->"
+ eerror " <*> Universal TUN/TAP device driver support"
+ eerror
+ eerror "and recompile your kernel ..."
+ die "no CONFIG_TUN support detected!"
+ fi
+ eend $?
+}
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+
+ if use doc; then
+ python-any-r1_pkg_setup
+ fi
+
+ if use kernel_linux; then
+ get_version
+ if linux_config_exists; then
+ tun_tap_check
+ else
+ ewarn "Was unable to determine your kernel .config"
+ ewarn "Please note that OpenConnect requires CONFIG_TUN to be set in your"
+ ewarn "kernel .config, Without it, it will not work correctly."
+ # We don't die here, so it's possible to compile this package without
+ # kernel sources available. Required for cross-compilation.
+ fi
+ fi
+}
+
+src_configure() {
+ strip-linguas $ILINGUAS
+ echo ${LINGUAS} > po/LINGUAS
+ if ! use doc; then
+ # If the python cannot be found, the docs will not build
+ sed -e 's#"${ac_cv_path_PYTHON}"#""#' -i configure || die
+ fi
+
+ # stoken and liboath not in portage
+ econf \
+ --with-vpnc-script="${EPREFIX}/etc/openconnect/openconnect.sh" \
+ $(use_enable static-libs static) \
+ $(use_enable nls ) \
+ $(use_with !gnutls openssl) \
+ $(use_with gnutls ) \
+ $(use_with libproxy) \
+ --without-stoken \
+ $(use_with gssapi) \
+ $(use_with java)
+}
+
+DOC_CONTENTS="The init script for openconnect supports multiple vpn tunnels.
+
+You need to create a symbolic link to /etc/init.d/openconnect in /etc/init.d
+instead of calling it directly:
+
+ln -s /etc/init.d/openconnect /etc/init.d/openconnect.vpn0
+
+You can then start the vpn tunnel like this:
+
+/etc/init.d/openconnect.vpn0 start
+
+If you would like to run preup, postup, predown, and/or postdown scripts,
+You need to create a directory in /etc/openconnect with the name of the vpn:
+
+mkdir /etc/openconnect/vpn0
+
+Then add executable shell files:
+
+mkdir /etc/openconnect/vpn0
+cd /etc/openconnect/vpn0
+echo '#!/bin/sh' > preup.sh
+cp preup.sh predown.sh
+cp preup.sh postup.sh
+cp preup.sh postdown.sh
+chmod 755 /etc/openconnect/vpn0/*
+"
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc AUTHORS TODO
+ newinitd "${FILESDIR}"/openconnect.init.in-r4 openconnect
+ dodir /etc/openconnect
+ insinto /etc/openconnect
+ newconfd "${FILESDIR}"/openconnect.conf.in openconnect
+ exeinto /etc/openconnect
+ newexe "${WORKDIR}"/vpnc-scripts-${VPNC_VER}/vpnc-script openconnect.sh
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openconnect.logrotate openconnect
+ keepdir /var/log/openconnect
+
+ # Remove useless .la files
+ prune_libtool_files --all
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog
+ elog "You may want to consider installing the following optional packages."
+ optfeature "resolvconf support" net-dns/openresolv
+ fi
+}
diff --git a/net-misc/openconnect/openconnect-7.06.ebuild b/net-misc/openconnect/openconnect-7.06.ebuild
new file mode 100644
index 000000000000..50197d67df9a
--- /dev/null
+++ b/net-misc/openconnect/openconnect-7.06.ebuild
@@ -0,0 +1,158 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="xml"
+
+inherit eutils java-pkg-opt-2 linux-info python-any-r1 readme.gentoo
+
+DESCRIPTION="Free client for Cisco AnyConnect SSL VPN software"
+HOMEPAGE="http://www.infradead.org/openconnect.html"
+VPNC_VER=20140806
+SRC_URI="ftp://ftp.infradead.org/pub/${PN}/${P}.tar.gz
+ ftp://ftp.infradead.org/pub/vpnc-scripts/vpnc-scripts-${VPNC_VER}.tar.gz"
+
+LICENSE="LGPL-2.1 GPL-2"
+SLOT="0/5"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+IUSE="doc +gnutls gssapi java libproxy nls static-libs"
+ILINGUAS="ar cs de el en_GB en_US es eu fi fr gl id lt nl pa pl pt pt_BR sk sl tg ug uk zh_CN zh_TW"
+for lang in $ILINGUAS; do
+ IUSE="${IUSE} linguas_${lang}"
+done
+
+DEPEND="dev-libs/libxml2
+ sys-libs/zlib
+ !gnutls? (
+ >=dev-libs/openssl-1.0.1h:0[static-libs?]
+ )
+ gnutls? (
+ >=net-libs/gnutls-3[static-libs?] dev-libs/nettle
+ app-misc/ca-certificates
+ )
+ gssapi? ( virtual/krb5 )
+ libproxy? ( net-libs/libproxy )
+ nls? ( virtual/libintl )"
+RDEPEND="${DEPEND}
+ sys-apps/iproute2"
+DEPEND="${DEPEND}
+ virtual/pkgconfig
+ doc? ( ${PYTHON_DEPS} sys-apps/groff )
+ java? ( >=virtual/jdk-1.6 )
+ nls? ( sys-devel/gettext )"
+
+tun_tap_check() {
+ ebegin "Checking for TUN/TAP support"
+ if { ! linux_chkconfig_present TUN; }; then
+ eerror "Please enable TUN/TAP support in your kernel config, found at:"
+ eerror
+ eerror " Device Drivers --->"
+ eerror " [*] Network device support --->"
+ eerror " <*> Universal TUN/TAP device driver support"
+ eerror
+ eerror "and recompile your kernel ..."
+ die "no CONFIG_TUN support detected!"
+ fi
+ eend $?
+}
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+
+ if use doc; then
+ python-any-r1_pkg_setup
+ fi
+
+ if use kernel_linux; then
+ get_version
+ if linux_config_exists; then
+ tun_tap_check
+ else
+ ewarn "Was unable to determine your kernel .config"
+ ewarn "Please note that OpenConnect requires CONFIG_TUN to be set in your"
+ ewarn "kernel .config, Without it, it will not work correctly."
+ # We don't die here, so it's possible to compile this package without
+ # kernel sources available. Required for cross-compilation.
+ fi
+ fi
+}
+
+src_configure() {
+ strip-linguas $ILINGUAS
+ echo ${LINGUAS} > po/LINGUAS
+ if ! use doc; then
+ # If the python cannot be found, the docs will not build
+ sed -e 's#"${ac_cv_path_PYTHON}"#""#' -i configure || die
+ fi
+
+ # stoken and liboath not in portage
+ econf \
+ --with-vpnc-script="${EPREFIX}/etc/openconnect/openconnect.sh" \
+ $(use_enable static-libs static) \
+ $(use_enable nls ) \
+ $(use_with !gnutls openssl) \
+ $(use_with gnutls ) \
+ $(use_with libproxy) \
+ --without-stoken \
+ $(use_with gssapi) \
+ $(use_with java)
+}
+
+DOC_CONTENTS="The init script for openconnect supports multiple vpn tunnels.
+
+You need to create a symbolic link to /etc/init.d/openconnect in /etc/init.d
+instead of calling it directly:
+
+ln -s /etc/init.d/openconnect /etc/init.d/openconnect.vpn0
+
+You can then start the vpn tunnel like this:
+
+/etc/init.d/openconnect.vpn0 start
+
+If you would like to run preup, postup, predown, and/or postdown scripts,
+You need to create a directory in /etc/openconnect with the name of the vpn:
+
+mkdir /etc/openconnect/vpn0
+
+Then add executable shell files:
+
+mkdir /etc/openconnect/vpn0
+cd /etc/openconnect/vpn0
+echo '#!/bin/sh' > preup.sh
+cp preup.sh predown.sh
+cp preup.sh postup.sh
+cp preup.sh postdown.sh
+chmod 755 /etc/openconnect/vpn0/*
+"
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc AUTHORS TODO
+ newinitd "${FILESDIR}"/openconnect.init.in-r3 openconnect
+ dodir /etc/openconnect
+ insinto /etc/openconnect
+ newconfd "${FILESDIR}"/openconnect.conf.in openconnect
+ exeinto /etc/openconnect
+ newexe "${WORKDIR}"/vpnc-scripts-${VPNC_VER}/vpnc-script openconnect.sh
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openconnect.logrotate openconnect
+ keepdir /var/log/openconnect
+
+ # Remove useless .la files
+ prune_libtool_files --all
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog
+ elog "You may want to consider installing the following optional packages."
+ optfeature "resolvconf support" net-dns/openresolv
+ fi
+}