Commit | Line | Data |
---|---|---|
2fbf053b | 1 | ;;; GNU Guix --- Functional package management for GNU |
06ed5982 | 2 | ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr> |
9dcd1b3b | 3 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> |
2fbf053b AE |
4 | ;;; |
5 | ;;; This file is part of GNU Guix. | |
6 | ;;; | |
7 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
8 | ;;; under the terms of the GNU General Public License as published by | |
9 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
10 | ;;; your option) any later version. | |
11 | ;;; | |
12 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
13 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | ;;; GNU General Public License for more details. | |
16 | ;;; | |
17 | ;;; You should have received a copy of the GNU General Public License | |
18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
19 | ||
20 | (define-module (gnu packages ssh) | |
b5b73a82 | 21 | #:use-module ((guix licenses) #:prefix license:) |
2fbf053b AE |
22 | #:use-module (gnu packages compression) |
23 | #:use-module (gnu packages gnupg) | |
fe0b8a78 | 24 | #:use-module (gnu packages groff) |
3e778ad3 | 25 | #:use-module (gnu packages elf) |
49d294e5 LC |
26 | #:use-module (gnu packages guile) |
27 | #:use-module (gnu packages pkg-config) | |
28 | #:use-module (gnu packages autotools) | |
00ee3a71 | 29 | #:use-module (gnu packages texinfo) |
87bf526b LC |
30 | #:use-module (gnu packages perl) |
31 | #:use-module (gnu packages ncurses) | |
32 | #:autoload (gnu packages protobuf) (protobuf) | |
33 | #:autoload (gnu packages boost) (boost) | |
ce0614dd | 34 | #:use-module (gnu packages base) |
cc2b77df | 35 | #:use-module (gnu packages tls) |
9c333da6 | 36 | #:use-module (gnu packages) |
2fbf053b AE |
37 | #:use-module (guix packages) |
38 | #:use-module (guix download) | |
817efe8b | 39 | #:use-module (guix git-download) |
1681cd4a LC |
40 | #:use-module (guix build-system gnu) |
41 | #:use-module (guix build-system cmake)) | |
42 | ||
43 | (define-public libssh | |
44 | (package | |
45 | (name "libssh") | |
87390c15 | 46 | (version "0.6.5") |
1681cd4a LC |
47 | (source (origin |
48 | (method url-fetch) | |
87390c15 LC |
49 | (uri (string-append |
50 | "https://red.libssh.org/attachments/download/121/libssh-" | |
51 | version ".tar.xz")) | |
1681cd4a LC |
52 | (sha256 |
53 | (base32 | |
87390c15 | 54 | "0b6wyx6bwbb8jpn8x4rhlrdiqwqrwrs0mxjmrnqykm9kw1ijgm8g")))) |
1681cd4a | 55 | (build-system cmake-build-system) |
deed349b | 56 | (arguments |
06ed5982 | 57 | '(#:configure-flags '("-DWITH_GCRYPT=ON") |
deed349b LC |
58 | |
59 | ;; TODO: Add 'CMockery' and '-DWITH_TESTING=ON' for the test suite. | |
06ed5982 | 60 | #:tests? #f)) |
1681cd4a | 61 | (inputs `(("zlib" ,zlib) |
87390c15 | 62 | ("libgcrypt", libgcrypt))) |
1681cd4a LC |
63 | (synopsis "SSH client library") |
64 | (description | |
65 | "libssh is a C library implementing the SSHv2 and SSHv1 protocol for | |
66 | client and server implementations. With libssh, you can remotely execute | |
67 | programs, transfer files, and use a secure and transparent tunnel for your | |
68 | remote applications.") | |
69 | (home-page "http://www.libssh.org") | |
70 | (license license:lgpl2.1+))) | |
2fbf053b | 71 | |
9c333da6 LC |
72 | (define libssh-0.5 ; kept private |
73 | (package (inherit libssh) | |
74 | (version "0.5.5") | |
75 | (source (origin | |
76 | (method url-fetch) | |
77 | (uri (string-append "https://red.libssh.org/attachments/download/51/libssh-" | |
78 | version ".tar.gz")) | |
79 | (sha256 | |
80 | (base32 | |
81 | "17cfdff4hc0ijzrr15biq29fiabafz0bw621zlkbwbc1zh2hzpy0")) | |
82 | (patches (list (search-patch "libssh-CVE-2014-0017.patch"))))))) | |
83 | ||
2fbf053b AE |
84 | (define-public libssh2 |
85 | (package | |
86 | (name "libssh2") | |
87 | (version "1.4.3") | |
88 | (source (origin | |
89 | (method url-fetch) | |
90 | (uri (string-append | |
91 | "http://www.libssh2.org/download/libssh2-" | |
92 | version ".tar.gz")) | |
93 | (sha256 (base32 | |
94 | "0vdr478dbhbdgnniqmirawjb7mrcxckn4slhhrijxnzrkmgziipa")))) | |
95 | (build-system gnu-build-system) | |
e9c14f37 EB |
96 | ;; The installed libssh2.pc file does not include paths to libgcrypt and |
97 | ;; zlib libraries, so we need to propagate the inputs. | |
98 | (propagated-inputs `(("libgcrypt" ,libgcrypt) | |
99 | ("zlib" ,zlib))) | |
100 | (arguments '(#:configure-flags `("--with-libgcrypt"))) | |
35b9e423 | 101 | (synopsis "Client-side C library implementing the SSH2 protocol") |
2fbf053b AE |
102 | (description |
103 | "libssh2 is a library intended to allow software developers access to | |
35b9e423 | 104 | the SSH-2 protocol in an easy-to-use self-contained package. It can be built |
2fbf053b AE |
105 | into an application to perform many different tasks when communicating with |
106 | a server that supports the SSH-2 protocol.") | |
107 | (license license:bsd-3) | |
108 | (home-page "http://www.libssh2.org/"))) | |
fe0b8a78 AE |
109 | |
110 | (define-public openssh | |
111 | (package | |
112 | (name "openssh") | |
2f9c3d19 | 113 | (version "7.0p1") |
fe0b8a78 AE |
114 | (source (origin |
115 | (method url-fetch) | |
ca2baf10 | 116 | (uri (let ((tail (string-append name "-" version ".tar.gz"))) |
087a4e9c | 117 | (list (string-append "http://openbsd.cs.fau.de/pub/OpenBSD/OpenSSH/portable/" |
ca2baf10 | 118 | tail) |
087a4e9c MW |
119 | (string-append "http://ftp.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/" |
120 | tail) | |
121 | (string-append "http://ftp2.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/" | |
ca2baf10 | 122 | tail)))) |
fe0b8a78 | 123 | (sha256 (base32 |
2f9c3d19 | 124 | "1rc52jyc5v5b8j9kvasrnz9vnj9b0i7fw4nqac8wix0r794k4ngx")))) |
fe0b8a78 AE |
125 | (build-system gnu-build-system) |
126 | (inputs `(("groff" ,groff) | |
127 | ("openssl" ,openssl) | |
128 | ("zlib" ,zlib))) | |
129 | (arguments | |
130 | `(#:test-target "tests" | |
131 | #:phases | |
d4bf49b1 EB |
132 | (alist-cons-after |
133 | 'configure 'reset-/var/empty | |
134 | (lambda* (#:key outputs #:allow-other-keys) | |
135 | (let ((out (assoc-ref outputs "out"))) | |
136 | (substitute* "Makefile" | |
137 | (("PRIVSEP_PATH=/var/empty") | |
138 | (string-append "PRIVSEP_PATH=" out "/var/empty"))))) | |
139 | (alist-cons-before | |
140 | 'check 'patch-tests | |
141 | (lambda _ | |
e4160d05 | 142 | ;; remove 't-exec' regress target which requires user 'sshd' |
d4bf49b1 | 143 | (substitute* "regress/Makefile" |
e4160d05 MW |
144 | (("^(REGRESS_TARGETS=.*) t-exec(.*)" all pre post) |
145 | (string-append pre post)))) | |
fe0b8a78 AE |
146 | (alist-replace |
147 | 'install | |
148 | (lambda* (#:key (make-flags '()) #:allow-other-keys) | |
149 | ;; install without host keys and system configuration files | |
150 | (zero? (apply system* "make" "install-nosysconf" make-flags))) | |
151 | %standard-phases))))) | |
35b9e423 | 152 | (synopsis "Client and server for the secure shell (ssh) protocol") |
fe0b8a78 AE |
153 | (description |
154 | "The SSH2 protocol implemented in OpenSSH is standardised by the | |
155 | IETF secsh working group and is specified in several RFCs and drafts. | |
156 | It is composed of three layered components: | |
157 | ||
158 | The transport layer provides algorithm negotiation and a key exchange. | |
159 | The key exchange includes server authentication and results in a | |
160 | cryptographically secured connection: it provides integrity, confidentiality | |
161 | and optional compression. | |
162 | ||
163 | The user authentication layer uses the established connection and relies on | |
35b9e423 EB |
164 | the services provided by the transport layer. It provides several mechanisms |
165 | for user authentication. These include traditional password authentication | |
fe0b8a78 AE |
166 | as well as public-key or host-based authentication mechanisms. |
167 | ||
168 | The connection layer multiplexes many different concurrent channels over the | |
169 | authenticated connection and allows tunneling of login sessions and | |
35b9e423 | 170 | TCP-forwarding. It provides a flow control service for these channels. |
fe0b8a78 | 171 | Additionally, various channel-specific options can be negotiated.") |
166191b3 | 172 | (license (license:non-copyleft "file://LICENSE" |
fe0b8a78 AE |
173 | "See LICENSE in the distribution.")) |
174 | (home-page "http://www.openssh.org/"))) | |
175 | ||
49d294e5 LC |
176 | (define-public guile-ssh |
177 | (package | |
178 | (name "guile-ssh") | |
44fd0994 | 179 | (version "0.8.0") |
49d294e5 | 180 | (source (origin |
44fd0994 LC |
181 | ;; ftp://memory-heap.org/software/guile-ssh/guile-ssh-VERSION.tar.gz |
182 | ;; exists, but the server appears to be too slow and unreliable. | |
817efe8b LC |
183 | (method git-fetch) |
184 | (uri (git-reference | |
185 | (url "https://github.com/artyom-poptsov/libguile-ssh.git") | |
46ffff90 | 186 | (commit (string-append "v" version)))) |
49d294e5 LC |
187 | (sha256 |
188 | (base32 | |
44fd0994 | 189 | "1ld2khzylaylhqfsfcvbxs95frvm8pkr7dq40ia1wwn9c349fcdv")))) |
49d294e5 LC |
190 | (build-system gnu-build-system) |
191 | (arguments | |
9dcd1b3b MW |
192 | '(#:phases (alist-cons-after |
193 | 'unpack 'autoreconf | |
49d294e5 | 194 | (lambda* (#:key inputs #:allow-other-keys) |
817efe8b | 195 | (chmod "doc/version.texi" #o777) ;make it writable |
49d294e5 LC |
196 | (zero? (system* "autoreconf" "-vfi"))) |
197 | (alist-cons-after | |
198 | 'install 'fix-libguile-ssh-file-name | |
199 | (lambda* (#:key outputs #:allow-other-keys) | |
200 | (let* ((out (assoc-ref outputs "out")) | |
201 | (libdir (string-append out "/lib")) | |
202 | (guiledir (string-append out | |
203 | "/share/guile/site/2.0"))) | |
204 | (substitute* (find-files guiledir ".scm") | |
205 | (("\"libguile-ssh\"") | |
206 | (string-append "\"" libdir "/libguile-ssh\""))) | |
207 | ||
208 | ;; Make sure it works. | |
209 | (setenv "GUILE_LOAD_PATH" guiledir) | |
210 | (setenv "GUILE_LOAD_COMPILED_PATH" guiledir) | |
843b1962 LC |
211 | (zero? |
212 | (system* "guile" "-c" "(use-modules (ssh session))")))) | |
49d294e5 LC |
213 | %standard-phases)) |
214 | #:configure-flags (list (string-append "--with-guilesitedir=" | |
215 | (assoc-ref %outputs "out") | |
00ee3a71 LC |
216 | "/share/guile/site/2.0")) |
217 | ||
afde8da3 LC |
218 | ;; Tests are not parallel-safe. |
219 | #:parallel-tests? #f)) | |
49d294e5 LC |
220 | (native-inputs `(("autoconf" ,autoconf) |
221 | ("automake" ,automake) | |
3246cc91 | 222 | ("libtool" ,libtool) |
00ee3a71 | 223 | ("texinfo" ,texinfo) |
49d294e5 LC |
224 | ("pkg-config" ,pkg-config) |
225 | ("which" ,which))) | |
226 | (inputs `(("guile" ,guile-2.0) | |
817efe8b | 227 | ("libssh" ,libssh) |
44fd0994 | 228 | ("libgcrypt" ,libgcrypt))) |
49d294e5 LC |
229 | (synopsis "Guile bindings to libssh") |
230 | (description | |
231 | "Guile-SSH is a library that provides access to the SSH protocol for | |
232 | programs written in GNU Guile interpreter. It is a wrapper to the underlying | |
233 | libssh library.") | |
234 | (home-page "https://github.com/artyom-poptsov/libguile-ssh") | |
235 | (license license:gpl3+))) | |
513e1950 SHT |
236 | |
237 | (define-public corkscrew | |
238 | (package | |
239 | (name "corkscrew") | |
240 | (version "2.0") | |
241 | (source | |
242 | (origin | |
243 | (method url-fetch) | |
244 | (uri (string-append "http://www.agroman.net/corkscrew/corkscrew-" | |
245 | version ".tar.gz")) | |
246 | (sha256 (base32 | |
247 | "1gmhas4va6gd70i2x2mpxpwpgww6413mji29mg282jms3jscn3qd")))) | |
248 | (build-system gnu-build-system) | |
249 | (arguments | |
250 | ;; Replace configure phase as the ./configure script does not link | |
251 | ;; CONFIG_SHELL and SHELL passed as parameters | |
252 | '(#:phases | |
253 | (alist-replace | |
254 | 'configure | |
7a345762 | 255 | (lambda* (#:key outputs inputs system build target |
513e1950 SHT |
256 | #:allow-other-keys #:rest args) |
257 | (let* ((configure (assoc-ref %standard-phases 'configure)) | |
258 | (prefix (assoc-ref outputs "out")) | |
259 | (bash (which "bash")) | |
260 | ;; Set --build and --host flags as the provided config.guess | |
261 | ;; is not able to detect them | |
262 | (flags `(,(string-append "--prefix=" prefix) | |
7a345762 MW |
263 | ,(string-append "--build=" build) |
264 | ,(string-append "--host=" (or target build))))) | |
513e1950 SHT |
265 | (setenv "CONFIG_SHELL" bash) |
266 | (zero? (apply system* bash | |
267 | (string-append "." "/configure") | |
268 | flags)))) | |
269 | %standard-phases))) | |
270 | (home-page "http://www.agroman.net/corkscrew") | |
9e771e3b | 271 | (synopsis "Tunneling SSH through HTTP proxies") |
513e1950 SHT |
272 | (description |
273 | "Corkscrew allows creating TCP tunnels through HTTP proxies. WARNING: | |
274 | At the moment only plain text authentication is supported, should you require | |
275 | to use it with your HTTP proxy. Digest based authentication may be supported | |
276 | in future and NTLM based authentication is most likey never be supported.") | |
277 | (license license:gpl2+))) | |
87bf526b LC |
278 | |
279 | (define-public mosh | |
280 | (package | |
281 | (name "mosh") | |
2e136987 | 282 | (version "1.2.5") |
87bf526b LC |
283 | (source (origin |
284 | (method url-fetch) | |
2e136987 | 285 | (uri (string-append "https://mosh.mit.edu/mosh-" |
87bf526b LC |
286 | version ".tar.gz")) |
287 | (sha256 | |
288 | (base32 | |
2e136987 | 289 | "1qsb0y882yfgwnpy6f98pi5xqm6kykdsrxzvaal37hs7szjhky0s")))) |
87bf526b LC |
290 | (build-system gnu-build-system) |
291 | (arguments | |
292 | '(#:phases (alist-cons-after | |
293 | 'install 'wrap | |
294 | (lambda* (#:key outputs #:allow-other-keys) | |
295 | ;; Make sure 'mosh' can find 'mosh-client' and | |
296 | ;; 'mosh-server'. | |
297 | (let* ((out (assoc-ref outputs "out")) | |
298 | (bin (string-append out "/bin"))) | |
299 | (wrap-program (string-append bin "/mosh") | |
300 | `("PATH" ":" prefix (,bin))))) | |
301 | %standard-phases))) | |
302 | (native-inputs | |
303 | `(("pkg-config" ,pkg-config))) | |
304 | (inputs | |
305 | `(("openssl" ,openssl) | |
306 | ("perl" ,perl) | |
307 | ("perl-io-tty" ,perl-io-tty) | |
308 | ("zlib" ,zlib) | |
309 | ("ncurses" ,ncurses) | |
310 | ("protobuf" ,protobuf) | |
311 | ("boost-headers" ,boost))) | |
312 | (home-page "http://mosh.mit.edu/") | |
313 | (synopsis "Remote shell tolerant to intermittent connectivity") | |
314 | (description | |
315 | "Remote terminal application that allows roaming, supports intermittent | |
316 | connectivity, and provides intelligent local echo and line editing of user | |
317 | keystrokes. Mosh is a replacement for SSH. It's more robust and responsive, | |
318 | especially over Wi-Fi, cellular, and long-distance links.") | |
319 | (license license:gpl3+))) | |
8c6cfd55 JD |
320 | |
321 | (define-public dropbear | |
322 | (package | |
323 | (name "dropbear") | |
324 | (version "2014.63") | |
325 | (source (origin | |
326 | (method url-fetch) | |
327 | (uri (string-append | |
328 | "http://matt.ucc.asn.au/" name "/releases/" name "-" version ".tar.bz2")) | |
329 | (sha256 | |
330 | (base32 "1bjpbg2vi5f332q4bqxkidkjfxsqmnqvp4g1wyh8d99b8gg94nar")))) | |
331 | (build-system gnu-build-system) | |
332 | (arguments `(#:tests? #f)) ; There is no "make check" or anything similar | |
333 | (inputs `(("zlib" ,zlib))) | |
334 | (synopsis "Small SSH server and client") | |
335 | (description "Dropbear is a relatively small SSH server and | |
35b9e423 EB |
336 | client. It runs on a variety of POSIX-based platforms. Dropbear is |
337 | particularly useful for embedded systems, such as wireless routers.") | |
8c6cfd55 JD |
338 | (home-page "https://matt.ucc.asn.au/dropbear/dropbear.html") |
339 | (license (license:x11-style "" "See file LICENSE.")))) |