gnu: mit-krb5: don't assume arguments are evaluated right-to-left.
[jackhill/guix/guix.git] / gnu / packages / mit-krb5.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013 Andreas Enge <andreas@enge.fr>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages mit-krb5)
20 #:use-module (gnu packages)
21 #:use-module (gnu packages bison)
22 #:use-module (gnu packages perl)
23 #:use-module (guix licenses)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu))
27
28 (define-public mit-krb5
29 (package
30 (name "mit-krb5")
31 (version "1.11.3")
32 (source (origin
33 (method url-fetch)
34 (uri (string-append "http://web.mit.edu/kerberos/www/dist/krb5/"
35 (string-copy version 0 (string-rindex version #\.))
36 "/krb5-" version "-signed.tar"))
37 (sha256 (base32
38 "1daiaxgkxcryqs37w28v4x1vajqmay4l144d1zd9c2d7jjxr9gcs"))))
39 (build-system gnu-build-system)
40 (native-inputs
41 `(("patch/init-fix" ,(search-patch "mit-krb5-init-fix.patch"))))
42 (inputs `(("bison" ,bison)
43 ("perl" ,perl)))
44 (arguments
45 '(#:phases
46 (alist-replace
47 'unpack
48 (lambda* (#:key source #:allow-other-keys)
49 (let ((inner
50 (substring source
51 (string-index-right source #\k)
52 (string-index-right source #\-))))
53 (and (zero? (system* "tar" "xvf" source))
54 (zero? (system* "tar" "xvf" (string-append inner ".tar.gz")))
55 (chdir inner)
56 (chdir "src")
57 ;; XXX The current patch system does not support unusual
58 ;; source unpack methods, so we have to apply this patch in a
59 ;; non-standard way.
60 (zero? (system* "patch" "-p1" "--batch" "-i"
61 (assoc-ref %build-inputs "patch/init-fix"))))))
62 (alist-replace
63 'check
64 (lambda* (#:key inputs #:allow-other-keys #:rest args)
65 (let ((perl (assoc-ref inputs "perl"))
66 (check (assoc-ref %standard-phases 'check)))
67 (substitute* "plugins/kdb/db2/libdb2/test/run.test"
68 (("/bin/cat") (string-append perl "/bin/perl")))
69 (substitute* "plugins/kdb/db2/libdb2/test/run.test"
70 (("D/bin/sh") (string-append "D" (which "bash"))))
71 (substitute* "plugins/kdb/db2/libdb2/test/run.test"
72 (("bindir=/bin/.") (string-append "bindir=" perl "/bin")))
73 ;; use existing files and directories in test
74 (substitute* "tests/resolve/Makefile"
75 (("-p telnet") "-p 23"))
76 ;; avoid service names since /etc/services is unavailable
77 (apply check args)))
78 %standard-phases))))
79 (synopsis "MIT Kerberos 5")
80 (description
81 "Massachusetts Institute of Technology implementation of Kerberos.
82 Kerberos is a network authentication protocol designed to provide strong
83 authentication for client/server applications by using secret-key cryptography.")
84 (license (bsd-style "file://NOTICE"
85 "See NOTICE in the distribution."))
86 (home-page "http://web.mit.edu/kerberos/")))