From af184b68e78aa51b6ff50b7327dfbbdb1d6e6843 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 20 Mar 2019 12:17:27 +0100 Subject: gnu: 389-ds-base: Use more global directories. * gnu/packages/openldap.scm (389-ds-base)[arguments]: Pass "with-instconfigdir"; add phase "overwrite-default-locations" to overwrite defaults for "initconfig_dir", the certificate location, and the location of the defaults file. --- gnu/packages/openldap.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gnu/packages/openldap.scm b/gnu/packages/openldap.scm index 6426c3067e..e0190d2c0e 100644 --- a/gnu/packages/openldap.scm +++ b/gnu/packages/openldap.scm @@ -224,6 +224,7 @@ (define-public 389-ds-base (string-append "--with-selinux=" (assoc-ref %build-inputs "libselinux")) "--localstatedir=/var" + "--with-instconfigdir=/etc/dirsrv" ;; The Perl scripts are being removed in the 1.4.0 release. ;; Building them would require packaging of the outdated Mozilla ;; LDAP SDK (instead of OpenLDAP) and PerLDAP. @@ -240,6 +241,25 @@ (define-public 389-ds-base (("'/usr/bin/c_rehash'") (string-append "'" (which "perl") "', '" (which "c_rehash") "'"))) #t)) + (add-after 'unpack 'overwrite-default-locations + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* "src/lib389/lib389/paths.py" + (("/usr/share/dirsrv/inf/defaults.inf") + (string-append out "/share/dirsrv/inf/defaults.inf"))) + ;; This directory can only be specified relative to sysconfdir. This + ;; is used to determine where to look for installed directory + ;; servers, so in the absence of a search path it needs to be global. + (substitute* "ldap/admin/src/defaults.inf.in" + (("^initconfig_dir =.*") + "initconfig_dir = /etc/dirsrv/registry\n")) + ;; This is used to determine where to write certificate files + ;; when installing new directory server instances. + (substitute* '("src/lib389/lib389/instance/setup.py" + "src/lib389/lib389/instance/remove.py") + (("etc_dirsrv_path = .*") + "etc_dirsrv_path = '/etc/dirsrv/'\n")) + #t))) (add-after 'unpack 'fix-install-location-of-python-tools (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) -- cgit v1.2.3