From 2d48aab2152a0396c957d716cde80f154a2cc975 Mon Sep 17 00:00:00 2001 From: William Brown Date: Sep 14 2016 22:43:33 +0000 Subject: Ticket 48983 - generate install path info from autotools scripts Bug Description: At configure time, this is the only time we know all the resolved paths of a ds installation. However, external tools such as lib389 need to be able to discover and use these paths. Fix Description: Add a new file to share in a well-known location that well provide all the paths of ds instance and install. This will allow discovery of what settings should be used on the associated platform or installation. https://fedorahosted.org/389/ticket/48983 Author: wibrown Review by: tbordaz, mreynolds (Thanks!) --- diff --git a/Makefile.am b/Makefile.am index a2f834e..7458ab7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -175,6 +175,7 @@ selinux-built/dirsrv.fc: selinux-built #------------------------ # Install Paths #------------------------ +prefixdir = @prefixdir@ configdir = $(sysconfdir)@configdir@ sampledatadir = $(datadir)@sampledatadir@ propertydir = $(datadir)@propertydir@ @@ -724,7 +725,8 @@ endif inf_DATA = ldap/admin/src/slapd.inf \ ldap/admin/src/scripts/dscreate.map \ ldap/admin/src/scripts/dsupdate.map \ - ldap/admin/src/scripts/dsorgentries.map + ldap/admin/src/scripts/dsorgentries.map \ + ldap/admin/src/defaults.inf mib_DATA = ldap/servers/snmp/redhat-directory.mib @@ -1837,7 +1839,8 @@ fixupcmd = sed \ -e 's,@ldaplib_defs\@,$(ldaplib_defs),g' \ -e 's,@systemdsystemunitdir\@,$(systemdsystemunitdir),g' \ -e 's,@systemdsystemconfdir\@,$(systemdsystemconfdir),g' \ - -e 's,@systemdgroupname\@,$(systemdgroupname),g' + -e 's,@systemdgroupname\@,$(systemdgroupname),g' \ + -e 's,@prefixdir\@,$(prefixdir),g' else fixupcmd = sed \ -e 's,@bindir\@,$(bindir),g' \ @@ -1906,7 +1909,8 @@ fixupcmd = sed \ -e 's,@ldaplib_defs\@,$(ldaplib_defs),g' \ -e 's,@systemdsystemunitdir\@,$(systemdsystemunitdir),g' \ -e 's,@systemdsystemconfdir\@,$(systemdsystemconfdir),g' \ - -e 's,@systemdgroupname\@,$(systemdgroupname),g' + -e 's,@systemdgroupname\@,$(systemdgroupname),g' \ + -e 's,@prefixdir\@,$(prefixdir),g' endif %: %.in diff --git a/configure.ac b/configure.ac index c18d2d9..3e0f8aa 100644 --- a/configure.ac +++ b/configure.ac @@ -285,6 +285,7 @@ localrundir='/run' if test "$with_fhs_opt" = "yes"; then # Override sysconfdir and localstatedir if FHS optional # package was requested. + prefixdir=$prefix sysconfdir='/etc/opt' localstatedir='/var/opt' localrundir='/var/opt/run' @@ -321,6 +322,7 @@ else localstatedir='/var' localrundir='/run' fi + prefixdir=$prefix # relative to datadir sampledatadir=/$PACKAGE_NAME/data # relative to datadir @@ -414,6 +416,7 @@ else with_pythonexec=/usr/bin/python2 fi +AC_SUBST(prefixdir) AC_SUBST(configdir) AC_SUBST(sampledatadir) AC_SUBST(propertydir) diff --git a/ldap/admin/src/defaults.inf.in b/ldap/admin/src/defaults.inf.in new file mode 100644 index 0000000..9b02542 --- /dev/null +++ b/ldap/admin/src/defaults.inf.in @@ -0,0 +1,43 @@ +; --- BEGIN COPYRIGHT BLOCK --- +; Copyright (C) 2016 Red Hat, Inc. +; All rights reserved. +; +; License: GPL (version 3 or any later version). +; See LICENSE for details. +; --- END COPYRIGHT BLOCK --- + +; Author: firstyear at redhat.com + +; This is a set of default paths that tools consuming DS should search +; for paths. This is the foundation of the version 2 ds setup inf +; +; All format strings should be in python syntax IE {key} + +[slapd] +product = @capbrand@ Directory Server +version = @PACKAGE_VERSION@ +user = dirsrv +group = dirsrv +root_dn = cn=Directory Manager +prefix = @prefixdir@ +bin_dir = @bindir@ +sbin_dir = @sbindir@ +lib_dir = @libdir@ +data_dir = @datadir@ +tmp_dir = /tmp + +sysconf_dir = @sysconfdir@ +initconfigdir = @initconfigdir@ +config_dir = @instconfigdir@/slapd-{instance_name} +schema_dir = @instconfigdir@/slapd-{instance_name}/schema +cert_dir = @instconfigdir@/slapd-{instance_name} + +local_state_dir = @localstatedir@ +run_dir = @localstatedir@/run/dirsrv +lock_dir = @localstatedir@/lock/dirsrv/slapd-{instance_name} +log_dir = @localstatedir@/log/dirsrv/slapd-{instance_name} +inst_dir = @localstatedir@/lib/dirsrv/slapd-{instance_name} +db_dir = @localstatedir@/lib/dirsrv/slapd-{instance_name}/db +backup_dir = @localstatedir@/lib/dirsrv/slapd-{instance_name}/bak +ldif_dir = @localstatedir@/lib/dirsrv/slapd-{instance_name}/ldif +