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") | |
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))) |
1681cd4a LC |
75 | (synopsis "SSH client library") |
76 | (description | |
77 | "libssh is a C library implementing the SSHv2 and SSHv1 protocol for | |
78 | client and server implementations. With libssh, you can remotely execute | |
79 | programs, transfer files, and use a secure and transparent tunnel for your | |
80 | remote applications.") | |
81 | (home-page "http://www.libssh.org") | |
82 | (license license:lgpl2.1+))) | |
2fbf053b | 83 | |
9c333da6 LC |
84 | (define libssh-0.5 ; kept private |
85 | (package (inherit libssh) | |
86 | (version "0.5.5") | |
87 | (source (origin | |
88 | (method url-fetch) | |
89 | (uri (string-append "https://red.libssh.org/attachments/download/51/libssh-" | |
90 | version ".tar.gz")) | |
91 | (sha256 | |
92 | (base32 | |
93 | "17cfdff4hc0ijzrr15biq29fiabafz0bw621zlkbwbc1zh2hzpy0")) | |
94 | (patches (list (search-patch "libssh-CVE-2014-0017.patch"))))))) | |
95 | ||
2fbf053b AE |
96 | (define-public libssh2 |
97 | (package | |
98 | (name "libssh2") | |
99 | (version "1.4.3") | |
100 | (source (origin | |
101 | (method url-fetch) | |
102 | (uri (string-append | |
103 | "http://www.libssh2.org/download/libssh2-" | |
104 | version ".tar.gz")) | |
105 | (sha256 (base32 | |
106 | "0vdr478dbhbdgnniqmirawjb7mrcxckn4slhhrijxnzrkmgziipa")))) | |
107 | (build-system gnu-build-system) | |
e9c14f37 EB |
108 | ;; The installed libssh2.pc file does not include paths to libgcrypt and |
109 | ;; zlib libraries, so we need to propagate the inputs. | |
110 | (propagated-inputs `(("libgcrypt" ,libgcrypt) | |
111 | ("zlib" ,zlib))) | |
112 | (arguments '(#:configure-flags `("--with-libgcrypt"))) | |
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") | |
e4160d05 | 125 | (version "6.8p1") |
fe0b8a78 AE |
126 | (source (origin |
127 | (method url-fetch) | |
ca2baf10 NK |
128 | (uri (let ((tail (string-append name "-" version ".tar.gz"))) |
129 | (list (string-append "ftp://ftp.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/" | |
130 | tail) | |
131 | (string-append "ftp://ftp2.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/" | |
132 | tail)))) | |
fe0b8a78 | 133 | (sha256 (base32 |
e4160d05 | 134 | "03hnrqvjq6ghg1mp3gkarfxh6g3x1n1vjrzpbc5lh9717vklrxiz")))) |
fe0b8a78 AE |
135 | (build-system gnu-build-system) |
136 | (inputs `(("groff" ,groff) | |
137 | ("openssl" ,openssl) | |
138 | ("zlib" ,zlib))) | |
139 | (arguments | |
140 | `(#:test-target "tests" | |
141 | #:phases | |
d4bf49b1 EB |
142 | (alist-cons-after |
143 | 'configure 'reset-/var/empty | |
144 | (lambda* (#:key outputs #:allow-other-keys) | |
145 | (let ((out (assoc-ref outputs "out"))) | |
146 | (substitute* "Makefile" | |
147 | (("PRIVSEP_PATH=/var/empty") | |
148 | (string-append "PRIVSEP_PATH=" out "/var/empty"))))) | |
149 | (alist-cons-before | |
150 | 'check 'patch-tests | |
151 | (lambda _ | |
e4160d05 | 152 | ;; remove 't-exec' regress target which requires user 'sshd' |
d4bf49b1 | 153 | (substitute* "regress/Makefile" |
e4160d05 MW |
154 | (("^(REGRESS_TARGETS=.*) t-exec(.*)" all pre post) |
155 | (string-append pre post)))) | |
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 | 181 | Additionally, various channel-specific options can be negotiated.") |
166191b3 | 182 | (license (license:non-copyleft "file://LICENSE" |
fe0b8a78 AE |
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") | |
46ffff90 | 189 | (version "0.7.2") |
49d294e5 | 190 | (source (origin |
817efe8b LC |
191 | (method git-fetch) |
192 | (uri (git-reference | |
193 | (url "https://github.com/artyom-poptsov/libguile-ssh.git") | |
46ffff90 | 194 | (commit (string-append "v" version)))) |
49d294e5 LC |
195 | (sha256 |
196 | (base32 | |
46ffff90 | 197 | "1wcv10xv7ayrhrg77zyng6flknnlkzhni24nf8x9nic00zha8znk")))) |
49d294e5 LC |
198 | (build-system gnu-build-system) |
199 | (arguments | |
9dcd1b3b MW |
200 | '(#:phases (alist-cons-after |
201 | 'unpack 'autoreconf | |
49d294e5 | 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) | |
843b1962 LC |
219 | (zero? |
220 | (system* "guile" "-c" "(use-modules (ssh session))")))) | |
49d294e5 LC |
221 | %standard-phases)) |
222 | #:configure-flags (list (string-append "--with-guilesitedir=" | |
223 | (assoc-ref %outputs "out") | |
00ee3a71 LC |
224 | "/share/guile/site/2.0")) |
225 | ||
afde8da3 LC |
226 | ;; Tests are not parallel-safe. |
227 | #:parallel-tests? #f)) | |
49d294e5 LC |
228 | (native-inputs `(("autoconf" ,autoconf) |
229 | ("automake" ,automake) | |
3246cc91 | 230 | ("libtool" ,libtool) |
00ee3a71 | 231 | ("texinfo" ,texinfo) |
49d294e5 LC |
232 | ("pkg-config" ,pkg-config) |
233 | ("which" ,which))) | |
234 | (inputs `(("guile" ,guile-2.0) | |
817efe8b LC |
235 | ("libssh" ,libssh) |
236 | ("libgcrypt" ,libgcrypt-1.5))) | |
49d294e5 LC |
237 | (synopsis "Guile bindings to libssh") |
238 | (description | |
239 | "Guile-SSH is a library that provides access to the SSH protocol for | |
240 | programs written in GNU Guile interpreter. It is a wrapper to the underlying | |
241 | libssh library.") | |
242 | (home-page "https://github.com/artyom-poptsov/libguile-ssh") | |
243 | (license license:gpl3+))) | |
513e1950 SHT |
244 | |
245 | (define-public corkscrew | |
246 | (package | |
247 | (name "corkscrew") | |
248 | (version "2.0") | |
249 | (source | |
250 | (origin | |
251 | (method url-fetch) | |
252 | (uri (string-append "http://www.agroman.net/corkscrew/corkscrew-" | |
253 | version ".tar.gz")) | |
254 | (sha256 (base32 | |
255 | "1gmhas4va6gd70i2x2mpxpwpgww6413mji29mg282jms3jscn3qd")))) | |
256 | (build-system gnu-build-system) | |
257 | (arguments | |
258 | ;; Replace configure phase as the ./configure script does not link | |
259 | ;; CONFIG_SHELL and SHELL passed as parameters | |
260 | '(#:phases | |
261 | (alist-replace | |
262 | 'configure | |
263 | (lambda* (#:key outputs inputs system target | |
264 | #:allow-other-keys #:rest args) | |
265 | (let* ((configure (assoc-ref %standard-phases 'configure)) | |
266 | (prefix (assoc-ref outputs "out")) | |
267 | (bash (which "bash")) | |
268 | ;; Set --build and --host flags as the provided config.guess | |
269 | ;; is not able to detect them | |
270 | (flags `(,(string-append "--prefix=" prefix) | |
271 | ,(string-append "--build=" system) | |
272 | ,(string-append "--host=" | |
273 | (or target system))))) | |
274 | (setenv "CONFIG_SHELL" bash) | |
275 | (zero? (apply system* bash | |
276 | (string-append "." "/configure") | |
277 | flags)))) | |
278 | %standard-phases))) | |
279 | (home-page "http://www.agroman.net/corkscrew") | |
9e771e3b | 280 | (synopsis "Tunneling SSH through HTTP proxies") |
513e1950 SHT |
281 | (description |
282 | "Corkscrew allows creating TCP tunnels through HTTP proxies. WARNING: | |
283 | At the moment only plain text authentication is supported, should you require | |
284 | to use it with your HTTP proxy. Digest based authentication may be supported | |
285 | in future and NTLM based authentication is most likey never be supported.") | |
286 | (license license:gpl2+))) | |
87bf526b LC |
287 | |
288 | (define-public mosh | |
289 | (package | |
290 | (name "mosh") | |
291 | (version "1.2.4") | |
292 | (source (origin | |
293 | (method url-fetch) | |
294 | (uri (string-append "http://mosh.mit.edu/mosh-" | |
295 | version ".tar.gz")) | |
296 | (sha256 | |
297 | (base32 | |
298 | "0inzfmqrab3n97m7rrmhd4xh3hjz0xva2sfl5m06w11668r0skg7")))) | |
299 | (build-system gnu-build-system) | |
300 | (arguments | |
301 | '(#:phases (alist-cons-after | |
302 | 'install 'wrap | |
303 | (lambda* (#:key outputs #:allow-other-keys) | |
304 | ;; Make sure 'mosh' can find 'mosh-client' and | |
305 | ;; 'mosh-server'. | |
306 | (let* ((out (assoc-ref outputs "out")) | |
307 | (bin (string-append out "/bin"))) | |
308 | (wrap-program (string-append bin "/mosh") | |
309 | `("PATH" ":" prefix (,bin))))) | |
310 | %standard-phases))) | |
311 | (native-inputs | |
312 | `(("pkg-config" ,pkg-config))) | |
313 | (inputs | |
314 | `(("openssl" ,openssl) | |
315 | ("perl" ,perl) | |
316 | ("perl-io-tty" ,perl-io-tty) | |
317 | ("zlib" ,zlib) | |
318 | ("ncurses" ,ncurses) | |
319 | ("protobuf" ,protobuf) | |
320 | ("boost-headers" ,boost))) | |
321 | (home-page "http://mosh.mit.edu/") | |
322 | (synopsis "Remote shell tolerant to intermittent connectivity") | |
323 | (description | |
324 | "Remote terminal application that allows roaming, supports intermittent | |
325 | connectivity, and provides intelligent local echo and line editing of user | |
326 | keystrokes. Mosh is a replacement for SSH. It's more robust and responsive, | |
327 | especially over Wi-Fi, cellular, and long-distance links.") | |
328 | (license license:gpl3+))) | |
8c6cfd55 JD |
329 | |
330 | (define-public dropbear | |
331 | (package | |
332 | (name "dropbear") | |
333 | (version "2014.63") | |
334 | (source (origin | |
335 | (method url-fetch) | |
336 | (uri (string-append | |
337 | "http://matt.ucc.asn.au/" name "/releases/" name "-" version ".tar.bz2")) | |
338 | (sha256 | |
339 | (base32 "1bjpbg2vi5f332q4bqxkidkjfxsqmnqvp4g1wyh8d99b8gg94nar")))) | |
340 | (build-system gnu-build-system) | |
341 | (arguments `(#:tests? #f)) ; There is no "make check" or anything similar | |
342 | (inputs `(("zlib" ,zlib))) | |
343 | (synopsis "Small SSH server and client") | |
344 | (description "Dropbear is a relatively small SSH server and | |
35b9e423 EB |
345 | client. It runs on a variety of POSIX-based platforms. Dropbear is |
346 | particularly useful for embedded systems, such as wireless routers.") | |
8c6cfd55 JD |
347 | (home-page "https://matt.ucc.asn.au/dropbear/dropbear.html") |
348 | (license (license:x11-style "" "See file LICENSE.")))) |