distro: Change the module name space to (gnu ...).
[jackhill/guix/guix.git] / gnu / packages / lsh.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages lsh)
20 #:use-module (guix licenses)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix build-system gnu)
24 #:use-module (distro)
25 #:use-module (gnu packages m4)
26 #:use-module (gnu packages linux)
27 #:use-module ((gnu packages compression)
28 #:renamer (symbol-prefix-proc 'guix:))
29 #:use-module (gnu packages multiprecision)
30 #:use-module (gnu packages readline)
31 #:use-module (gnu packages gperf)
32 #:use-module (gnu packages base))
33
34 (define-public liboop
35 (package
36 (name "liboop")
37 (version "1.0")
38 (source
39 (origin
40 (method url-fetch)
41 (uri (string-append "http://download.ofb.net/liboop/liboop-"
42 version ".tar.gz"))
43 (sha256
44 (base32
45 "0z6rlalhvfca64jpvksppc9bdhs7jwhiw4y35g5ibvh91xp3rn1l"))))
46 (build-system gnu-build-system)
47 (home-page "http://liboop.ofb.net/")
48 (synopsis "`liboop', an event loop library")
49 (description "liboop is an event loop library.")
50 (license lgpl2.1+)))
51
52 (define-public lsh
53 (package
54 (name "lsh")
55 (version "2.0.4")
56 (source
57 (origin
58 (method url-fetch)
59 (uri (string-append "mirror://gnu/lsh/lsh-"
60 version ".tar.gz"))
61 (sha256
62 (base32
63 "149hf49xcj99wwvi7hcb59igq4vpyv8har1br1if3lrsw5irsjv1"))))
64 (build-system gnu-build-system)
65 (inputs
66 `(("linux-pam" ,linux-pam)
67 ("m4" ,m4)
68 ("readline" ,readline)
69 ("liboop" ,liboop)
70 ("zlib" ,guix:zlib)
71 ("gmp" ,gmp)
72 ("guile" ,guile-final)
73 ("gperf" ,gperf)
74 ("psmisc" ,psmisc) ; for `killall'
75
76 ("patch/no-root-login" ,(search-patch "lsh-no-root-login.patch"))
77 ("patch/guile-compat" ,(search-patch "lsh-guile-compat.patch"))
78 ("patch/pam-service-name"
79 ,(search-patch "lsh-pam-service-name.patch"))))
80 (arguments
81 '(#:patches (list (assoc-ref %build-inputs "patch/no-root-login")
82 (assoc-ref %build-inputs "patch/pam-service-name")
83 (assoc-ref %build-inputs "patch/guile-compat"))
84
85 ;; Skip the `configure' test that checks whether /dev/ptmx &
86 ;; co. work as expected, because it relies on impurities (for
87 ;; instance, /dev/pts may be unavailable in chroots.)
88 #:configure-flags '("lsh_cv_sys_unix98_ptys=yes")
89
90 ;; FIXME: Tests won't run in a chroot, presumably because
91 ;; /etc/profile is missing, and thus clients get an empty $PATH
92 ;; and nothing works.
93 #:tests? #f
94
95 #:phases
96 (alist-cons-before
97 'configure 'fix-test-suite
98 (lambda _
99 ;; Tests rely on $USER being set.
100 (setenv "USER" "guix")
101
102 (substitute* "src/testsuite/functions.sh"
103 (("localhost")
104 ;; Avoid host name lookups since they don't work in chroot
105 ;; builds.
106 "127.0.0.1")
107 (("set -e")
108 ;; Make tests more verbose.
109 "set -e\nset -x"))
110
111 (substitute* (find-files "src/testsuite" "-test$")
112 (("localhost") "127.0.0.1"))
113
114 (substitute* "src/testsuite/login-auth-test"
115 (("/bin/cat")
116 ;; Use the right path to `cat'.
117 (which "cat"))))
118 %standard-phases)))
119 (home-page "http://www.lysator.liu.se/~nisse/lsh/")
120 (synopsis
121 "GNU lsh, a GPL'd implementation of the SSH protocol")
122 (description
123 "lsh is a free implementation (in the GNU sense) of the ssh
124 version 2 protocol, currently being standardised by the IETF
125 SECSH working group.")
126 (license gpl2+)))