Commit | Line | Data |
---|---|---|
2fbf053b | 1 | ;;; GNU Guix --- Functional package management for GNU |
89e34644 | 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org> |
06ed5982 | 3 | ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr> |
45f2ffb4 | 4 | ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org> |
dec3e015 | 5 | ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il> |
78d80c5c | 6 | ;;; Copyright © 2016 Leo Famulari <leo@famulari.name> |
c777570b | 7 | ;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
8caeb117 | 8 | ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org> |
81d95a12 | 9 | ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr> |
2fbf053b AE |
10 | ;;; |
11 | ;;; This file is part of GNU Guix. | |
12 | ;;; | |
13 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
14 | ;;; under the terms of the GNU General Public License as published by | |
15 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
16 | ;;; your option) any later version. | |
17 | ;;; | |
18 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
19 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 | ;;; GNU General Public License for more details. | |
22 | ;;; | |
23 | ;;; You should have received a copy of the GNU General Public License | |
24 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
25 | ||
26 | (define-module (gnu packages ssh) | |
2102ae2e DC |
27 | #:use-module (gnu packages) |
28 | #:use-module (gnu packages autotools) | |
29 | #:use-module (gnu packages base) | |
30 | #:autoload (gnu packages boost) (boost) | |
2fbf053b | 31 | #:use-module (gnu packages compression) |
2102ae2e | 32 | #:use-module (gnu packages elf) |
2fbf053b | 33 | #:use-module (gnu packages gnupg) |
2102ae2e | 34 | #:use-module (gnu packages gperf) |
fe0b8a78 | 35 | #:use-module (gnu packages groff) |
49d294e5 | 36 | #:use-module (gnu packages guile) |
2102ae2e DC |
37 | #:use-module (gnu packages linux) |
38 | #:use-module (gnu packages m4) | |
39 | #:use-module (gnu packages multiprecision) | |
87bf526b | 40 | #:use-module (gnu packages ncurses) |
2102ae2e | 41 | #:use-module (gnu packages nettle) |
89e34644 | 42 | #:use-module (gnu packages kerberos) |
2102ae2e DC |
43 | #:use-module (gnu packages perl) |
44 | #:use-module (gnu packages pkg-config) | |
87bf526b | 45 | #:autoload (gnu packages protobuf) (protobuf) |
2102ae2e DC |
46 | #:use-module (gnu packages readline) |
47 | #:use-module (gnu packages texinfo) | |
cc2b77df | 48 | #:use-module (gnu packages tls) |
2102ae2e DC |
49 | #:use-module (gnu packages xorg) |
50 | #:use-module (guix build-system cmake) | |
51 | #:use-module (guix build-system gnu) | |
2fbf053b | 52 | #:use-module (guix download) |
817efe8b | 53 | #:use-module (guix git-download) |
2102ae2e | 54 | #:use-module ((guix licenses) #:prefix license:) |
befbaebf LC |
55 | #:use-module (guix packages) |
56 | #:use-module (srfi srfi-1)) | |
1681cd4a LC |
57 | |
58 | (define-public libssh | |
59 | (package | |
60 | (name "libssh") | |
5d79b1bf | 61 | (version "0.7.4") |
1681cd4a LC |
62 | (source (origin |
63 | (method url-fetch) | |
87390c15 | 64 | (uri (string-append |
5d79b1bf | 65 | "https://red.libssh.org/attachments/download/210/libssh-" |
87390c15 | 66 | version ".tar.xz")) |
1681cd4a LC |
67 | (sha256 |
68 | (base32 | |
5d79b1bf | 69 | "03bcp9ksqp0s1pmwfmzhcknvkxay5k0mjzzxp3rjlifbng1vxq9r")))) |
1681cd4a | 70 | (build-system cmake-build-system) |
deed349b | 71 | (arguments |
06ed5982 | 72 | '(#:configure-flags '("-DWITH_GCRYPT=ON") |
deed349b LC |
73 | |
74 | ;; TODO: Add 'CMockery' and '-DWITH_TESTING=ON' for the test suite. | |
06ed5982 | 75 | #:tests? #f)) |
1681cd4a | 76 | (inputs `(("zlib" ,zlib) |
b3546174 | 77 | ("libgcrypt" ,libgcrypt))) |
1681cd4a LC |
78 | (synopsis "SSH client library") |
79 | (description | |
80 | "libssh is a C library implementing the SSHv2 and SSHv1 protocol for | |
81 | client and server implementations. With libssh, you can remotely execute | |
82 | programs, transfer files, and use a secure and transparent tunnel for your | |
83 | remote applications.") | |
5d79b1bf | 84 | (home-page "https://www.libssh.org") |
1681cd4a | 85 | (license license:lgpl2.1+))) |
2fbf053b AE |
86 | |
87 | (define-public libssh2 | |
88 | (package | |
89 | (name "libssh2") | |
5d97f4c7 | 90 | (version "1.8.0") |
2fbf053b AE |
91 | (source (origin |
92 | (method url-fetch) | |
93 | (uri (string-append | |
78d80c5c | 94 | "https://www.libssh2.org/download/libssh2-" |
2fbf053b | 95 | version ".tar.gz")) |
78d80c5c LF |
96 | (sha256 |
97 | (base32 | |
ac2d5de3 MB |
98 | "1m3n8spv79qhjq4yi0wgly5s5rc8783jb1pyra9bkx1md0plxwrr")) |
99 | (patches | |
100 | (search-patches "libssh2-fix-build-failure-with-gcrypt.patch")))) | |
2fbf053b | 101 | (build-system gnu-build-system) |
e9c14f37 EB |
102 | ;; The installed libssh2.pc file does not include paths to libgcrypt and |
103 | ;; zlib libraries, so we need to propagate the inputs. | |
104 | (propagated-inputs `(("libgcrypt" ,libgcrypt) | |
105 | ("zlib" ,zlib))) | |
ac2d5de3 MB |
106 | (arguments '(#:configure-flags `("--with-libgcrypt") |
107 | #:phases (modify-phases %standard-phases | |
108 | (add-before 'configure 'autoreconf | |
109 | (lambda _ | |
110 | (zero? (system* "autoreconf" "-v"))))))) | |
111 | (native-inputs `(("autoconf" ,autoconf) | |
112 | ("automake" ,automake))) | |
35b9e423 | 113 | (synopsis "Client-side C library implementing the SSH2 protocol") |
2fbf053b AE |
114 | (description |
115 | "libssh2 is a library intended to allow software developers access to | |
35b9e423 | 116 | the SSH-2 protocol in an easy-to-use self-contained package. It can be built |
2fbf053b AE |
117 | into an application to perform many different tasks when communicating with |
118 | a server that supports the SSH-2 protocol.") | |
119 | (license license:bsd-3) | |
120 | (home-page "http://www.libssh2.org/"))) | |
fe0b8a78 AE |
121 | |
122 | (define-public openssh | |
123 | (package | |
124 | (name "openssh") | |
d8be338f | 125 | (version "7.5p1") |
fe0b8a78 AE |
126 | (source (origin |
127 | (method url-fetch) | |
ca2baf10 | 128 | (uri (let ((tail (string-append name "-" version ".tar.gz"))) |
087a4e9c | 129 | (list (string-append "http://openbsd.cs.fau.de/pub/OpenBSD/OpenSSH/portable/" |
ca2baf10 | 130 | tail) |
087a4e9c MW |
131 | (string-append "http://ftp.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/" |
132 | tail) | |
133 | (string-append "http://ftp2.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/" | |
ca2baf10 | 134 | tail)))) |
fe0b8a78 | 135 | (sha256 (base32 |
d8be338f | 136 | "1w7rb5gbrikxdkp8w7zxnci4549gk4bw1lml01s59w5rzb2y6ilq")))) |
fe0b8a78 | 137 | (build-system gnu-build-system) |
7d3373a0 LF |
138 | (native-inputs `(("groff" ,groff))) |
139 | (inputs `(("openssl" ,openssl) | |
39012aab | 140 | ("pam" ,linux-pam) |
040b6299 | 141 | ("mit-krb5" ,mit-krb5) |
683a4a34 LC |
142 | ("zlib" ,zlib) |
143 | ("xauth" ,xauth))) ;for 'ssh -X' and 'ssh -Y' | |
fe0b8a78 AE |
144 | (arguments |
145 | `(#:test-target "tests" | |
040b6299 | 146 | #:configure-flags `("--sysconfdir=/etc/ssh" |
39012aab | 147 | |
040b6299 | 148 | ;; Default value of 'PATH' used by sshd. |
9af49832 LC |
149 | "--with-default-path=/run/current-system/profile/bin" |
150 | ||
040b6299 JD |
151 | ;; configure needs to find krb5-config |
152 | ,(string-append "--with-kerberos5=" | |
153 | (assoc-ref %build-inputs "mit-krb5") | |
154 | "/bin") | |
155 | ||
39012aab LC |
156 | ;; Enable PAM support in sshd. |
157 | "--with-pam") | |
158 | ||
fe0b8a78 | 159 | #:phases |
a9ee11d5 RW |
160 | (modify-phases %standard-phases |
161 | (add-after 'configure 'reset-/var/empty | |
162 | (lambda* (#:key outputs #:allow-other-keys) | |
163 | (let ((out (assoc-ref outputs "out"))) | |
164 | (substitute* "Makefile" | |
165 | (("PRIVSEP_PATH=/var/empty") | |
166 | (string-append "PRIVSEP_PATH=" out "/var/empty"))) | |
167 | #t))) | |
168 | (add-before 'check 'patch-tests | |
169 | (lambda _ | |
170 | ;; remove 't-exec' regress target which requires user 'sshd' | |
171 | (substitute* "regress/Makefile" | |
172 | (("^(REGRESS_TARGETS=.*) t-exec(.*)" all pre post) | |
173 | (string-append pre post))) | |
174 | #t)) | |
175 | (replace 'install | |
36f26211 | 176 | (lambda* (#:key outputs (make-flags '()) #:allow-other-keys) |
a9ee11d5 | 177 | ;; install without host keys and system configuration files |
36f26211 RW |
178 | (and (zero? (apply system* "make" "install-nosysconf" make-flags)) |
179 | (begin | |
180 | (install-file "contrib/ssh-copy-id" | |
181 | (string-append (assoc-ref outputs "out") | |
182 | "/bin/")) | |
183 | (chmod (string-append (assoc-ref outputs "out") | |
184 | "/bin/ssh-copy-id") #o555) | |
185 | (install-file "contrib/ssh-copy-id.1" | |
186 | (string-append (assoc-ref outputs "out") | |
187 | "/share/man/man1/")) | |
188 | #t))))))) | |
35b9e423 | 189 | (synopsis "Client and server for the secure shell (ssh) protocol") |
fe0b8a78 AE |
190 | (description |
191 | "The SSH2 protocol implemented in OpenSSH is standardised by the | |
192 | IETF secsh working group and is specified in several RFCs and drafts. | |
193 | It is composed of three layered components: | |
194 | ||
195 | The transport layer provides algorithm negotiation and a key exchange. | |
196 | The key exchange includes server authentication and results in a | |
197 | cryptographically secured connection: it provides integrity, confidentiality | |
198 | and optional compression. | |
199 | ||
200 | The user authentication layer uses the established connection and relies on | |
35b9e423 EB |
201 | the services provided by the transport layer. It provides several mechanisms |
202 | for user authentication. These include traditional password authentication | |
fe0b8a78 AE |
203 | as well as public-key or host-based authentication mechanisms. |
204 | ||
205 | The connection layer multiplexes many different concurrent channels over the | |
206 | authenticated connection and allows tunneling of login sessions and | |
35b9e423 | 207 | TCP-forwarding. It provides a flow control service for these channels. |
fe0b8a78 | 208 | Additionally, various channel-specific options can be negotiated.") |
166191b3 | 209 | (license (license:non-copyleft "file://LICENSE" |
fe0b8a78 AE |
210 | "See LICENSE in the distribution.")) |
211 | (home-page "http://www.openssh.org/"))) | |
212 | ||
49d294e5 LC |
213 | (define-public guile-ssh |
214 | (package | |
215 | (name "guile-ssh") | |
6634180f LC |
216 | (version "0.10.2") |
217 | (home-page "https://github.com/artyom-poptsov/guile-ssh") | |
49d294e5 | 218 | (source (origin |
44fd0994 LC |
219 | ;; ftp://memory-heap.org/software/guile-ssh/guile-ssh-VERSION.tar.gz |
220 | ;; exists, but the server appears to be too slow and unreliable. | |
6634180f LC |
221 | ;; Also, using this URL allows the GitHub updater to work. |
222 | (method url-fetch) | |
223 | (uri (string-append home-page "/archive/v" | |
224 | version ".tar.gz")) | |
225 | (file-name (string-append name "-" version ".tar.gz")) | |
49d294e5 LC |
226 | (sha256 |
227 | (base32 | |
6634180f | 228 | "0pkiq3fm15pr4w1r420rrwwfmi4jz492r6l6vzjk6v73xlyfyfl3")))) |
49d294e5 LC |
229 | (build-system gnu-build-system) |
230 | (arguments | |
8a8f6590 LC |
231 | '(#:phases (modify-phases %standard-phases |
232 | (add-after 'unpack 'autoreconf | |
233 | (lambda* (#:key inputs #:allow-other-keys) | |
8a8f6590 | 234 | (zero? (system* "autoreconf" "-vfi")))) |
92b72582 | 235 | (add-before 'build 'fix-libguile-ssh-file-name |
8a8f6590 | 236 | (lambda* (#:key outputs #:allow-other-keys) |
92b72582 LC |
237 | ;; Build and install libguile-ssh.so so that we can use |
238 | ;; its absolute file name in .scm files, before we build | |
239 | ;; the .go files. | |
240 | (and (zero? (system* "make" "install" | |
241 | "-C" "libguile-ssh" | |
242 | "-j" (number->string | |
243 | (parallel-job-count)))) | |
244 | (let* ((out (assoc-ref outputs "out")) | |
245 | (libdir (string-append out "/lib"))) | |
246 | (substitute* (find-files "." "\\.scm$") | |
247 | (("\"libguile-ssh\"") | |
248 | (string-append "\"" libdir "/libguile-ssh\""))) | |
249 | #t))))) | |
00ee3a71 | 250 | |
afde8da3 LC |
251 | ;; Tests are not parallel-safe. |
252 | #:parallel-tests? #f)) | |
49d294e5 LC |
253 | (native-inputs `(("autoconf" ,autoconf) |
254 | ("automake" ,automake) | |
3246cc91 | 255 | ("libtool" ,libtool) |
00ee3a71 | 256 | ("texinfo" ,texinfo) |
49d294e5 LC |
257 | ("pkg-config" ,pkg-config) |
258 | ("which" ,which))) | |
259 | (inputs `(("guile" ,guile-2.0) | |
6f9d5b2e | 260 | ("libssh" ,libssh) |
44fd0994 | 261 | ("libgcrypt" ,libgcrypt))) |
49d294e5 LC |
262 | (synopsis "Guile bindings to libssh") |
263 | (description | |
264 | "Guile-SSH is a library that provides access to the SSH protocol for | |
265 | programs written in GNU Guile interpreter. It is a wrapper to the underlying | |
266 | libssh library.") | |
49d294e5 | 267 | (license license:gpl3+))) |
513e1950 | 268 | |
befbaebf LC |
269 | (define-public guile2.2-ssh |
270 | ;; This is a snapshot of a unofficial copy of Guile-SSH, which hopefully | |
271 | ;; reflects the upcoming release well enough. | |
272 | (let ((commit "926a0843626f89e3db02d01a6b01cc1f0d9cefcf") | |
273 | (revision "0")) | |
274 | (package | |
275 | (inherit guile-ssh) | |
276 | (name "guile2.2-ssh") | |
277 | (version (string-append "0.10.2." revision "." (string-take commit 7))) | |
278 | (source (origin | |
279 | (method git-fetch) | |
280 | (uri (git-reference | |
281 | (url "https://notabug.org/civodul/guile-ssh/") | |
282 | (commit commit))) | |
283 | (file-name (git-file-name name version)) | |
284 | (sha256 | |
285 | (base32 | |
286 | "0hf28macq8d1w05g0xy2lw1s5vzmcrixh7m43x7qvvdd31c998ip")))) | |
287 | (inputs `(("guile" ,guile-2.2) | |
288 | ,@(alist-delete "guile" (package-inputs guile-ssh))))))) | |
289 | ||
513e1950 SHT |
290 | (define-public corkscrew |
291 | (package | |
292 | (name "corkscrew") | |
293 | (version "2.0") | |
294 | (source | |
295 | (origin | |
296 | (method url-fetch) | |
040ae44a TGR |
297 | ;; The agroman.net domain name expired on 2017-03-23, and the original |
298 | ;; "http://www.agroman.net/corkscrew/corkscrew-2.0.tar.gz" now returns | |
299 | ;; bogus HTML. Perhaps it will yet return. Until then, use a mirror. | |
300 | (uri (string-append "https://downloads.openwrt.org/sources/" | |
301 | "corkscrew-" version ".tar.gz")) | |
513e1950 SHT |
302 | (sha256 (base32 |
303 | "1gmhas4va6gd70i2x2mpxpwpgww6413mji29mg282jms3jscn3qd")))) | |
304 | (build-system gnu-build-system) | |
305 | (arguments | |
306 | ;; Replace configure phase as the ./configure script does not link | |
307 | ;; CONFIG_SHELL and SHELL passed as parameters | |
308 | '(#:phases | |
91c52629 EF |
309 | (modify-phases %standard-phases |
310 | (replace 'configure | |
311 | (lambda* (#:key outputs inputs system build target | |
312 | #:allow-other-keys #:rest args) | |
313 | (let* ((configure (assoc-ref %standard-phases 'configure)) | |
314 | (prefix (assoc-ref outputs "out")) | |
315 | (bash (which "bash")) | |
316 | ;; Set --build and --host flags as the provided config.guess | |
317 | ;; is not able to detect them | |
318 | (flags `(,(string-append "--prefix=" prefix) | |
319 | ,(string-append "--build=" build) | |
320 | ,(string-append "--host=" (or target build))))) | |
321 | (setenv "CONFIG_SHELL" bash) | |
322 | (zero? (apply system* bash | |
323 | (string-append "." "/configure") | |
81d95a12 TGR |
324 | flags))))) |
325 | (add-after 'install 'install-documentation | |
326 | (lambda* (#:key outputs #:allow-other-keys) | |
327 | (let* ((out (assoc-ref outputs "out")) | |
328 | (doc (string-append out "/share/doc/corkscrew"))) | |
329 | (install-file "README" doc) | |
330 | #t)))))) | |
513e1950 | 331 | (home-page "http://www.agroman.net/corkscrew") |
10c95711 | 332 | (synopsis "SSH tunneling through HTTP(S) proxies") |
513e1950 | 333 | (description |
10c95711 TGR |
334 | "Corkscrew tunnels SSH connections through most HTTP and HTTPS proxies. |
335 | Proxy authentication is only supported through the plain-text HTTP basic | |
336 | authentication scheme.") | |
513e1950 | 337 | (license license:gpl2+))) |
87bf526b LC |
338 | |
339 | (define-public mosh | |
340 | (package | |
341 | (name "mosh") | |
a800c217 | 342 | (version "1.3.0") |
87bf526b LC |
343 | (source (origin |
344 | (method url-fetch) | |
c3671282 | 345 | (uri (string-append "https://mosh.org/mosh-" version ".tar.gz")) |
87bf526b LC |
346 | (sha256 |
347 | (base32 | |
a800c217 | 348 | "0xikz40q873g9ihvz3x6bwkcb9hb8kcnp5wpcmb72pg5c7s143ij")))) |
87bf526b LC |
349 | (build-system gnu-build-system) |
350 | (arguments | |
11379192 EF |
351 | '(#:phases |
352 | (modify-phases %standard-phases | |
353 | (add-after 'install 'wrap | |
354 | (lambda* (#:key outputs #:allow-other-keys) | |
355 | ;; Make sure 'mosh' can find 'mosh-client' and | |
356 | ;; 'mosh-server'. | |
357 | (let* ((out (assoc-ref outputs "out")) | |
358 | (bin (string-append out "/bin"))) | |
359 | (wrap-program (string-append bin "/mosh") | |
360 | `("PATH" ":" prefix (,bin))))))))) | |
87bf526b LC |
361 | (native-inputs |
362 | `(("pkg-config" ,pkg-config))) | |
363 | (inputs | |
364 | `(("openssl" ,openssl) | |
365 | ("perl" ,perl) | |
366 | ("perl-io-tty" ,perl-io-tty) | |
367 | ("zlib" ,zlib) | |
368 | ("ncurses" ,ncurses) | |
369 | ("protobuf" ,protobuf) | |
370 | ("boost-headers" ,boost))) | |
c3671282 | 371 | (home-page "https://mosh.org/") |
87bf526b LC |
372 | (synopsis "Remote shell tolerant to intermittent connectivity") |
373 | (description | |
374 | "Remote terminal application that allows roaming, supports intermittent | |
375 | connectivity, and provides intelligent local echo and line editing of user | |
376 | keystrokes. Mosh is a replacement for SSH. It's more robust and responsive, | |
377 | especially over Wi-Fi, cellular, and long-distance links.") | |
378 | (license license:gpl3+))) | |
8c6cfd55 JD |
379 | |
380 | (define-public dropbear | |
381 | (package | |
382 | (name "dropbear") | |
d4db0612 | 383 | (version "2016.74") |
8c6cfd55 JD |
384 | (source (origin |
385 | (method url-fetch) | |
386 | (uri (string-append | |
dec3e015 | 387 | "https://matt.ucc.asn.au/" name "/releases/" |
a124bbd2 | 388 | name "-" version ".tar.bz2")) |
8c6cfd55 | 389 | (sha256 |
dec3e015 | 390 | (base32 |
d4db0612 | 391 | "14c8f4gzixf0j9fkx68jgl85q7b05852kk0vf09gi6h0xmafl817")))) |
8c6cfd55 JD |
392 | (build-system gnu-build-system) |
393 | (arguments `(#:tests? #f)) ; There is no "make check" or anything similar | |
394 | (inputs `(("zlib" ,zlib))) | |
395 | (synopsis "Small SSH server and client") | |
396 | (description "Dropbear is a relatively small SSH server and | |
35b9e423 EB |
397 | client. It runs on a variety of POSIX-based platforms. Dropbear is |
398 | particularly useful for embedded systems, such as wireless routers.") | |
8c6cfd55 JD |
399 | (home-page "https://matt.ucc.asn.au/dropbear/dropbear.html") |
400 | (license (license:x11-style "" "See file LICENSE.")))) | |
2102ae2e DC |
401 | |
402 | (define-public liboop | |
403 | (package | |
404 | (name "liboop") | |
405 | (version "1.0") | |
406 | (source | |
407 | (origin | |
408 | (method url-fetch) | |
409 | (uri (string-append "http://download.ofb.net/liboop/liboop-" | |
410 | version ".tar.gz")) | |
411 | (sha256 | |
412 | (base32 | |
413 | "0z6rlalhvfca64jpvksppc9bdhs7jwhiw4y35g5ibvh91xp3rn1l")) | |
414 | (patches (search-patches "liboop-mips64-deplibs-fix.patch")))) | |
415 | (build-system gnu-build-system) | |
416 | (home-page "http://www.lysator.liu.se/liboop/") | |
417 | (synopsis "Event loop library") | |
418 | (description "Liboop is a low-level event loop management library for | |
419 | POSIX-based operating systems. It supports the development of modular, | |
420 | multiplexed applications which may respond to events from several sources. It | |
421 | replaces the \"select() loop\" and allows the registration of event handlers | |
422 | for file and network I/O, timers and signals. Since processes use these | |
423 | mechanisms for almost all external communication, liboop can be used as the | |
424 | basis for almost any application.") | |
425 | (license license:lgpl2.1+))) | |
426 | ||
427 | (define-public lsh | |
428 | (package | |
429 | (name "lsh") | |
430 | (version "2.1") | |
431 | (source (origin | |
432 | (method url-fetch) | |
433 | (uri (string-append "mirror://gnu/lsh/lsh-" | |
434 | version ".tar.gz")) | |
435 | (sha256 | |
436 | (base32 | |
437 | "1qqjy9zfzgny0rkb27c8c7dfsylvb6n0ld8h3an2r83pmaqr9gwb")) | |
438 | (modules '((guix build utils))) | |
439 | (snippet | |
440 | '(begin | |
441 | (substitute* "src/testsuite/functions.sh" | |
442 | (("localhost") | |
443 | ;; Avoid host name lookups since they don't work in | |
444 | ;; chroot builds. | |
445 | "127.0.0.1") | |
446 | (("set -e") | |
447 | ;; Make tests more verbose. | |
448 | "set -e\nset -x")) | |
449 | ||
450 | (substitute* (find-files "src/testsuite" "-test$") | |
451 | (("localhost") "127.0.0.1")) | |
452 | ||
453 | (substitute* "src/testsuite/login-auth-test" | |
454 | (("/bin/cat") "cat")))))) | |
455 | (build-system gnu-build-system) | |
456 | (native-inputs | |
457 | `(("m4" ,m4) | |
458 | ("guile" ,guile-2.0) | |
459 | ("gperf" ,gperf) | |
460 | ("psmisc" ,psmisc))) ; for `killall' | |
461 | (inputs | |
462 | `(("nettle" ,nettle-2) | |
463 | ("linux-pam" ,linux-pam) | |
464 | ||
465 | ;; 'rl.c' uses the 'CPPFunction' type, which is no longer in | |
466 | ;; Readline 6.3. | |
467 | ("readline" ,readline-6.2) | |
468 | ||
469 | ("liboop" ,liboop) | |
470 | ("zlib" ,zlib) | |
471 | ("gmp" ,gmp) | |
472 | ||
473 | ;; The server (lshd) invokes xauth when X11 forwarding is requested. | |
474 | ;; This adds 24 MiB (or 27%) to the closure of lsh. | |
475 | ("xauth" ,xauth))) | |
476 | (arguments | |
477 | '(;; Skip the `configure' test that checks whether /dev/ptmx & | |
478 | ;; co. work as expected, because it relies on impurities (for | |
479 | ;; instance, /dev/pts may be unavailable in chroots.) | |
d5c969ce LC |
480 | #:configure-flags '("lsh_cv_sys_unix98_ptys=yes" |
481 | ||
482 | ;; Use glibc's argp rather than the bundled one. | |
483 | "--with-system-argp" | |
484 | ||
485 | ;; 'lsh_argp.h' checks HAVE_ARGP_PARSE but nothing | |
486 | ;; defines it. | |
487 | "CPPFLAGS=-DHAVE_ARGP_PARSE") | |
2102ae2e DC |
488 | |
489 | ;; FIXME: Tests won't run in a chroot, presumably because | |
490 | ;; /etc/profile is missing, and thus clients get an empty $PATH | |
491 | ;; and nothing works. | |
492 | #:tests? #f | |
493 | ||
494 | #:phases | |
495 | (modify-phases %standard-phases | |
496 | (add-before 'configure 'pre-configure | |
497 | (lambda* (#:key inputs #:allow-other-keys) | |
498 | (let* ((nettle (assoc-ref inputs "nettle")) | |
499 | (sexp-conv (string-append nettle "/bin/sexp-conv"))) | |
d5c969ce LC |
500 | ;; Remove argp from the list of sub-directories; we don't want |
501 | ;; to build it, really. | |
502 | (substitute* "src/Makefile.in" | |
503 | (("^SUBDIRS = argp") | |
504 | "SUBDIRS =")) | |
505 | ||
2102ae2e DC |
506 | ;; Make sure 'lsh' and 'lshd' pick 'sexp-conv' in the right place |
507 | ;; by default. | |
508 | (substitute* "src/environ.h.in" | |
509 | (("^#define PATH_SEXP_CONV.*") | |
510 | (string-append "#define PATH_SEXP_CONV \"" | |
511 | sexp-conv "\"\n"))) | |
512 | ||
513 | ;; Same for the 'lsh-authorize' script. | |
514 | (substitute* "src/lsh-authorize" | |
515 | (("=sexp-conv") | |
516 | (string-append "=" sexp-conv))) | |
517 | ||
518 | ;; Tell lshd where 'xauth' lives. Another option would be to | |
519 | ;; hardcode "/run/current-system/profile/bin/xauth", thereby | |
520 | ;; reducing the closure size, but that wouldn't work on foreign | |
521 | ;; distros. | |
522 | (with-fluids ((%default-port-encoding "ISO-8859-1")) | |
523 | (substitute* "src/server_x11.c" | |
524 | (("define XAUTH_PROGRAM.*") | |
525 | (string-append "define XAUTH_PROGRAM \"" | |
526 | (assoc-ref inputs "xauth") | |
527 | "/bin/xauth\"\n"))))) | |
528 | ||
529 | ;; Tests rely on $USER being set. | |
530 | (setenv "USER" "guix")))))) | |
531 | (home-page "http://www.lysator.liu.se/~nisse/lsh/") | |
532 | (synopsis "GNU implementation of the Secure Shell (ssh) protocols") | |
533 | (description | |
534 | "GNU lsh is a free implementation of the SSH version 2 protocol. It is | |
535 | used to create a secure line of communication between two computers, | |
536 | providing shell access to the server system from the client. It provides | |
537 | both the server daemon and the client application, as well as tools for | |
538 | manipulating key files.") | |
539 | (license license:gpl2+))) | |
c777570b NG |
540 | |
541 | (define-public sshpass | |
542 | (package | |
543 | (name "sshpass") | |
544 | (version "1.06") | |
545 | (synopsis "Non-interactive password authentication with SSH") | |
546 | (home-page "https://sourceforge.net/projects/sshpass/") | |
547 | (source | |
548 | (origin | |
549 | (method url-fetch) | |
550 | (uri (string-append "mirror://sourceforge/sshpass/sshpass/" | |
551 | version "/sshpass-" version ".tar.gz")) | |
552 | (sha256 | |
553 | (base32 | |
554 | "0q7fblaczb7kwbsz0gdy9267z0sllzgmf0c7z5c9mf88wv74ycn6")))) | |
555 | (build-system gnu-build-system) | |
556 | (description "sshpass is a tool for non-interactivly performing password | |
557 | authentication with SSH's so-called @dfn{interactive keyboard password | |
558 | authentication}.") | |
559 | (license license:gpl2+))) | |
8caeb117 CAW |
560 | |
561 | (define-public autossh | |
562 | (package | |
563 | (name "autossh") | |
564 | (version "1.4e") | |
565 | (source | |
566 | (origin | |
567 | (method url-fetch) | |
568 | (uri (string-append | |
569 | "http://www.harding.motd.ca/autossh/autossh-" | |
570 | version ".tgz")) | |
571 | (sha256 | |
572 | (base32 "0mlicw28vq2jxa0jf0dys5ja75v0fxpjavlq9dpif6bnknji13ly")))) | |
573 | (build-system gnu-build-system) | |
574 | (arguments `(#:tests? #f)) ; There is no "make check" or anything similar | |
575 | (inputs `(("openssh" ,openssh))) | |
576 | (synopsis "Automatically restart SSH sessions and tunnels") | |
577 | (description "autossh is a program to start a copy of @command{ssh} and | |
578 | monitor it, restarting it as necessary should it die or stop passing traffic.") | |
579 | (home-page "http://www.harding.motd.ca/autossh/") | |
580 | (license | |
581 | ;; Why point to a source file? Well, all the individual files have a | |
582 | ;; copy of this license in their headers, but there's no separate file | |
583 | ;; with that information. | |
584 | (license:non-copyleft "file://autossh.c")))) |