gnu: mit-krb5: Update to 1.17.1.
[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 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
12 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages kerberos)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages autotools)
31 #:use-module (gnu packages bison)
32 #:use-module (gnu packages dbm)
33 #:use-module (gnu packages perl)
34 #:use-module (gnu packages gettext)
35 #:use-module (gnu packages gnupg)
36 #:use-module (gnu packages libidn)
37 #:use-module (gnu packages linux)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages compression)
40 #:use-module (gnu packages readline)
41 #:use-module (gnu packages sqlite)
42 #:use-module (gnu packages texinfo)
43 #:use-module (gnu packages tls)
44 #:use-module ((guix licenses) #:prefix license:)
45 #:use-module (guix packages)
46 #:use-module (guix download)
47 #:use-module (guix utils)
48 #:use-module (guix build-system gnu))
49
50 (define-public mit-krb5
51 (package
52 (name "mit-krb5")
53 (version "1.17.1")
54 (source (origin
55 (method url-fetch)
56 (uri (list
57 (string-append "https://web.mit.edu/kerberos/dist/krb5/"
58 (version-major+minor version)
59 "/krb5-" version ".tar.gz")
60 (string-append "https://kerberos.org/dist/krb5/"
61 (version-major+minor version)
62 "/krb5-" version ".tar.gz")))
63 (sha256
64 (base32
65 "10dimzcdzk9s79291qb4s3kwmbpb8bvppa6k6873wxxa5vndf1ip"))))
66 (build-system gnu-build-system)
67 (native-inputs
68 `(("bison" ,bison)
69 ("perl" ,perl)))
70 (arguments
71 `(;; XXX: On 32-bit systems, 'kdb5_util' hangs on an fcntl/F_SETLKW call
72 ;; while running the tests in 'src/tests'. Also disable tests when
73 ;; cross-compiling.
74 #:tests? ,(and (not (%current-target-system))
75 (string=? (%current-system) "x86_64-linux"))
76
77 ,@(if (%current-target-system)
78 '(#:configure-flags
79 (list "krb5_cv_attr_constructor_destructor=yes"
80 "ac_cv_func_regcomp=yes"
81 "ac_cv_printf_positional=yes"
82 "ac_cv_file__etc_environment=yes"
83 "ac_cv_file__etc_TIMEZONE=no")
84 #:make-flags
85 (list "CFLAGS+=-DDESTRUCTOR_ATTR_WORKS=1"))
86 '())
87 #:phases
88 (modify-phases %standard-phases
89 (add-after 'unpack 'enter-source-directory
90 (lambda _
91 (chdir "src")
92 #t))
93 (add-before 'check 'pre-check
94 (lambda* (#:key inputs native-inputs #:allow-other-keys)
95 (let ((perl (assoc-ref (or native-inputs inputs) "perl")))
96 (substitute* "plugins/kdb/db2/libdb2/test/run.test"
97 (("/bin/cat") (string-append perl "/bin/perl"))
98 (("D/bin/sh") (string-append "D" (which "sh")))
99 (("bindir=/bin/.") (string-append "bindir=" perl "/bin"))))
100
101 ;; avoid service names since /etc/services is unavailable
102 (substitute* "tests/resolve/Makefile"
103 (("-p telnet") "-p 23"))
104 #t)))))
105 (synopsis "MIT Kerberos 5")
106 (description
107 "Massachusetts Institute of Technology implementation of Kerberos.
108 Kerberos is a network authentication protocol designed to provide strong
109 authentication for client/server applications by using secret-key
110 cryptography.")
111 (license (license:non-copyleft "file://NOTICE"
112 "See NOTICE in the distribution."))
113 (home-page "http://web.mit.edu/kerberos/")
114 (properties '((cpe-name . "kerberos")))))
115
116 (define-public shishi
117 (package
118 (name "shishi")
119 (version "1.0.2")
120 (source
121 (origin
122 (method url-fetch)
123 (uri (string-append "mirror://gnu/shishi/shishi-"
124 version ".tar.gz"))
125 (patches (search-patches "shishi-fix-libgcrypt-detection.patch"))
126 (sha256
127 (base32
128 "032qf72cpjdfffq1yq54gz3ahgqf2ijca4vl31sfabmjzq9q370d"))))
129 (build-system gnu-build-system)
130 (arguments
131 '(;; This is required since we patch some of the build scripts.
132 ;; Remove first two items for the next Shishi release after 1.0.2 or
133 ;; when removing 'shishi-fix-libgcrypt-detection.patch'.
134 #:configure-flags
135 '("ac_cv_libgcrypt=yes" "--disable-static"
136 "--with-key-dir=/etc/shishi" "--with-db-dir=/var/shishi")
137 #:phases
138 (modify-phases %standard-phases
139 (add-after 'configure 'disable-automatic-key-generation
140 (lambda* (#:key outputs #:allow-other-keys)
141 (substitute* "Makefile"
142 (("^install-data-hook:")
143 "install-data-hook:\nx:\n"))
144 #t)))))
145 (native-inputs `(("pkg-config" ,pkg-config)))
146 (inputs
147 `(("gnutls" ,gnutls)
148 ("libidn" ,libidn)
149 ("linux-pam" ,linux-pam-1.2)
150 ("zlib" ,zlib)
151 ("libgcrypt" ,libgcrypt)
152 ("libtasn1" ,libtasn1)))
153 (home-page "https://www.gnu.org/software/shishi/")
154 (synopsis "Implementation of the Kerberos 5 network security system")
155 (description
156 "GNU Shishi is a free implementation of the Kerberos 5 network security
157 system. It is used to allow non-secure network nodes to communicate in a
158 secure manner through client-server mutual authentication via tickets.
159
160 After installation, the system administrator should generate keys using
161 @code{shisa -a /etc/shishi/shishi.keys}.")
162 (license license:gpl3+)))
163
164 (define-public heimdal
165 (package
166 (name "heimdal")
167 (version "7.5.0")
168 (source (origin
169 (method url-fetch)
170 (uri (string-append
171 "https://github.com/heimdal/heimdal/releases/download/"
172 "heimdal-" version "/" "heimdal-" version ".tar.gz"))
173 (sha256
174 (base32
175 "1bdc682in55ygrxmhncs7cf4s239apcblci3z8i80wnc1w1s18n5"))
176 (modules '((guix build utils)))
177 (snippet
178 '(begin
179 (substitute* "configure"
180 (("User=.*$") "User=Guix\n")
181 (("Host=.*$") "Host=GNU")
182 (("Date=.*$") "Date=2017\n"))
183 #t))))
184 (build-system gnu-build-system)
185 (arguments
186 '(#:configure-flags (list
187 ;; Avoid 7 MiB of .a files.
188 "--disable-static"
189
190 ;; Do not build libedit.
191 (string-append
192 "--with-readline-lib="
193 (assoc-ref %build-inputs "readline") "/lib")
194 (string-append
195 "--with-readline-include="
196 (assoc-ref %build-inputs "readline") "/include")
197
198 ;; Do not build sqlite.
199 (string-append
200 "--with-sqlite3="
201 (assoc-ref %build-inputs "sqlite")))
202
203 #:phases (modify-phases %standard-phases
204 (add-before 'configure 'pre-configure
205 (lambda _
206 (substitute* '("appl/afsutil/pagsh.c"
207 "tools/Makefile.in")
208 (("/bin/sh") (which "sh")))
209 #t))
210 (add-before 'check 'pre-check
211 (lambda _
212 ;; For 'getxxyyy-test'.
213 (setenv "USER" (passwd:name (getpwuid (getuid))))
214
215 ;; Skip 'db' and 'kdc' tests for now.
216 ;; FIXME: figure out why 'kdc' tests fail.
217 (with-output-to-file "tests/db/have-db.in"
218 (lambda ()
219 (format #t "#!~a~%exit 1~%" (which "sh"))))
220 #t)))
221 ;; Tests fail when run in parallel.
222 #:parallel-tests? #f))
223 (native-inputs `(("e2fsprogs" ,e2fsprogs) ;for 'compile_et'
224 ("texinfo" ,texinfo)
225 ("unzip" ,unzip))) ;for tests
226 (inputs `(("readline" ,readline)
227 ("bdb" ,bdb)
228 ("e2fsprogs" ,e2fsprogs) ;for libcom_err
229 ("sqlite" ,sqlite)))
230 (home-page "http://www.h5l.org/")
231 (synopsis "Kerberos 5 network authentication")
232 (description
233 "Heimdal is an implementation of Kerberos 5 network authentication
234 service.")
235 (license license:bsd-3)))