Commit 8d79f7ce authored by Damian Montero's avatar Damian Montero Committed by GitHub

Merge pull request #1031 from uberhacker/update-openconnect-package

Update openconnect from 7.06-1 to 7.08
parents 3aa49015 c69f3ff4
require 'package'
# @todo: provide vpnc-script (standalone), instructions for manual install:
#
# sudo su -
# mkdir /usr/local/etc/vpnc
# cd /usr/local/etc/vpnc
# wget http://git.infradead.org/users/dwmw2/vpnc-scripts.git/blob_plain/HEAD:/vpnc-script
# chmod a+x vpnc-script
# exit
# @todo: provide start-vpn script, instructions for manual connect:
# Usage (as root - run 'sudo su -'):
#
# Create 'tun0' tunnel interface:
#
# > ip tuntap add mode tun tun0
#
# Run openconnect on tun0 interface
#
# > openconnect -i tun0 vpn.example.com
# (Press Ctrl+C to exit)
#
# Shut down tun0 interface
#
# > ip tuntap del mode tun tun0
class Openconnect < Package
version '7.06-1'
version '7.08'
description 'OpenConnect is an SSL VPN client initially created to support Cisco\'s AnyConnect SSL VPN.'
homepage 'http://www.infradead.org/openconnect/'
source_url 'ftp://ftp.infradead.org/pub/openconnect/openconnect-7.06.tar.gz'
source_sha256 'facf695368dc4537a6a30e2147be90b1d77ee3cb2d269eaef070b6d9ddab70f2'
source_url 'ftp://ftp.infradead.org/pub/openconnect/openconnect-7.08.tar.gz'
source_sha256 '1c44ec1f37a6a025d1ca726b9555649417f1d31a46f747922b84099ace628a03'
depends_on 'buildessential'
depends_on 'libxml2'
depends_on 'gnutls'
depends_on 'vpnc'
def self.build
system "./configure CFLAGS=\" -fPIC\" --with-vpnc-script=/usr/local/etc/vpnc/vpnc-script"
system "./configure CFLAGS=' -fPIC' --with-vpnc-script=#{CREW_PREFIX}/etc/vpnc/vpnc-script"
system "make"
end
def self.install
system "make", "DESTDIR=#{CREW_DEST_DIR}", "install"
system "mkdir -p #{CREW_DEST_DIR}#{CREW_PREFIX}/bin"
FileUtils.cd("#{CREW_DEST_DIR}#{CREW_PREFIX}/bin") do
system "echo '#!/bin/bash' > vpnc-start"
system "echo 'if test \$1; then' >> vpnc-start"
system "echo ' sudo ip tuntap add mode tun tun0' >> vpnc-start"
system "echo ' read -p \"VPN Username: \" USER' >> vpnc-start"
system "echo ' read -s -p \"VPN Password: \" PASS' >> vpnc-start"
system "echo ' echo \"\$PASS\" | openconnect --user=\$USER --interface=tun0 -b \$1' >> vpnc-start"
system "echo 'else' >> vpnc-start"
system "echo ' echo \"Usage: vpnc-start vpn.example.com\"' >> vpnc-start"
system "echo 'fi' >> vpnc-start"
system "chmod +x vpnc-start"
system "echo '#!/bin/bash' > vpnc-stop"
system "echo 'killall openconnect' >> vpnc-stop"
system "echo 'sudo ip tuntap del mode tun tun0' >> vpnc-stop"
system "chmod +x vpnc-stop"
end
puts
puts "Added the following bash scripts:".lightblue
puts "vpnc-start - start vpn".lightblue
puts "vpnc-stop - stop vpn".lightblue
puts
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment