From patchwork Fri Dec 17 13:09:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: JEAN-FRANCOIS GUILLAUME X-Patchwork-Id: 35352 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E940727BBEA; Fri, 17 Dec 2021 15:56:58 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 3F5CC27BBE9 for ; Fri, 17 Dec 2021 15:56:58 +0000 (GMT) Received: from localhost ([::1]:46464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1myFbN-0007KV-9v for patchwork@mira.cbaines.net; Fri, 17 Dec 2021 10:56:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49400) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myEp4-00018H-Ux for guix-patches@gnu.org; Fri, 17 Dec 2021 10:07:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57076) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1myEp4-00027J-KN for guix-patches@gnu.org; Fri, 17 Dec 2021 10:07:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1myEp4-0006uT-Fp for guix-patches@gnu.org; Fri, 17 Dec 2021 10:07:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52579] [PATCH] updating openldap and adding service definition Resent-From: JEAN-FRANCOIS GUILLAUME Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 17 Dec 2021 15:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52579 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52579@debbugs.gnu.org Cc: JEAN-FRANCOIS GUILLAUME X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163975358126490 (code B ref -1); Fri, 17 Dec 2021 15:07:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 Dec 2021 15:06:21 +0000 Received: from localhost ([127.0.0.1]:40388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myEoO-0006tA-4W for submit@debbugs.gnu.org; Fri, 17 Dec 2021 10:06:20 -0500 Received: from lists.gnu.org ([209.51.188.17]:37408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myDAk-0003UG-4e for submit@debbugs.gnu.org; Fri, 17 Dec 2021 08:21:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myDAj-0008GM-VD for guix-patches@gnu.org; Fri, 17 Dec 2021 08:21:17 -0500 Received: from smtp2.univ-nantes.fr ([193.52.82.19]:41714 helo=smtp-prv.univ-nantes.fr) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myDAh-0000cI-Du for guix-patches@gnu.org; Fri, 17 Dec 2021 08:21:17 -0500 Received: from localhost (localhost [127.0.0.1]) by smtp-prv.univ-nantes.fr (Postfix) with ESMTP id C586EAA8E7D; Fri, 17 Dec 2021 14:09:36 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at smtp2.univ-nantes.fr Received: from smtp-prv.univ-nantes.fr ([127.0.0.1]) by localhost (smtp2.u12.univ-nantes.prive [127.0.0.1]) (amavisd-new, port 10024) with LMTP id IiZFNsIYstmg; Fri, 17 Dec 2021 14:09:36 +0100 (CET) Received: from bird2cluster.univ-nantes.fr (unknown [172.20.52.134]) by smtp-prv.univ-nantes.fr (Postfix) with ESMTP id B11A3AA8E76; Fri, 17 Dec 2021 14:09:36 +0100 (CET) Received: by bird2cluster.univ-nantes.fr (Postfix, from userid 1000) id AB7A773C63; Fri, 17 Dec 2021 14:09:36 +0100 (CET) From: JEAN-FRANCOIS GUILLAUME Date: Fri, 17 Dec 2021 14:09:32 +0100 Message-Id: <20211217130932.4029400-1-mrbear@yam-it.net> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Received-SPF: none client-ip=193.52.82.19; envelope-from=fedora@bird2cluster.univ-nantes.fr; helo=smtp-prv.univ-nantes.fr X-Spam_score_int: -39 X-Spam_score: -4.0 X-Spam_bar: ---- X-Spam_report: (-4.0 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 17 Dec 2021 10:06:19 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Fri, 17 Dec 2021 10:56:43 -0500 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches --- 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 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 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.") + ) +)