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, 2019 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.18")
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 (patches (search-patches "mit-krb5-qualify-short-hostnames.patch"))
64 (sha256
65 (base32
66 "121c5xsy3x0i4wdkrpw62yhvji6virbh6n30ypazkp0isws3k4bk"))))
67 (build-system gnu-build-system)
68 (native-inputs
69 `(("bison" ,bison)
70 ("perl" ,perl)))
71 (arguments
72 `(;; XXX: On 32-bit systems, 'kdb5_util' hangs on an fcntl/F_SETLKW call
73 ;; while running the tests in 'src/tests'. Also disable tests when
74 ;; cross-compiling.
75 #:tests? ,(and (not (%current-target-system))
76 (string=? (%current-system) "x86_64-linux"))
77
78 ,@(if (%current-target-system)
79 '(#:configure-flags
80 (list "--localstatedir=/var"
81 "krb5_cv_attr_constructor_destructor=yes"
82 "ac_cv_func_regcomp=yes"
83 "ac_cv_printf_positional=yes"
84 "ac_cv_file__etc_environment=yes"
85 "ac_cv_file__etc_TIMEZONE=no")
86 #:make-flags
87 (list "CFLAGS+=-DDESTRUCTOR_ATTR_WORKS=1"))
88 '(#:configure-flags
89 (list "--localstatedir=/var")))
90 #:phases
91 (modify-phases %standard-phases
92 (add-after 'unpack 'enter-source-directory
93 (lambda _
94 (chdir "src")
95 #t))
96 (add-before 'check 'pre-check
97 (lambda* (#:key inputs native-inputs #:allow-other-keys)
98 (let ((perl (assoc-ref (or native-inputs inputs) "perl")))
99 (substitute* "plugins/kdb/db2/libdb2/test/run.test"
100 (("/bin/cat") (string-append perl "/bin/perl"))
101 (("D/bin/sh") (string-append "D" (which "sh")))
102 (("bindir=/bin/.") (string-append "bindir=" perl "/bin"))))
103
104 ;; avoid service names since /etc/services is unavailable
105 (substitute* "tests/resolve/Makefile"
106 (("-p telnet") "-p 23"))
107 #t)))))
108 (synopsis "MIT Kerberos 5")
109 (description
110 "Massachusetts Institute of Technology implementation of Kerberos.
111 Kerberos is a network authentication protocol designed to provide strong
112 authentication for client/server applications by using secret-key
113 cryptography.")
114 (license (license:non-copyleft "file://NOTICE"
115 "See NOTICE in the distribution."))
116 (home-page "https://web.mit.edu/kerberos/")
117 (properties '((cpe-name . "kerberos")))))
118
119 (define-public shishi
120 (package
121 (name "shishi")
122 (version "1.0.2")
123 (source
124 (origin
125 (method url-fetch)
126 (uri (string-append "mirror://gnu/shishi/shishi-"
127 version ".tar.gz"))
128 (patches (search-patches "shishi-fix-libgcrypt-detection.patch"))
129 (sha256
130 (base32
131 "032qf72cpjdfffq1yq54gz3ahgqf2ijca4vl31sfabmjzq9q370d"))))
132 (build-system gnu-build-system)
133 (arguments
134 '(;; This is required since we patch some of the build scripts.
135 ;; Remove first two items for the next Shishi release after 1.0.2 or
136 ;; when removing 'shishi-fix-libgcrypt-detection.patch'.
137 #:configure-flags
138 '("ac_cv_libgcrypt=yes" "--disable-static"
139 "--with-key-dir=/etc/shishi" "--with-db-dir=/var/shishi")
140 #:phases
141 (modify-phases %standard-phases
142 (add-after 'configure 'disable-automatic-key-generation
143 (lambda* (#:key outputs #:allow-other-keys)
144 (substitute* "Makefile"
145 (("^install-data-hook:")
146 "install-data-hook:\nx:\n"))
147 #t)))))
148 (native-inputs `(("pkg-config" ,pkg-config)))
149 (inputs
150 `(("gnutls" ,gnutls)
151 ("libidn" ,libidn)
152 ("linux-pam" ,linux-pam-1.2)
153 ("zlib" ,zlib)
154 ("libgcrypt" ,libgcrypt)
155 ("libtasn1" ,libtasn1)))
156 (home-page "https://www.gnu.org/software/shishi/")
157 (synopsis "Implementation of the Kerberos 5 network security system")
158 (description
159 "GNU Shishi is a free implementation of the Kerberos 5 network security
160 system. It is used to allow non-secure network nodes to communicate in a
161 secure manner through client-server mutual authentication via tickets.
162
163 After installation, the system administrator should generate keys using
164 @code{shisa -a /etc/shishi/shishi.keys}.")
165 (license license:gpl3+)))
166
167 (define-public heimdal
168 (package
169 (name "heimdal")
170 (version "7.5.0")
171 (source (origin
172 (method url-fetch)
173 (uri (string-append
174 "https://github.com/heimdal/heimdal/releases/download/"
175 "heimdal-" version "/" "heimdal-" version ".tar.gz"))
176 (sha256
177 (base32
178 "1bdc682in55ygrxmhncs7cf4s239apcblci3z8i80wnc1w1s18n5"))
179 (modules '((guix build utils)))
180 (snippet
181 '(begin
182 (substitute* "configure"
183 (("User=.*$") "User=Guix\n")
184 (("Host=.*$") "Host=GNU")
185 (("Date=.*$") "Date=2017\n"))
186 #t))))
187 (build-system gnu-build-system)
188 (arguments
189 '(#:configure-flags (list
190 ;; Avoid 7 MiB of .a files.
191 "--disable-static"
192
193 ;; Do not build libedit.
194 (string-append
195 "--with-readline-lib="
196 (assoc-ref %build-inputs "readline") "/lib")
197 (string-append
198 "--with-readline-include="
199 (assoc-ref %build-inputs "readline") "/include")
200
201 ;; Do not build sqlite.
202 (string-append
203 "--with-sqlite3="
204 (assoc-ref %build-inputs "sqlite")))
205
206 #:phases (modify-phases %standard-phases
207 (add-before 'configure 'pre-configure
208 (lambda _
209 (substitute* '("appl/afsutil/pagsh.c"
210 "tools/Makefile.in")
211 (("/bin/sh") (which "sh")))
212 #t))
213 (add-before 'check 'pre-check
214 (lambda _
215 ;; For 'getxxyyy-test'.
216 (setenv "USER" (passwd:name (getpwuid (getuid))))
217
218 ;; Skip 'db' and 'kdc' tests for now.
219 ;; FIXME: figure out why 'kdc' tests fail.
220 (with-output-to-file "tests/db/have-db.in"
221 (lambda ()
222 (format #t "#!~a~%exit 1~%" (which "sh"))))
223 #t)))
224 ;; Tests fail when run in parallel.
225 #:parallel-tests? #f))
226 (native-inputs `(("e2fsprogs" ,e2fsprogs) ;for 'compile_et'
227 ("texinfo" ,texinfo)
228 ("unzip" ,unzip))) ;for tests
229 (inputs `(("readline" ,readline)
230 ("bdb" ,bdb)
231 ("e2fsprogs" ,e2fsprogs) ;for libcom_err
232 ("sqlite" ,sqlite)))
233 (home-page "http://www.h5l.org/")
234 (synopsis "Kerberos 5 network authentication")
235 (description
236 "Heimdal is an implementation of Kerberos 5 network authentication
237 service.")
238 (license license:bsd-3)))