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