浏览代码

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)
William Brown 9 年之前
父节点
当前提交
9034668327
共有 3 个文件被更改,包括 61 次插入3 次删除
  1. 7 3
      Makefile.am
  2. 3 0
      configure.ac
  3. 51 0
      ldap/admin/src/defaults.inf.in

+ 7 - 3
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

+ 3 - 0
configure.ac

@@ -239,6 +239,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
@@ -271,6 +272,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
@@ -390,6 +392,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)

+ 51 - 0
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
+