diff --git a/glicid/packages/glicid-openldap.scm b/glicid/packages/glicid-openldap.scm deleted file mode 100644 index 9fffdab..0000000 --- a/glicid/packages/glicid-openldap.scm +++ /dev/null @@ -1,166 +0,0 @@ -(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 make-openldap-configuration - openldap-configuration? - (openldap openldap-configuration-openldap ; - (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 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.") - ) - ) -) diff --git a/glicid/packages/openldap.scm b/glicid/packages/openldap.scm new file mode 100644 index 0000000..035f3f7 --- /dev/null +++ b/glicid/packages/openldap.scm @@ -0,0 +1,99 @@ +(define-module (glicid packages openldap) + #:use-module (guix build-system gnu) + #:use-module ((guix licenses) #:select (openldap2.8 lgpl2.1+ gpl3+ psfl expat)) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages autotools) + #:use-module (gnu packages check) + #:use-module (gnu packages compression) + #:use-module (gnu packages cyrus-sasl) + #:use-module (gnu packages dbm) + #:use-module (gnu packages documentation) + #:use-module (gnu packages gettext) + #:use-module (gnu packages gnupg) + #:use-module (gnu packages groff) + #:use-module (gnu packages icu4c) + #:use-module (gnu packages kerberos) + #:use-module (gnu packages libevent) + #:use-module (gnu packages linux) + #:use-module (gnu packages networking) + #:use-module (gnu packages nss) + #:use-module (gnu packages password-utils) + #:use-module (gnu packages pcre) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages rsync) + #:use-module (gnu packages selinux) + #:use-module (gnu packages time) + #:use-module (gnu packages tls) + #:use-module (gnu packages web) + #:use-module (gnu packages databases) + #:use-module (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") + ) + ) + ) + )) + ) +) diff --git a/glicid/services/openldap.scm b/glicid/services/openldap.scm new file mode 100644 index 0000000..4ee36fd --- /dev/null +++ b/glicid/services/openldap.scm @@ -0,0 +1,75 @@ +(define-module (glicid services openldap) + #:use-module (glicid packages openldap) + #: export ( + openldap-configuration + openldap-configuration? + %default-slapd.conf + ) +) + + (define-record-type* + openldap-configuration make-openldap-configuration + openldap-configuration? + (openldap openldap-configuration-openldap ; + (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 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.") + ) + )