guix-glicid/glicid/packages/glicid-openldap.scm

167 lines
6.9 KiB
Scheme
Raw Normal View History

2021-10-20 08:55:58 +02:00
(use-modules (guix)
(guix build-system gnu)
((guix licenses) #:select (openldap2.8 lgpl2.1+ gpl3+ psfl expat))
(guix packages)
(guix utils)
(guix download)
(guix build-system gnu)
(gnu packages base)
(gnu packages autotools)
(gnu packages check)
(gnu packages compression)
(gnu packages cyrus-sasl)
(gnu packages dbm)
(gnu packages documentation)
(gnu packages gettext)
(gnu packages gnupg)
(gnu packages groff)
(gnu packages icu4c)
(gnu packages kerberos)
(gnu packages libevent)
(gnu packages linux)
(gnu packages networking)
(gnu packages nss)
(gnu packages password-utils)
(gnu packages pcre)
(gnu packages perl)
(gnu packages pkg-config)
(gnu packages python)
(gnu packages python-xyz)
(gnu packages rsync)
(gnu packages selinux)
(gnu packages time)
(gnu packages tls)
(gnu packages web)
(gnu packages databases)
(gnu packages password-utils)
)
(define-public openldap-glicid
(package
(name "openldap-glicid")
(version "2.5.7")
(synopsis "Implementation of the Lightweight Directory Access Protocol")
(description "OpenLDAP is a free implementation of the Lightweight Directory Access Protocol.")
(license openldap2.8)
(home-page "https://www.openldap.org/")
(source (origin
(method url-fetch)
(uri (list
(string-append "https://www.openldap.org/software/download/OpenLDAP/" "openldap-release/openldap-" version ".tgz")
(string-append "http://gpl.savoirfairelinux.net/pub/mirrors/openldap/" "openldap-release/openldap-" version ".tgz")
(string-append "http://repository.linagora.org/OpenLDAP/" "openldap-release/openldap-" version ".tgz")
(string-append "ftp://ftp.ntua.gr/mirror/OpenLDAP/" "openldap-release/openldap-" version ".tgz")
(string-append "https://mirror-hk.koddos.net/OpenLDAP/" "openldap-release/openldap-" version ".tgz")
(string-append "ftp://ftp.dti.ad.jp/pub/net/OpenLDAP/" "openldap-release/openldap-" version ".tgz")
(string-append "https://mirror.koddos.net/OpenLDAP/" "openldap-release/openldap-" version ".tgz")
(string-append "https://mirror.lyrahosting.com/OpenLDAP/" "openldap-release/openldap-" version ".tgz")
))
(sha256 ( base32 "1ayr76sa5hjwldqzis5v71sbp88hd3hysc00gw1raqn33c05g5za" ))
)
)
(build-system gnu-build-system)
(inputs `(
("bdb", bdb)
("cyrus-sasl", cyrus-sasl)
("gnutls", gnutls)
("libgcrypt", libgcrypt)
("zlib", zlib)
("libltdl", libltdl)
("pkg-config", pkg-config)
("libevent", libevent)
("libtool", libtool)
("groff", groff)
("openssl", openssl)
("argon2", argon2)
("wiredtiger", wiredtiger)
("snappy", snappy)
("lz4", lz4)
))
(arguments '(
; this is needed because the make check does not work inside guix
#:tests? #f
#:configure-flags '(
"--enable-debug" "--enable-dynamic" "--enable-syslog" "--enable-ipv6" "--enable-local" "--enable-slapd" "--enable-dynacl"
"--enable-aci" "--enable-cleartext" "--enable-crypt" "--enable-spasswd" "--enable-modules" "--enable-rlookups" "--enable-slapi"
"--enable-backends=mod" "--enable-overlays=mod" "--enable-argon2" "--enable-balancer" "--disable-static"
"--enable-shared" "--with-tls=openssl"
)
; Disable install stripping as it breaks cross-compiling.
#:make-flags '("STRIP=")
#:phases (modify-phases %standard-phases
(add-before 'build 'make-depend
(lambda* (#:key input #:allow-other-keys)
(invoke "make" "depend")
)
)
)
))
)
(define-record-type* <openldap-configuration>
openldap-configuration make-openldap-configuration
openldap-configuration?
(openldap openldap-configuration-openldap ;<package>
(default openldap-glicid)
)
(arguments openldap-configuration-arguments ;list of strings
(default '())
)
(logflags openldap-configuration-logflags ;number
(default "0")
)
(log-file openldap-configuration-log-file ; string
(default "/var/log/slapd.log")
)
(pid-file openldap-configuration-pid-file ; string
(default "/var/run/openldap/slapd.pid")
)
(config-file openldap-configuration-config-file ; string
(default %default-slapd.conf)
)
(schema-dir openldap-configuration-schema-dir ; string
(default '())
)
)
(define %default-slapd.conf
(plain-file "slapd.conf" "
# Empty file for test
"))
(define schema_dir (local-file "ldap_schema" #:recursive? #t))
(define openldap-shepherd-service
(match-lambda
(($ <openldap-configuration> openldap arguments logflags log-file pid-file config-file schema-dir)
(list
(shepherd-service
(provision '(slapd) )
(documentation "Run openldap.")
(requirement '(user-processes))
(respawn? #f)
(start #~(make-forkexec-constructor
(list
#$(file-append openldap-glicid "/libexec/slapd")
"-h 'ldap:/// ldaps:///'"
"-d" #$logflags
"-f" #$config-file
)
#:pid-file #$pid-file
))
(stop #~(make-kill-destructor))
)
)
)
)
)
(define openldap-service-type
(service-type (name 'slapd)
(extensions
(list (
service-extension
shepherd-root-service-type
openldap-shepherd-service
))
)
(description "Run @uref{https://www.openldap.org, Openldap} community developped LDAP software.")
)
)
)