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>
13 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
50 (define-public mit-krb5
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"))
66 "121c5xsy3x0i4wdkrpw62yhvji6virbh6n30ypazkp0isws3k4bk"))))
67 (build-system gnu-build-system)
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
75 #:tests? ,(and (not (%current-target-system))
76 (string=? (%current-system) "x86_64-linux"))
78 ,@(if (%current-target-system)
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")
87 (list "CFLAGS+=-DDESTRUCTOR_ATTR_WORKS=1"))
89 (list "--localstatedir=/var")))
91 (modify-phases %standard-phases
92 (add-after 'unpack 'enter-source-directory
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"))))
104 ;; avoid service names since /etc/services is unavailable
105 (substitute* "tests/resolve/Makefile"
106 (("-p telnet") "-p 23"))
108 (synopsis "MIT Kerberos 5")
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
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")))))
119 (define-public shishi
126 (uri (string-append "mirror://gnu/shishi/shishi-"
128 (patches (search-patches "shishi-fix-libgcrypt-detection.patch"))
131 "032qf72cpjdfffq1yq54gz3ahgqf2ijca4vl31sfabmjzq9q370d"))))
132 (build-system gnu-build-system)
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'.
138 '("ac_cv_libgcrypt=yes" "--disable-static"
139 "--with-key-dir=/etc/shishi" "--with-db-dir=/var/shishi")
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"))
148 (native-inputs `(("pkg-config" ,pkg-config)))
152 ("linux-pam" ,linux-pam-1.2)
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")
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.
163 After installation, the system administrator should generate keys using
164 @code{shisa -a /etc/shishi/shishi.keys}.")
165 (license license:gpl3+)))
167 (define-public heimdal
174 "https://github.com/heimdal/heimdal/releases/download/"
175 "heimdal-" version "/" "heimdal-" version ".tar.gz"))
178 "1bdc682in55ygrxmhncs7cf4s239apcblci3z8i80wnc1w1s18n5"))
179 (modules '((guix build utils)))
182 (substitute* "configure"
183 (("User=.*$") "User=Guix\n")
184 (("Host=.*$") "Host=GNU")
185 (("Date=.*$") "Date=2017\n"))
187 (build-system gnu-build-system)
189 '(#:configure-flags (list
190 ;; Avoid 7 MiB of .a files.
193 ;; Do not build libedit.
195 "--with-readline-lib="
196 (assoc-ref %build-inputs "readline") "/lib")
198 "--with-readline-include="
199 (assoc-ref %build-inputs "readline") "/include")
201 ;; Do not build sqlite.
204 (assoc-ref %build-inputs "sqlite")))
206 #:phases (modify-phases %standard-phases
207 (add-before 'configure 'pre-configure
209 (substitute* '("appl/afsutil/pagsh.c"
211 (("/bin/sh") (which "sh")))
213 (add-before 'check 'pre-check
215 ;; For 'getxxyyy-test'.
216 (setenv "USER" (passwd:name (getpwuid (getuid))))
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"
222 (format #t "#!~a~%exit 1~%" (which "sh"))))
224 ;; Tests fail when run in parallel.
225 #:parallel-tests? #f))
226 (native-inputs `(("e2fsprogs" ,e2fsprogs) ;for 'compile_et'
228 ("unzip" ,unzip))) ;for tests
229 (inputs `(("readline" ,readline)
231 ("e2fsprogs" ,e2fsprogs) ;for libcom_err
233 (home-page "http://www.h5l.org/")
234 (synopsis "Kerberos 5 network authentication")
236 "Heimdal is an implementation of Kerberos 5 network authentication
238 (license license:bsd-3)))