gnu: Add wl-clipboard.
[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 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
14 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages openldap)
24 #:use-module (gnu packages autotools)
25 #:use-module (gnu packages check)
26 #:use-module (gnu packages compression)
27 #:use-module (gnu packages cyrus-sasl)
28 #:use-module (gnu packages databases)
29 #:use-module (gnu packages documentation)
30 #:use-module (gnu packages gettext)
31 #:use-module (gnu packages gnupg)
32 #:use-module (gnu packages gnuzilla)
33 #:use-module (gnu packages groff)
34 #:use-module (gnu packages icu4c)
35 #:use-module (gnu packages kerberos)
36 #:use-module (gnu packages libevent)
37 #:use-module (gnu packages linux)
38 #:use-module (gnu packages networking)
39 #:use-module (gnu packages pcre)
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages python)
43 #:use-module (gnu packages rsync)
44 #:use-module (gnu packages selinux)
45 #:use-module (gnu packages time)
46 #:use-module (gnu packages tls)
47 #:use-module (gnu packages web)
48 #:use-module (gnu packages)
49 #:use-module ((guix licenses) #:select (openldap2.8 lgpl2.1+ gpl3+ psfl))
50 #:use-module (guix packages)
51 #:use-module (guix download)
52 #:use-module (guix build-system gnu)
53 #:use-module (guix build-system python))
54
55 (define-public openldap
56 (package
57 (name "openldap")
58 (version "2.4.46")
59 (source (origin
60 (method url-fetch)
61
62 ;; See <http://www.openldap.org/software/download/> for a list of
63 ;; mirrors.
64 (uri (list (string-append
65 "ftp://mirror.switch.ch/mirror/OpenLDAP/"
66 "openldap-release/openldap-" version ".tgz")
67 (string-append
68 "https://www.openldap.org/software/download/OpenLDAP/"
69 "openldap-release/openldap-" version ".tgz")
70 (string-append
71 "ftp://ftp.dti.ad.jp/pub/net/OpenLDAP/"
72 "openldap-release/openldap-" version ".tgz")))
73 (sha256
74 (base32
75 "0bab1km8f2nan1x0zgwliknbxg0zlf2pafxrr867kblrdfwdr44s"))))
76 (build-system gnu-build-system)
77 (inputs `(("bdb" ,bdb-5.3)
78 ("cyrus-sasl" ,cyrus-sasl)
79 ("gnutls" ,gnutls)
80 ("groff" ,groff)
81 ("icu4c" ,icu4c)
82 ("libgcrypt" ,libgcrypt)
83 ("zlib" ,zlib)))
84 (native-inputs `(("libtool" ,libtool)))
85 (arguments
86 `(#:tests? #f
87 #:configure-flags '("--disable-static")
88 #:phases
89 (modify-phases %standard-phases
90 (add-after 'install 'patch-sasl-path
91 ;; Give -L arguments for cyrus-sasl to avoid propagation.
92 (lambda* (#:key inputs outputs #:allow-other-keys)
93 (let ((out (assoc-ref outputs "out"))
94 (sasl (assoc-ref inputs "cyrus-sasl")))
95 (substitute* (map (lambda (f) (string-append out "/" f))
96 '("lib/libldap.la" "lib/libldap_r.la"))
97 (("-lsasl2" lib)
98 (string-append "-L" sasl "/lib " lib)))
99 #t))))))
100 (synopsis "Implementation of the Lightweight Directory Access Protocol")
101 (description
102 "OpenLDAP is a free implementation of the Lightweight Directory Access Protocol.")
103 (license openldap2.8)
104 (home-page "https://www.openldap.org/")))
105
106 (define-public nss-pam-ldapd
107 (package
108 (name "nss-pam-ldapd")
109 (version "0.9.10")
110 (source (origin
111 (method url-fetch)
112 (uri (string-append "https://arthurdejong.org/nss-pam-ldapd/"
113 "nss-pam-ldapd-" version ".tar.gz"))
114 (sha256
115 (base32
116 "1cqamcr6qpgwxijlr6kg7jspjamjra8w0haan0qssn0yxn95d7c0"))))
117 (build-system gnu-build-system)
118 (arguments
119 `(#:configure-flags
120 (list (string-append "--with-pam-seclib-dir="
121 (assoc-ref %outputs "out") "/lib/security/")
122 ;; nslcd cannot be convinced to look at run-time for its
123 ;; configuration file at a location that differs from the
124 ;; configured location.
125 "--with-ldap-conf-file=/etc/nslcd.conf")
126 #:phases
127 (modify-phases %standard-phases
128 ;; This is necessary because we tell nslcd with configure flags that
129 ;; it should look for its configuration file at /etc/nslcd.conf. The
130 ;; build system tries to install a default configuration to that very
131 ;; location.
132 (add-after 'unpack 'override-nslcd.conf-install-path
133 (lambda* (#:key outputs #:allow-other-keys)
134 (substitute* "Makefile.in"
135 (("\\$\\(DESTDIR\\)\\$\\(NSLCD_CONF_PATH\\)")
136 (string-append (assoc-ref outputs "out")
137 "/etc/nslcd.conf.example")))
138 #t)))))
139 (inputs
140 `(("linux-pam" ,linux-pam)
141 ("openldap" ,openldap)
142 ("mit-krb5" ,mit-krb5)
143 ("python" ,python-2)))
144 (home-page "https://arthurdejong.org/nss-pam-ldapd")
145 (synopsis "NSS and PAM modules for LDAP")
146 (description "nss-pam-ldapd provides a @dfn{Name Service Switch} (NSS)
147 module that allows your LDAP server to provide user account, group, host name,
148 alias, netgroup, and basically any other information that you would normally
149 get from @file{/etc} flat files or NIS. It also provides a @dfn{Pluggable
150 Authentication Module} (PAM) to do identity and authentication management with
151 an LDAP server.")
152 (license lgpl2.1+)))
153
154 (define-public python-ldap
155 (package
156 (name "python-ldap")
157 (version "3.1.0")
158 (source
159 (origin
160 (method url-fetch)
161 (uri (pypi-uri "python-ldap" version))
162 (sha256
163 (base32
164 "1i97nwfnraylyn0myxlf3vciicrf5h6fymrcff9c00k581wmx5s1"))))
165 (build-system python-build-system)
166 (arguments
167 `(#:phases
168 (modify-phases %standard-phases
169 (add-after 'unpack 'configure-openldap-locations
170 (lambda* (#:key inputs #:allow-other-keys)
171 (let ((openldap (assoc-ref inputs "openldap")))
172 (setenv "SLAPD"
173 (string-append openldap
174 "/libexec/slapd"))
175 (setenv "SCHEMA"
176 (string-append openldap
177 "/etc/openldap/schema/")))
178 #t)))))
179 (inputs
180 `(("openldap" ,openldap)
181 ("cyrus-sasl" ,cyrus-sasl)
182 ("mit-krb5" ,mit-krb5)))
183 (propagated-inputs
184 `(("python-pyasn1" ,python-pyasn1)
185 ("python-pyasn1-modules" ,python-pyasn1-modules)))
186 (home-page "https://www.python-ldap.org/")
187 (synopsis "Python modules for implementing LDAP clients")
188 (description
189 "This package provides an object-oriented API to access LDAP directory
190 servers from Python programs.")
191 (license psfl)))
192
193 (define-public 389-ds-base
194 (package
195 (name "389-ds-base")
196 (version "1.4.0.13")
197 (source (origin
198 (method url-fetch)
199 (uri (string-append "https://releases.pagure.org/389-ds-base/"
200 "389-ds-base-" version ".tar.bz2"))
201 (sha256
202 (base32
203 "01dm3zq3w5ami9pwcjbjz8wfbx9krjxybjrgc4wyhrxlzd90ylzj"))))
204 (build-system gnu-build-system)
205 (arguments
206 `(#:modules ((srfi srfi-1)
207 (guix build gnu-build-system)
208 (guix build utils))
209 #:configure-flags
210 (list (string-append "--with-db="
211 (assoc-ref %build-inputs "bdb"))
212 (string-append "--with-sasl="
213 (assoc-ref %build-inputs "cyrus-sasl"))
214 (string-append "--with-netsnmp="
215 (assoc-ref %build-inputs "net-snmp"))
216 (string-append "--with-pcre="
217 (assoc-ref %build-inputs "pcre"))
218 (string-append "--with-selinux="
219 (assoc-ref %build-inputs "libselinux"))
220 ;; The Perl scripts are being removed in the 1.4.0 release.
221 ;; Building them would require packaging of the outdated Mozilla
222 ;; LDAP SDK (instead of OpenLDAP) and PerLDAP.
223 "--disable-perl")
224 #:phases
225 (modify-phases %standard-phases
226 (add-after 'unpack 'fix-install-location-of-python-tools
227 (lambda* (#:key inputs outputs #:allow-other-keys)
228 (let* ((out (assoc-ref outputs "out"))
229 (get-python-version
230 ;; FIXME: copied from python-build-system
231 (lambda (python)
232 (let* ((version (last (string-split python #\-)))
233 (components (string-split version #\.))
234 (major+minor (take components 2)))
235 (string-join major+minor "."))))
236 (pythondir (string-append
237 out "/lib/python"
238 (get-python-version (assoc-ref inputs "python"))
239 "/site-packages/")))
240 ;; Install directory must be on PYTHONPATH.
241 (setenv "PYTHONPATH"
242 (string-append (getenv "PYTHONPATH")
243 ":" pythondir))
244 ;; Install directory must exist.
245 (mkdir-p pythondir)
246 (substitute* "src/lib389/setup.py"
247 (("/usr") out))
248 (substitute* "Makefile.am"
249 (("setup.py install --skip-build" m)
250 (string-append m " --prefix=" out
251 " --root=/ --single-version-externally-managed"))))
252 #t))
253 (add-after 'build 'build-python-tools
254 (lambda* (#:key make-flags #:allow-other-keys)
255 ;; Set DETERMINISTIC_BUILD to override the embedded mtime in pyc
256 ;; files.
257 (setenv "DETERMINISTIC_BUILD" "1")
258 ;; Use deterministic hashes for strings, bytes, and datetime
259 ;; objects.
260 (setenv "PYTHONHASHSEED" "0")
261 (apply invoke "make" "lib389" make-flags)
262 #t))
263 (add-after 'install 'install-python-tools
264 (lambda* (#:key make-flags #:allow-other-keys)
265 (apply invoke "make" "lib389-install" make-flags)
266 #t))
267 (add-after 'install-python-tools 'wrap-python-tools
268 (lambda* (#:key outputs #:allow-other-keys)
269 (let* ((out (assoc-ref outputs "out"))
270 (path (getenv "PYTHONPATH")))
271 (for-each (lambda (file)
272 (wrap-program (string-append out file)
273 `("PYTHONPATH" ":" prefix (,path))))
274 '("/sbin/dsconf"
275 "/sbin/dscreate"
276 "/sbin/dsctl"
277 "/sbin/dsidm"
278 "/bin/ds-logpipe.py"
279 "/bin/ds-replcheck"
280 "/bin/readnsstate")))
281 #t)))))
282 (inputs
283 `(("bdb" ,bdb)
284 ("cyrus-sasl" ,cyrus-sasl)
285 ("gnutls" ,gnutls)
286 ("httpd" ,httpd)
287 ("icu4c" ,icu4c)
288 ("libevent" ,libevent)
289 ("libselinux" ,libselinux)
290 ("linux-pam" ,linux-pam)
291 ("mit-krb5" ,mit-krb5)
292 ("net-snmp" ,net-snmp)
293 ("nspr" ,nspr)
294 ("nss" ,nss)
295 ("openldap" ,openldap)
296 ("openssl" ,openssl) ; #included by net-snmp
297 ("pcre" ,pcre)
298 ("perl" ,perl)
299 ("python" ,python)
300 ("python-pyasn1" ,python-pyasn1)
301 ("python-pyasn1-modules" ,python-pyasn1-modules)
302 ("python-pytest" ,python-pytest)
303 ("python-dateutil" ,python-dateutil)
304 ("python-six" ,python-six)
305 ("python-argcomplete" ,python-argcomplete)
306 ("python-argparse-manpage" ,python-argparse-manpage)
307 ("python-ldap" ,python-ldap)))
308 (native-inputs
309 `(("autoconf" ,autoconf)
310 ("automake" ,automake)
311 ("doxygen" ,doxygen)
312 ("gettext" ,gettext-minimal)
313 ("libtool" ,libtool)
314 ("rsync" ,rsync)
315 ("pkg-config" ,pkg-config)))
316 (home-page "https://directory.fedoraproject.org")
317 (synopsis "Enterprise-class LDAP server")
318 (description "389ds is an enterprise-class LDAP server. It is hardened by
319 real-world use, is full-featured, and supports multi-master replication.
320
321 Other features include:
322
323 @enumerate
324 @item Online, zero downtime, LDAP-based update of schema, configuration, and
325 management including @dfn{Access Control Information} (ACIs);
326 @item Asynchronous Multi-Master Replication, to provide fault tolerance and
327 high write performance;
328 @item Extensive documentation;
329 @item Secure authentication and transport (TLS, and SASL);
330 @item LDAPv3 compliant server.
331 @end enumerate\n")
332 ;; GPLv3+ with OpenSSL linking exception.
333 (license gpl3+)))