From dd6784cefeaf50f3e6456107d2e2766e98a0019e Mon Sep 17 00:00:00 2001
From: William Brown <firstyear@redhat.com>
Date: Mon, 12 Sep 2016 11:30:55 +1000
Subject: [PATCH] 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: mreynolds, tbordaz(Thanks)
(cherry picked from commit 90346683273ba64ce92582fd09edb838cf9d28f6)
---
Makefile.am | 10 ++++++---
configure.ac | 3 +++
ldap/admin/src/defaults.inf.in | 51 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 61 insertions(+), 3 deletions(-)
create mode 100644 ldap/admin/src/defaults.inf.in
diff --git a/Makefile.am b/Makefile.am
index bc40ea7..a808269 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -136,6 +136,7 @@ selinux-built/dirsrv.fc: selinux-built
#------------------------
# Install Paths
#------------------------
+prefixdir = @prefixdir@
configdir = $(sysconfdir)@configdir@
sampledatadir = $(datadir)@sampledatadir@
propertydir = $(datadir)@propertydir@
@@ -413,7 +414,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
@@ -1475,7 +1477,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' \
@@ -1541,7 +1544,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 df02cff..2859c23 100644
--- a/configure.ac
+++ b/configure.ac
@@ -237,6 +237,7 @@ m4_include(m4/fhs.m4)
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'
# relative to datadir
@@ -269,6 +270,7 @@ else
dnl as opposed to the default /usr/var
localstatedir='/var'
fi
+ prefixdir=$prefix
# relative to datadir
sampledatadir=/$PACKAGE_NAME/data
# relative to datadir
@@ -388,6 +390,7 @@ if test -n "$with_systemdsystemunitdir" -o -n "$with_systemdsystemconfdir" ; the
AC_SUBST(with_systemdgroupname)
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..e4ce74a
--- /dev/null
+++ b/ldap/admin/src/defaults.inf.in
@@ -0,0 +1,51 @@
+; --- 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]
+; These values should NOT be altered in an installation.
+; This is because the server itself depends on these locations and values
+; being known, and are set at compilation time.
+product = @capbrand@ Directory Server
+version = @PACKAGE_VERSION@
+; In 1.2.xx, this will never be true.
+asan_enabled = false
+prefix = @prefixdir@
+bin_dir = @bindir@
+sbin_dir = @sbindir@
+lib_dir = @libdir@
+data_dir = @datadir@
+tmp_dir = /tmp
+sysconf_dir = @sysconfdir@
+initconfig_dir = @initconfigdir@
+config_dir = @instconfigdir@/slapd-{instance_name}
+local_state_dir = @localstatedir@
+run_dir = @localstatedir@/run/dirsrv
+plugin_dir = @serverplugindir@
+
+; These values can be altered in an installation of ds
+user = dirsrv
+group = dirsrv
+root_dn = cn=Directory Manager
+
+schema_dir = @instconfigdir@/slapd-{instance_name}/schema
+cert_dir = @instconfigdir@/slapd-{instance_name}
+
+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
+
--
2.4.11