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