unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#52578] [PATCH] updating openldap and adding service definition
@ 2021-12-17 13:52 Jean-Francois GUILLAUME
  2021-12-17 22:39 ` Maxime Devos
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Jean-Francois GUILLAUME @ 2021-12-17 13:52 UTC (permalink / raw)
  To: 52578

* gnu/packages/openldap.scm (openldap): Update to 2.6.0, adding 2.5.7, 
2.5.8, 2.5.9
* gnu/services/openldap.scm (openldap): Adding slapd service
---
  gnu/packages/openldap.scm | 148 ++++++++++++++++++++++++++++++++++++++
  gnu/services/openldap.scm |  87 ++++++++++++++++++++++
  2 files changed, 235 insertions(+)
  create mode 100644 gnu/services/openldap.scm

diff --git a/gnu/packages/openldap.scm b/gnu/packages/openldap.scm
index b0ce899696..61f99dea7a 100644
--- a/gnu/packages/openldap.scm
+++ b/gnu/packages/openldap.scm
@@ -60,6 +60,154 @@
    #:use-module (guix build-system python))

  (define-public openldap
+  (package
+    (name "openldap")
+    (version "2.6.0")
+    (source (origin
+      (method url-fetch)
+      (uri (list
+        (string-append 
"https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-" 
version ".tgz")
+        (string-append 
"http://repository.linagora.org/OpenLDAP/openldap-release/openldap-" 
version ".tgz")
+        (string-append 
"ftp://ftp.dti.ad.jp/pub/net/OpenLDAP/openldap-release/openldap-" 
version ".tgz")
+      ))
+      (sha256 ( base32 
"0kqswk8pxgnlibh0kz6py3a2x3yh9pfk6pyr2nx9lgjpmh75h75p" ))
+      )
+    )
+    (build-system gnu-build-system)
+    (inputs `(
+      ("argon2", argon2)
+      ("cyrus-sasl", cyrus-sasl)
+      ("libevent", libevent)
+      ("libgcrypt", libgcrypt)
+      ("libltdl", libltdl)
+      ("lz4", lz4)
+      ("openssl", openssl)
+      ("perl", perl)
+      ("snappy", snappy)
+      ("unixodbc", unixodbc)
+      ("wiredtiger", wiredtiger)
+      ("zlib", zlib)
+    ))
+    (native-inputs `(
+      ("bdb", bdb)
+      ("groff", groff)
+      ("libtool", libtool)
+      ("pkg-config", pkg-config)
+    ))
+    (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-static"
+        ,@(if (%current-target-system)
+          '("--with-yielding_select=yes" 
"ac_cv_func_memcmp_working=yes")
+          '()
+        )
+      )
+      #:make-flags '("STRIP=")
+      #:parallel-build? #t
+      #:phases (modify-phases %standard-phases
+        (add-before 'build 'make-depend
+          (lambda* (#:key input #:allow-other-keys)
+            (invoke "make" "depend")
+          )
+        )
+        ,@(if (%current-target-system)
+            '(
+              (add-before 'make-depend 'fix-cross-gcc
+                (lambda* (#:key target #:allow-other-keys)
+                  (setenv "CC" (string-append target "-gcc"))
+                  #t
+                )
+              )
+            )
+            '()
+        )
+      )
+    ))
+    (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/")
+  )
+)
+
+(define-public openldap-2.5.9
+  (package
+    (inherit openldap)
+    (name "openldap")
+    (version "2.5.9")
+    (source (origin
+      (method url-fetch)
+      (uri (list
+        (string-append 
"https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-" 
version ".tgz")
+        (string-append 
"http://repository.linagora.org/OpenLDAP/openldap-release/openldap-" 
version ".tgz")
+        (string-append 
"ftp://ftp.dti.ad.jp/pub/net/OpenLDAP/openldap-release/openldap-" 
version ".tgz")
+      ))
+      (sha256 ( base32 
"17pvwrj27jybbmjqpv0p7kd2qa4i6jnp134lz7cxa0sqrbs153n0" ))
+      )
+    )
+  )
+)
+
+(define-public openldap-2.5.8
+  (package
+    (inherit openldap)
+    (name "openldap")
+    (version "2.5.8")
+    (source (origin
+      (method url-fetch)
+      (uri (list
+        (string-append 
"https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-" 
version ".tgz")
+        (string-append 
"http://repository.linagora.org/OpenLDAP/openldap-release/openldap-" 
version ".tgz")
+        (string-append 
"ftp://ftp.dti.ad.jp/pub/net/OpenLDAP/openldap-release/openldap-" 
version ".tgz")
+      ))
+      (sha256 ( base32 
"1p3jck2kh7rsz6mkrqaailaf9ky050hn72wph52dw0j2nb1s2vin" ))
+      )
+    )
+  )
+)
+
+(define-public openldap-2.5.7
+  (package
+    (inherit openldap)
+    (name "openldap")
+    (version "2.5.7")
+    (source (origin
+      (method url-fetch)
+      (uri (list
+        (string-append 
"https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-" 
version ".tgz")
+        (string-append 
"http://repository.linagora.org/OpenLDAP/openldap-release/openldap-" 
version ".tgz")
+        (string-append 
"ftp://ftp.dti.ad.jp/pub/net/OpenLDAP/openldap-release/openldap-" 
version ".tgz")
+      ))
+      (sha256 ( base32 
"1ayr76sa5hjwldqzis5v71sbp88hd3hysc00gw1raqn33c05g5za" ))
+      )
+    )
+  )
+)
+
+(define-public openldap-2.4.57
    (package
     (name "openldap")
     (version "2.4.57")
diff --git a/gnu/services/openldap.scm b/gnu/services/openldap.scm
new file mode 100644
index 0000000000..0fd329d611
--- /dev/null
+++ b/gnu/services/openldap.scm
@@ -0,0 +1,87 @@
+(define-module (gnu services openldap)
+  #:use-module (gnu packages openldap)
+  #:use-module (gnu services)
+  #:use-module (gnu services shepherd)
+  #:use-module (guix)
+  #:use-module (guix records)
+  #:use-module (ice-9 match)
+  #: export (
+    openldap-configuration
+    openldap-configuration?
+    openldap-shepherd-service
+    openldap-service-type
+  )
+)
+
+(define-record-type* <openldap-configuration>
+  openldap-configuration make-openldap-configuration
+  openldap-configuration?
+  (openldap openldap-configuration-openldap
+    (default openldap)
+  )
+  (uri openldap-configuration-uri
+    (default "ldapi:// ldap://")
+  )
+  (logflags openldap-configuration-logflags
+    (default "0")
+  )
+  (pid-file openldap-configuration-pid-file
+    (default "/var/run/openldap/slapd.pid")
+  )
+  (config-file openldap-configuration-config-file
+    (default (file-append openldap "/etc/openldap/slapd.conf"))
+  )
+  (log-file openldap-configuration-log-file
+    (default "/var/log/slapd.log")
+  )
+)
+
+(define openldap-shepherd-service
+  (match-lambda
+    (($ <openldap-configuration> openldap uri logflags pid-file 
config-file log-file)
+      (list
+        (shepherd-service
+          (provision '(slapd) )
+          (documentation "Run openldap.")
+          (requirement '(user-processes))
+          (respawn? #t)
+          (start #~(make-forkexec-constructor
+            (list
+              #$(file-append openldap "/libexec/slapd")
+              "-h" #$uri
+              "-d" #$logflags
+              "-f" #$config-file
+            )
+            #:pid-file #$pid-file
+            #:log-file #$log-file
+          ))
+          (stop #~(make-kill-destructor))
+        )
+      )
+    )
+  )
+)
+
+
+(define %openldap-activation
+  (with-imported-modules '((guix build utils))
+    #~(begin
+        (use-modules (guix build utils))
+        (mkdir-p "/var/run/openldap")
+        (mkdir-p "/var/lib/ldap")
+        #t
+    )
+  )
+)
+
+(define openldap-service-type
+  (service-type (name 'slapd)
+    (extensions
+      (list
+        (service-extension shepherd-root-service-type 
openldap-shepherd-service)
+        (service-extension activation-service-type (const 
%openldap-activation))
+      )
+    )
+    (description "Run @uref{https://www.openldap.org, Openldap} 
community developped LDAP software.")
+  )
+)
--
2.30.2




^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-05-23  7:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-17 13:52 [bug#52578] [PATCH] updating openldap and adding service definition Jean-Francois GUILLAUME
2021-12-17 22:39 ` Maxime Devos
2021-12-18 10:53   ` zimoun
2021-12-17 22:46 ` Maxime Devos
2021-12-18 10:22 ` zimoun
2021-12-18 11:09   ` Jean-Francois GUILLAUME
2021-12-18 10:37 ` Jean-Francois GUILLAUME
2021-12-18 10:49   ` Jean-Francois GUILLAUME
2022-03-25 15:34 ` [bug#52578] [PATCH v2 0/2] OpenLDAP service zimoun
2022-03-28  8:38   ` Jean-Francois GUILLAUME
2024-05-16 21:08     ` Ludovic Courtès
2024-05-17 12:04       ` Simon Tournier
2024-05-22 10:18       ` Jean-Francois GUILLAUME
2024-05-23  7:12         ` Ludovic Courtès
2022-03-25 15:35 ` [bug#52578] [PATCH v2 1/2] DRAFT gnu: Add openldap-for-services zimoun
2022-03-25 15:35   ` [bug#52578] [PATCH v2 2/2] DRAFT services: Add openldap service zimoun

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).