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