guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: gnu: vpnc: Make sure 'vpnc-script' finds the commands it needs.


From: Ludovic Courtès
Subject: 01/03: gnu: vpnc: Make sure 'vpnc-script' finds the commands it needs.
Date: Fri, 05 Feb 2016 21:11:09 +0000

civodul pushed a commit to branch master
in repository guix.

commit 42c97811c973d41b752a9cc561d2544583cc5c71
Author: Ludovic Courtès <address@hidden>
Date:   Fri Feb 5 16:36:38 2016 +0100

    gnu: vpnc: Make sure 'vpnc-script' finds the commands it needs.
    
    * gnu/packages/vpn.scm (vpnc)[inputs]: Add NET-TOOLS and IPROUTE.
    [arguments]: Use 'modify-phases'.  Wrap 'vpnc-script'.
---
 gnu/packages/vpn.scm |   40 +++++++++++++++++++++++++++++-----------
 1 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 6af87d2..34dacec 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Andreas Enge <address@hidden>
-;;; Copyright © 2013 Ludovic Courtès <address@hidden>
+;;; Copyright © 2013, 2016 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2014 Eric Bavier <address@hidden>
 ;;; Copyright © 2015 Jeff Mickey <address@hidden>
 ;;;
@@ -70,19 +70,37 @@ endpoints.")
             (patches (list (search-patch "vpnc-script.patch")))))
    (build-system gnu-build-system)
    (inputs `(("libgcrypt" ,libgcrypt)
-             ("perl" ,perl)))
+             ("perl" ,perl)
+
+             ;; The following packages provide commands that 'vpnc-script'
+             ;; expects.
+             ("net-tools" ,net-tools)             ;ifconfig, route
+             ("iproute2" ,iproute)))              ;ip
    (arguments
     `(#:tests? #f ; there is no check target
       #:phases
-      (alist-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")))))
-       %standard-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
+          (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"))))))))))
    (synopsis "Client for Cisco VPN concentrators")
    (description
     "vpnc is a VPN client compatible with Cisco's EasyVPN equipment.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]