gnu: texlive-latex-seminar: Declare a source file-name.
[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, 2018 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 (version "2.4.45")
44 (source (origin
45 (method url-fetch)
46
47 ;; See <http://www.openldap.org/software/download/> for a list of
48 ;; mirrors.
49 (uri (list (string-append
50 "ftp://mirror.switch.ch/mirror/OpenLDAP/"
51 "openldap-release/openldap-" version ".tgz")
52 (string-append
53 "https://www.openldap.org/software/download/OpenLDAP/"
54 "openldap-release/openldap-" version ".tgz")
55 (string-append
56 "ftp://ftp.dti.ad.jp/pub/net/OpenLDAP/"
57 "openldap-release/openldap-" version ".tgz")))
58 (sha256
59 (base32
60 "091qvwk5dkcpp17ziabcnh3rg3m7qwzw2pihfcd1d5fdxgywzmnd"))))
61 (build-system gnu-build-system)
62 (inputs `(("bdb" ,bdb-5.3)
63 ("cyrus-sasl" ,cyrus-sasl)
64 ("gnutls" ,gnutls)
65 ("groff" ,groff)
66 ("icu4c" ,icu4c)
67 ("libgcrypt" ,libgcrypt)
68 ("zlib" ,zlib)))
69 (native-inputs `(("libtool" ,libtool)))
70 (arguments
71 `(#:tests? #f
72 #:phases
73 (modify-phases %standard-phases
74 (add-after 'configure 'provide-libtool
75 (lambda _ (copy-file (which "libtool") "libtool")
76 #t))
77 (add-after 'install 'patch-sasl-path
78 ;; Give -L arguments for cyrus-sasl to avoid propagation.
79 (lambda* (#:key inputs outputs #:allow-other-keys)
80 (let ((out (assoc-ref outputs "out"))
81 (sasl (assoc-ref inputs "cyrus-sasl")))
82 (substitute* (map (lambda (f) (string-append out "/" f))
83 '("lib/libldap.la" "lib/libldap_r.la"))
84 (("-lsasl2" lib)
85 (string-append "-L" sasl "/lib " lib)))
86 #t))))))
87 (synopsis "Implementation of the Lightweight Directory Access Protocol")
88 (description
89 "OpenLDAP is a free implementation of the Lightweight Directory Access Protocol.")
90 (license openldap2.8)
91 (home-page "https://www.openldap.org/")))
92
93 (define-public nss-pam-ldapd
94 (package
95 (name "nss-pam-ldapd")
96 (version "0.9.9")
97 (source (origin
98 (method url-fetch)
99 (uri (string-append "https://arthurdejong.org/nss-pam-ldapd/"
100 "nss-pam-ldapd-" version ".tar.gz"))
101 (sha256
102 (base32
103 "1lj7qkjlg3bshwdc5x5r1ny37rly4wgm1c8b6w6b5f4wa11nmji0"))))
104 (build-system gnu-build-system)
105 (arguments
106 `(#:configure-flags
107 (list (string-append "--with-pam-seclib-dir="
108 (assoc-ref %outputs "out") "/lib/security/")
109 ;; nslcd cannot be convinced to look at run-time for its
110 ;; configuration file at a location that differs from the
111 ;; configured location.
112 "--with-ldap-conf-file=/etc/nslcd.conf")
113 #:phases
114 (modify-phases %standard-phases
115 ;; This is necessary because we tell nslcd with configure flags that
116 ;; it should look for its configuration file at /etc/nslcd.conf. The
117 ;; build system tries to install a default configuration to that very
118 ;; location.
119 (add-after 'unpack 'override-nslcd.conf-install-path
120 (lambda* (#:key outputs #:allow-other-keys)
121 (substitute* "Makefile.in"
122 (("\\$\\(DESTDIR\\)\\$\\(NSLCD_CONF_PATH\\)")
123 (string-append (assoc-ref outputs "out")
124 "/etc/nslcd.conf.example")))
125 #t)))))
126 (inputs
127 `(("linux-pam" ,linux-pam)
128 ("openldap" ,openldap)
129 ("mit-krb5" ,mit-krb5)
130 ("python" ,python-2)))
131 (home-page "https://arthurdejong.org/nss-pam-ldapd")
132 (synopsis "NSS and PAM modules for LDAP")
133 (description "nss-pam-ldapd provides a @dfn{Name Service Switch} (NSS)
134 module that allows your LDAP server to provide user account, group, host name,
135 alias, netgroup, and basically any other information that you would normally
136 get from @file{/etc} flat files or NIS. It also provides a @dfn{Pluggable
137 Authentication Module} (PAM) to do identity and authentication management with
138 an LDAP server.")
139 (license lgpl2.1+)))