Browse Source

Resolves: #210947
Summary: parameterizing the hardcoded paths (phase 3. installed binaries, change log, setup)
Comment #23

Noriko Hosoi 19 years ago
parent
commit
1f66bb691f
49 changed files with 454 additions and 510 deletions
  1. 10 9
      components.mk
  2. 1 1
      internal_comp_deps.mk
  3. 4 4
      ldap/admin/src/Makefile
  4. 81 174
      ldap/admin/src/create_instance.c
  5. 12 7
      ldap/admin/src/create_instance.h
  6. 8 2
      ldap/admin/src/ds_newinst.pl
  7. 20 19
      ldap/admin/src/ns-newpwpolicy.pl
  8. 4 3
      ldap/admin/src/scripts/template-bak2db.pl
  9. 2 13
      ldap/admin/src/scripts/template-cl-dump.pl
  10. 4 2
      ldap/admin/src/scripts/template-db2bak.pl
  11. 8 5
      ldap/admin/src/scripts/template-db2index.pl
  12. 4 2
      ldap/admin/src/scripts/template-db2ldif.pl
  13. 4 3
      ldap/admin/src/scripts/template-ldif2db.pl
  14. 6 5
      ldap/admin/src/scripts/template-ns-accountstatus.pl
  15. 6 5
      ldap/admin/src/scripts/template-ns-activate.pl
  16. 6 5
      ldap/admin/src/scripts/template-ns-inactivate.pl
  17. 11 17
      ldap/admin/src/scripts/template-ns-newpwpolicy.pl
  18. 3 2
      ldap/admin/src/scripts/template-repl-monitor-cgi.pl
  19. 1 14
      ldap/admin/src/scripts/template-repl-monitor.pl
  20. 8 4
      ldap/admin/src/scripts/template-verify-db.pl
  21. 6 6
      ldap/admin/src/upgradeServer
  22. 130 124
      ldap/cm/Makefile
  23. 24 18
      ldap/cm/newinst/ns-update
  24. 52 27
      ldap/nsldap.mk
  25. 1 1
      ldap/servers/plugins/acl/Makefile
  26. 1 1
      ldap/servers/plugins/chainingdb/Makefile
  27. 2 2
      ldap/servers/plugins/collation/Makefile
  28. 2 2
      ldap/servers/plugins/cos/Makefile
  29. 1 1
      ldap/servers/plugins/distrib/Makefile
  30. 2 2
      ldap/servers/plugins/http/Makefile
  31. 1 1
      ldap/servers/plugins/pam_passthru/Makefile
  32. 1 1
      ldap/servers/plugins/passthru/Makefile
  33. 2 2
      ldap/servers/plugins/presence/Makefile
  34. 1 1
      ldap/servers/plugins/pwdstorage/Makefile
  35. 1 1
      ldap/servers/plugins/referint/Makefile
  36. 1 1
      ldap/servers/plugins/replication/Makefile
  37. 1 1
      ldap/servers/plugins/retrocl/Makefile
  38. 2 2
      ldap/servers/plugins/rever/Makefile
  39. 2 2
      ldap/servers/plugins/roles/Makefile
  40. 2 2
      ldap/servers/plugins/statechange/Makefile
  41. 1 1
      ldap/servers/plugins/syntaxes/Makefile
  42. 1 1
      ldap/servers/plugins/uiduniq/Makefile
  43. 2 2
      ldap/servers/plugins/vattrsp_template/Makefile
  44. 2 2
      ldap/servers/plugins/views/Makefile
  45. 1 1
      ldap/servers/slapd/back-ldbm/Makefile
  46. 1 1
      ldap/servers/slapd/tools/dbscan.c
  47. 3 3
      ldap/servers/slapd/tools/ldclt/Makefile
  48. 2 2
      ldap/servers/slapd/tools/rsearch/Makefile
  49. 3 3
      ldap/servers/snmp/Makefile

+ 10 - 9
components.mk

@@ -254,12 +254,12 @@ else
 endif
 
 # we need to package the root cert file in the alias directory
-PACKAGE_SRC_DEST += $(SECURITY_LIBPATH)/$(LIB_PREFIX)nssckbi.$(DLL_SUFFIX) alias
+PACKAGE_SRC_DEST += $(SECURITY_LIBPATH)/$(LIB_PREFIX)nssckbi.$(DLL_SUFFIX) etc/$(DS_BRAND)-ds
 
 # the security tools are wrapped with shell scripts so that the correct ld libpath can be set
 # so, when we package them, we rename them with a -bin extension e.g. certutil -> shared/bin/certutil-bin
 # the actual certutil will be an executable shell script that points to certutil-bin
-PACKAGE_SRC_DESTFILE += $(foreach prog,$(SECURITY_TOOLS),$(SECURITY_BINPATH)/$(prog)$(SPACE)shared/bin/$(prog)-bin)
+PACKAGE_SRC_DESTFILE += $(foreach prog,$(SECURITY_TOOLS),$(SECURITY_BINPATH)/$(prog)$(SPACE)usr/bin/$(prog)-bin)
 
 ### SECURITY END #############################
 
@@ -312,9 +312,10 @@ LDAPSDK_INCLUDE = -I$(LDAPSDK_INCDIR)
 LDAPSDK_TOOLS = $(wildcard $(LDAPSDK_BINPATH)/ldap*$(EXE_SUFFIX))
 BINS_TO_PKG_SHARED += $(LDAPSDK_TOOLS)
 # package the include files - needed for the plugin API
-LDAPSDK_INCLUDE_FILES = $(wildcard $(LDAPSDK_INCDIR)/*.h)
-PACKAGE_SRC_DEST += $(subst $(SPACE),$(SPACE)plugins/slapd/slapi/include$(SPACE),$(LDAPSDK_INCLUDE_FILES))
-PACKAGE_SRC_DEST += plugins/slapd/slapi/include
+#LDAPSDK_INCLUDE_FILES = $(wildcard $(LDAPSDK_INCDIR)/*.h)
+#PACKAGE_SRC_DEST += $(subst $(SPACE),$(SPACE)usr/share/$(DS_BRAND)-ds/plugins/slapi/include$(SPACE),$(LDAPSDK_INCLUDE_FILES))
+# _datadir/brand_ds/plugins/slapi/include
+#PACKAGE_SRC_DEST += usr/share/$(DS_BRAND)-ds/plugins/slapi/include
 
 ifeq ($(ARCH), WINNT)
   LDAP_LIBNAMES = ldapssl32v$(LDAP_SUF) ldap32v$(LDAP_SUF) ldappr32v$(LDAP_SUF)
@@ -519,7 +520,7 @@ else	# not WINNT
 endif	# not WINNT
 
 # libdb only needs to be in the server directory since only the server uses it
-PACKAGE_SRC_DEST += $(wildcard $(DB_LIBPATH)/*.$(DLL_SUFFIX)) bin/slapd/server
+PACKAGE_SRC_DEST += $(wildcard $(DB_LIBPATH)/*.$(DLL_SUFFIX)) usr/lib/$(DS_BRAND)-ds
 
 ### DB component (Berkeley DB) ############################
 
@@ -638,9 +639,9 @@ ifdef PERLDAP_SOURCE_ROOT
   PERLDAP_LIB_DIR = $(PERLDAP_BUILT_DIR)/lib/Mozilla
   PERLDAP_AUTOLIB_DIR = $(PERLDAP_BUILT_DIR)/lib/auto
   # under the serverroot/lib directory, we should have a perl directory which contains arch/, auto/, and Mozilla/
-  PACKAGE_SRC_DEST += $(PERLDAP_ARCHLIB_DIR) lib/perl
-  PACKAGE_SRC_DEST += $(PERLDAP_LIB_DIR) lib/perl
-  PACKAGE_SRC_DEST += $(PERLDAP_AUTOLIB_DIR) lib/perl
+  PACKAGE_SRC_DEST += $(PERLDAP_ARCHLIB_DIR) usr/lib/perl
+  PACKAGE_SRC_DEST += $(PERLDAP_LIB_DIR) usr/lib/perl
+  PACKAGE_SRC_DEST += $(PERLDAP_AUTOLIB_DIR) usr/lib/perl
 endif
 
 

+ 1 - 1
internal_comp_deps.mk

@@ -540,7 +540,7 @@ endif
 PERLDAP_COMPONENT_DIR = $(COMPONENTS_DIR_DEV)/perldap/$(PERLDAP_VERSION)/$(NSOBJDIR_NAME)
 PERLDAP_FILES=lib
 PERLDAP_DEP = $(PERLDAP_BUILT_DIR)/lib/perl
-PACKAGE_SRC_DEST += $(PERLDAP_DEP) lib
+PACKAGE_SRC_DEST += $(PERLDAP_DEP) usr/lib
 
 # this is the rule to pull PerLDAP
 ifndef PERLDAP_PULL_METHOD

+ 4 - 4
ldap/admin/src/Makefile

@@ -49,11 +49,11 @@ NSPR20=true	# probably should be defined somewhere else (not sure where)
 BINDIR=$(LDAP_ADMIN_BIN_RELDIR)
 OBJDEST=$(LDAP_ADMOBJDIR)
 
-SCRIPTSDIR=$(LDAP_BASE_RELDIR)/admin/scripts
-
 include $(BUILD_ROOT)/nsconfig.mk
 include $(LDAP_SRC)/nsldap.mk
 
+SCRIPTSDIR=$(RELDIR)/$(DS_ETCDIR)/script-templates
+
 ifeq ($(USE_ADMINSERVER), 1)
 MCC_INCLUDE += $(ADMINUTIL_INCLUDE)
 endif
@@ -242,7 +242,7 @@ TEMPLATE_SCRIPTS_SRC = $(wildcard scripts/template-*)
 TEMPLATE_SCRIPTS_DEST = $(subst scripts/,$(SCRIPTSDIR)/,$(TEMPLATE_SCRIPTS_SRC))
 
 # we wrap the security tools with a shell script wrapper for their ld libpath
-PACKAGE_SEC_TOOLS = $(addprefix $(RELDIR)/shared/bin/,$(SECURITY_TOOLS))
+PACKAGE_SEC_TOOLS = $(addprefix $(RELDIR)/usr/bin/,$(SECURITY_TOOLS))
 
 # We only need to do this if we have to ship 32 bit binaries in our 64 bit packages
 # Right now, on rhel/linux, we ship all native 64 bit apps so we don't have to do
@@ -385,7 +385,7 @@ $(SCRIPTSDIR)/template-%: scripts/template-% $(SCRIPTSDIR)
 	$(CP) $< $@
 	chmod +x $@
 
-$(RELDIR)/shared/bin/%: sec_tools_wrapper $(RELDIR)/shared/bin
+$(RELDIR)/usr/bin/%: sec_tools_wrapper $(RELDIR)/usr/bin
 	-@$(RM) $@
 	$(CP) $< $@
 	chmod +x $@

+ 81 - 174
ldap/admin/src/create_instance.c

@@ -256,9 +256,6 @@ void set_defaults(char *sroot, char *hn, server_config_s *conf)
     conf->servport = "389";
     conf->secserv = "off";
     conf->secservport = "636";
-    conf->ntsynch = "off";
-    conf->ntsynchssl = "on";
-    conf->ntsynchport = "5009";
     conf->rootpw = "";
     conf->roothashedpw = "";
     conf->loglevel = NULL;
@@ -448,13 +445,6 @@ static char *sanity_check(server_config_s *cf, char *param_name)
                 return t;
             }
         }
-        if ( cf->ntsynch && (strcmp(cf->ntsynch, "on") == 0) && (cf->ntsynchport != NULL) &&
-         (*(cf->ntsynchport) != '\0') ) {
-            if ( (t = create_instance_checkport(cf->bindaddr, cf->ntsynchport)) ) {
-                PL_strncpyz(param_name, "ntsynchport", BIG_LINE);
-                return t;
-            }
-        }
     }
 
     /* is the server identifier good? */
@@ -710,10 +700,11 @@ char *gen_perl_script_auto(char *s_root, char *cs_path, char *name,
         return NULL;
     }
 
-    PR_snprintf(ofn, sizeof(ofn), "%s%cbin%cslapd%cadmin%cscripts%ctemplate-%s",
-            cf->prefix, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP,
-            FILE_PATHSEP, name);
+    PR_snprintf(ofn, sizeof(ofn), "%s%c%s%cscript-templates%ctemplate-%s",
+            cf->sysconfdir, FILE_PATHSEP, cf->brand_ds,
+            FILE_PATHSEP, FILE_PATHSEP, name);
     PR_snprintf(fn, sizeof(fn), "%s%c%s", cs_path, FILE_PATHSEP, name);
+    create_instance_mkdir(cs_path, NEWDIR_MODE);
 #ifdef USE_NSPERL
     PR_snprintf(myperl, sizeof(myperl), "!%s%cbin%cslapd%cadmin%cbin%cperl",
             cf->prefix, FILE_PATHSEP, FILE_PATHSEP,
@@ -724,8 +715,8 @@ char *gen_perl_script_auto(char *s_root, char *cs_path, char *name,
 
     table[0][0] = "DS-ROOT";
     table[0][1] = cf->prefix;
-    table[1][0] = "MY-DS-ROOT";
-    table[1][1] = cs_path;
+    table[1][0] = "DS-BRAND";
+    table[1][1] = cf->brand_ds;
     table[2][0] = "SEP";
     table[2][1] = FILE_PATHSEPP;
     table[3][0] = "SERVER-NAME";
@@ -765,13 +756,19 @@ char *gen_perl_script_auto_for_migration(char *s_root, char *cs_path, char *name
     char myperl[PATH_SIZE];
     char fn[PATH_SIZE], ofn[PATH_SIZE];
     const char *table[12][2];
+    char *fnp = NULL;
+    int fnlen = 0;
 
-    PR_snprintf(ofn, sizeof(ofn), "%s%cbin%cslapd%cadmin%cscripts%ctemplate-%s",
-            cf->prefix, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP,
-            FILE_PATHSEP, FILE_PATHSEP, name);
-    PR_snprintf(fn, sizeof(fn), "%s%cbin%cslapd%cadmin%cbin%c%s",
-            cf->prefix, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP,
+    PR_snprintf(ofn, sizeof(ofn), "%s%c%s%cscript-templates%ctemplate-%s",
+            cf->sysconfdir, FILE_PATHSEP, cf->brand_ds,
             FILE_PATHSEP, FILE_PATHSEP, name);
+    PR_snprintf(fn, sizeof(fn),   "%s%c%s%cbin",
+            cf->sysconfdir, FILE_PATHSEP, cf->brand_ds, FILE_PATHSEP);
+    create_instance_mkdir(fn, NEWDIR_MODE);
+    fnlen = strlen(fn);
+    fnp = fn + fnlen;
+    PR_snprintf(fnp, sizeof(fn) - fnlen,   "%c%s", FILE_PATHSEP, name);
+
 #ifdef USE_NSPERL
     PR_snprintf(myperl, sizeof(myperl), "!%s%cbin%cslapd%cadmin%cbin%cperl",
             cf->prefix, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP,
@@ -782,8 +779,8 @@ char *gen_perl_script_auto_for_migration(char *s_root, char *cs_path, char *name
 
     table[0][0] = "DS-ROOT";
     table[0][1] = cf->prefix;
-    table[1][0] = "MY-DS-ROOT";
-    table[1][1] = cs_path;
+    table[1][0] = "DS-BRAND";
+    table[1][1] = cf->brand_ds;
     table[2][0] = "SEP";
     table[2][1] = FILE_PATHSEPP;
     table[3][0] = "SERVER-NAME";
@@ -1171,11 +1168,7 @@ create_scripts(server_config_s *cf, char *param_name)
             "        rm -f $PIDFILE\n"
             "    fi\n"
             "fi\n"
-#if 0
             "cd %s; ./%s -D %s -i %s/pid -w $STARTPIDFILE \"$@\"\n"
-#else /* will go away */
-            "cd %s/bin/slapd/server; ./%s -D %s -i %s/pid -w $STARTPIDFILE \"$@\"\n"
-#endif
             "if [ $? -ne 0 ]; then\n"
             "    exit 1\n"
             "fi\n"
@@ -1218,7 +1211,7 @@ create_scripts(server_config_s *cf, char *param_name)
             "exit 1\n",
             sroot, DS_CONFIG_DIR, cf->config_dir, DS_CONFIG_DIR, cf->run_dir,
             cf->run_dir, PRODUCT_BIN, PRODUCT_BIN,
-            cf->prefix, PRODUCT_BIN, cf->config_dir, cf->run_dir
+            cf->sroot, PRODUCT_BIN, cf->config_dir, cf->run_dir
         );
     }
     if(t) return t;
@@ -1380,9 +1373,8 @@ out:
 /* ---------------------- Create configuration files ---------------------- */
 char *create_server(server_config_s *cf, char *param_name)
 {
-#if 0
+#if defined (BUILD_PRESENCE)
     char line[PATH_SIZE]
-    char subdir[PATH_SIZE];
 #endif
     char *t, *sroot = cf->sroot;
     struct passwd *pw = getpwnam(cf->servuser);
@@ -1461,12 +1453,6 @@ char *create_server(server_config_s *cf, char *param_name)
     if( (create_instance_mkdir_p("cert dir", cf->cert_dir, NEWSECDIR_MODE, pw)) )
         return make_error("make cert dir %s failed (%s)",
                           cf->cert_dir, ds_system_errmsg());
-# if 0
-    /* Create httpacl directory */
-    PR_snprintf(line, sizeof(line), "%s%chttpacl", cf->sroot, FILE_PATHSEP); 
-    if( (create_instance_mkdir(line, NEWDIR_MODE)) )
-        return make_error("mkdir %s failed (%s)", line, ds_system_errmsg());
-#endif
     t = create_scripts(cf, param_name);
     if(t) return t;
 
@@ -2069,16 +2055,9 @@ ds_cre_subdirs(server_config_s *cf, struct passwd* pw)
 char *ds_gen_scripts(char *sroot, server_config_s *cf, char *cs_path)
 {
     char *t = NULL;
-#if 0
     char *server = sroot;
     char *admin = sroot;
     char *tools = cf->bindir;
-    char cgics_path[PATH_SIZE];
-#else
-    char server[PATH_SIZE];
-    char admin[PATH_SIZE];
-    char tools[PATH_SIZE];
-#endif
     char *cl_scripts[7] = {"dsstop", "dsstart", "dsrestart", "dsrestore", "dsbackup", "dsimport", "dsexport"};
     char *cl_javafiles[7] = {"DSStop", "DSStart", "DSRestart", "DSRestore", "DSBackup", "DSImport", "DSExport"};
     int  cls = 0; /*Index into commandline script names and java names - RJP*/
@@ -2094,16 +2073,6 @@ char *ds_gen_scripts(char *sroot, server_config_s *cf, char *cs_path)
     mysroot = sroot;
     mycs_path = cs_path;
 
-#if 0
-    /* nothing to do for server, admin, tools */
-    PR_snprintf(cgics_path, sizeof(cgics_path), "%s%cbin%cadmin%cadmin%cbin",
-            cf->prefix, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP);
-
-#else /* will go away */
-    PR_snprintf(server, sizeof(server), "%s/bin/"PRODUCT_NAME"/server", cf->prefix); 
-    PR_snprintf(admin, sizeof(admin), "%s/bin/"PRODUCT_NAME"/admin/bin", cf->prefix);
-    PR_snprintf(tools, sizeof(tools), "%s/shared/bin", cf->prefix);    
-#endif
     t = gen_script(cs_path, "monitor", 
            "if [ \"x$1\" != \"x\" ];\nthen MDN=\"$1\";\nelse MDN=\"cn=monitor\";\n fi\n"
 
@@ -3184,7 +3153,7 @@ suffix_gen_conf(FILE* f, char * suffix, char *be_name)
     fprintf(f, "objectclass: nsSlapdPlugin\n"); \
     fprintf(f, "objectclass: extensibleObject\n"); \
     fprintf(f, "cn: %s\n",(_name)); \
-    fprintf(f, "nsslapd-pluginpath: %s/lib/syntax-plugin%s\n", prefix, shared_lib); \
+    fprintf(f, "nsslapd-pluginpath: %s/libsyntax-plugin%s\n", cf->plugin_dir, shared_lib); \
     fprintf(f, "nsslapd-plugininitfunc: %s\n", (_fn)); \
     fprintf(f, "nsslapd-plugintype: syntax\n"); \
     fprintf(f, "nsslapd-pluginenabled: on\n"); \
@@ -3306,7 +3275,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: top\n");
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "cn: SSHA\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libpwdstorage-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: ssha_pwd_storage_scheme_init\n");
     fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3316,7 +3285,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: top\n");
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "cn: SSHA256\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libpwdstorage-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: ssha256_pwd_storage_scheme_init\n");
     fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3326,7 +3295,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: top\n");
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "cn: SSHA384\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libpwdstorage-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: ssha384_pwd_storage_scheme_init\n");
     fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3336,7 +3305,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: top\n");
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "cn: SSHA512\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libpwdstorage-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: ssha512_pwd_storage_scheme_init\n");
     fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3346,7 +3315,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: top\n");
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "cn: SHA\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libpwdstorage-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: sha_pwd_storage_scheme_init\n");
     fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3356,7 +3325,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: top\n");
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "cn: SHA256\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libpwdstorage-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: sha256_pwd_storage_scheme_init\n");
     fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3366,7 +3335,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: top\n");
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "cn: SHA384\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libpwdstorage-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: sha384_pwd_storage_scheme_init\n");
     fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3376,7 +3345,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: top\n");
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "cn: SHA512\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libpwdstorage-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: sha512_pwd_storage_scheme_init\n");
     fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3387,7 +3356,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: top\n");
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "cn: CRYPT\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libpwdstorage-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: crypt_pwd_storage_scheme_init\n");
     fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3398,7 +3367,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: top\n");
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "cn: MD5\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libpwdstorage-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: md5_pwd_storage_scheme_init\n");
     fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3408,7 +3377,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: top\n");
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "cn: CLEAR\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libpwdstorage-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: clear_pwd_storage_scheme_init\n");
     fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3418,7 +3387,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: top\n");
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "cn: NS-MTA-MD5\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/pwdstorage-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libpwdstorage-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: ns_mta_md5_pwd_storage_scheme_init\n");
     fprintf(f, "nsslapd-plugintype: pwdstoragescheme\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3429,7 +3398,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: DES\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/des-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libdes-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: des_init\n");
     fprintf(f, "nsslapd-plugintype: reverpwdstoragescheme\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3459,7 +3428,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: State Change Plugin\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/statechange-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libstatechange-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: statechange_init\n");
     fprintf(f, "nsslapd-plugintype: postoperation\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3470,7 +3439,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: Roles Plugin\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/roles-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libroles-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: roles_init\n");
      fprintf(f, "nsslapd-plugintype: postoperation\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3484,7 +3453,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: ACL Plugin\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/acl-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libacl-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: acl_init\n");
     fprintf(f, "nsslapd-plugintype: accesscontrol\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3496,7 +3465,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: ACL preoperation\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/acl-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libacl-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: acl_preopInit\n");
     fprintf(f, "nsslapd-plugintype: preoperation\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3508,7 +3477,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: Legacy Replication Plugin\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/replication-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libreplication-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: replication_legacy_plugin_init\n");
     fprintf(f, "nsslapd-plugintype: object\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3521,7 +3490,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: Multimaster Replication Plugin\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/replication-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libreplication-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: replication_multimaster_plugin_init\n");
     fprintf(f, "nsslapd-plugintype: object\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3534,7 +3503,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: Retro Changelog Plugin\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/retrocl-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libretrocl-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: retrocl_plugin_init\n");
     fprintf(f, "nsslapd-plugintype: object\n");
     fprintf(f, "nsslapd-pluginenabled: off\n");
@@ -3548,7 +3517,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: Class of Service\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/cos-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libcos-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: cos_init\n");
     fprintf(f, "nsslapd-plugintype: postoperation\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3562,7 +3531,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: Views\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/views-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libviews-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: views_init\n");
     fprintf(f, "nsslapd-plugintype: object\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3579,7 +3548,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: referential integrity postoperation\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/referint-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libreferint-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: referint_postop_init\n");
     fprintf(f, "nsslapd-plugintype: postoperation\n");
     fprintf(f, "nsslapd-pluginenabled: off\n");
@@ -3592,31 +3561,6 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
      fprintf(f, "nsslapd-pluginArg6: seeAlso\n");
     fprintf(f, "nsslapd-plugin-depends-on-type: database\n");
     fprintf(f, "\n");
-/*
-    NT synch is dead as of 5.0
-
-    fprintf(f, "dn: cn=ntSynchService preoperation,cn=plugins,cn=config\n");
-    fprintf(f, "objectclass: top\n");
-    fprintf(f, "objectclass: nsSlapdPlugin\n");
-    fprintf(f, "objectclass: extensibleObject\n");
-    fprintf(f, "cn: ntSynchService preoperation\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/ntsynch-plugin%s\n", prefix, shared_lib);
-    fprintf(f, "nsslapd-plugininitfunc: libntsynch_plugin_preop_init\n");
-    fprintf(f, "nsslapd-plugintype: preoperation\n");
-    fprintf(f, "nsslapd-pluginenabled: on\n");
-    fprintf(f, "\n");
-
-    fprintf(f, "dn: cn=ntSynchService postoperation,cn=plugins,cn=config\n");
-    fprintf(f, "objectclass: top\n");
-    fprintf(f, "objectclass: nsSlapdPlugin\n");
-    fprintf(f, "objectclass: extensibleObject\n");
-    fprintf(f, "cn: ntSynchService postoperation\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/ntsynch-plugin%s\n", prefix, shared_lib);
-    fprintf(f, "nsslapd-plugininitfunc: libntsynch_plugin_postop_init\n");
-    fprintf(f, "nsslapd-plugintype: postoperation\n");
-    fprintf(f, "nsslapd-pluginenabled: on\n");
-    fprintf(f, "\n");
-*/
     if (!cf->use_existing_user_ds) {
         t = cf->suffix;
     } else {
@@ -3632,7 +3576,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: attribute uniqueness\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/attr-unique-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libattr-unique-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: NSUniqueAttr_Init\n");
     fprintf(f, "nsslapd-plugintype: preoperation\n");
     fprintf(f, "nsslapd-pluginenabled: off\n");
@@ -3646,7 +3590,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: 7-bit check\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/attr-unique-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libattr-unique-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: NS7bitAttr_Init\n");
     fprintf(f, "nsslapd-plugintype: preoperation\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3665,7 +3609,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: Internationalization Plugin\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/liblcoll%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libcollation-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: orderingRule_init\n");
     fprintf(f, "nsslapd-plugintype: matchingRule\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3678,7 +3622,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: HTTP Client\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/http-client-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libhttp-client-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: http_client_init\n");
     fprintf(f, "nsslapd-plugintype: preoperation\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3692,7 +3636,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: Presence\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/presence-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libpresence-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: presence_init\n");
     fprintf(f, "nsslapd-plugintype: preoperation\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3774,7 +3718,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
             fprintf(f, "objectclass: nsSlapdPlugin\n");
             fprintf(f, "objectclass: extensibleObject\n");
             fprintf(f, "cn: Pass Through Authentication\n");
-            fprintf(f, "nsslapd-pluginpath: %s/lib/passthru-plugin%s\n", prefix, shared_lib);
+            fprintf(f, "nsslapd-pluginpath: %s/libpassthru-plugin%s\n", cf->plugin_dir, shared_lib);
             fprintf(f, "nsslapd-plugininitfunc: passthruauth_init\n");
             fprintf(f, "nsslapd-plugintype: preoperation\n");
             fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3791,7 +3735,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
         fprintf(f, "objectclass: nsSlapdPlugin\n");
         fprintf(f, "objectclass: extensibleObject\n");
         fprintf(f, "cn: Pass Through Authentication\n");
-        fprintf(f, "nsslapd-pluginpath: %s/lib/passthru-plugin%s\n", prefix, shared_lib);
+        fprintf(f, "nsslapd-pluginpath: %s/libpassthru-plugin%s\n", cf->plugin_dir, shared_lib);
         fprintf(f, "nsslapd-plugininitfunc: passthruauth_init\n");
         fprintf(f, "nsslapd-plugintype: preoperation\n");
         fprintf(f, "nsslapd-pluginenabled: off\n");
@@ -3808,7 +3752,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "objectclass: pamConfig\n");
     fprintf(f, "cn: PAM Pass Through Auth\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/pam-passthru-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libpam-passthru-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: pam_passthruauth_init\n");
     fprintf(f, "nsslapd-plugintype: preoperation\n");
     fprintf(f, "nsslapd-pluginenabled: off\n");
@@ -3832,7 +3776,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: ldbm database\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/libback-ldbm%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libback-ldbm%s\n", cf->sroot, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: ldbm_back_init\n");
     fprintf(f, "nsslapd-plugintype: database\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -3887,7 +3831,7 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     fprintf(f, "objectclass: nsSlapdPlugin\n");
     fprintf(f, "objectclass: extensibleObject\n");
     fprintf(f, "cn: chaining database\n");
-    fprintf(f, "nsslapd-pluginpath: %s/lib/chainingdb-plugin%s\n", prefix, shared_lib);
+    fprintf(f, "nsslapd-pluginpath: %s/libchainingdb-plugin%s\n", cf->plugin_dir, shared_lib);
     fprintf(f, "nsslapd-plugininitfunc: chaining_back_init\n");
     fprintf(f, "nsslapd-plugintype: database\n");
     fprintf(f, "nsslapd-pluginenabled: on\n");
@@ -4024,15 +3968,15 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     create_instance_copy(src, dest, 0600, 0 );
 
     /* install certmap.conf at <configdir> */
-    PR_snprintf(src, sizeof(src), "%s/bin/slapd/install/config/certmap.conf",
-                cf->prefix);
+    PR_snprintf(src, sizeof(src), "%s%c%s%c/config/certmap.conf",
+                cf->sysconfdir, FILE_PATHSEP, cf->brand_ds, FILE_PATHSEP);
     PR_snprintf(dest, sizeof(dest), "%s/certmap.conf", cf->config_dir);
     create_instance_copy(src, dest, 0600, 0 );
 
     /* generate <confdir>/slapd-collations.conf */
-    PR_snprintf(src, sizeof(src),
-                "%s/bin/slapd/install/config/%s-collations.conf",
-                cf->prefix, PRODUCT_NAME);
+    PR_snprintf(src, sizeof(src), "%s%c%s%c/config/%s-collations.conf",
+                cf->sysconfdir, FILE_PATHSEP, cf->brand_ds,
+                FILE_PATHSEP, PRODUCT_NAME);
     PR_snprintf(dest, sizeof(dest), "%s%c%s-collations.conf",
             cf->config_dir, FILE_PATHSEP, PRODUCT_NAME);
     if (!(srcf = fopen(src, "r"))) {
@@ -4056,12 +4000,14 @@ char *ds_gen_confs(char *sroot, server_config_s *cf, char *cs_path)
     /*
      * <sysconfdir>/BRAND_DS/schema to schema_dir
      */
-    PR_snprintf(src, sizeof(src), "%s/bin/slapd/install/schema", cf->prefix);
+    PR_snprintf(src, sizeof(src), "%s%c%s%cschema", 
+        cf->sysconfdir, FILE_PATHSEP, cf->brand_ds, FILE_PATHSEP);
     if (NULL != (t = ds_copy_group_files(src, cf->schema_dir, 0)))
         return t;
         
 #if defined (BUILD_PRESENCE)
-    PR_snprintf(src, sizeof(src), "%s/bin/slapd/install/presence", cf->prefix);
+    PR_snprintf(src, sizeof(src), "%s%c%s%c/config/presence",
+                cf->sysconfdir, FILE_PATHSEP, cf->brand_ds, FILE_PATHSEP);
     PR_snprintf(dest, sizeof(dest), "%s/presence", cf->config_dir);
     if (t = ds_copy_group_files(src, dest, 0))
         return t;
@@ -4511,42 +4457,6 @@ static char *install_ds(char *sroot, server_config_s *cf, char *param_name)
     if ( (t = ds_gen_confs(sroot, cf, cf->inst_dir)) )
         return(t);
 
-    PR_snprintf(src, sizeof(src),
-                "%s%cbin%c"PRODUCT_NAME"%cinstall%cldif%cExample.ldif",
-                cf->prefix, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP,
-                FILE_PATHSEP, FILE_PATHSEP);
-    PR_snprintf(dest, sizeof(dest), "%s%cExample.ldif",
-                cf->ldif_dir, FILE_PATHSEP);
-    create_instance_copy(src, dest, NEWFILE_MODE, 1);
-    chownfile (pw, dest);
-
-    PR_snprintf(src, sizeof(src),
-                "%s%cbin%c"PRODUCT_NAME"%cinstall%cldif%cExample-roles.ldif",
-                cf->prefix, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP,
-                FILE_PATHSEP, FILE_PATHSEP);
-    PR_snprintf(dest, sizeof(dest), "%s%cExample-roles.ldif",
-                cf->ldif_dir, FILE_PATHSEP);
-    create_instance_copy(src, dest, NEWFILE_MODE, 1);
-    chownfile (pw, dest);
-
-    PR_snprintf(src, sizeof(src),
-                "%s%cbin%c"PRODUCT_NAME"%cinstall%cldif%cExample-views.ldif",
-                cf->prefix, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP,
-                FILE_PATHSEP, FILE_PATHSEP);
-    PR_snprintf(dest, sizeof(dest), "%s%cExample-views.ldif",
-                cf->ldif_dir, FILE_PATHSEP);
-    create_instance_copy(src, dest, NEWFILE_MODE, 1);
-    chownfile (pw, dest);
-
-    PR_snprintf(src, sizeof(src),
-                "%s%cbin%c"PRODUCT_NAME"%cinstall%cldif%cEuropean.ldif",
-                cf->prefix, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP,
-                FILE_PATHSEP, FILE_PATHSEP);
-    PR_snprintf(dest, sizeof(dest), "%s%cEuropean.ldif",
-                cf->ldif_dir, FILE_PATHSEP);
-    create_instance_copy(src, dest, NEWFILE_MODE, 1);
-    chownfile (pw, dest);
-
 #ifdef DSML
     /* new code for dsml sample files */
     PR_snprintf(src, sizeof(src),
@@ -4873,7 +4783,7 @@ set_path_attribute(char *attr, char *defaultval, char *prefix)
 /* ------ Parse the results of a form and create a server from them ------- */
 /*
  * FHS description
- * cf->prefix: %{_prefix}
+ * cf->prefix: %{_prefix} 
  * cf->sroot: %{_libdir}/BRAND_DS 
  * cf->localstatedir: %{_localstatedir}
  * cf->sysconfdir: %{_sysconfdir}
@@ -4889,14 +4799,16 @@ set_path_attribute(char *attr, char *defaultval, char *prefix)
  * cf->db_dir: <localstatedir>/lib/slapd-<servid>/db
  * cf->bak_dir: <localstatedir>/lib/slapd-<servid>/bak
  * cf->tmp_dir: <localstatedir>/tmp/slapd-<servid>
- * cf->ldif_dir: <datadir>/<brand-ds>/slapd-<servid>
+ * cf->ldif_dir: <datadir>/<brand-ds>/ldif
  * cf->cert_dir: <sysconfdir>/BRAND_DS/slapd-<servid>
+ * cf->plugin_dir: <sroot>/plugins
  *
- * NOTE: If prefix is given, all the other paths start from prefix.
- * NETSITE_ROOT is treated as a secondary prefix.  (If prefix is also set,
- * it's ignored.  If prefix is not set, NETSITE_ROOT becomes prefix.
- * If both are not set, the paths start from '/'.)
- * Therefore, NETSITE_ROOT is not mandatory any more.
+ * NOTES: 
+ *    If prefix is given, all the other paths start from prefix.
+ *    NETSITE_ROOT is treated as a secondary prefix.  (If prefix is also set,
+ *    it's ignored.  If prefix is not set, NETSITE_ROOT becomes prefix.
+ *    If both are not set, the paths start from '/'.)
+ *    Therefore, NETSITE_ROOT is not mandatory any more.
  */
 
 int parse_form(server_config_s *cf)
@@ -4907,18 +4819,10 @@ int parse_form(server_config_s *cf)
     char *cfg_sspt_uid_pw2 = NULL;
     char *temp = NULL;
     char *prefix = NULL;
+    int prefixlen = 0;
     LDAPURLDesc *desc = 0;
 
     cf->brand_ds = BRAND_DS;
-    prefix = getenv("NETSITE_ROOT");
-#if 0
-    if (NULL == temp) {
-        ds_report_error (DS_INCORRECT_USAGE,
-            " NETSITE_ROOT environment variable not set.",
-            "The environment variable NETSITE_ROOT must be set to the server root directory.");
-        return 1;
-    }
-#endif
     if (rm && qs && !strcmp(rm, "GET"))
     {
         ds_get_begin(qs);
@@ -4934,16 +4838,19 @@ int parse_form(server_config_s *cf)
     }
     /* else we are being called from server installation; no output */
 
+    prefix = getenv("NETSITE_ROOT");
     temp = ds_a_get_cgi_var("prefix", NULL, NULL);
     if (NULL != temp) {
         prefix = cf->prefix = PL_strdup(temp);
     } else if (NULL != prefix) {
-        cf->prefix = prefix;
+        cf->prefix = PL_strdup(prefix); /* value of NETSITE_ROOT */
     } else {
-        prefix = cf->prefix = "";
+        prefix = cf->prefix = PL_strdup("/");
     }
-    cf->sroot = PR_smprintf("%s%clib%c%s",
-                            prefix, FILE_PATHSEP, FILE_PATHSEP, cf->brand_ds);
+
+    cf->sroot = PR_smprintf("%s%cusr%clib%c%s",
+                prefix, FILE_PATHSEP, FILE_PATHSEP, FILE_PATHSEP, cf->brand_ds);
+    cf->plugin_dir = PR_smprintf("%s%cplugins", cf->sroot, FILE_PATHSEP);
 
     if (!(cf->servname = ds_a_get_cgi_var("servname", "Server Name",
                                           "Please give a hostname for your server.")))

+ 12 - 7
ldap/admin/src/create_instance.h

@@ -54,13 +54,20 @@ extern "C" {            /* Assume C declarations for C++ */
 #ifdef XP_UNIX
 #define PRODUCT_NAME    "slapd"
 #define PRODUCT_BIN     "ns-slapd"
-#endif
-
 #define LOCALSTATEDIR   "/var"
 #define SYSCONFDIR      "/etc"
-#define BINDIR          "/bin"
-#define DATADIR         "/share"
+#define BINDIR          "/usr/bin"
+#define DATADIR         "/usr/share"
 #define DOCDIR          "/usr/doc"
+#else # Windows
+#define PRODUCT_NAME    "slapd"
+#define PRODUCT_BIN     "slapd"
+#define LOCALSTATEDIR   "\\var"
+#define SYSCONFDIR      "\\etc"
+#define BINDIR          "\\usr\\bin"
+#define DATADIR         "\\usr\\share"
+#define DOCDIR          "\\usr\\doc"
+#endif
 
 typedef struct {
     char *sroot; /* _libdir */
@@ -82,9 +89,6 @@ typedef struct {
     char *cfg_sspt_uidpw;
     char *secserv;
     char *secservport;
-    char *ntsynch;
-    char *ntsynchssl;
-    char *ntsynchport;
     char *rootdn;
     char *rootpw;    
     char *roothashedpw;
@@ -129,6 +133,7 @@ typedef struct {
     char *db_dir;
     char *bak_dir;
     char *ldif_dir;
+    char *plugin_dir;
     char *tmp_dir;
     char *cert_dir;
     char *prefix;

+ 8 - 2
ldap/admin/src/ds_newinst.pl

@@ -165,6 +165,7 @@ close IN;
 # next, construct a hash table with our arguments
 
 my %cgiargs = ();
+my $brand_ds = "fedora-ds";
 
 # the following items are always required
 addAndCheck(\%cgiargs, "sroot", \%table, "General", "ServerRoot");
@@ -214,7 +215,12 @@ if ($table{General}->{UserDirectoryLdapURL}) {
 }
 
 if ($table{General}->{prefix}) {
-	$cgiargs{prefix} = $table{General}->{prefix};
+	$prefix = $table{General}->{prefix};
+}
+$cgiargs{prefix} = $prefix;
+
+if ($table{General}->{BrandDs}) {
+	$brand_ds = $table{General}->{BrandDs};
 }
 
 # populate the DS with this file - the suffix in this file must
@@ -230,7 +236,7 @@ $cgiargs{start_server} = 1;
 my $sroot = $cgiargs{sroot};
 
 my $rc = &cgiFake($sroot, $verbose,
-				  $sroot . "/bin/slapd/admin/bin/ds_newinst",
+				  $prefix . "/usr/lib/$brand_ds/ds_newinst",
 				  \%cgiargs);
 
 if (!$rc) {

+ 20 - 19
ldap/admin/src/ns-newpwpolicy.pl

@@ -42,25 +42,26 @@
 # enable the use of our bundled perldap with our bundled ldapsdk libraries
 # all of this nonsense can be omitted if the mozldapsdk and perldap are
 # installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
-BEGIN {
-	my $savedir = `pwd`;
-	my $dirname = `dirname $0`;
-	chdir $dirname;
-	my $sroot = `pwd`;
-	$sroot =~ s@/slapd-.*@@;
-	chomp($sroot);
-	chdir $savedir;
-	push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
-	if ($ENV{LD_LIBRARY_PATH}) {
-		$ENV{LD_LIBRARY_PATH} .= ":";
-	}
-	$ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
-	# this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
-	if ($ENV{SHLIB_PATH}) {
-		$ENV{SHLIB_PATH} .= ":";
-	}
-	$ENV{SHLIB_PATH} .= "$sroot/shared/lib";
-}
+#BEGIN {
+#	my $savedir = `pwd`;
+#	my $dirname = `dirname $0`;
+#	chdir $dirname;
+#	my $sroot = `pwd`;
+#	$sroot =~ s@/slapd-.*@@;
+#	chomp($sroot);
+#	chdir $savedir;
+#	push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
+#	if ($ENV{LD_LIBRARY_PATH}) {
+#		$ENV{LD_LIBRARY_PATH} .= ":";
+#	}
+#	$ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
+#	# this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
+#	if ($ENV{SHLIB_PATH}) {
+#		$ENV{SHLIB_PATH} .= ":";
+#	}
+#	$ENV{SHLIB_PATH} .= "$sroot/shared/lib";
+#}
+$ENV{'LD_LIBRARY_PATH'} = "$prefix{{SEP}}usr{{SEP}}lib:{{SEP}}usr{{SEP}}lib{{SEP}}mozldap6:{{SEP}}usr{{SEP}}lib{{SEP}}dirsec";
 # Add new password policy specific entries
 
 #############################################################################

+ 4 - 3
ldap/admin/src/scripts/template-bak2db.pl

@@ -56,7 +56,6 @@ $archivedir = "";
 $dbtype = "ldbm database";
 $instance = "";
 $prefix = "{{DS-ROOT}}";
-$mydsroot = "{{MY-DS-ROOT}}";
 $verbose = 0;
 $rootdn = "";
 $passwd = "";
@@ -127,7 +126,9 @@ $nsdbtype = "nsDatabaseType: $dbtype\n";
 $entry = "${dn}${misc}${cn}${nsinstance}${nsarchivedir}${nsdbtype}";
 $vstr = "";
 if ($verbose != 0) { $vstr = "-v"; }
-chdir("$prefix{{SEP}}shared{{SEP}}bin");
-open(FOO, "| $prefix{{SEP}}shared{{SEP}}bin{{SEP}}ldapmodify $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -a" );
+$ENV{'PATH'} = '$prefix/usr/lib/mozldap6:$prefix/usr/lib:/usr/lib/mozldap6:/usr/lib';
+$ENV{'LD_LIBRARY_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+$ENV{'SHLIB_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+open(FOO, "| ldapmodify $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -a" );
 print(FOO "$entry");
 close(FOO);

+ 2 - 13
ldap/admin/src/scripts/template-cl-dump.pl

@@ -99,19 +99,8 @@
 # enable the use of our bundled perldap with our bundled ldapsdk libraries
 # all of this nonsense can be omitted if the mozldapsdk and perldap are
 # installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
-BEGIN {
-	my $sroot = "{{DS-ROOT}}";
-	push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
-	if ($ENV{LD_LIBRARY_PATH}) {
-		$ENV{LD_LIBRARY_PATH} .= ":";
-	}
-	$ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
-	# this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
-	if ($ENV{SHLIB_PATH}) {
-		$ENV{SHLIB_PATH} .= ":";
-	}
-	$ENV{SHLIB_PATH} .= "$sroot/shared/lib";
-}
+$ENV{'LD_LIBRARY_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+$ENV{'SHLIB_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
 
 $usage="Usage: $0 [-h host] [-p port] [-D bind-dn] [-w bind-password | -P bind-cert] [-r replica-roots] [-o output-file] [-c] [-v]\n\n       $0 -i changelog-ldif-file-with-base64encoding [-o output-file] [-c]";
 

+ 4 - 2
ldap/admin/src/scripts/template-db2bak.pl

@@ -115,7 +115,9 @@ $nsdbtype = "nsDatabaseType: $dbtype\n";
 $entry = "${dn}${misc}${cn}${nsarchivedir}${nsdbtype}";
 $vstr = "";
 if ($verbose != 0) { $vstr = "-v"; }
-chdir("$prefix{{SEP}}shared{{SEP}}bin");
-open(FOO, "| $prefix{{SEP}}shared{{SEP}}bin{{SEP}}ldapmodify $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -a" );
+$ENV{'PATH'} = '$prefix/usr/lib/mozldap6:$prefix/usr/lib:/usr/lib/mozldap6:/usr/lib';
+$ENV{'LD_LIBRARY_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+$ENV{'SHLIB_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+open(FOO, "| ldapmodify $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -a" );
 print(FOO "$entry");
 close(FOO);

+ 8 - 5
ldap/admin/src/scripts/template-db2index.pl

@@ -67,6 +67,10 @@ $verbose = 0;
 
 $prefix = "{{DS-ROOT}}";
 
+$ENV{'PATH'} = '$prefix/usr/lib/mozldap6:$prefix/usr/lib:/usr/lib/mozldap6:/usr/lib';
+$ENV{'LD_LIBRARY_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+$ENV{'SHLIB_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+
 $i = 0;
 while ($i <= $#ARGV) 
 {
@@ -162,13 +166,12 @@ $attribute="";
 $indexes_list="";
 $vlvattribute="";
 $vlvindexes_list="";
-chdir("$prefix{{SEP}}shared{{SEP}}bin");
+chdir("$prefix{{SEP}}usr{{SEP}}bin");
 if ( $attribute_arg eq "" && $vlvattribute_arg eq "" )
 {
     # Get the list of indexes from the entry
-    $indexes_list="$prefix{{SEP}}shared{{SEP}}bin{{SEP}}ldapsearch $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -s one " .
+    $indexes_list="ldapsearch $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -s one " .
     "-b \"cn=index,cn=\"$instance\", cn=ldbm database,cn=plugins,cn=config\" \"(&(objectclass=*)(nsSystemIndex=false))\" cn";
-
     # build the values of the attribute nsIndexAttribute
     open(LDAP1, "$indexes_list |");
     while (<LDAP1>) {
@@ -186,7 +189,7 @@ if ( $attribute_arg eq "" && $vlvattribute_arg eq "" )
     }
 
     # Get the list of indexes from the entry
-    $vlvindexes_list="$prefix{{SEP}}shared{{SEP}}bin{{SEP}}ldapsearch $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -s sub -b \"cn=\"$instance\", cn=ldbm database,cn=plugins,cn=config\" \"objectclass=vlvIndex\" cn";
+    $vlvindexes_list="ldapsearch $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -s sub -b \"cn=\"$instance\", cn=ldbm database,cn=plugins,cn=config\" \"objectclass=vlvIndex\" cn";
 
     # build the values of the attribute nsIndexVlvAttribute
     open(LDAP1, "$vlvindexes_list |");
@@ -219,6 +222,6 @@ $cn =  "cn: $taskname\n";
 $nsinstance = "nsInstance: ${instance}\n";
 
 $entry = "${dn}${misc}${cn}${nsinstance}${attribute}${vlvattribute}";
-open(FOO, "| $prefix{{SEP}}shared{{SEP}}bin{{SEP}}ldapmodify $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -a" );
+open(FOO, "| ldapmodify $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -a" );
 print(FOO "$entry");
 close(FOO);

+ 4 - 2
ldap/admin/src/scripts/template-db2ldif.pl

@@ -242,7 +242,9 @@ $nsldiffile = "nsFilename: ${ldiffile}\n";
 $entry = "${dn}${misc}${cn}${nsinstance}${nsincluded}${nsexcluded}${nsreplica}${nsnobase64}${nsnowrap}${nsnoversion}${nsnouniqueid}${nsuseid2entry}${nsonefile}${nsexportdecrypt}${nsprintkey}${nsldiffile}";
 $vstr = "";
 if ($verbose != 0) { $vstr = "-v"; }
-chdir("$prefix{{SEP}}shared{{SEP}}bin");
-open(FOO, "| $prefix{{SEP}}shared{{SEP}}bin{{SEP}}ldapmodify $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -a" );
+$ENV{'PATH'} = '$prefix/usr/lib/mozldap6:$prefix/usr/lib:/usr/lib/mozldap6:/usr/lib';
+$ENV{'LD_LIBRARY_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+$ENV{'SHLIB_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+open(FOO, "| ldapmodify $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -a" );
 print(FOO "$entry");
 close(FOO);

+ 4 - 3
ldap/admin/src/scripts/template-ldif2db.pl

@@ -94,7 +94,6 @@ $genuniqid = "time";
 $uniqidname = "";
 $taskname = "";
 $prefix = "{{DS-ROOT}}";
-$mydsroot = "{{MY-DS-ROOT}}";
 $verbose = 0;
 $rootdn = "";
 $passwd = "";
@@ -219,7 +218,9 @@ if ($uniqidname ne "") { $nsuniqidname = "nsUniqueIdGeneratorNamespace: ${uniqid
 $entry = "${dn}${misc}${cn}${nsinstance}${nsincluded}${nsexcluded}${nsldiffiles}${nsnoattrindexes}${nsimportencrypt}${nsmergechunksiz}${nsgenuniqid}${nsuniqidname}";
 $vstr = "";
 if ($verbose != 0) { $vstr = "-v"; }
-chdir("$prefix{{SEP}}shared{{SEP}}bin");
-open(FOO, "| $prefix{{SEP}}shared{{SEP}}bin{{SEP}}ldapmodify $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -a" );
+$ENV{'PATH'} = '$prefix/usr/lib/mozldap6:$prefix/usr/lib:/usr/lib/mozldap6:/usr/lib';
+$ENV{'LD_LIBRARY_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+$ENV{'SHLIB_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+open(FOO, "| ldapmodify $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -a" );
 print(FOO "$entry");
 close(FOO);

+ 6 - 5
ldap/admin/src/scripts/template-ns-accountstatus.pl

@@ -392,9 +392,12 @@ else
 
 debug("Running ** $cmd ** $operation\n");
 
-$dsbinroot="$prefix{{SEP}}shared{{SEP}}bin";
-$ldapsearch="$dsbinroot{{SEP}}ldapsearch -1";
-$ldapmodify="$dsbinroot{{SEP}}ldapmodify";
+$ENV{'PATH'} = '$prefix/usr/lib/mozldap6:$prefix/usr/lib:/usr/lib/mozldap6:/usr/lib';
+$ENV{'LD_LIBRARY_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+$ENV{'SHLIB_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+
+$ldapsearch="ldapsearch -1";
+$ldapmodify="ldapmodify";
  
 # Default values
 $defrootdn= "{{ROOT-DN}}";
@@ -412,8 +415,6 @@ $entry= "";
 $single=0;
 $role=0;
 
-chdir("$dsbinroot");
-
 # Process the command line arguments
 while( $arg = shift)
 {

+ 6 - 5
ldap/admin/src/scripts/template-ns-activate.pl

@@ -392,9 +392,12 @@ else
 
 debug("Running ** $cmd ** $operation\n");
 
-$dsbinroot="$prefix{{SEP}}shared{{SEP}}bin";
-$ldapsearch="$dsbinroot{{SEP}}ldapsearch -1";
-$ldapmodify="$dsbinroot{{SEP}}ldapmodify";
+$ENV{'PATH'} = '$prefix/usr/lib/mozldap6:$prefix/usr/lib:/usr/lib/mozldap6:/usr/lib';
+$ENV{'LD_LIBRARY_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+$ENV{'SHLIB_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+
+$ldapsearch="ldapsearch -1";
+$ldapmodify="ldapmodify";
  
 # Default values
 $defrootdn= "{{ROOT-DN}}";
@@ -412,8 +415,6 @@ $entry= "";
 $single=0;
 $role=0;
 
-chdir("$dsbinroot");
-
 # Process the command line arguments
 while( $arg = shift)
 {

+ 6 - 5
ldap/admin/src/scripts/template-ns-inactivate.pl

@@ -392,9 +392,12 @@ else
 
 debug("Running ** $cmd ** $operation\n");
 
-$dsbinroot="$prefix{{SEP}}shared{{SEP}}bin";
-$ldapsearch="$dsbinroot{{SEP}}ldapsearch -1";
-$ldapmodify="$dsbinroot{{SEP}}ldapmodify";
+$ENV{'PATH'} = '$prefix/usr/lib/mozldap6:$prefix/usr/lib:/usr/lib/mozldap6:/usr/lib';
+$ENV{'LD_LIBRARY_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+$ENV{'SHLIB_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+
+$ldapsearch="ldapsearch -1";
+$ldapmodify="ldapmodify";
  
 # Default values
 $defrootdn= "{{ROOT-DN}}";
@@ -412,8 +415,6 @@ $entry= "";
 $single=0;
 $role=0;
 
-chdir("$dsbinroot");
-
 # Process the command line arguments
 while( $arg = shift)
 {

+ 11 - 17
ldap/admin/src/scripts/template-ns-newpwpolicy.pl

@@ -42,19 +42,9 @@
 # enable the use of our bundled perldap with our bundled ldapsdk libraries
 # all of this nonsense can be omitted if the mozldapsdk and perldap are
 # installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
-BEGIN {
-	my $sroot = "{{DS-ROOT}}";
-	push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
-	if ($ENV{LD_LIBRARY_PATH}) {
-		$ENV{LD_LIBRARY_PATH} .= ":";
-	}
-	$ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
-	# this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
-	if ($ENV{SHLIB_PATH}) {
-		$ENV{SHLIB_PATH} .= ":";
-	}
-	$ENV{SHLIB_PATH} .= "$sroot/shared/lib";
-}
+$ENV{'PATH'} = '$prefix/usr/lib/mozldap6:$prefix/usr/lib:/usr/lib/mozldap6:/usr/lib';
+$ENV{'LD_LIBRARY_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+$ENV{'SHLIB_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
 # Add new password policy specific entries
 
 #############################################################################
@@ -74,11 +64,15 @@ $opt_p = "{{SERVER-PORT}}";
 $opt_h = "{{SERVER-NAME}}";
 $opt_v = 0;
 
-# Variables
-$ldapsearch="{{DS-ROOT}}{{SEP}}shared{{SEP}}bin{{SEP}}ldapsearch";
-$ldapmodify="{{DS-ROOT}}{{SEP}}shared{{SEP}}bin{{SEP}}ldapmodify";
+$ENV{'PATH'} = '$prefix{{SEP}}usr{{SEP}}lib:{{SEP}}usr{{SEP}}lib{{SEP}}mozldap';
+$ENV{'LD_LIBRARY_PATH'} .= ":";
+$ENV{'LD_LIBRARY_PATH'} .= "$prefix{{SEP}}usr{{SEP}}lib:{{SEP}}usr{{SEP}}lib{{SEP}}mozldap";
+$ENV{'SHLIB_PATH'} .= ":";
+$ENV{'SHLIB_PATH'} .= "$prefix{{SEP}}usr{{SEP}}lib:{{SEP}}usr{{SEP}}lib{{SEP}}mozldap";
 
-chdir("{{DS-ROOT}}{{SEP}}shared{{SEP}}bin");
+# Variables
+$ldapsearch="ldapsearch -1";
+$ldapmodify="ldapmodify";
 
 #############################################################################
 

+ 3 - 2
ldap/admin/src/scripts/template-repl-monitor-cgi.pl

@@ -56,8 +56,9 @@ if ($cgiVars{'admurl'}) {
 	$params .= " -u \"$admurl\"";
 }
 $siteroot = $cgiVars{'siteroot'};
-$ENV{'LD_LIBRARY_PATH'} = "$siteroot/shared/lib";
-$ENV{'SHLIB_PATH'} = "$siteroot/shared/lib";
+$ENV{'PATH'} = '$prefix/usr/lib/mozldap6:$prefix/usr/lib:/usr/lib/mozldap6:/usr/lib';
+$ENV{'LD_LIBRARY_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
+$ENV{'SHLIB_PATH'} = '$prefix/usr/lib/dirsec:$prefix/usr/lib:/usr/lib/dirsec:/usr/lib';
 
 # Save user-specified parameters as cookies in monreplication.properties.
 # Sync up with the property file so that monreplication2 is interval, and

+ 1 - 14
ldap/admin/src/scripts/template-repl-monitor.pl

@@ -150,7 +150,7 @@
 #   e.g. PERL5LIB="serverroot/lib/perl/arch:serverroot/lib/perl"
 #
 #    4. Set LD_LIBRARY_PATH (or SHLIB_PATH) to point to the location of our
-#   bundled shared libraries e.g. LD_LIBRARY_PATH="serverroot/shared/lib"
+#   bundled shared libraries e.g. LD_LIBRARY_PATH="serverroot/lib"
 #
 #    5. Invoke the script as follows if <MYPERLDIR> (serverroot/lib/perl) contains
 #	Mozilla/LDAP:
@@ -163,19 +163,6 @@
 # this script is always invoked by repl-monitor-cgi.pl, which sets all of these
 # If using this script standalone, be sure to set the shared lib path and
 # the path to the perldap modules.
-# BEGIN {
-# 	my $sroot = "{{DS-ROOT}}";
-# 	push @INC, "$sroot/lib/perl/arch", "$sroot/lib/perl";
-# 	if ($ENV{LD_LIBRARY_PATH}) {
-# 		$ENV{LD_LIBRARY_PATH} .= ":";
-# 	}
-# 	$ENV{LD_LIBRARY_PATH} .= "$sroot/shared/lib";
-# 	# this is only needed for HP/ux PA-RISC, but it doesn't hurt other platforms
-# 	if ($ENV{SHLIB_PATH}) {
-# 		$ENV{SHLIB_PATH} .= ":";
-# 	}
-# 	$ENV{SHLIB_PATH} .= "$sroot/shared/lib";
-# }
 $usage = "\nusage: $0 -f configuration-file [-h host] [-p port] [-r] [-u refresh-url] [-t refresh-interval]\n\nor   : $0 -v\n"; 
 
 use Getopt::Std;		# parse command line arguments

+ 8 - 4
ldap/admin/src/scripts/template-verify-db.pl

@@ -111,12 +111,16 @@ print("*****************************************************************\n");
 
 # get dirs having DBVERSION
 my $dbdirs = getDbDir(".");
+my $brand_ds = {{DS-BRAND}};
+$ENV{'PATH'} = '$prefix/usr/bin:$prefix/usr/lib:/usr/bin:/usr/lib';
+$ENV{'LD_LIBRARY_PATH'} = ':/usr/lib';
+$ENV{'SHLIB_PATH'} = ':/usr/lib';
 
 for (my $i = 0; $i < @$dbdirs; $i++)
 {
-    # run ../bin/slapd/server/db_printlog -h <dbdir> for each <dbdir>
+    # run db_printlog -h <dbdir> for each <dbdir>
     print "Verify log files in $$dbdirs[$i] ... ";
-    open(PRINTLOG, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_printlog -h $$dbdirs[$i] 2>&1 1> $NULL |");
+    open(PRINTLOG, "db_printlog -h $$dbdirs[$i] 2>&1 1> $NULL |");
     sleep 1;
     my $haserr = 0;
     while ($l = <PRINTLOG>)
@@ -154,7 +158,7 @@ for (my $i = 0; $i < @$dbdirs; $i++)
         {
             my $thisdb = $$dbdirs[$i] . "{{SEP}}" . $db;
             print "Verify $thisdb ... ";
-            open(DBVERIFY, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_verify $thisdb 2>&1 1> $NULL |");
+            open(DBVERIFY, "db_verify $thisdb 2>&1 1> $NULL |");
             sleep 1;
             my $haserr = 0;
             while ($l = <DBVERIFY>)
@@ -195,7 +199,7 @@ for (my $i = 0; $i < @$dbdirs; $i++)
             {
                 my $thisdb = $$instdirs[$j] . "{{SEP}}" . $db;
                 print "Verify $thisdb ... ";
-                open(DBVERIFY, "..{{SEP}}bin{{SEP}}slapd{{SEP}}server{{SEP}}db_verify $thisdb 2>&1 1> $NULL |");
+                open(DBVERIFY, "db_verify $thisdb 2>&1 1> $NULL |");
                 sleep 1;
                 my $haserr = 0;
                 while ($l = <DBVERIFY>)

+ 6 - 6
ldap/admin/src/upgradeServer

@@ -204,8 +204,8 @@ sub modify_dse_ldif
     print DSE "nsslapd-pluginType: syntax\n";
     print DSE "nsslapd-pluginEnabled: on\n";
     print DSE "nsslapd-pluginId: oid-syntax\n";
-    print DSE "nsslapd-pluginVersion: 6.2.1\n";
-    print DSE "nsslapd-pluginVendor: Netscape Communications Corp.\n";
+    print DSE "nsslapd-pluginVersion: 1.0.3\n";
+    print DSE "nsslapd-pluginVendor: Fedora Project\n";
     print DSE "nsslapd-pluginDescription: OID attribute syntax plugin\n";
     print DSE "\n";
   }
@@ -222,8 +222,8 @@ sub modify_dse_ldif
     print DSE "nsslapd-pluginType: syntax\n";
     print DSE "nsslapd-pluginEnabled: on\n";
     print DSE "nsslapd-pluginId: jpeg-syntax\n";
-    print DSE "nsslapd-pluginVersion: 6.2.1\n";
-    print DSE "nsslapd-pluginVendor: Netscape Communications Corp.\n";
+    print DSE "nsslapd-pluginVersion: 1.0.3\n";
+    print DSE "nsslapd-pluginVendor: Fedora Project\n";
     print DSE "nsslapd-pluginDescription: JPEG attribute syntax plugin\n";
     print DSE "\n";
   }
@@ -240,8 +240,8 @@ sub modify_dse_ldif
     print DSE "nsslapd-pluginType: syntax\n";
     print DSE "nsslapd-pluginEnabled: on\n";
     print DSE "nsslapd-pluginId: spaceinsensitivestring-syntax\n";
-    print DSE "nsslapd-pluginVersion: 6.2.1\n";
-    print DSE "nsslapd-pluginVendor: Netscape Communications Corp.\n";
+    print DSE "nsslapd-pluginVersion: 1.0.3\n";
+    print DSE "nsslapd-pluginVendor: Fedora Project\n";
     print DSE "nsslapd-pluginDescription: space insensitive string attribute syntax plugin\n";
     print DSE "\n";
   }

+ 130 - 124
ldap/cm/Makefile

@@ -246,10 +246,8 @@ DS_JAR_SRC_PATH = $(NSDIST)/$(BUILD_DEBUG)
 # web services files that are Apache or Java licensed - we cannot put them
 # in the same rpm/tarball as the directory server, so we create a separate
 # package for them, using the below macro as the staging area
-#EXT_JAVA_RELDIR = $(BUILD_ROOT)/built/release/extjava
 # actually, we can - GPL is compatible with APL in this situation
 EXT_JAVA_RELDIR = $(RELDIR)
-DS_JAR_DEST_PATH = java/jars
 XMLTOOLS_JAR_FILE = xmltools.jar
 
 UNZIP=unzip -o
@@ -306,73 +304,73 @@ dummy:
 importAdmin:
 
 releaseDirectory:
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/ldif/*.ldif $(RELDIR)/bin/slapd/install/ldif
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/schema/*.ldif $(RELDIR)/bin/slapd/install/schema
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/schema/slapd-collations.conf $(RELDIR)/bin/slapd/install/config
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/ldif/*.ldif $(RELDIR)/$(DS_LDIFDIR)
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/schema/*.ldif $(RELDIR)/$(DS_SCHEMADIR)
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/schema/slapd-collations.conf $(RELDIR)/$(DS_CONFIGDIR)
 
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/lib/ldaputil/certmap.conf $(RELDIR)/bin/slapd/install/config
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/lib/ldaputil/certmap.conf $(RELDIR)/$(DS_CONFIGDIR)
 
 # the httpd library
 ifneq ($(ARCH), WINNT)
-	$(INSTALL) -m 755 $(OBJDIR)/$(NSHTTPD_DLL)$(DLL_PRESUF).$(DLL_SUFFIX)* $(RELDIR)/bin/slapd/lib
+	$(INSTALL) -m 755 $(OBJDIR)/$(NSHTTPD_DLL)$(DLL_PRESUF).$(DLL_SUFFIX)* $(RELDIR)/$(DS_LIBDIR)
 endif
 
 # Images for IM Presence plugin
 ifdef BUILD_PRESENCE
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/plugins/presence/images/*.gif $(RELDIR)/bin/slapd/install/presence
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/plugins/presence/images/*.gif $(RELDIR)/$(DS_CONFIGDIR)/presence
 endif
 
 ifdef USE_PURIFY
-	-$(INSTALL) -m 755 $(DB_LIBPATH)/*.so_pure* $(RELDIR)/lib
-	-$(INSTALL) -m 755 $(NSCP_DISTDIR)/lib/*.so_pure* $(RELDIR)/lib
-	rm -f $(RELDIR)/bin/slapd/server/ns-slapd
-	mv -f $(RELDIR)/bin/slapd/server/ns-slapd.pure $(RELDIR)/bin/slapd/server/ns-slapd
+	-$(INSTALL) -m 755 $(DB_LIBPATH)/*.so_pure* $(DS_LIBDIR)
+	-$(INSTALL) -m 755 $(NSCP_DISTDIR)/lib/*.so_pure* $(DS_LIBDIR)
+	rm -f $(RELDIR)/$(DS_LIBDIR)/ns-slapd
+	mv -f $(RELDIR)/$(DS_LIBDIR)/ns-slapd.pure $(RELDIR)/$(DS_LIBDIR)/ns-slapd
 endif
 ifdef USE_QUANTIFY
-	rm -f $(RELDIR)/bin/slapd/server/ns-slapd
-	mv -f $(RELDIR)/bin/slapd/server/ns-slapd.quantify $(RELDIR)/bin/slapd/server/ns-slapd
+	rm -f $(RELDIR)/$(DS_LIBDIR)/ns-slapd
+	mv -f $(RELDIR)/$(DS_LIBDIR)/ns-slapd.quantify $(RELDIR)/$(DS_LIBDIR)/ns-slapd
 endif
 
-	$(INSTALL) -m 755 $(OBJDIR)/lib/libsi18n/ns-slapd.properties $(RELDIR)/bin/slapd/property;
+	$(INSTALL) -m 755 $(OBJDIR)/lib/libsi18n/ns-slapd.properties $(RELDIR)/$(DS_PROPERTYDIR)
 
 # Install LDAP Readme and License files at root of SLAPD Release sub-directory.
 ifeq ($(ARCH), WINNT)
 	if [ -d $(LDAPDIR)/docs ] ; then \
 		cd $(LDAPDIR)/docs; \
-		perl $(NT_RELTOOLS)/unx2dos.plx WINNT LICENSE.txt $(RELDIR)/bin/slapd; \
+		perl $(NT_RELTOOLS)/unx2dos.plx WINNT LICENSE.txt $(RELDIR)/$(DS_ETCDIR); \
 		perl $(NT_RELTOOLS)/unx2dos.plx WINNT LICENSE.txt $(RELDIR); \
-		perl $(NT_RELTOOLS)/unx2dos.plx WINNT README.txt $(RELDIR)/bin/slapd; \
+		perl $(NT_RELTOOLS)/unx2dos.plx WINNT README.txt $(RELDIR)/$(DS_ETCDIR); \
 		perl $(NT_RELTOOLS)/unx2dos.plx WINNT README.txt $(RELDIR); \
 	fi
 else
 	if [ -d $(LDAPDIR)/docs ] ; then \
 		cd $(LDAPDIR)/docs; \
-		$(INSTALL) -m 755 README.txt LICENSE.txt $(RELDIR)/bin/slapd; \
+		$(INSTALL) -m 755 README.txt LICENSE.txt $(RELDIR)/$(DS_ETCDIR); \
 		$(INSTALL) -m 755 README.txt LICENSE.txt $(RELDIR); \
 	fi
 endif
 
 # include the old configuration files in the package so we can use them
 # for comparison purposes during migration
-	$(INSTALL) -m 444 $(LDAPDIR)/cm/v1confs/*.* $(RELDIR)/bin/slapd/install/version1
-	$(INSTALL) -m 444 $(LDAPDIR)/cm/v3confs/*.* $(RELDIR)/bin/slapd/install/version3
-	$(INSTALL) -m 444 $(LDAPDIR)/cm/v4confs/40/*.*  $(RELDIR)/bin/slapd/install/version4/40
-	$(INSTALL) -m 444 $(LDAPDIR)/cm/v4confs/41/*.*  $(RELDIR)/bin/slapd/install/version4/41
-	$(INSTALL) -m 444 $(LDAPDIR)/cm/v4confs/411/*.* $(RELDIR)/bin/slapd/install/version4/411
-	$(INSTALL) -m 444 $(LDAPDIR)/cm/v4confs/412/*.* $(RELDIR)/bin/slapd/install/version4/412
+	$(INSTALL) -m 444 $(LDAPDIR)/cm/v1confs/*.* $(RELDIR)/$(DS_LEGACYSCHEMADIR)/version1
+	$(INSTALL) -m 444 $(LDAPDIR)/cm/v3confs/*.* $(RELDIR)/$(DS_LEGACYSCHEMADIR)/version3
+	$(INSTALL) -m 444 $(LDAPDIR)/cm/v4confs/40/*.*  $(RELDIR)/$(DS_LEGACYSCHEMADIR)/version4/40
+	$(INSTALL) -m 444 $(LDAPDIR)/cm/v4confs/41/*.*  $(RELDIR)/$(DS_LEGACYSCHEMADIR)/version4/41
+	$(INSTALL) -m 444 $(LDAPDIR)/cm/v4confs/411/*.* $(RELDIR)/$(DS_LEGACYSCHEMADIR)/version4/411
+	$(INSTALL) -m 444 $(LDAPDIR)/cm/v4confs/412/*.* $(RELDIR)/$(DS_LEGACYSCHEMADIR)/version4/412
 
 # for RPM, include the post install setup program
 ifdef BUILD_RPM
-	$(INSTALL) -m 755 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/cm/newinst/setup $(RELDIR)/setup
+	$(INSTALL) -m 755 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/cm/newinst/setup $(RELDIR)/$(DS_SETUPDIR)
 endif # BUILD_RPM
 
 	find $(RELDIR) -exec chmod go-w {} \;
-# $(RELDIR)/bin/slapd/server may host a core file if the server crashes
+# $(RELDIR)/$(DS_LIBDIR) may host a core file if the server crashes
 # shortly after startup (otherwise, cores go in slapd-instance/logs)
 # For security reasons, it's readable only by the owner
 # but it needs to be executable (11) so that it can
 # load in shared libs from slapd/lib after the setuid
-	chmod 711 $(RELDIR)/bin/slapd/server
+	chmod 711 $(RELDIR)/$(DS_LIBDIR)
 
 $(INSTDIR):
 	$(MKDIR) -p $@
@@ -394,41 +392,49 @@ packageDirectory: $(INSTDIR) $(INSTDIR)/slapd \
 # with the other component files that we don't necessarily pick up from the admin server build
 # see below for windows packaging
 ifneq ($(ARCH), WINNT)
+###############################################################################
+### THIS INSTALLATION SHOULD GO AWAY, WHEN LIBS_TO_PKG BECOME SYSTEM LIB: BEGIN
+###############################################################################
 	for file in $(LIBS_TO_PKG) ; \
 	do if [ -f $$file ] ; \
-	then $(INSTALL) -m 755 $$file $(RELDIR)/bin/slapd/lib ; \
+	then $(INSTALL) -m 755 $$file $(RELDIR)/$(DS_LIBDIR) ; \
 	fi ; \
 	done
-# these are files to copy to the shared/bin directory - ldap cmd line tools, sec tools, etc.
+# these are files to copy to the bin directory - ldap cmd line tools, sec tools, etc.
 	for file in $(BINS_TO_PKG_SHARED); \
 	do if [ -f $$file ] ; \
-	then $(INSTALL) -m 755 $$file $(RELDIR)/shared/bin ; \
+	then $(INSTALL) -m 755 $$file $(RELDIR)/$(CORE_BINDIR) ; \
 	fi ; \
 	done
-# these are files to copy to the shared/lib directory - ldap cmd line tools, sec tools, etc.
+# these are files to copy to the lib directory - ldap cmd line tools, sec tools, etc.
 	for file in $(LIBS_TO_PKG_SHARED); \
 	do if [ -f $$file ] ; \
-	then $(INSTALL) -m 755 $$file $(RELDIR)/shared/lib ; \
+	then $(INSTALL) -m 755 $$file $(RELDIR)/$(CORE_LIBDIR) ; \
 	fi ; \
 	done
-# these are libs to copy to clients/lib on unix to support dsgw & pb
+#############################################################################
+### THIS INSTALLATION SHOULD GO AWAY, WHEN LIBS_TO_PKG BECOME SYSTEM LIB: END
+#############################################################################
+# these are libs to copy to lib on unix to support dsgw & pb
 ifeq ($(USE_DSGW), 1)
 	for file in $(LIBS_TO_PKG_CLIENTS); \
 	do if [ -f $$file ] ; \
-	then $(INSTALL) -m 755 $$file $(RELDIR)/clients/lib ; \
+	then $(INSTALL) -m 755 $$file $(RELDIR)/$(CORE_LIBDIR) ; \
 	fi ; \
 	done
 # the httpd library
-	$(INSTALL) -m 755 $(OBJDIR)/$(NSHTTPD_DLL)$(DLL_PRESUF).$(DLL_SUFFIX)* $(RELDIR)/clients/lib
+	$(INSTALL) -m 755 $(OBJDIR)/$(NSHTTPD_DLL)$(DLL_PRESUF).$(DLL_SUFFIX)* $(RELDIR)/$(CORE_LIBDIR)
 endif # USE_DSGW
-ifeq ($(PACKAGE_LIB32), 1)
-# these are files to copy to the shared32/lib directory - nspr, nss, ldapsdk lib
-	for file in $(LIBS_TO_PKG_SHARED_32); \
-	do if [ -f $$file ] ; \
-	then $(INSTALL) -m 755 $$file $(RELDIR)/shared32/lib ; \
-	fi ; \
-	done
-endif
+## We don't need this any more, do we?
+#ifeq ($(PACKAGE_LIB32), 1)
+## these are files to copy to the shared32/lib directory - nspr, nss, ldapsdk lib
+#	for file in $(LIBS_TO_PKG_SHARED_32); \
+#	do if [ -f $$file ] ; \
+#	then $(INSTALL) -m 755 $$file $(RELDIR)/shared32/lib ; \
+#	fi ; \
+#	done
+#endif
+## We don't need this any more, do we?
 endif
 
 # PACKAGE_SRC_DEST is defined in components.mk - these are component files and directories to install
@@ -467,34 +473,33 @@ endif
 # web-app_2_3.dtd, activation.jar, saaj.jar - due to Sun license
 # jaxrpc-api.jar, jaxrpc.jar, xercesImpl.jar, xml-apis.jar, crimson.jar - due to Apache license
 ifeq ($(USE_DSMLGW), 1)
-	$(MKDIR) $(RELDIR)/clients/dsmlgw
-	$(MKDIR) $(EXT_JAVA_RELDIR)/clients/dsmlgw
+	$(MKDIR) $(RELDIR)/$(DS_DSMLGWDIR)
 	if [ -d $(DSMLGWJARS_BUILD_DIR)/$(AXIS_REL_DIR)/webapps/axis ] ; then \
-		$(CP) -R $(DSMLGWJARS_BUILD_DIR)/$(AXIS_REL_DIR)/webapps/axis/*  $(EXT_JAVA_RELDIR)/clients/dsmlgw/ ; \
+		$(CP) -R $(DSMLGWJARS_BUILD_DIR)/$(AXIS_REL_DIR)/webapps/axis/*  $(RELDIR)/$(DS_DSMLGWDIR) ; \
 	fi
 
-	$(INSTALL) -m 644 $(NSDIST)/dsmlgw/dsmlgw.jar $(RELDIR)/clients/dsmlgw/WEB-INF/lib
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/clients/dsmlgw/misc/server-config.wsdd $(RELDIR)/clients/dsmlgw/WEB-INF
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/clients/dsmlgw/misc/web-app_2_3.dtd $(EXT_JAVA_RELDIR)/clients/dsmlgw/
+	$(INSTALL) -m 644 $(NSDIST)/dsmlgw/dsmlgw.jar $(RELDIR)/$(DS_DSMLGWDIR)/WEB-INF/lib
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/clients/dsmlgw/misc/server-config.wsdd $(RELDIR)/$(DS_DSMLGWDIR)/WEB-INF
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/clients/dsmlgw/misc/web-app_2_3.dtd $(RELDIR)/$(DS_DSMLGWDIR)/
 
 # now time to move the necessary jars in place
-	$(INSTALL) -m 644 $(LDAPJARFILE)  $(RELDIR)/clients/dsmlgw/WEB-INF/lib
+	$(INSTALL) -m 644 $(LDAPJARFILE)  $(RELDIR)/$(DS_DSMLGWDIR)/WEB-INF/lib
 	if [ -f $(DSMLGWJARS_BUILD_DIR)/jaf.jar ] ; then \
-		$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/jaf.jar  $(EXT_JAVA_RELDIR)/clients/dsmlgw/WEB-INF/lib ; \
+		$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/jaf.jar  $(RELDIR)/$(DS_DSMLGWDIR)/WEB-INF/lib ; \
 	else \
-		$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/activation.jar  $(EXT_JAVA_RELDIR)/clients/dsmlgw/WEB-INF/lib ; \
+		$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/activation.jar  $(RELDIR)/$(DS_DSMLGWDIR)/WEB-INF/lib ; \
 	fi
 # if you use the jaxrpc.jar from the axis distribution, you don't need the api file
 # or perhaps you need the jaxrpc.jar for building, and jaxrpc-api.jar at runtime, or vice versa
 # if so, I'm not sure where to get the implementation
 	if [ -f $(DSMLGWJARS_BUILD_DIR)/jaxrpc-api.jar ] ; then \
-		$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/jaxrpc-api.jar  $(EXT_JAVA_RELDIR)/clients/dsmlgw/WEB-INF/lib ; \
+		$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/jaxrpc-api.jar  $(RELDIR)/$(DS_DSMLGWDIR)/WEB-INF/lib ; \
 	fi
-	$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/jaxrpc.jar  $(EXT_JAVA_RELDIR)/clients/dsmlgw/WEB-INF/lib
+	$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/jaxrpc.jar  $(RELDIR)/$(DS_DSMLGWDIR)/WEB-INF/lib
 	$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/saaj.jar  $(EXT_JAVA_RELDIR)/clients/dsmlgw/WEB-INF/lib
-	$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/xercesImpl.jar $(EXT_JAVA_RELDIR)/clients/dsmlgw/WEB-INF/lib
-	$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/xml-apis.jar $(EXT_JAVA_RELDIR)/clients/dsmlgw/WEB-INF/lib
-	$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/jakarta-commons-codec.jar $(EXT_JAVA_RELDIR)/clients/dsmlgw/WEB-INF/lib
+	$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/xercesImpl.jar $(RELDIR)/$(DS_DSMLGWDIR)/WEB-INF/lib
+	$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/xml-apis.jar $(RELDIR)/$(DS_DSMLGWDIR)/WEB-INF/lib
+	$(INSTALL) -m 644 $(DSMLGWJARS_BUILD_DIR)/jakarta-commons-codec.jar $(RELDIR)/$(DS_DSMLGWDIR)/WEB-INF/lib
 endif # USE_DSMLGW
 
 # PACKAGE_UNDER_JAVA is defined in components.mk - these are component .jar files to install
@@ -503,12 +508,12 @@ endif # USE_DSMLGW
 ifdef PACKAGE_UNDER_JAVA
 	for file in $(PACKAGE_UNDER_JAVA) ; \
 		do if [ -f $$file ] ; \
-		then $(INSTALL) -m 755 $$file $(RELDIR)/$(DS_JAR_DEST_PATH) ; \
+		then $(INSTALL) -m 755 $$file $(RELDIR)/$(DS_JAVADIR) ; \
 	fi ; \
 	done
 endif
 
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/dsml/*.dsml $(RELDIR)/bin/slapd/install/dsml
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/dsml/*.dsml $(RELDIR)/$(DS_DSMLGWDIR)
 
 ### Package up the orgchart ###
 ifeq ($(USE_ORGCHART), 1)
@@ -532,114 +537,116 @@ endif # USE_ORGCHART
 
 # libdb for windows special and smartheap
 ifeq ($(ARCH), WINNT)
-	$(INSTALL) -m 755 $(DB_LIBPATH)/$(DB_LIBNAME).$(DLL_SUFFIX)  $(RELDIR)/bin/slapd/server
-	$(INSTALL) -m 755 $(SASL_LIBPATH)/*.$(DLL_SUFFIX)  $(RELDIR)/bin/slapd/server
+    ### THIS INSTALLATION SHOULD GO AWAY, WHEN LIBS_TO_PKG BECOME SYSTEM LIB
+	$(INSTALL) -m 755 $(DB_LIBPATH)/$(DB_LIBNAME).$(DLL_SUFFIX) $(RELDIR)/$(DS_LIBDIR)
+	$(INSTALL) -m 755 $(SASL_LIBPATH)/*.$(DLL_SUFFIX)  $(RELDIR)/$(DS_LIBDIR)
 #Install smartheap dll in the server binary directory
 ifeq ($(DEBUG), optimize)
-	$(INSTALL) -m 755 $(SH_LIBPATH)/shsmp.$(DLL_SUFFIX)  $(RELDIR)/bin/slapd/server
-	$(INSTALL) -m 755 $(SH_LIBPATH)/shsmp.$(DLL_SUFFIX)  $(RELDIR)/lib
-endif
+	$(INSTALL) -m 755 $(SH_LIBPATH)/shsmp.$(DLL_SUFFIX)  $(RELDIR)/$(DS_LIBDIR)
 endif
+endif # WINNT
 
 ifeq ($(ARCH), SOLARIS)
 ifndef LDAP_DONT_USE_SMARTHEAP
-	$(INSTALL) -m 755 $(SH_LIBPATH)/libsh.$(DLL_SUFFIX)  $(RELDIR)/bin/slapd/server
+    ### THIS INSTALLATION SHOULD GO AWAY, WHEN LIBS_TO_PKG BECOME SYSTEM LIB
+    ### BUT WE DON'T NEED THIS ANY MORE, DO WE?
+	$(INSTALL) -m 755 $(SH_LIBPATH)/libsh.$(DLL_SUFFIX)  $(RELDIR)/$(DS_LIBDIR)
 endif
 endif
 
 ifeq ($(ARCH), HPUX)
 ifeq ($(DEBUG), optimize)
 ifndef LDAP_DONT_USE_SMARTHEAP
-	$(INSTALL) -m 755 $(SH_LIBPATH)/libsh.$(DLL_SUFFIX)  $(RELDIR)/bin/slapd/server
+    ### DO WE STILL NEED THIS???
+	$(INSTALL) -m 755 $(SH_LIBPATH)/libsh.$(DLL_SUFFIX)  $(RELDIR)/$(DS_LIBDIR)
 endif
 endif
 endif
 
 # if not Linux, we need package sasl library and supported plugins
 ifneq ($(ARCH), Linux)
-	$(INSTALL) -m 755 $(SASL_LIBPATH)/*.$(DLL_SUFFIX)* $(RELDIR)/lib
-	-mkdir $(RELDIR)/lib/sasl2
-	$(INSTALL) -m 755 $(SASL_LIBPATH)/sasl2/libdigestmd5.$(DLL_SUFFIX)* $(RELDIR)/lib/sasl2
-	$(INSTALL) -m 755 $(SASL_LIBPATH)/sasl2/libgssapiv2.$(DLL_SUFFIX)* $(RELDIR)/lib/sasl2
+	$(INSTALL) -m 755 $(SASL_LIBPATH)/*.$(DLL_SUFFIX)* $(DS_LIBDIR)
+	-mkdir $(DS_LIBDIR)/sasl2
+	$(INSTALL) -m 755 $(SASL_LIBPATH)/sasl2/libdigestmd5.$(DLL_SUFFIX)* $(DS_LIBDIR)/sasl2
+	$(INSTALL) -m 755 $(SASL_LIBPATH)/sasl2/libgssapiv2.$(DLL_SUFFIX)* $(DS_LIBDIR)/sasl2
 endif
 
 # the plugin API
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/slapi-plugin.h $(RELDIR)/plugins/slapd/slapi/include
-	$(INSTALL) -m 644 $(NSPR_INCDIR)/*.h $(RELDIR)/plugins/slapd/slapi/include
-	$(INSTALL) -m 644 $(NSPR_INCDIR)/obsolete/*.h $(RELDIR)/plugins/slapd/slapi/include/obsolete
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/slapi-plugin-compat4.h $(RELDIR)/plugins/slapd/slapi/include
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/slapi-plugin.h $(RELDIR)/$(DS_PLUGINDIR)/include
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/slapi-plugin-compat4.h $(RELDIR)/$(DS_PLUGINDIR)/include
 #	if [ -f $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/docs/plugin/README ] ; \
 #	then $(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/docs/plugin/README $(RELDIR)/plugins/slapd ; \
 #	fi
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/*.c $(RELDIR)/plugins/slapd/slapi/examples
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/*.h $(RELDIR)/plugins/slapd/slapi/examples
-	$(INSTALL) -m 644 $(DB_INCLUDE)/db.h $(RELDIR)/plugins/slapd/slapi/examples
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/README $(RELDIR)/plugins/slapd/slapi/examples
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/clients/*.* $(RELDIR)/plugins/slapd/slapi/examples/clients
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/clients/README $(RELDIR)/plugins/slapd/slapi/examples/clients
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/plugins/distrib/*.c $(RELDIR)/plugins/slapd/slapi/examples/distrib
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/plugins/distrib/README $(RELDIR)/plugins/slapd/slapi/examples/distrib
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/Makefile.$(MAKEARCH) $(RELDIR)/plugins/slapd/slapi/examples
-	$(MV) $(RELDIR)/plugins/slapd/slapi/examples/Makefile.$(MAKEARCH) $(RELDIR)/plugins/slapd/slapi/examples/Makefile
-	$(CP) $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/plugins/distrib/Makefile.$(MAKEARCH) $(RELDIR)/plugins/slapd/slapi/examples/distrib/Makefile
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/*.c $(RELDIR)/$(DS_PLUGINDIR)/examples
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/*.h $(RELDIR)/$(DS_PLUGINDIR)/examples
+	$(INSTALL) -m 644 $(DB_INCLUDE)/db.h $(RELDIR)/$(DS_PLUGINDIR)/examples
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/README $(RELDIR)/$(DS_PLUGINDIR)/examples
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/clients/*.* $(RELDIR)/$(DS_PLUGINDIR)/examples/clients
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/clients/README $(RELDIR)/$(DS_PLUGINDIR)/examples/clients
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/plugins/distrib/*.c $(RELDIR)/$(DS_PLUGINDIR)/examples/distrib
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/plugins/distrib/README $(RELDIR)/$(DS_PLUGINDIR)/examples/distrib
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/Makefile.$(MAKEARCH) $(RELDIR)/$(DS_PLUGINDIR)/examples
+	$(MV) $(RELDIR)/$(DS_PLUGINDIR)/examples/Makefile.$(MAKEARCH) $(RELDIR)/$(DS_PLUGINDIR)/examples/Makefile
+	$(CP) $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/plugins/distrib/Makefile.$(MAKEARCH) $(RELDIR)/$(DS_PLUGINDIR)/examples/distrib/Makefile
 ifeq ($(ARCH), WINNT)
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/testplugin.mak $(RELDIR)/plugins/slapd/slapi/examples
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/testplugin.def $(RELDIR)/plugins/slapd/slapi/examples
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/testplugin.dsp $(RELDIR)/plugins/slapd/slapi/examples
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/plugins/distrib/distrib.dsp $(RELDIR)/plugins/slapd/slapi/examples/distrib
-	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/plugins/distrib/libdistrib.def $(RELDIR)/plugins/slapd/slapi/examples/distrib
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/testplugin.mak $(RELDIR)/$(DS_PLUGINDIR)/examples
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/testplugin.def $(RELDIR)/$(DS_PLUGINDIR)/examples
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/test-plugins/testplugin.dsp $(RELDIR)/$(DS_PLUGINDIR)/examples
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/plugins/distrib/distrib.dsp $(RELDIR)/$(DS_PLUGINDIR)/examples/distrib
+	$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/plugins/distrib/libdistrib.def $(RELDIR)/$(DS_PLUGINDIR)/examples/distrib
 endif
 ifeq ($(ARCH), WINNT)
-	$(INSTALL) -m 755 $(LIBSLAPD) $(RELDIR)/plugins/slapd/slapi/lib
-	$(INSTALL) -m 755 $(NSPR_LIBPATH)/*.lib $(RELDIR)/plugins/slapd/slapi/lib
+	$(INSTALL) -m 755 $(LIBSLAPD) $(RELDIR)/$(DS_PLUGINDIR)/lib
+	$(INSTALL) -m 755 $(NSPR_LIBPATH)/*.lib $(RELDIR)/$(DS_PLUGINDIR)/lib
 # needed only for testdatainterop plugin in the plugins examples
-	mkdir -p $(RELDIR)/plugins/slapd/slapi/examples/lib
-	$(INSTALL) -m 755 $(DB_LIBPATH)/$(DB_LIBNAME).lib $(RELDIR)/plugins/slapd/slapi/examples/lib
+	mkdir -p $(RELDIR)/$(DS_PLUGINDIR)/examples/lib
+	$(INSTALL) -m 755 $(DB_LIBPATH)/$(DB_LIBNAME).lib $(RELDIR)/$(DS_PLUGINDIR)/examples/lib
 endif
 
-# install the ds jar file in the <server root>/$(DS_JAR_DEST_PATH) directory
+# install the ds jar file in the <server root>/$(DS_CONSOLEDIR) directory
 # also install the other jar files we use
 ifeq ($(USE_CONSOLE), 1)
-	$(INSTALL) -m 644 $(LDAPCONSOLE_DIR)/$(LDAPCONSOLEJAR) $(RELDIR)/$(DS_JAR_DEST_PATH)
-	$(INSTALL) -m 644 $(LDAPCONSOLE_DIR)/$(LDAPCONSOLEJAR_EN) $(RELDIR)/$(DS_JAR_DEST_PATH)
+	$(INSTALL) -m 644 $(LDAPCONSOLE_DIR)/$(LDAPCONSOLEJAR) $(RELDIR)/$(DS_CONSOLEDIR)
+	$(INSTALL) -m 644 $(LDAPCONSOLE_DIR)/$(LDAPCONSOLEJAR_EN) $(RELDIR)/$(DS_CONSOLEDIR)
   ifneq ($(ARCH), WINNT)
-	-(cd $(RELDIR)/$(DS_JAR_DEST_PATH); ln -s $(LDAPCONSOLEJAR_EN) $(LDAPCONSOLEGENJAR_EN))
-	-(cd $(RELDIR)/$(DS_JAR_DEST_PATH); ln -s $(LDAPCONSOLEJAR) $(LDAPCONSOLEGENJAR))
+	-(cd $(RELDIR)/$(DS_CONSOLEDIR); ln -s $(LDAPCONSOLEJAR_EN) $(LDAPCONSOLEGENJAR_EN))
+	-(cd $(RELDIR)/$(DS_CONSOLEDIR); ln -s $(LDAPCONSOLEJAR) $(LDAPCONSOLEGENJAR))
   endif
 endif
 ifeq ($(USE_JAVATOOLS), 1)
-	$(INSTALL) -m 644 $(DS_JAR_SRC_PATH)/$(XMLTOOLS_JAR_FILE) $(RELDIR)/$(DS_JAR_DEST_PATH)
-	$(INSTALL) -m 644 $(CRIMSONJAR_FILE) $(EXT_JAVA_RELDIR)/$(DS_JAR_DEST_PATH)
+	$(INSTALL) -m 644 $(DS_JAR_SRC_PATH)/$(XMLTOOLS_JAR_FILE) $(RELDIR)/$(DS_CONSOLEDIR)
+	$(INSTALL) -m 644 $(CRIMSONJAR_FILE) $(EXT_JAVA_RELDIR)/$(DS_CONSOLEDIR)
 	if [ -f $(CRIMSON_BUILD_DIR)/$(CRIMSON_LICENSE) ] ; then \
-		$(INSTALL) -m 644 $(CRIMSON_BUILD_DIR)/$(CRIMSON_LICENSE) $(EXT_JAVA_RELDIR)/$(DS_JAR_DEST_PATH) ; \
+		$(INSTALL) -m 644 $(CRIMSON_BUILD_DIR)/$(CRIMSON_LICENSE) $(EXT_JAVA_RELDIR)/$(DS_CONSOLEDIR) ; \
 	fi
 endif
 
 # docs
-	-$(RM) -r $(RELDIR)/manual/en/slapd
-	-$(MKDIR) $(RELDIR)/manual/en/slapd
+	-$(RM) -r $(RELDIR)/$(DS_DOCDIR)/en/slapd
+	-$(MKDIR) $(RELDIR)/$(DS_DOCDIR)/en/slapd
 # copy over the manual files built in our build tree
 	if [ -d "$(OBJDIR)/manual/slapd" ] ; then \
-	  $(INSTALL) -m 644 $(OBJDIR)/manual/slapd/help/*.* $(RELDIR)/manual/en/slapd/help ; \
-	  $(INSTALL) -m 644 $(OBJDIR)/manual/slapd/index.map $(RELDIR)/manual/en/slapd/ ; \
-	  $(INSTALL) -m 644 $(OBJDIR)/manual/slapd/index.htm $(RELDIR)/manual/en/slapd/ ; \
-	  $(INSTALL) -m 644 $(OBJDIR)/manual/slapd/pixel.gif $(RELDIR)/manual/en/slapd/ ; \
-	  $(INSTALL) -m 644 $(OBJDIR)/manual/slapd/topicindex.htm $(RELDIR)/manual/en/slapd/ ; \
-	  $(INSTALL) -m 644 $(OBJDIR)/manual/slapd/tokens.map $(RELDIR)/manual/en/slapd/ ; \
+	  $(INSTALL) -m 644 $(OBJDIR)/manual/slapd/help/*.* $(RELDIR)/$(DS_DOCDIR)/en/slapd/help ; \
+	  $(INSTALL) -m 644 $(OBJDIR)/manual/slapd/index.map $(RELDIR)/$(DS_DOCDIR)/en/slapd/ ; \
+	  $(INSTALL) -m 644 $(OBJDIR)/manual/slapd/index.htm $(RELDIR)/$(DS_DOCDIR)/en/slapd/ ; \
+	  $(INSTALL) -m 644 $(OBJDIR)/manual/slapd/pixel.gif $(RELDIR)/$(DS_DOCDIR)/en/slapd/ ; \
+	  $(INSTALL) -m 644 $(OBJDIR)/manual/slapd/topicindex.htm $(RELDIR)/$(DS_DOCDIR)/en/slapd/ ; \
+	  $(INSTALL) -m 644 $(OBJDIR)/manual/slapd/tokens.map $(RELDIR)/$(DS_DOCDIR)/en/slapd/ ; \
     fi
 # copy the manual files from the zip files or checked out directory
 	if [ "$(DSDOC_DIR)" -a -d "$(DSDOC_DIR)" ] ; then \
       if [ -f $(DSDOC_DIR)/$(DSDOC_COPYRIGHT) ] ; then \
-	    $(UNZIP) $(DSDOC_DIR)/$(DSDOC_COPYRIGHT) -d $(RELDIR)/manual/en/slapd ; \
-	    $(UNZIP) $(DSDOC_DIR)/$(DSDOC_CLIENTS) -d $(RELDIR)/manual/en/slapd ; \
+	    $(UNZIP) $(DSDOC_DIR)/$(DSDOC_COPYRIGHT) -d $(RELDIR)/$(DS_DOCDIR)/en/slapd ; \
+	    $(UNZIP) $(DSDOC_DIR)/$(DSDOC_CLIENTS) -d $(RELDIR)/$(DS_DOCDIR)/en/slapd ; \
       else \
-        cp -r $(DSDOC_DIR) $(RELDIR)/manual/en/slapd ; \
+        cp -r $(DSDOC_DIR) $(RELDIR)/$(DS_DOCDIR)/en/slapd ; \
       fi ; \
 	fi
 
 # Copy db tools 
-	$(INSTALL) -m 755 $(DB_BINPATH)/db_printlog$(EXE_SUFFIX) $(RELDIR)/bin/slapd/server
-	$(INSTALL) -m 755 $(DB_BINPATH)/db_verify$(EXE_SUFFIX) $(RELDIR)/bin/slapd/server
+### THIS INSTALLATION SHOULD GO AWAY, WHEN LIBS_TO_PKG BECOME SYSTEM LIB
+	$(INSTALL) -m 755 $(DB_BINPATH)/db_printlog$(EXE_SUFFIX) $(RELDIR)/$(DS_LIBDIR)
+	$(INSTALL) -m 755 $(DB_BINPATH)/db_verify$(EXE_SUFFIX) $(RELDIR)/$(DS_LIBDIR)
 
 # this gets setup, setup.inf, silent.inf, the zip wrapper, and svrcore, among others
 ifeq ($(USE_SETUPUTIL), 1)
@@ -714,7 +721,7 @@ else
 endif
 endif # USE_CONSOLE
 #; for file in $(LDAPSDK_IMPORTS) ; \
-#	do $(ZIP) $(ZIP_FLAGS) -g $(INSTDIR)/slapd/slapd-client.zip bin/slapd/server/$$file$(DOTEXE) ; \
+#	do $(ZIP) $(ZIP_FLAGS) -g $(INSTDIR)/slapd/slapd-client.zip $(DS_LIBDIR)/$$file$(DOTEXE) ; \
 #	done
 
 ifeq ($(USE_SETUPUTIL), 1)
@@ -784,7 +791,7 @@ endif
 	fi
 
 # Install dsktune at root of Installation
-	cp $(RELDIR)/bin/slapd/server/dsktune $(INSTDIR)
+	cp $(RELDIR)/$(DS_LIBDIR)/dsktune $(INSTDIR)
 
 ifeq ($(USE_SETUPUTIL), 1)
 ifndef NO_INSTALLER_TAR_FILES
@@ -1020,24 +1027,23 @@ $(INSTDIR)/$(SLAPD_DIR)/slapd.z:
 # see components.mk for a description of LIBS_TO_PKG
 	-@for file in $(LIBS_TO_PKG) ; \
 	do if [ -f $$file ] ; \
-	then $(INSTALL) -m 755 $$file $(RELDIR)/bin/slapd/server ; \
-	     $(INSTALL) -m 755 $$file $(RELDIR)/bin/slapd/admin/bin ; \
+	then $(INSTALL) -m 755 $$file $(RELDIR)/$(DS_LIBDIR) ; \
 	fi ; \
 	done
-# these are files to copy to the shared/bin directory - ldap cmd line tools, sec tools, etc.
+# these are files to copy to the bin directory - ldap cmd line tools, sec tools, etc.
 	for file in $(BINS_TO_PKG_SHARED) $(LIBS_TO_PKG_SHARED); \
 	do if [ -f $$file ] ; \
-	then $(INSTALL) -m 755 $$file $(RELDIR)/shared/bin ; \
+	then $(INSTALL) -m 755 $$file $(RELDIR)/$(CORE_BINDIR) ; \
 	fi ; \
 	done
 # these are dlls to copy to the clients/dsgw/bin directory to support dsgw & pb
 	for file in $(LIBS_TO_PKG_CLIENTS); \
 	do if [ -f $$file ] ; \
-	then $(INSTALL) -m 755 $$file $(RELDIR)/clients/dsgw/bin ; \
+	then $(INSTALL) -m 755 $$file $(RELDIR)/$(DS_DSGWDIR) ; \
 	fi ; \
 	done
-	$(INSTALL) -m 755 $(OBJDIR)/$(BUILD_HTTPDLL_NAME).dll $(RELDIR)/bin/slapd/server
-	$(INSTALL) -m 755 $(OBJDIR)/$(BUILD_HTTPDLL_NAME).dll $(RELDIR)/clients/dsgw/bin
+	$(INSTALL) -m 755 $(OBJDIR)/$(BUILD_HTTPDLL_NAME).dll $(RELDIR)/$(DS_LIBDIR)
+	$(INSTALL) -m 755 $(OBJDIR)/$(BUILD_HTTPDLL_NAME).dll $(RELDIR)/$(DS_DSGWDIR)
 	rm -f $(SLAPD_ZIPFILE); cd $(RELDIR); zip -r $(SLAPD_ZIPFILE) *
 
 #----------------------------- setup rules ---------------------------------------------------

+ 24 - 18
ldap/cm/newinst/ns-update

@@ -43,7 +43,12 @@
 # the directory it lives in due to run time shared library
 # dependencies
 
-sroot=`echo $0 | sed s#/bin/slapd/admin/bin/.\*##g`
+# ns-update is supposed to be placed in _libdir/<brand>-ds
+brand_ds=`echo $0 | sed -e "s#.*/\([a-z]*-ds\)/.*#\1#"`
+if [ -z ${brand_ds} ]; then
+    brand_ds=`pwd | sed -e "s#.*/\([a-z]*-ds\)/.*#\1#"`
+fi
+sroot=`echo $0 | sed -e "s#/lib/$brand_ds/.\*##g"`
 PERL=perl # just use perl from PATH
 
 #        run_ds_create "$sroot" "$dir" "$inffile"
@@ -56,7 +61,7 @@ run_ds_create()
     inffile="$1"
 
     # the inffile is incomplete - it needs the instance specific stuff
-    dseldif=$sroot/$dir/config/dse.ldif
+    dseldif=$sroot/var/lib/$dir/dse.ldif
     port=`grep \^nsslapd-port: $dseldif | sed -e s/\^nsslapd-port:[\ \	]*//`
     rootdn=`grep \^nsslapd-rootdn: $dseldif | sed -e s/\^nsslapd-rootdn:[\ \	]*//`
     id=`echo $dir | sed -e s/^slapd-//`
@@ -131,9 +136,9 @@ if [ "$iDSISolaris" = "" ]; then
 	# instances in this server root, and assume -r if there
 	# are
 	if [ "$reconfig" = "" ]; then
-		cd $sroot
+		cd $sroot/var/lib
 		for dir in slapd-* ; do
-			if [ -d $dir/config ]; then
+			if [ -f $dir/dse.ldif ]; then
 				reconfig=1
 				extraflags="-r"
 				break
@@ -146,15 +151,15 @@ if [ $reconfig ] ; then
 	cd $sroot
 	for dir in slapd-* ; do
 		# first, fix any old password files
-		if [ -d alias ]; then
-			cd alias
+		if [ -d etc/$brand_ds/$dir ]; then
+			cd etc/$brand_ds/$dir
 			echo Converting $dir to new format password file . . .
-			$PERL $sroot/bin/slapd/admin/bin/migratePwdFile $sroot $dir
-			cd ..
+			$PERL $sroot/lib/$brand_ds/migratePwdFile $sroot $dir
+			cd ../../..
 		fi
 		# Copy new schema ldiffiles
 		echo Copying new schema ldiffiles . . .
-		$PERL $sroot/bin/slapd/admin/bin/upgradeServer $sroot $dir
+		$PERL $sroot/lib/$brand_ds/upgradeServer $brand_ds $sroot $dir
 
 		# next, start the server
 		echo Starting $dir . . .
@@ -166,7 +171,7 @@ if [ $reconfig ] ; then
 
 	done
 	# fix any non-instance specific files - omit server instance argument
-	$PERL $sroot/bin/slapd/admin/bin/upgradeServer $sroot
+	$PERL $sroot/lib/$brand_ds/upgradeServer $brand_ds $sroot
 fi
 
 cd `dirname $0`
@@ -192,13 +197,14 @@ if test -z "$reconfig" ; then
 fi
 rc=$?
 
-# chown the cookie directory - bug 175098
-if [ "$ssuser" ] ; then
-    if [ "$ssgrp" ] ; then
-        chown $ssuser:$ssgrp $sroot/bin/slapd/authck
-    else
-        chown $ssuser $sroot/bin/slapd/authck
-    fi
-fi
+# dsgw package should take care of this ???
+## chown the cookie directory - bug 175098
+#if [ "$ssuser" ] ; then
+#    if [ "$ssgrp" ] ; then
+#        chown $ssuser:$ssgrp $sroot/bin/slapd/authck
+#    else
+#        chown $ssuser $sroot/bin/slapd/authck
+#    fi
+#fi
 
 exit $rc

+ 52 - 27
ldap/nsldap.mk

@@ -72,20 +72,44 @@ RELDIR = $(BUILD_DRIVE)$(RELTOP)/$(OBJDIR_BASE)
 RELDIR_32 = $(BUILD_DRIVE)$(RELTOP)/$(OBJDIR_BASE_32)
 RELDIR_UNSTRIP = $(RELDIR)-unstripped
 
-# this is the place libraries and plugins go which are used by other
-# components i.e. not specific to slapd and its programs
-LIB_RELDIR = $(RELDIR)/lib
+# FHS install paths
+CORE_BINDIR := /usr/bin
+CORE_LIBDIR := /usr/lib
+CORE_DATADIR := /usr/share
+CORE_DOCDIR := /usr/doc
+CORE_SYSCONFDIR := /etc
+DS_ETCDIR := $(CORE_SYSCONFDIR)/$(DS_BRAND)-ds
+DS_LIBDIR := $(CORE_LIBDIR)/$(DS_BRAND)-ds
+DS_DOCDIR := $(CORE_DOCDIR)/$(DS_BRAND)-ds
+DS_PLUGINDIR := $(CORE_DATADIR)/$(DS_BRAND)-ds/plugins
+DS_DATADIR := $(CORE_DATADIR)/$(DS_BRAND)-ds
+DS_LDIFDIR := $(DS_DATADIR)/data
+DS_PROPERTYDIR := $(DS_ETCDIR)/property
+# WILL GO AWAY ???
+DS_JAVADIR := $(CORE_DATADIR)/java
+# WILL GO AWAY ???
+DS_CONSOLEDIR := $(DS_JAVADIR)/$(DS_BRAND)-directoryconsole
+# WILL GO AWAY ???
+DS_DSGWDIR := $(DS_LIBDIR)/dsgw
+# WILL GO AWAY ???
+DS_DSMLGWDIR := $(DS_JAVADIR)/dsmlgw
+DS_SCHEMADIR := $(DS_ETCDIR)/schema
+DS_CONFIGDIR := $(DS_ETCDIR)/config
+DS_LEGACYSCHEMADIR := $(CORE_DATADIR)/$(DS_BRAND)-ds/legacy-schema
+
 # Release path definitions for software components
 # This is the base path for directory server specific components
 LDAP_BASE_RELDIR = $(RELDIR)/bin/slapd
 # This is the base path for the slapd program and other related programs
-LDAP_SERVER_RELDIR = $(LDAP_BASE_RELDIR)/server
+LDAP_SERVER_RELDIR = $(RELDIR)$(DS_LIBDIR)
 # This is the path for administrative programs, installers, CGIs, etc.
-LDAP_ADMIN_BIN_RELDIR = $(LDAP_BASE_RELDIR)/admin/bin
+LDAP_ADMIN_BIN_RELDIR = $(RELDIR)$(DS_LIBDIR)
 # This is the path for other programs, perf counters, etc.
 LDAP_INSTALL_BIN_RELDIR = $(LDAP_BASE_RELDIR)/install/bin
 # This is the base path for directory server specific dlls
-LDAP_LIB_RELDIR = $(LDAP_BASE_RELDIR)/lib
+LDAP_LIB_RELDIR = $(RELDIR)$(DS_LIBDIR)
+# Plugin location
+LDAP_PLUGIN_RELDIR = $(RELDIR)$(DS_LIBDIR)/plugins
 # This is the primary location for the dsadmin dll
 LDAP_ADMDLLDIR = $(LDAP_LIB_RELDIR)
 # This is the location for the dsadmin export and/or static library,
@@ -120,10 +144,11 @@ LDAP_HDIR = $(LDAP_SRC)/include
 
 # set up a target for all directories which are used as dependencies so that the
 # directory will be created if it is needed
-DEPENDENCY_DIRS = $(RELDIR) $(LDAP_SERVER_RELDIR) $(LDAP_ADMIN_BIN_RELDIR) \
-	$(LDAP_LIB_RELDIR) $(LDAP_ADMROOT)/lib $(OBJDIR) $(LDAP_LIBDIR) $(LDAP_OBJDIR) \
-	$(LDAP_MANDIR) $(LDAP_BINDIR) $(LDAP_INCLUDEDIR) $(LDAP_ETCDIR) $(LIB_RELDIR) \
-	$(LDAP_ADMINCDIR) $(LDAP_ADMOBJDIR) $(LDAP_ADMPERLDIR) $(LDAP_INSTALL_BIN_RELDIR)
+DEPENDENCY_DIRS = $(RELDIR) $(LDAP_SERVER_RELDIR) \
+	$(LDAP_ADMROOT)/lib $(OBJDIR) $(LDAP_LIBDIR) $(LDAP_OBJDIR) \
+	$(LDAP_MANDIR) $(LDAP_BINDIR) $(LDAP_INCLUDEDIR) $(LDAP_ETCDIR) \
+	$(LDAP_ADMINCDIR) $(LDAP_ADMOBJDIR) $(LDAP_ADMPERLDIR) \
+	$(LDAP_PLUGIN_RELDIR) $(LDAP_INSTALL_BIN_RELDIR)
 
 $(DEPENDENCY_DIRS):
 	$(MKDIR) $@
@@ -291,14 +316,14 @@ endif
 # be put in <builddir>/lib; this is mostly for NT and other
 # platforms that separate the static and dynamic code
 ifeq ($(ARCH), WINNT)
-LDAP_LIBBACK_LDBM_LIBDIR = $(LDAP_LIBDIR)
-LDAP_LIBBACK_LDBM_DLLDIR = $(LIB_RELDIR)
+LDAP_LIBBACK_LDBM_LIBDIR = $(LDAP_LIB_RELDIR)
+LDAP_LIBBACK_LDBM_DLLDIR = $(LDAP_LIB_RELDIR)
 LDAP_LIBBACK_LDBM = $(addsuffix .$(LIB_SUFFIX), \
     $(addprefix $(LDAP_LIBDIR)/, $(LIBBACK_LDBM_LIB)))
 else
 LDAP_LIBBACK_LDBM = -lback-ldbm
-LDAP_LIBBACK_LDBM_LIBDIR = $(LDAP_LIBDIR)
-LDAP_LIBBACK_LDBM_DLLDIR = $(LIB_RELDIR)
+LDAP_LIBBACK_LDBM_LIBDIR = $(LDAP_LIB_RELDIR)
+LDAP_LIBBACK_LDBM_DLLDIR = $(LDAP_LIB_RELDIR)
 endif
 LDAP_LIBBACK_LDBM_DEP = $(addsuffix .$(DLL_SUFFIX), \
     $(addprefix $(LDAP_LIBBACK_LDBM_LIBDIR)/, $(LIBBACK_LDBM_DLL)))
@@ -515,7 +540,7 @@ LIBBACK_LDIF_DLL = libback-ldif$(DLL_PRESUFFIX)
 ifeq ($(ARCH), WINNT)
 REFERINT_DLL = referint-plugin
 else
-REFERINT_DLL = referint-plugin$(DLL_PRESUFFIX)
+REFERINT_DLL = libreferint-plugin$(DLL_PRESUFFIX)
 endif
 
 #
@@ -524,44 +549,44 @@ endif
 ifeq ($(ARCH), WINNT)
 SYNTAX_DLL = syntax-plugin
 else
-SYNTAX_DLL = syntax-plugin$(DLL_PRESUFFIX)
+SYNTAX_DLL = libsyntax-plugin$(DLL_PRESUFFIX)
 endif
 
 #
 # Dynamic library, COLLATION
 #
-COLLATION_DLL=liblcoll$(DLL_PRESUFFIX)
+COLLATION_DLL=libcollation-plugin$(DLL_PRESUFFIX)
 
 #
 # Dynamic library, NT Synchronization Service plugin
 #
-NTSYNCH_DLL=ntsynch-plugin$(DLL_PRESUFFIX)
+NTSYNCH_DLL=libntsynch-plugin$(DLL_PRESUFFIX)
 
 #
 # Dynamic library, PASS THROUGH AUTHENTICATION PLUGIN
 #
-PASSTHRU_DLL = passthru-plugin$(DLL_PRESUFFIX)
+PASSTHRU_DLL = libpassthru-plugin$(DLL_PRESUFFIX)
 
 #
 # Dynamic library, PAM PASS THROUGH AUTHENTICATION PLUGIN
 #
-PAM_PASSTHRU_DLL = pam-passthru-plugin$(DLL_PRESUFFIX)
+PAM_PASSTHRU_DLL = libpam-passthru-plugin$(DLL_PRESUFFIX)
 
 #
 # Dynamic library, UNIQUE UID CHECKING PLUGIN
 #
-UID_DLL = attr-unique-plugin$(DLL_RESUFFIX)
+UID_DLL = libattr-unique-plugin$(DLL_RESUFFIX)
 
 # Dynamic library, Replication Plugin
 #
-REPLICATION_DLL = replication-plugin$(DLL_RESUFFIX)
+REPLICATION_DLL = libreplication-plugin$(DLL_RESUFFIX)
 
-RETROCL_DLL = retrocl-plugin$(DLL_RESUFFIX)
+RETROCL_DLL = libretrocl-plugin$(DLL_RESUFFIX)
 
 #
 # Dynamic library, ACL PLUGIN
 #
-ACL_DLL = acl-plugin$(DLL_RESUFFIX)
+ACL_DLL = libacl-plugin$(DLL_RESUFFIX)
 
 #
 # Dynamic library, TEST-PLUGINS
@@ -578,7 +603,7 @@ endif
 ifeq ($(ARCH), WINNT)
 PWD_DLL = pwdstorage-plugin
 else
-PWD_DLL = pwdstorage-plugin$(DLL_PRESUFFIX)
+PWD_DLL = libpwdstorage-plugin$(DLL_PRESUFFIX)
 endif
 
 #
@@ -587,13 +612,13 @@ endif
 ifeq ($(ARCH), WINNT)
 DIS_DLL = distrib-plugin
 else
-DIS_DLL = distrib-plugin$(DLL_PRESUFFIX)
+DIS_DLL = libdistrib-plugin$(DLL_PRESUFFIX)
 endif
 
 #
 # Chaining backend library, CHAINING DATABASE PLUGIN
 #
-CB_DLL = chainingdb-plugin$(DLL_PRESUFFIX)
+CB_DLL = libchainingdb-plugin$(DLL_PRESUFFIX)
 
 #
 # Admin server dynamic library location.

+ 1 - 1
ldap/servers/plugins/acl/Makefile

@@ -49,7 +49,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/libacl
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsconfig.mk
 include $(LDAP_SRC)/nsldap.mk

+ 1 - 1
ldap/servers/plugins/chainingdb/Makefile

@@ -50,7 +50,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/libcb
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsconfig.mk
 include $(LDAP_SRC)/nsldap.mk

+ 2 - 2
ldap/servers/plugins/collation/Makefile

@@ -44,8 +44,8 @@ NOSTDCLEAN=true # don't let nsconfig.mk define target clean
 NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
-OBJDEST= $(OBJDIR)/lib/liblcoll
-LIBDIR= $(LIB_RELDIR)
+OBJDEST= $(OBJDIR)/lib/libcollation-plugin
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsconfig.mk
 include $(LDAP_SRC)/nsldap.mk

+ 2 - 2
ldap/servers/plugins/cos/Makefile

@@ -45,7 +45,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/libcos
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsdefs.mk
 include $(BUILD_ROOT)/nsconfig.mk
@@ -58,7 +58,7 @@ endif
 COS_OBJS =	cos.o cos_cache.o
 OBJS = $(addprefix $(OBJDEST)/, $(COS_OBJS)) 
 
-COS_DLL = cos-plugin
+COS_DLL = libcos-plugin
 
 INCLUDES += -I../../slapd  -I../../../include
 CFLAGS+=$(SLCFLAGS) -DSLAPD_LOGGING

+ 1 - 1
ldap/servers/plugins/distrib/Makefile

@@ -48,7 +48,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/libdistrib
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsconfig.mk
 include $(LDAP_SRC)/nsldap.mk

+ 2 - 2
ldap/servers/plugins/http/Makefile

@@ -44,7 +44,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/libhttpclient
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsdefs.mk
 include $(BUILD_ROOT)/nsconfig.mk
@@ -58,7 +58,7 @@ HTTP_OBJS =	http_client.o http_impl.o
 
 OBJS = $(addprefix $(OBJDEST)/, $(HTTP_OBJS)) 
 
-HTTP_DLL = http-client-plugin
+HTTP_DLL = libhttp-client-plugin
 
 INCLUDES += -I../../slapd  -I../../../include
 

+ 1 - 1
ldap/servers/plugins/pam_passthru/Makefile

@@ -49,7 +49,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/libpam_passthru
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsconfig.mk
 include $(LDAP_SRC)/nsldap.mk

+ 1 - 1
ldap/servers/plugins/passthru/Makefile

@@ -50,7 +50,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/libpassthru
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsconfig.mk
 include $(LDAP_SRC)/nsldap.mk

+ 2 - 2
ldap/servers/plugins/presence/Makefile

@@ -45,7 +45,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/libpresence
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsdefs.mk
 include $(BUILD_ROOT)/nsconfig.mk
@@ -58,7 +58,7 @@ endif
 PRESENCE_OBJS =	presence.o
 OBJS = $(addprefix $(OBJDEST)/, $(PRESENCE_OBJS)) 
 
-PRESENCE_DLL = presence-plugin
+PRESENCE_DLL = libpresence-plugin
 
 INCLUDES += -I../http -I../../slapd  -I../../../include  
 CFLAGS+=$(SLCFLAGS) -DSLAPD_LOGGING

+ 1 - 1
ldap/servers/plugins/pwdstorage/Makefile

@@ -49,7 +49,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/libpwdstorage
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsconfig.mk
 include $(LDAP_SRC)/nsldap.mk

+ 1 - 1
ldap/servers/plugins/referint/Makefile

@@ -45,7 +45,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/referint-plugin
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsconfig.mk
 include $(LDAP_SRC)/nsldap.mk

+ 1 - 1
ldap/servers/plugins/replication/Makefile

@@ -50,7 +50,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/replication-plugin
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsconfig.mk
 include $(LDAP_SRC)/nsldap.mk

+ 1 - 1
ldap/servers/plugins/retrocl/Makefile

@@ -49,7 +49,7 @@ NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/retrocl-plugin
 BINDIR = $(LDAP_SERVER_RELDIR)
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsdefs.mk
 include $(BUILD_ROOT)/nsconfig.mk

+ 2 - 2
ldap/servers/plugins/rever/Makefile

@@ -49,7 +49,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/libdes
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsconfig.mk
 include $(BUILD_ROOT)/ns_usepurify.mk
@@ -73,7 +73,7 @@ ifeq ($(ARCH), WINNT)
 LIBREVER_DLL_OBJ = $(addprefix $(OBJDEST)/, dllmain.o)
 endif
 
-REVER_DLL = des-plugin
+REVER_DLL = libdes-plugin
 LIBREVER =	$(addprefix $(LIBDIR)/, $(REVER_DLL).$(DLL_SUFFIX))
 
 ifeq ($(ARCH), WINNT)

+ 2 - 2
ldap/servers/plugins/roles/Makefile

@@ -45,7 +45,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/libroles
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 ifndef INSTDIR
 INSTDIR = c:/netscape/server4/
 endif
@@ -61,7 +61,7 @@ endif
 ROLES_OBJS = roles_plugin.o roles_cache.o
 OBJS = $(addprefix $(OBJDEST)/, $(ROLES_OBJS)) 
 
-ROLES_DLL = roles-plugin
+ROLES_DLL = libroles-plugin
 
 INCLUDES += -I../../slapd  -I../../../include
 CFLAGS+=$(SLCFLAGS) -DSLAPD_LOGGING

+ 2 - 2
ldap/servers/plugins/statechange/Makefile

@@ -45,7 +45,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/libstatechange
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsdefs.mk
 include $(BUILD_ROOT)/nsconfig.mk
@@ -58,7 +58,7 @@ endif
 STATECHANGE_OBJS =	statechange.o
 OBJS = $(addprefix $(OBJDEST)/, $(STATECHANGE_OBJS)) 
 
-STATECHANGE_DLL = statechange-plugin
+STATECHANGE_DLL = libstatechange-plugin
 
 INCLUDES += -I../../slapd  -I../../../include
 CFLAGS+=$(SLCFLAGS) -DSLAPD_LOGGING

+ 1 - 1
ldap/servers/plugins/syntaxes/Makefile

@@ -49,7 +49,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/libsyntax
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsconfig.mk
 include $(LDAP_SRC)/nsldap.mk

+ 1 - 1
ldap/servers/plugins/uiduniq/Makefile

@@ -50,7 +50,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/libuidunique
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 SHAREDLIB = $(OBJDIR)/lib/shared/utils.o
 
 include $(BUILD_ROOT)/nsconfig.mk

+ 2 - 2
ldap/servers/plugins/vattrsp_template/Makefile

@@ -45,7 +45,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/libvattrsp
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsdefs.mk
 include $(BUILD_ROOT)/nsconfig.mk
@@ -58,7 +58,7 @@ endif
 VATTRSP_OBJS =	vattrsp.o
 OBJS = $(addprefix $(OBJDEST)/, $(VATTRSP_OBJS)) 
 
-VATTRSP_DLL = vattrsp-plugin
+VATTRSP_DLL = libvattrsp-plugin
 
 INCLUDES += -I../../slapd  -I../../../include
 CFLAGS+=$(SLCFLAGS) -DSLAPD_LOGGING

+ 2 - 2
ldap/servers/plugins/views/Makefile

@@ -45,7 +45,7 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/lib/libviews
-LIBDIR = $(LIB_RELDIR)
+LIBDIR = $(LDAP_PLUGIN_RELDIR)
 
 include $(BUILD_ROOT)/nsdefs.mk
 include $(BUILD_ROOT)/nsconfig.mk
@@ -58,7 +58,7 @@ endif
 VIEWS_OBJS =	views.o
 OBJS = $(addprefix $(OBJDEST)/, $(VIEWS_OBJS)) 
 
-VIEWS_DLL = views-plugin
+VIEWS_DLL = libviews-plugin
 
 INCLUDES += -I../../slapd  -I../../../include
 CFLAGS+=$(SLCFLAGS) -DSLAPD_LOGGING

+ 1 - 1
ldap/servers/slapd/back-ldbm/Makefile

@@ -178,7 +178,7 @@ ifeq ($(ARCH), WINNT)
 endif
 
 dummy:
-	-@echo LDAP_LIBDIR = $(LDAP_LIBDIR)
+	-@echo LDAP_LIBDIR = $(LDAP_LIB_RELDIR)
 	-@echo LDAP_LIBBACK_LDBM_LIBDIR = $(LDAP_LIBBACK_LDBM_LIBDIR)
 	-@echo LIB_RELDIR = $(LIB_RELDIR)
 	-@echo LDAP_LIBBACK_LDBM_DLLDIR = $(LDAP_LIBBACK_LDBM_DLLDIR)

+ 1 - 1
ldap/servers/slapd/tools/dbscan.c

@@ -745,7 +745,7 @@ static void usage(char *argv0)
     printf("    -r              display the conents of idl\n");
     printf("    -s              Summary of index counts\n");
     printf("  sample usages:\n");
-    printf("    # set <serverroot>/bin/slapd/server:<serverroot>/shared/lib in the library path\n");
+    printf("    # set <prefix>/usr/lib/<brand-ds>:<prefix>/usr/lib:/usr/lib in the library path\n");
     printf("    # dump the entry file\n");
     printf("    %s -f id2entry.db\n", argv0);
     printf("    # display index keys in cn.db4\n");

+ 3 - 3
ldap/servers/slapd/tools/ldclt/Makefile

@@ -47,9 +47,9 @@
 LDAP_SRC = ../../../..
 BUILD_ROOT = ../../../../..
 
-OBJDEST         = $(OBJDIR)/servers/tools/obj
-BINDIR = $(RELDIR)/shared/bin
-DATDIR = $(RELDIR)/shared/data
+OBJDEST = $(OBJDIR)/servers/tools/obj
+BINDIR = $(RELDIR)/usr/bin
+DATDIR = $(RELDIR)/usr/share/data
 
 include $(BUILD_ROOT)/nsdefs.mk
 include $(BUILD_ROOT)/nsconfig.mk

+ 2 - 2
ldap/servers/slapd/tools/rsearch/Makefile

@@ -49,8 +49,8 @@ NOSTDSTRIP=true # don't let nsconfig.mk define target strip
 NSPR20=true	# probably should be defined somewhere else (not sure where)
 
 OBJDEST = $(OBJDIR)/servers/tools/obj
-BINDIR = $(RELDIR)/shared/bin
-DATDIR = $(RELDIR)/shared/data
+BINDIR = $(RELDIR)/usr/bin
+DATDIR = $(RELDIR)/usr/share/$(DS_BRAND)-ds/data
 
 include $(BUILD_ROOT)/nsdefs.mk
 include $(BUILD_ROOT)/nsconfig.mk

+ 3 - 3
ldap/servers/snmp/Makefile

@@ -89,9 +89,9 @@ ifneq ($(ARCH), WINNT)
   EXTRA_LIBS += $(NETSNMP_LINK) $(EXTERNAL_AGENT_LIBS)
 endif
 
-# the redhat-directory.mib goes in the plugins/snmp directory, and the other mib like
-# files go in the plugins/snmp/mibs directory
-MIB_DEST_DIR = $(RELDIR)/plugins/snmp
+# the redhat-directory.mib goes in the _datadir/brand-ds/plugins/snmp directory, and the other mib like
+# files go in the _datadir/brand-ds/plugins/snmp/mibs directory
+MIB_DEST_DIR = $(RELDIR)/$(DS_PLUGINDIR)/snmp
 MIB_SRC_FILES =redhat-directory.mib
 MIBS_DEST_DIR = $(MIB_DEST_DIR)/mibs
 MIBS_SRC_FILES = NETWORK-SERVICES-MIB.txt \