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