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>
16 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
57 (define-public mit-krb5
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"))
73 "0snz1jm2w4dkk65zcz953jmmv9mqa30fanch2bk8r3rs9vp3yi8h"))))
74 (build-system gnu-build-system)
76 (list bison perl tcl)) ;required for some tests
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
83 #:tests? ,(and (not (%current-target-system))
84 (string=? (%current-system) "x86_64-linux"))
86 ,@(if (%current-target-system)
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")
95 (list "CFLAGS+=-DDESTRUCTOR_ATTR_WORKS=1"))
97 (list "--localstatedir=/var")))
99 (modify-phases %standard-phases
100 (add-after 'unpack 'enter-source-directory
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")
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
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")))))
121 (define-public shishi
128 (uri (string-append "mirror://gnu/shishi/shishi-"
130 (patches (search-patches "shishi-fix-libgcrypt-detection.patch"))
133 "032qf72cpjdfffq1yq54gz3ahgqf2ijca4vl31sfabmjzq9q370d"))))
134 (build-system gnu-build-system)
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'.
140 '("ac_cv_libgcrypt=yes" "--disable-static"
141 "--with-key-dir=/etc/shishi" "--with-db-dir=/var/shishi")
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"))
150 (native-inputs (list pkg-config))
158 (home-page "https://www.gnu.org/software/shishi/")
159 (synopsis "Implementation of the Kerberos 5 network security system")
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.
165 After installation, the system administrator should generate keys using
166 @code{shisa -a /etc/shishi/shishi.keys}.")
167 (license license:gpl3+)))
169 (define-public heimdal
176 "https://github.com/heimdal/heimdal/releases/download/"
177 "heimdal-" version "/" "heimdal-" version ".tar.gz"))
180 "06vx3cb01s4lv3lpv0qzbbj97cln1np1wjphkkmmbk1lsqa36bgh"))
181 (modules '((guix build utils)))
184 (substitute* "configure"
185 (("User=.*$") "User=Guix\n")
186 (("Host=.*$") "Host=GNU")
187 (("Date=.*$") "Date=2019\n"))))))
188 (build-system gnu-build-system)
192 ;; Avoid 7 MiB of .a files.
195 ;; Do not build libedit.
197 "--with-readline-lib="
198 (assoc-ref %build-inputs "readline") "/lib")
200 "--with-readline-include="
201 (assoc-ref %build-inputs "readline") "/include")
203 ;; Do not build sqlite.
206 (assoc-ref %build-inputs "sqlite"))
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")))
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\"")
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")
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?).
237 "\"" (search-input-file inputs "bin/sh") "\"")))
238 (substitute* '("tools/Makefile.in")
239 (("/bin/sh") (which "sh")))))
240 (add-before 'check 'pre-check
242 ;; For 'getxxyyy-test'.
243 (setenv "USER" (passwd:name (getpwuid (getuid))))
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"
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'
256 (inputs (list readline
259 e2fsprogs ;for libcom_err
262 (home-page "http://www.h5l.org/")
263 (synopsis "Kerberos 5 network authentication")
265 "Heimdal is an implementation of Kerberos 5 network authentication
267 (license license:bsd-3)))