Submitted By:            Armin K. <krejzi at email dot com>
Date:                    2012-04-06
Initial Package Version: 2.4.30
Upstream Status:         BLFS Specific
Origin:                  Self
Description:             Patch changes various installation options, such as ldap database path,
                         configuration file options, slapd install location, etc.

--- openldap.orig/doc/man/man5/slapd-bdb.5	2012-02-29 18:37:09.000000000 +0100
+++ openldap/doc/man/man5/slapd-bdb.5	2012-04-06 00:18:54.171136608 +0200
@@ -131,7 +131,7 @@
 associated indexes live.
 A separate directory must be specified for each database.
 The default is
-.BR LOCALSTATEDIR/openldap\-data .
+.BR LOCALSTATEDIR/lib/openldap .
 .TP
 .B dirtyread
 Allow reads of modified but not yet committed data.
--- openldap.orig/doc/man/man5/slapd.conf.5	2012-02-29 18:37:09.000000000 +0100
+++ openldap/doc/man/man5/slapd.conf.5	2012-04-06 00:18:54.174136671 +0200
@@ -1987,7 +1987,7 @@
 # The database directory MUST exist prior to
 # running slapd AND should only be accessible
 # by the slapd/tools. Mode 0700 recommended.
-directory LOCALSTATEDIR/openldap\-data
+directory LOCALSTATEDIR/lib/openldap
 # Indices to maintain
 index     objectClass  eq
 index     cn,sn,mail   pres,eq,approx,sub
--- openldap.orig/doc/man/man5/slapd-config.5	2012-02-29 18:37:09.000000000 +0100
+++ openldap/doc/man/man5/slapd-config.5	2012-04-06 00:18:54.194137078 +0200
@@ -2029,7 +2029,7 @@
 # The database directory MUST exist prior to
 # running slapd AND should only be accessible
 # by the slapd/tools. Mode 0700 recommended.
-olcDbDirectory: LOCALSTATEDIR/openldap\-data
+olcDbDirectory: LOCALSTATEDIR/lib/openldap
 # Indices to maintain
 olcDbIndex:     objectClass  eq
 olcDbIndex:     cn,sn,mail   pres,eq,approx,sub
--- openldap.orig/include/ldap_defaults.h	2012-02-29 18:37:09.000000000 +0100
+++ openldap/include/ldap_defaults.h	2012-04-06 00:18:54.200137199 +0200
@@ -39,7 +39,7 @@
 #define LDAP_ENV_PREFIX "LDAP"
 
 /* default ldapi:// socket */
-#define LDAPI_SOCK LDAP_RUNDIR LDAP_DIRSEP "run" LDAP_DIRSEP "ldapi"
+#define LDAPI_SOCK LDAP_RUNDIR LDAP_DIRSEP "run" LDAP_DIRSEP "openldap" LDAP_DIRSEP "ldapi"
 
 /*
  * SLAPD DEFINITIONS
@@ -47,7 +47,7 @@
 	/* location of the default slapd config file */
 #define SLAPD_DEFAULT_CONFIGFILE	LDAP_SYSCONFDIR LDAP_DIRSEP "slapd.conf"
 #define SLAPD_DEFAULT_CONFIGDIR		LDAP_SYSCONFDIR LDAP_DIRSEP "slapd.d"
-#define SLAPD_DEFAULT_DB_DIR		LDAP_RUNDIR LDAP_DIRSEP "openldap-data"
+#define SLAPD_DEFAULT_DB_DIR		LDAP_RUNDIR LDAP_DIRSEP "lib" LDAP_DIRSEP "openldap"
 #define SLAPD_DEFAULT_DB_MODE		0600
 #define SLAPD_DEFAULT_UCDATA		LDAP_DATADIR LDAP_DIRSEP "ucdata"
 	/* default max deref depth for aliases */
--- openldap.orig/libraries/liblber/Makefile.in	2012-02-29 18:37:09.000000000 +0100
+++ openldap/libraries/liblber/Makefile.in	2012-04-06 00:18:54.204137280 +0200
@@ -48,6 +48,6 @@
 
 install-local: FORCE
 	-$(MKDIR) $(DESTDIR)$(libdir)
-	$(LTINSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(DESTDIR)$(libdir)
+	$(LTINSTALL) $(INSTALLFLAGS) -m 755 $(LIBRARY) $(DESTDIR)$(libdir)
 	$(LTFINISH) $(DESTDIR)$(libdir)
 
--- openldap.orig/libraries/libldap/Makefile.in	2012-02-29 18:37:09.000000000 +0100
+++ openldap/libraries/libldap/Makefile.in	2012-04-06 00:18:54.204137280 +0200
@@ -68,7 +68,7 @@
 
 install-local: $(CFFILES) FORCE
 	-$(MKDIR) $(DESTDIR)$(libdir)
-	$(LTINSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(DESTDIR)$(libdir)
+	$(LTINSTALL) $(INSTALLFLAGS) -m 755 $(LIBRARY) $(DESTDIR)$(libdir)
 	$(LTFINISH) $(DESTDIR)$(libdir)
 	-$(MKDIR) $(DESTDIR)$(sysconfdir)
 	@for i in $(CFFILES); do \
--- openldap.orig/libraries/libldap_r/Makefile.in	2012-02-29 18:37:09.000000000 +0100
+++ openldap/libraries/libldap_r/Makefile.in	2012-04-06 00:18:54.208137362 +0200
@@ -83,6 +83,6 @@
 
 install-local: $(CFFILES) FORCE
 	-$(MKDIR) $(DESTDIR)$(libdir)
-	$(LTINSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(DESTDIR)$(libdir)
+	$(LTINSTALL) $(INSTALLFLAGS) -m 755 $(LIBRARY) $(DESTDIR)$(libdir)
 	$(LTFINISH) $(DESTDIR)$(libdir)
 
--- openldap.orig/servers/slapd/Makefile.in	2012-02-29 18:37:09.000000000 +0100
+++ openldap/servers/slapd/Makefile.in	2012-04-06 00:18:54.208137362 +0200
@@ -370,10 +370,10 @@
 	install-conf install-db-config install-schema install-tools
 
 install-slapd: FORCE
-	-$(MKDIR) $(DESTDIR)$(libexecdir)
+	-$(MKDIR) $(DESTDIR)$(sbindir)
 	-$(MKDIR) $(DESTDIR)$(localstatedir)/run
 	$(LTINSTALL) $(INSTALLFLAGS) $(STRIP) -m 755 \
-		slapd$(EXEEXT) $(DESTDIR)$(libexecdir)
+		slapd$(EXEEXT) $(DESTDIR)$(sbindir)
 	@for i in $(SUBDIRS); do \
 	    if test -d $$i && test -f $$i/Makefile ; then \
 		echo; echo "  cd $$i; $(MAKE) $(MFLAGS) install"; \
@@ -439,9 +439,9 @@
 
 install-db-config: FORCE
 	@-$(MKDIR) $(DESTDIR)$(localstatedir) $(DESTDIR)$(sysconfdir)
-	@-$(INSTALL) -m 700 -d $(DESTDIR)$(localstatedir)/openldap-data
+	@-$(INSTALL) -m 700 -d $(DESTDIR)$(localstatedir)/lib/openldap
 	$(INSTALL) $(INSTALLFLAGS) -m 600 $(srcdir)/DB_CONFIG \
-		$(DESTDIR)$(localstatedir)/openldap-data/DB_CONFIG.example
+		$(DESTDIR)$(localstatedir)/lib/openldap/DB_CONFIG.example
 	$(INSTALL) $(INSTALLFLAGS) -m 600 $(srcdir)/DB_CONFIG \
 		$(DESTDIR)$(sysconfdir)/DB_CONFIG.example
 
@@ -449,6 +449,6 @@
 	-$(MKDIR) $(DESTDIR)$(sbindir)
 	for i in $(SLAPTOOLS); do \
 		$(RM) $(DESTDIR)$(sbindir)/$$i$(EXEEXT); \
-		$(LN_S) -f $(DESTDIR)$(libexecdir)/slapd$(EXEEXT) $(DESTDIR)$(sbindir)/$$i$(EXEEXT); \
+		$(LN_S) -f $(DESTDIR)$(sbindir)/slapd$(EXEEXT) $(DESTDIR)$(sbindir)/$$i$(EXEEXT); \
 	done
 
--- openldap.orig/servers/slapd/slapd.conf	2012-02-29 18:37:09.000000000 +0100
+++ openldap/servers/slapd/slapd.conf	2012-04-06 00:21:12.891992222 +0200
@@ -10,14 +10,12 @@
 # service AND an understanding of referrals.
 #referral	ldap://root.openldap.org
 
-pidfile		%LOCALSTATEDIR%/run/slapd.pid
-argsfile	%LOCALSTATEDIR%/run/slapd.args
+pidfile		%LOCALSTATEDIR%/run/openldap/slapd.pid
+argsfile	%LOCALSTATEDIR%/run/openldap/slapd.args
 
 # Load dynamic backend modules:
-# modulepath	%MODULEDIR%
-# moduleload	back_bdb.la
-# moduleload	back_hdb.la
-# moduleload	back_ldap.la
+modulepath	%MODULEDIR%
+moduleload	back_bdb
 
 # Sample security restrictions
 #	Require integrity protection (prevent hijacking)
@@ -46,20 +44,26 @@
 #
 # rootdn can always read and write EVERYTHING!
 
+# Specific Backend Directives for bdb:
+backend         bdb
+
 #######################################################################
 # BDB database definitions
 #######################################################################
 
 database	bdb
 suffix		"dc=my-domain,dc=com"
-rootdn		"cn=Manager,dc=my-domain,dc=com"
+#rootdn		"cn=Manager,dc=my-domain,dc=com"
+
 # Cleartext passwords, especially for the rootdn, should
 # be avoid.  See slappasswd(8) and slapd.conf(5) for details.
 # Use of strong authentication encouraged.
-rootpw		secret
+#rootpw		secret
+
 # The database directory MUST exist prior to running slapd AND 
 # should only be accessible by the slapd and slap tools.
 # Mode 700 recommended.
-directory	%LOCALSTATEDIR%/openldap-data
+directory	%LOCALSTATEDIR%/lib/openldap
+
 # Indices to maintain
 index	objectClass	eq
--- openldap.orig/servers/slapd/slapi/Makefile.in	2012-02-29 18:37:09.000000000 +0100
+++ openldap/servers/slapd/slapi/Makefile.in	2012-04-06 00:18:54.210137403 +0200
@@ -46,6 +46,6 @@
 install-local: FORCE
 	if test "$(BUILD_MOD)" = "yes"; then \
 		$(MKDIR) $(DESTDIR)$(libdir); \
-		$(LTINSTALL) $(INSTALLFLAGS) -m 644 $(LIBRARY) $(DESTDIR)$(libdir); \
+		$(LTINSTALL) $(INSTALLFLAGS) -m 755 $(LIBRARY) $(DESTDIR)$(libdir); \
 	fi