You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

246 lines
10 KiB

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Andreas Enge <>
;;; This file is part of GNU Guix.
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; GNU General Public License for more details.
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix. If not, see <>.
(define-module (gnu packages ssh)
#:use-module ((guix licenses)
#:renamer (symbol-prefix-proc 'license:))
#:use-module (gnu packages compression)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages groff)
#:use-module (gnu packages openssl)
#:use-module (gnu packages elf)
#:use-module (gnu packages guile)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages autotools)
#:use-module (gnu packages which)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (guix build-system cmake))
(define-public libssh
(name "libssh")
(version "0.5.5")
(source (origin
(method url-fetch)
(uri (string-append ""
version ".tar.gz"))
(build-system cmake-build-system)
'(#:configure-flags '("-DWITH_GCRYPT=ON"
;; Leave a valid RUNPATH upon install.
;; TODO: Add 'CMockery' and '-DWITH_TESTING=ON' for the test suite.
#:tests? #f
#:modules ((guix build cmake-build-system)
(guix build utils)
(guix build rpath))
#:imported-modules ((guix build gnu-build-system)
(guix build cmake-build-system)
(guix build utils)
(guix build rpath))
#:phases (alist-cons-after
'install 'augment-runpath
(lambda* (#:key outputs #:allow-other-keys)
;; NEEDs, so add $libdir to its
(define (dereference file)
(let ((target (false-if-exception (readlink file))))
(if target
(dereference target)
(let* ((out (assoc-ref outputs "out"))
(lib (string-append out "/lib")))
(with-directory-excursion lib
(augment-rpath (dereference "")
(inputs `(("zlib" ,zlib)
;; Link against an older gcrypt, because libssh tries to access
;; fields of 'gcry_thread_cbs' that are now private:
;; src/threads.c:72:26: error: 'struct gcry_thread_cbs' has no member named 'mutex_init'
("libgcrypt", libgcrypt-1.5)))
(native-inputs `(("patchelf" ,patchelf)))
(synopsis "SSH client library")
"libssh is a C library implementing the SSHv2 and SSHv1 protocol for
client and server implementations. With libssh, you can remotely execute
programs, transfer files, and use a secure and transparent tunnel for your
remote applications.")
(home-page "")
(license license:lgpl2.1+)))
(define-public libssh2
(name "libssh2")
(version "1.4.3")
(source (origin
(method url-fetch)
(uri (string-append
version ".tar.gz"))
(sha256 (base32
(build-system gnu-build-system)
(inputs `(("libgcrypt" ,libgcrypt)
("zlib" ,zlib)))
(synopsis "libssh2, a client-side C library implementing the SSH2 protocol")
"libssh2 is a library intended to allow software developers access to
the SSH-2 protocol in an easy-to-use self-contained package. It can be built
into an application to perform many different tasks when communicating with
a server that supports the SSH-2 protocol.")
(license license:bsd-3)
(home-page "")))
(define-public openssh
(name "openssh")
(version "6.1p1")
(source (origin
(method url-fetch)
(uri (string-append
version ".tar.gz"))
(sha256 (base32
(build-system gnu-build-system)
(inputs `(("groff" ,groff)
("openssl" ,openssl)
("zlib" ,zlib)))
`(#:test-target "tests"
(lambda* (#:key outputs #:allow-other-keys #:rest args)
(let ((configure (assoc-ref %standard-phases 'configure))
(out (assoc-ref outputs "out")))
(apply configure args)
(substitute* "Makefile"
(string-append "PRIVSEP_PATH=" out "/var/empty")))))
(lambda* (#:key #:allow-other-keys #:rest args)
(let ((check (assoc-ref %standard-phases 'check)))
;; remove tests that require the user sshd
(substitute* "regress/Makefile"
(("t9 t-exec") "t9"))
(apply check args)))
(lambda* (#:key (make-flags '()) #:allow-other-keys)
;; install without host keys and system configuration files
(zero? (apply system* "make" "install-nosysconf" make-flags)))
(synopsis "OpenSSH, a client and server for the secure shell (ssh) protocol")
"The SSH2 protocol implemented in OpenSSH is standardised by the
IETF secsh working group and is specified in several RFCs and drafts.
It is composed of three layered components:
The transport layer provides algorithm negotiation and a key exchange.
The key exchange includes server authentication and results in a
cryptographically secured connection: it provides integrity, confidentiality
and optional compression.
The user authentication layer uses the established connection and relies on
the services provided by the transport layer. It provides several mechanisms
for user authentication. These include traditional password authentication
as well as public-key or host-based authentication mechanisms.
The connection layer multiplexes many different concurrent channels over the
authenticated connection and allows tunneling of login sessions and
TCP-forwarding. It provides a flow control service for these channels.
Additionally, various channel-specific options can be negotiated.")
(license (license:bsd-style "file://LICENSE"
"See LICENSE in the distribution."))
(home-page "")))
(define-public guile-ssh
(name "guile-ssh")
(version "0.4.0")
(source (origin
(method url-fetch)
(uri (string-append
version ".tar.gz"))
(build-system gnu-build-system)
'(#:phases (alist-cons-before
'configure 'autoreconf
(lambda* (#:key inputs #:allow-other-keys)
;; The 'configure' script would want libssh 0.5.4, but that
;; doesn't exist.
(substitute* ""
(substitute* "src/"
(("-lssh_threads" match)
(string-append "-L" (assoc-ref inputs "libssh")
"/lib " match)))
(zero? (system* "autoreconf" "-vfi")))
'install 'fix-libguile-ssh-file-name
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(libdir (string-append out "/lib"))
(guiledir (string-append out
(substitute* (find-files guiledir ".scm")
(string-append "\"" libdir "/libguile-ssh\"")))
;; Make sure it works.
(setenv "GUILE_LOAD_PATH" guiledir)
(setenv "GUILE_LOAD_COMPILED_PATH" guiledir)
(system* "guile" "-c" "(use-modules (ssh session))")))
#:configure-flags (list (string-append "--with-guilesitedir="
(assoc-ref %outputs "out")
(native-inputs `(("autoconf" ,autoconf)
("automake" ,automake)
("libtool" ,libtool "bin")
("pkg-config" ,pkg-config)
("which" ,which)))
(inputs `(("guile" ,guile-2.0)
("libssh" ,libssh)))
(synopsis "Guile bindings to libssh")
"Guile-SSH is a library that provides access to the SSH protocol for
programs written in GNU Guile interpreter. It is a wrapper to the underlying
libssh library.")
(home-page "")
(license license:gpl3+)))