Subject: [PATCH v2 1/2] DRAFT gnu: Add openldap-for-services.

From: zimoun <[email-masked]>
Date: Fri, 25 Mar 2022 16:35:16 +0100

* gnu/packages/openldap.scm (openldap-for-services): New variable.

Co-Authored-By: Jean-François Guillaume <[email-masked]>.
---
 gnu/packages/openldap.scm | 47 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/openldap.scm b/gnu/packages/openldap.scm
index c8a47e45d5..8374386807 100644
--- a/gnu/packages/openldap.scm
+++ b/gnu/packages/openldap.scm
@@ -9,6 +9,8 @@
 ;;; Copyright © 2020 Efraim Flashner <[email-masked]>
 ;;; Copyright © 2021 Maxim Cournoyer <[email-masked]>
 ;;; Copyright © 2022 Marius Bakke <[email-masked]>
+;;; Copyright © 2022 Jean-François Guillaume <[email-masked]>
+;;; Copyright © 2022 Simon Tournier <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -30,6 +32,7 @@ (define-module (gnu packages openldap)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cyrus-sasl)
+  #:use-module (gnu packages databases)
   #:use-module (gnu packages dbm)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages gettext)
@@ -164,6 +167,50 @@ (define-public openldap-2.6
                   (lambda (port)
                     (format port "INPUT ( libldap.so )~%")))))))))))
 
+(define-public openldap-for-services
+  ;; TODO: Update in the next rebuild cycle
+  (let* ((openldap-minimal openldap-2.6))
+    (package
+      (inherit openldap-minimal)
+      (name (string-append (package-name openldap-minimal) "-for-services"))
+      (arguments
+       (substitute-keyword-arguments (package-arguments openldap-minimal)
+         ((#:configure-flags flags)
+          `(append (list
+                    "--enable-aci"
+                    "--enable-argon2"
+                    "--enable-backends=mod"
+                    "--enable-balancer"
+                    "--enable-cleartext"
+                    "--enable-crypt"
+                    "--enable-debug"
+                    "--enable-dynacl"
+                    "--enable-modules"
+                    "--enable-ipv6"
+                    "--enable-local"
+                    "--enable-overlays=mod"
+                    "--enable-rlookups"
+                    "--enable-shared"
+                    "--enable-slapd"
+                    "--enable-slapi"
+                    "--enable-spasswd"
+                    "--enable-syslog"
+                    "--with-tls=openssl")
+                   ,flags))))
+      (inputs (modify-inputs (package-inputs openldap-minimal)
+                (delete "gnutls")
+                (append argon2
+                        libevent
+                        libltdl
+                        lz4
+                        openssl
+                        perl
+                        snappy
+                        unixodbc
+                        wiredtiger)))
+      (native-inputs (modify-inputs (package-native-inputs openldap-minimal)
+                       (append pkg-config))))))
+
 (define-public nss-pam-ldapd
   (package
     (name "nss-pam-ldapd")
-- 
2.34.0