From 935a3896c8bb0c356bb04865dc7af3daa09cdb44 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 7 May 2017 01:56:41 +0200 Subject: [PATCH 2/3] gnu: vpnc: Use newer vpnc-scripts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/vpn.scm (vpnc)[source]: Remove patch. [inputs]: Remove net-tools and iproute2. Add vpnc-scripts. [arguments]: Delete ‘configure’ and ‘wrap-vpnc-script’ #:phases. Add ‘use-store-paths’ phase. * gnu/packages/patches/vpnc-script.patch: Delete patch. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/patches/vpnc-script.patch | 15 ------------ gnu/packages/vpn.scm | 42 ++++++++++++---------------------- 3 files changed, 15 insertions(+), 43 deletions(-) delete mode 100644 gnu/packages/patches/vpnc-script.patch diff --git a/gnu/local.mk b/gnu/local.mk index 83b019605..55b4071e9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1047,7 +1047,6 @@ dist_patch_DATA = \ %D%/packages/patches/vorbis-tools-CVE-2014-9638+CVE-2014-9639.patch \ %D%/packages/patches/vorbis-tools-CVE-2014-9640.patch \ %D%/packages/patches/vorbis-tools-CVE-2015-6749.patch \ - %D%/packages/patches/vpnc-script.patch \ %D%/packages/patches/vte-CVE-2012-2738-pt1.patch \ %D%/packages/patches/vte-CVE-2012-2738-pt2.patch \ %D%/packages/patches/weechat-python.patch \ diff --git a/gnu/packages/patches/vpnc-script.patch b/gnu/packages/patches/vpnc-script.patch deleted file mode 100644 index a0d948195..000000000 --- a/gnu/packages/patches/vpnc-script.patch +++ /dev/null @@ -1,15 +0,0 @@ -This patch adapts the vpnc script to newer kernel versions, see - https://lkml.org/lkml/2011/3/24/645 - -diff -u a/vpnc-script.in b/vpnc-script.in ---- a/vpnc-script.in 2013-03-03 13:55:16.000000000 +0100 -+++ b/vpnc-script.in 2013-03-03 13:56:11.000000000 +0100 -@@ -116,7 +116,7 @@ - - if [ -n "$IPROUTE" ]; then - fix_ip_get_output () { -- sed 's/cache//;s/metric \?[0-9]\+ [0-9]\+//g;s/hoplimit [0-9]\+//g' -+ sed 's/cache//;s/metric \?[0-9]\+ [0-9]\+//g;s/hoplimit [0-9]\+//g;s/ipid 0x....//g' - } - - set_vpngateway_route() { diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm index 4b47a76b3..aa79a7cfb 100644 --- a/gnu/packages/vpn.scm +++ b/gnu/packages/vpn.scm @@ -73,41 +73,29 @@ endpoints.") (uri (string-append "https://www.unix-ag.uni-kl.de/~massar/vpnc/vpnc-" version ".tar.gz")) (sha256 (base32 - "1128860lis89g1s21hqxvap2nq426c9j4bvgghncc1zj0ays7kj6")) - (patches (search-patches "vpnc-script.patch")))) + "1128860lis89g1s21hqxvap2nq426c9j4bvgghncc1zj0ays7kj6")))) (build-system gnu-build-system) (inputs `(("libgcrypt" ,libgcrypt) ("perl" ,perl) - - ;; The following packages provide commands that 'vpnc-script' - ;; expects. - ("net-tools" ,net-tools) ;ifconfig, route - ("iproute2" ,iproute))) ;ip + ("vpnc-scripts" ,vpnc-scripts))) (arguments `(#:tests? #f ; there is no check target #:phases (modify-phases %standard-phases - (replace 'configure - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (substitute* "Makefile" - (("PREFIX=/usr/local") (string-append "PREFIX=" out))) - (substitute* "Makefile" - (("ETCDIR=/etc/vpnc") (string-append "ETCDIR=" out - "/etc/vpnc")))))) - (add-after 'install 'wrap-vpnc-script + (add-after 'unpack 'use-store-paths (lambda* (#:key inputs outputs #:allow-other-keys) - ;; Wrap 'etc/vpnc/vpnc-script' so that it finds the commands it - ;; needs. Assume coreutils/grep/sed are in $PATH. - (let ((out (assoc-ref outputs "out"))) - (wrap-program (string-append out "/etc/vpnc/vpnc-script") - `("PATH" ":" prefix - (,(string-append (assoc-ref inputs "net-tools") - "/sbin") - ,(string-append (assoc-ref inputs "net-tools") - "/bin") - ,(string-append (assoc-ref inputs "iproute2") - "/sbin")))))))))) + (let ((out (assoc-ref outputs "out")) + (vpnc-scripts (assoc-ref inputs "vpnc-scripts"))) + (substitute* "config.c" + (("/etc/vpnc/vpnc-script") + (string-append vpnc-scripts "/etc/vpnc/vpnc-script"))) + (substitute* "Makefile" + (("ETCDIR=.*") + (string-append "ETCDIR=" out "/etc/vpnc\n")) + (("PREFIX=.*") + (string-append "PREFIX=" out "\n"))) + #t))) + (delete 'configure)))) ; no configure script (synopsis "Client for Cisco VPN concentrators") (description "vpnc is a VPN client compatible with Cisco's EasyVPN equipment. -- 2.13.1