Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / kerberos.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita@karetnikov.org>
7 ;;; Copyright © 2012, 2017 Ludovic Courtès <ludo@gnu.org>
8 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
9 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
11 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
18 ;;;
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27 (define-module (gnu packages kerberos)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages autotools)
30 #:use-module (gnu packages bison)
31 #:use-module (gnu packages dbm)
32 #:use-module (gnu packages perl)
33 #:use-module (gnu packages gettext)
34 #:use-module (gnu packages gnupg)
35 #:use-module (gnu packages libidn)
36 #:use-module (gnu packages linux)
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages readline)
40 #:use-module (gnu packages sqlite)
41 #:use-module (gnu packages texinfo)
42 #:use-module (gnu packages tls)
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix packages)
45 #:use-module (guix download)
46 #:use-module (guix utils)
47 #:use-module (guix build-system gnu))
48
49 (define-public mit-krb5
50 (package
51 (name "mit-krb5")
52 (version "1.17")
53 (source (origin
54 (method url-fetch)
55 (uri (list
56 (string-append "https://web.mit.edu/kerberos/dist/krb5/"
57 (version-major+minor version)
58 "/krb5-" version ".tar.gz")
59 (string-append "https://kerberos.org/dist/krb5/"
60 (version-major+minor version)
61 "/krb5-" version ".tar.gz")))
62 (sha256
63 (base32
64 "1xc1ly09697b7g2vngvx76szjqy9769kpgn27lnp1r9xln224vjs"))))
65 (build-system gnu-build-system)
66 (native-inputs
67 `(("bison" ,bison)
68 ("perl" ,perl)))
69 (arguments
70 `(;; XXX: On 32-bit systems, 'kdb5_util' hangs on an fcntl/F_SETLKW call
71 ;; while running the tests in 'src/tests'.
72 #:tests? ,(string=? (%current-system) "x86_64-linux")
73
74 #:phases
75 (modify-phases %standard-phases
76 (add-after 'unpack 'enter-source-directory
77 (lambda _
78 (chdir "src")
79 #t))
80 (add-before 'check 'pre-check
81 (lambda* (#:key inputs #:allow-other-keys)
82 (let ((perl (assoc-ref inputs "perl")))
83 (substitute* "plugins/kdb/db2/libdb2/test/run.test"
84 (("/bin/cat") (string-append perl "/bin/perl"))
85 (("D/bin/sh") (string-append "D" (which "sh")))
86 (("bindir=/bin/.") (string-append "bindir=" perl "/bin"))))
87
88 ;; avoid service names since /etc/services is unavailable
89 (substitute* "tests/resolve/Makefile"
90 (("-p telnet") "-p 23"))
91 #t)))))
92 (synopsis "MIT Kerberos 5")
93 (description
94 "Massachusetts Institute of Technology implementation of Kerberos.
95 Kerberos is a network authentication protocol designed to provide strong
96 authentication for client/server applications by using secret-key
97 cryptography.")
98 (license (license:non-copyleft "file://NOTICE"
99 "See NOTICE in the distribution."))
100 (home-page "http://web.mit.edu/kerberos/")
101 (properties '((cpe-name . "kerberos")))))
102
103 (define-public shishi
104 (package
105 (name "shishi")
106 (version "1.0.2")
107 (source
108 (origin
109 (method url-fetch)
110 (uri (string-append "mirror://gnu/shishi/shishi-"
111 version ".tar.gz"))
112 (patches (search-patches "shishi-fix-libgcrypt-detection.patch"))
113 (sha256
114 (base32
115 "032qf72cpjdfffq1yq54gz3ahgqf2ijca4vl31sfabmjzq9q370d"))))
116 (build-system gnu-build-system)
117 (arguments
118 '(;; This is required since we patch some of the build scripts.
119 ;; Remove for the next Shishi release after 1.0.2 or when
120 ;; removing 'shishi-fix-libgcrypt-detection.patch'.
121 #:configure-flags '("ac_cv_libgcrypt=yes" "--disable-static")))
122 (native-inputs `(("pkg-config" ,pkg-config)))
123 (inputs
124 `(("gnutls" ,gnutls)
125 ("libidn" ,libidn)
126 ("linux-pam" ,linux-pam-1.2)
127 ("zlib" ,zlib)
128 ("libgcrypt" ,libgcrypt)
129 ("libtasn1" ,libtasn1)))
130 (home-page "https://www.gnu.org/software/shishi/")
131 (synopsis "Implementation of the Kerberos 5 network security system")
132 (description
133 "GNU Shishi is a free implementation of the Kerberos 5 network security
134 system. It is used to allow non-secure network nodes to communicate in a
135 secure manner through client-server mutual authentication via tickets.")
136 (license license:gpl3+)))
137
138 (define-public heimdal
139 (package
140 (name "heimdal")
141 (version "7.5.0")
142 (source (origin
143 (method url-fetch)
144 (uri (string-append
145 "https://github.com/heimdal/heimdal/releases/download/"
146 "heimdal-" version "/" "heimdal-" version ".tar.gz"))
147 (sha256
148 (base32
149 "1bdc682in55ygrxmhncs7cf4s239apcblci3z8i80wnc1w1s18n5"))
150 (modules '((guix build utils)))
151 (snippet
152 '(begin
153 (substitute* "configure"
154 (("User=.*$") "User=Guix\n")
155 (("Host=.*$") "Host=GNU")
156 (("Date=.*$") "Date=2017\n"))
157 #t))))
158 (build-system gnu-build-system)
159 (arguments
160 '(#:configure-flags (list
161 ;; Avoid 7 MiB of .a files.
162 "--disable-static"
163
164 ;; Do not build libedit.
165 (string-append
166 "--with-readline-lib="
167 (assoc-ref %build-inputs "readline") "/lib")
168 (string-append
169 "--with-readline-include="
170 (assoc-ref %build-inputs "readline") "/include")
171
172 ;; Do not build sqlite.
173 (string-append
174 "--with-sqlite3="
175 (assoc-ref %build-inputs "sqlite")))
176
177 #:phases (modify-phases %standard-phases
178 (add-before 'configure 'pre-configure
179 (lambda _
180 (substitute* '("appl/afsutil/pagsh.c"
181 "tools/Makefile.in")
182 (("/bin/sh") (which "sh")))
183 #t))
184 (add-before 'check 'pre-check
185 (lambda _
186 ;; For 'getxxyyy-test'.
187 (setenv "USER" (passwd:name (getpwuid (getuid))))
188
189 ;; Skip 'db' and 'kdc' tests for now.
190 ;; FIXME: figure out why 'kdc' tests fail.
191 (with-output-to-file "tests/db/have-db.in"
192 (lambda ()
193 (format #t "#!~a~%exit 1~%" (which "sh"))))
194 #t)))
195 ;; Tests fail when run in parallel.
196 #:parallel-tests? #f))
197 (native-inputs `(("e2fsprogs" ,e2fsprogs) ;for 'compile_et'
198 ("texinfo" ,texinfo)
199 ("unzip" ,unzip))) ;for tests
200 (inputs `(("readline" ,readline)
201 ("bdb" ,bdb)
202 ("e2fsprogs" ,e2fsprogs) ;for libcom_err
203 ("sqlite" ,sqlite)))
204 (home-page "http://www.h5l.org/")
205 (synopsis "Kerberos 5 network authentication")
206 (description
207 "Heimdal is an implementation of Kerberos 5 network authentication
208 service.")
209 (license license:bsd-3)))