| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 |
|
| 30 | (define-module (gnu packages openldap)
|
| 31 | #:use-module (gnu packages autotools)
|
| 32 | #:use-module (gnu packages bash)
|
| 33 | #:use-module (gnu packages check)
|
| 34 | #:use-module (gnu packages compression)
|
| 35 | #:use-module (gnu packages crypto)
|
| 36 | #:use-module (gnu packages cyrus-sasl)
|
| 37 | #:use-module (gnu packages databases)
|
| 38 | #:use-module (gnu packages dbm)
|
| 39 | #:use-module (gnu packages documentation)
|
| 40 | #:use-module (gnu packages gettext)
|
| 41 | #:use-module (gnu packages gnupg)
|
| 42 | #:use-module (gnu packages groff)
|
| 43 | #:use-module (gnu packages icu4c)
|
| 44 | #:use-module (gnu packages kerberos)
|
| 45 | #:use-module (gnu packages libevent)
|
| 46 | #:use-module (gnu packages linux)
|
| 47 | #:use-module (gnu packages networking)
|
| 48 | #:use-module (gnu packages nss)
|
| 49 | #:use-module (gnu packages password-utils)
|
| 50 | #:use-module (gnu packages pcre)
|
| 51 | #:use-module (gnu packages perl)
|
| 52 | #:use-module (gnu packages pkg-config)
|
| 53 | #:use-module (gnu packages python)
|
| 54 | #:use-module (gnu packages python-build)
|
| 55 | #:use-module (gnu packages python-xyz)
|
| 56 | #:use-module (gnu packages rsync)
|
| 57 | #:use-module (gnu packages selinux)
|
| 58 | #:use-module (gnu packages time)
|
| 59 | #:use-module (gnu packages tls)
|
| 60 | #:use-module (gnu packages web)
|
| 61 | #:use-module (gnu packages)
|
| 62 | #:use-module ((guix licenses) #:select (openldap2.8 lgpl2.1+ gpl3+ psfl expat))
|
| 63 | #:use-module (guix packages)
|
| 64 | #:use-module (guix gexp)
|
| 65 | #:use-module (guix utils)
|
| 66 | #:use-module (guix download)
|
| 67 | #:use-module (guix git-download)
|
| 68 | #:use-module (guix build-system gnu)
|
| 69 | #:use-module (guix build-system pyproject))
|
| 70 |
|
| 71 | (define-public openldap
|
| 72 | (package
|
| 73 | (name "openldap")
|
| 74 | (version "2.6.13")
|
| 75 | (source (origin
|
| 76 | (method url-fetch)
|
| 77 | |
| 78 | |
| 79 | (uri (list (string-append
|
| 80 | "http://repository.linagora.org/OpenLDAP"
|
| 81 | "/openldap-release/openldap-" version ".tgz")
|
| 82 | (string-append
|
| 83 | "https://www.openldap.org/software/download/OpenLDAP/"
|
| 84 | "openldap-release/openldap-" version ".tgz")
|
| 85 | (string-append
|
| 86 | "ftp://ftp.dti.ad.jp/pub/net/OpenLDAP/"
|
| 87 | "openldap-release/openldap-" version ".tgz")))
|
| 88 | (sha256
|
| 89 | (base32
|
| 90 | "0mmnziwblgzg646nrd6i53a56snimq8a6r53l62znbm42yav94yn"))))
|
| 91 | (build-system gnu-build-system)
|
| 92 | (inputs (list cyrus-sasl gnutls libgcrypt zlib))
|
| 93 | (native-inputs (list libtool groff bdb))
|
| 94 | (arguments
|
| 95 | (list
|
| 96 | #:tests? #f
|
| 97 | #:configure-flags
|
| 98 | #~(list "--disable-static"
|
| 99 | #$@(if (%current-target-system)
|
| 100 | '("--with-yielding_select=yes"
|
| 101 | "ac_cv_func_memcmp_working=yes")
|
| 102 | '()))
|
| 103 | |
| 104 | #:make-flags
|
| 105 | #~(list "STRIP=")
|
| 106 | #:phases
|
| 107 | #~(modify-phases %standard-phases
|
| 108 | #$@(if (%current-target-system)
|
| 109 | '((add-before 'configure 'fix-cross-gcc
|
| 110 | (lambda* (#:key target #:allow-other-keys)
|
| 111 | (setenv "CC" (string-append target "-gcc"))
|
| 112 | (setenv "STRIP" (string-append target "-strip")))))
|
| 113 | '()))))
|
| 114 | (synopsis "Implementation of the Lightweight Directory Access Protocol")
|
| 115 | (description
|
| 116 | "OpenLDAP is a free implementation of the Lightweight Directory Access Protocol.")
|
| 117 | (license openldap2.8)
|
| 118 | (home-page "https://www.openldap.org/")))
|
| 119 |
|
| 120 | |
| 121 | |
| 122 | (define-public openldap-for-linphone
|
| 123 | (let ((commit "8511a0f54d270ff529d83b4a8ba113819b18b856")
|
| 124 | (revision "0"))
|
| 125 | (hidden-package
|
| 126 | (package
|
| 127 | (inherit openldap)
|
| 128 | (name "openldap")
|
| 129 | (version (git-version "2.6.4" revision commit))
|
| 130 | (source
|
| 131 | (origin
|
| 132 | (method git-fetch)
|
| 133 | (uri (git-reference
|
| 134 | (url "https://gitlab.linphone.org/BC/public/external/openldap/")
|
| 135 | (commit commit)))
|
| 136 | (file-name (git-file-name name version))
|
| 137 | (sha256
|
| 138 | (base32
|
| 139 | "06qf8lcalvgzr3w1m697xrj12ikav5im00wjmxa62qdmsg5rvji1"))))
|
| 140 | (arguments
|
| 141 | (substitute-keyword-arguments arguments
|
| 142 | ((#:configure-flags flags)
|
| 143 | #~(append
|
| 144 | (list #$(string-append "CFLAGS=-g -O2"
|
| 145 | " -Wno-error=implicit-int"
|
| 146 | " -Wno-error=int-conversion"))
|
| 147 | #$flags))))))))
|
| 148 |
|
| 149 | (define-public nss-pam-ldapd
|
| 150 | (package
|
| 151 | (name "nss-pam-ldapd")
|
| 152 | (version "0.9.13")
|
| 153 | (source (origin
|
| 154 | (method url-fetch)
|
| 155 | (uri (string-append "https://arthurdejong.org/nss-pam-ldapd/"
|
| 156 | "nss-pam-ldapd-" version ".tar.gz"))
|
| 157 | (sha256
|
| 158 | (base32
|
| 159 | "0vbi3h9v8ai3j1ppmpy2qd2k89l5ww2y4086pmkbncxmgkhq85z0"))))
|
| 160 | (build-system gnu-build-system)
|
| 161 | (arguments
|
| 162 | (list
|
| 163 | #:configure-flags
|
| 164 | #~(list (string-append "--with-pam-seclib-dir=" #$output "/lib/security/")
|
| 165 | |
| 166 | |
| 167 | |
| 168 | "--with-ldap-conf-file=/etc/nslcd.conf")
|
| 169 | #:phases
|
| 170 | #~(modify-phases %standard-phases
|
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | (add-after 'unpack 'override-nslcd.conf-install-path
|
| 176 | (lambda _
|
| 177 | (substitute* "Makefile.in"
|
| 178 | (("\\$\\(DESTDIR\\)\\$\\(NSLCD_CONF_PATH\\)")
|
| 179 | (string-append #$output "/etc/nslcd.conf.example"))))))))
|
| 180 | (inputs
|
| 181 | (list linux-pam openldap mit-krb5 python))
|
| 182 | (home-page "https://arthurdejong.org/nss-pam-ldapd")
|
| 183 | (synopsis "NSS and PAM modules for LDAP")
|
| 184 | (description "nss-pam-ldapd provides a @dfn{Name Service Switch} (NSS)
|
| 185 | module that allows your LDAP server to provide user account, group, host name,
|
| 186 | alias, netgroup, and basically any other information that you would normally
|
| 187 | get from @file{/etc} flat files or NIS. It also provides a @dfn{Pluggable
|
| 188 | Authentication Module} (PAM) to do identity and authentication management with
|
| 189 | an LDAP server.")
|
| 190 | (license lgpl2.1+)))
|
| 191 |
|
| 192 | (define-public python-ldap
|
| 193 | (package
|
| 194 | (name "python-ldap")
|
| 195 | (version "3.4.5")
|
| 196 | (source
|
| 197 | (origin
|
| 198 | (method git-fetch)
|
| 199 | (uri (git-reference
|
| 200 | (url "https://github.com/python-ldap/python-ldap")
|
| 201 | (commit (string-append name "-" version))))
|
| 202 | (file-name (git-file-name name version))
|
| 203 | (sha256
|
| 204 | (base32
|
| 205 | "0gbda9lpa2kxm2xy6l4j3k3c69jh7qq77l6nf20aci4wfvj6wm52"))))
|
| 206 | (build-system pyproject-build-system)
|
| 207 | (arguments
|
| 208 | (list
|
| 209 | #:phases
|
| 210 | #~(modify-phases %standard-phases
|
| 211 | (add-after 'unpack 'configure-openldap-locations
|
| 212 | (lambda* (#:key inputs #:allow-other-keys)
|
| 213 | (let ((slapd (search-input-file inputs "libexec/slapd"))
|
| 214 | (schema (search-input-directory
|
| 215 | inputs "etc/openldap/schema")))
|
| 216 | (setenv "SLAPD" slapd)
|
| 217 | (setenv "SCHEMA" schema)))))))
|
| 218 | (inputs
|
| 219 | (list openldap cyrus-sasl mit-krb5))
|
| 220 | (native-inputs
|
| 221 | (list python-pytest python-setuptools))
|
| 222 | (propagated-inputs
|
| 223 | (list python-pyasn1 python-pyasn1-modules))
|
| 224 | (home-page "https://www.python-ldap.org/")
|
| 225 | (synopsis "Python modules for implementing LDAP clients")
|
| 226 | (description
|
| 227 | "This package provides an object-oriented API to access LDAP directory
|
| 228 | servers from Python programs.")
|
| 229 | (license psfl)))
|
| 230 |
|
| 231 | (define-public 389-ds-base
|
| 232 | (package
|
| 233 | (name "389-ds-base")
|
| 234 | |
| 235 | |
| 236 | (version "2.2.2")
|
| 237 | (source (origin
|
| 238 | (method git-fetch)
|
| 239 | (uri (git-reference
|
| 240 | (url "https://github.com/389ds/389-ds-base")
|
| 241 | (commit (string-append "389-ds-base-" version))))
|
| 242 | (file-name (git-file-name name version))
|
| 243 | (sha256
|
| 244 | (base32
|
| 245 | "1sdvfbjfg0091f47562gw3gdc2vgvvhyhdi21lrpwnw9lqc8xdxk"))
|
| 246 | (patches (search-patches "389-ds-base-legacy-version.patch"))
|
| 247 | (modules '((guix build utils)))
|
| 248 | (snippet
|
| 249 | |
| 250 | |
| 251 | '(substitute* "ldap/servers/slapd/slap.h"
|
| 252 | (("#include <sys/types\\.h>")
|
| 253 | "#include <sys/types.h>
|
| 254 | #include <sys/statvfs.h>")))))
|
| 255 | (build-system gnu-build-system)
|
| 256 | (arguments
|
| 257 | (list
|
| 258 | #:modules '((srfi srfi-1)
|
| 259 | (guix build gnu-build-system)
|
| 260 | ((guix build pyproject-build-system) #:prefix py:)
|
| 261 | (guix build utils))
|
| 262 | #:imported-modules (append %default-gnu-imported-modules
|
| 263 | %pyproject-build-system-modules)
|
| 264 | #:disallowed-references (list (this-package-native-input "httpd"))
|
| 265 | #:configure-flags
|
| 266 | #~(list
|
| 267 | |
| 268 | (string-append "CFLAGS=-g -O2"
|
| 269 | " -Wno-error=incompatible-pointer-types")
|
| 270 | "--enable-cmocka"
|
| 271 | (string-append "--with-db="
|
| 272 | #$(this-package-input "bdb"))
|
| 273 | (string-append "--with-netsnmp="
|
| 274 | #$(this-package-input "net-snmp"))
|
| 275 | (string-append "--with-selinux="
|
| 276 | #$(this-package-input "libselinux"))
|
| 277 | "--localstatedir=/var"
|
| 278 | "--with-instconfigdir=/etc/dirsrv")
|
| 279 | #:phases
|
| 280 | #~(modify-phases %standard-phases
|
| 281 | (add-after 'unpack 'fix-references
|
| 282 | (lambda _
|
| 283 | |
| 284 | |
| 285 | |
| 286 | (let ((path (getenv "PATH"))
|
| 287 | (nss (string-append ":" #$nss:bin)))
|
| 288 | (setenv "PATH" (string-append path ":" nss)))
|
| 289 | |
| 290 | (substitute* "src/lib389/lib389/instance/setup.py"
|
| 291 | (("container_result = subprocess.*") "container_result = 1\n")
|
| 292 | (("container_result.returncode") "container_result"))
|
| 293 | (substitute* "ldap/servers/plugins/sync/sync_persist.c"
|
| 294 | (("nspr4") "nspr"))
|
| 295 | (substitute* "src/lib389/lib389/utils.py"
|
| 296 | (("'/sbin/ip'")
|
| 297 | (string-append "'" (which "ip") "'")))
|
| 298 | (substitute* "src/lib389/lib389/nss_ssl.py"
|
| 299 | (("'/usr/bin/certutil'")
|
| 300 | (string-append "'" (which "certutil") "'"))
|
| 301 | (("'/usr/bin/openssl'")
|
| 302 | (string-append "'" (which "openssl") "'")))))
|
| 303 | (add-after 'unpack 'overwrite-default-locations
|
| 304 | (lambda _
|
| 305 | (substitute* "src/lib389/lib389/paths.py"
|
| 306 | (("/usr/share/dirsrv/inf/defaults.inf")
|
| 307 | (string-append #$output "/share/dirsrv/inf/defaults.inf")))
|
| 308 | |
| 309 | |
| 310 | |
| 311 | (substitute* "ldap/admin/src/defaults.inf.in"
|
| 312 | (("^initconfig_dir =.*")
|
| 313 | "initconfig_dir = /etc/dirsrv/registry\n"))
|
| 314 | |
| 315 | |
| 316 | (substitute* "src/lib389/lib389/instance/setup.py"
|
| 317 | (("etc_dirsrv_path = .*")
|
| 318 | "etc_dirsrv_path = '/etc/dirsrv/'\n"))))
|
| 319 | (add-after 'unpack 'fix-install-location-of-python-tools
|
| 320 | (lambda* (#:key inputs outputs #:allow-other-keys)
|
| 321 | (let ((pythondir (py:site-packages inputs outputs)))
|
| 322 | |
| 323 | (py:add-installed-pythonpath inputs outputs)
|
| 324 | |
| 325 | (mkdir-p pythondir)
|
| 326 | (setenv "INSTALL_PREFIX" #$output)
|
| 327 | (substitute* "Makefile.am"
|
| 328 | (("setup.py install --skip-build" m)
|
| 329 | (string-append
|
| 330 | m " --prefix=" #$output
|
| 331 | " --root=/ --single-version-externally-managed"))))))
|
| 332 | (add-after 'build 'build-python-tools
|
| 333 | (lambda* (#:key make-flags #:allow-other-keys)
|
| 334 | |
| 335 | |
| 336 | (setenv "DETERMINISTIC_BUILD" "1")
|
| 337 | |
| 338 | |
| 339 | (setenv "PYTHONHASHSEED" "0")
|
| 340 | (apply invoke "make" "lib389" make-flags)))
|
| 341 | (add-after 'install 'install-python-tools
|
| 342 | (lambda* (#:key make-flags #:allow-other-keys)
|
| 343 | (apply invoke "make" "lib389-install" make-flags)))
|
| 344 | (add-after 'install-python-tools 'wrap-python-tools
|
| 345 | (lambda* (#:key outputs #:allow-other-keys)
|
| 346 | (let ((pythonpath (getenv "GUIX_PYTHONPATH")))
|
| 347 | (for-each (lambda (file)
|
| 348 | (wrap-program (string-append #$output file)
|
| 349 | `("GUIX_PYTHONPATH" ":" prefix (,pythonpath))))
|
| 350 | '("/sbin/dsconf"
|
| 351 | "/sbin/dscreate"
|
| 352 | "/sbin/dsctl"
|
| 353 | "/sbin/dsidm"
|
| 354 | "/bin/ds-logpipe.py"
|
| 355 | "/bin/ds-replcheck"))))))))
|
| 356 | (inputs
|
| 357 | (list bash-minimal
|
| 358 | bdb
|
| 359 | cracklib
|
| 360 | cyrus-sasl
|
| 361 | gnutls
|
| 362 | icu4c
|
| 363 | iproute
|
| 364 | json-c
|
| 365 | libevent
|
| 366 | libselinux
|
| 367 | linux-pam
|
| 368 | libxcrypt
|
| 369 | lmdb
|
| 370 | mit-krb5
|
| 371 | net-snmp
|
| 372 | nspr
|
| 373 | nss
|
| 374 | (list nss "bin") |
| 375 | openldap
|
| 376 | openssl |
| 377 | pcre
|
| 378 | python
|
| 379 | python-pyasn1
|
| 380 | python-pyasn1-modules
|
| 381 | python-pytest
|
| 382 | python-dateutil
|
| 383 | python-six
|
| 384 | python-argcomplete
|
| 385 | python-argparse-manpage
|
| 386 | python-ldap))
|
| 387 | (native-inputs
|
| 388 | (list autoconf
|
| 389 | automake
|
| 390 | cmocka
|
| 391 | doxygen
|
| 392 | gettext-minimal
|
| 393 | httpd
|
| 394 | libtool
|
| 395 | pkg-config
|
| 396 | python-setuptools
|
| 397 | rsync))
|
| 398 | (home-page "https://directory.fedoraproject.org")
|
| 399 | (synopsis "Enterprise-class LDAP server")
|
| 400 | (description "389ds is an enterprise-class LDAP server. It is hardened by
|
| 401 | real-world use, is full-featured, and supports multi-master replication.
|
| 402 |
|
| 403 | Other features include:
|
| 404 |
|
| 405 | @enumerate
|
| 406 | @item Online, zero downtime, LDAP-based update of schema, configuration, and
|
| 407 | management including @dfn{Access Control Information} (ACIs);
|
| 408 | @item Asynchronous Multi-Master Replication, to provide fault tolerance and
|
| 409 | high write performance;
|
| 410 | @item Extensive documentation;
|
| 411 | @item Secure authentication and transport (TLS, and SASL);
|
| 412 | @item LDAPv3 compliant server.
|
| 413 | @end enumerate\n")
|
| 414 | |
| 415 | (license gpl3+)))
|
| 416 |
|
| 417 | (define-public python-bonsai
|
| 418 | (package
|
| 419 | (name "python-bonsai")
|
| 420 | (version "1.5.4")
|
| 421 | (source
|
| 422 | (origin
|
| 423 | (method git-fetch)
|
| 424 | (uri (git-reference
|
| 425 | (url "https://github.com/noirello/bonsai")
|
| 426 | (commit (string-append "v" version))))
|
| 427 | (file-name (git-file-name name version))
|
| 428 | (sha256
|
| 429 | (base32 "1p1330cxaxb2j80zw0vvi2hrnyw3qr5vh8fm2wy8ci745dmrs0nl"))))
|
| 430 | (build-system pyproject-build-system)
|
| 431 | (arguments
|
| 432 | (list
|
| 433 | #:test-flags
|
| 434 | #~(list
|
| 435 | |
| 436 | "--ignore=tests/test_asyncio.py"
|
| 437 | "--ignore=tests/test_ldapclient.py"
|
| 438 | "--ignore=tests/test_ldapconnection.py"
|
| 439 | "--ignore=tests/test_ldapentry.py"
|
| 440 | "--ignore=tests/test_ldapreference.py"
|
| 441 | "--ignore=tests/test_pool.py"
|
| 442 | "-k" "not test_set_async_connect")))
|
| 443 | (native-inputs (list python-pytest python-setuptools))
|
| 444 | (inputs (list mit-krb5 cyrus-sasl openldap))
|
| 445 | (home-page "https://github.com/noirello/bonsai")
|
| 446 | (synopsis "Access LDAP directory servers from Python")
|
| 447 | (description
|
| 448 | "This is a module for handling LDAP operations in Python. LDAP entries
|
| 449 | are mapped to a special Python case-insensitive dictionary, tracking the
|
| 450 | changes of the dictionary to modify the entry on the server easily.")
|
| 451 | (license expat)))
|