gnu: Add texlive-latex-etoolbox.
[jackhill/guix/guix.git] / gnu / packages / openldap.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
5 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages openldap)
23 #:use-module (gnu packages autotools)
24 #:use-module (gnu packages databases)
25 #:use-module (gnu packages compression)
26 #:use-module (gnu packages cyrus-sasl)
27 #:use-module (gnu packages gnupg)
28 #:use-module (gnu packages groff)
29 #:use-module (gnu packages icu4c)
30 #:use-module (gnu packages kerberos)
31 #:use-module (gnu packages linux)
32 #:use-module (gnu packages python)
33 #:use-module (gnu packages tls)
34 #:use-module (gnu packages)
35 #:use-module ((guix licenses) #:select (openldap2.8 lgpl2.1+))
36 #:use-module (guix packages)
37 #:use-module (guix download)
38 #:use-module (guix build-system gnu))
39
40 (define-public openldap
41 (package
42 (name "openldap")
43 (replacement openldap/fixed)
44 (version "2.4.44")
45 (source (origin
46 (method url-fetch)
47
48 ;; See <http://www.openldap.org/software/download/> for a list of
49 ;; mirrors.
50 (uri (list (string-append
51 "ftp://mirror.switch.ch/mirror/OpenLDAP/"
52 "openldap-release/openldap-" version ".tgz")
53 (string-append
54 "ftp://ftp.OpenLDAP.org/pub/OpenLDAP/"
55 "openldap-release/openldap-" version ".tgz")
56 (string-append
57 "ftp://ftp.dti.ad.jp/pub/net/OpenLDAP/"
58 "openldap-release/openldap-" version ".tgz")))
59 (sha256
60 (base32
61 "0044p20hx07fwgw2mbwj1fkx04615hhs1qyx4mawj2bhqvrnppnp"))))
62 (build-system gnu-build-system)
63 (inputs `(("bdb" ,bdb-5.3)
64 ("cyrus-sasl" ,cyrus-sasl)
65 ("gnutls" ,gnutls)
66 ("groff" ,groff)
67 ("icu4c" ,icu4c)
68 ("libgcrypt" ,libgcrypt)
69 ("zlib" ,zlib)))
70 (native-inputs `(("libtool" ,libtool)))
71 (arguments
72 `(#:tests? #f
73 #:phases
74 (alist-cons-after
75 'configure 'provide-libtool
76 (lambda _ (copy-file (which "libtool") "libtool"))
77 %standard-phases)))
78 (synopsis "Implementation of the Lightweight Directory Access Protocol")
79 (description
80 "OpenLDAP is a free implementation of the Lightweight Directory Access Protocol.")
81 (license openldap2.8)
82 (home-page "http://www.openldap.org/")))
83
84 (define openldap/fixed
85 (package
86 (inherit openldap)
87 (source
88 (origin
89 (inherit (package-source openldap))
90 (patches (search-patches "openldap-CVE-2017-9287.patch"))))))
91
92 (define-public nss-pam-ldapd
93 (package
94 (name "nss-pam-ldapd")
95 (version "0.9.8")
96 (source (origin
97 (method url-fetch)
98 (uri (string-append "https://arthurdejong.org/nss-pam-ldapd/"
99 "nss-pam-ldapd-" version ".tar.gz"))
100 (sha256
101 (base32
102 "0gs5ycbfpry6mn5srai54rqwyjj960yc1g5ppv3shg80ybkn4wzg"))))
103 (build-system gnu-build-system)
104 (arguments
105 `(#:configure-flags
106 (list (string-append "--with-pam-seclib-dir="
107 (assoc-ref %outputs "out") "/lib/security/")
108 ;; nslcd cannot be convinced to look at run-time for its
109 ;; configuration file at a location that differs from the
110 ;; configured location.
111 "--with-ldap-conf-file=/etc/nslcd.conf")
112 #:phases
113 (modify-phases %standard-phases
114 ;; This is necessary because we tell nslcd with configure flags that
115 ;; it should look for its configuration file at /etc/nslcd.conf. The
116 ;; build system tries to install a default configuration to that very
117 ;; location.
118 (add-after 'unpack 'override-nslcd.conf-install-path
119 (lambda* (#:key outputs #:allow-other-keys)
120 (substitute* "Makefile.in"
121 (("\\$\\(DESTDIR\\)\\$\\(NSLCD_CONF_PATH\\)")
122 (string-append (assoc-ref outputs "out")
123 "/etc/nslcd.conf.example")))
124 #t)))))
125 (inputs
126 `(("linux-pam" ,linux-pam)
127 ("openldap" ,openldap)
128 ("mit-krb5" ,mit-krb5)
129 ("python" ,python-2)))
130 (home-page "https://arthurdejong.org/nss-pam-ldapd")
131 (synopsis "NSS and PAM modules for LDAP")
132 (description "nss-pam-ldapd provides a @dfn{Name Service Switch} (NSS)
133 module that allows your LDAP server to provide user account, group, host name,
134 alias, netgroup, and basically any other information that you would normally
135 get from @file{/etc} flat files or NIS. It also provides a @dfn{Pluggable
136 Authentication Module} (PAM) to do identity and authentication management with
137 an LDAP server.")
138 (license lgpl2.1+)))