>From 199e031b9389fb8edd3e9315bbd36b87ff8fba16 Mon Sep 17 00:00:00 2001
From: Rich Megginson <rmeggins@redhat.com>
Date: Thu, 12 Nov 2009 11:20:16 -0700
Subject: [PATCH] Implement support for versioning and release engineering procedures - version 1.2.5.a1
 Instead of changing configure.ac AC_INIT for each version change, there
 is a new file - VERSION.sh.  This file also contains support for creating
 version numbers for pre-releases, and pre-release strings containing git
 commit hashes.
 One of the complications is that AC_INIT does not allow you to override the version and package tarname fields.  We can override them after the fact everywhere
 except in config.h.  AC_INIT defines the following which we would like to override but cannot: PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_STRING PACKAGE_BUGREPORT
 Instead, we define DS_ versions of these e.g. DS_PACKAGE_VERSION etc. and make
 these available with AC_DEFINE(DS_PACKAGE_VERSION,...) etc.
 As an extra added precaution, we undefine these in Makefile.am like this:
 DS_DEFINES = ... \
 	-UPACKAGE_VERSION -UPACKAGE_TARNAME -UPACKAGE_STRING -UPACKAGE_BUGREPORT
 If someone tries to use PACKAGE_VERSION in C code, they will not be able to,
 and will have to use DS_PACKAGE_VERSION instead.  All of the DS code that used
 PACKAGE_VERSION has been changed to use DS_PACKAGE_VERSION instead.
 There is a new make target - git-archive - as a convenience for creating source
 tarballs from git.  By default, the source archive will be placed in the build
 directory - you can specify SRCDISTDIR=/path/to/SOURCES to use an alternate
 dir (e.g. make SRCDISTDIR=/path/to/rpmbuild/SOURCES git-archive to make a
 source tarball for rpmbuild)

---
 Makefile.am                                        |   19 +++-
 Makefile.in                                        |   26 ++++-
 VERSION.sh                                         |   50 ++++++++
 config.h.in                                        |   16 +++-
 configure                                          |  124 ++++++++++++--------
 configure.ac                                       |   20 ++-
 ldap/servers/plugins/acl/aclplugin.c               |    2 +-
 ldap/servers/plugins/bitwise/bitwise.c             |    2 +-
 ldap/servers/plugins/chainingdb/cb_init.c          |    2 +-
 ldap/servers/plugins/collation/orfilter.c          |    2 +-
 ldap/servers/plugins/cos/cos.c                     |    2 +-
 ldap/servers/plugins/deref/deref.c                 |    2 +-
 ldap/servers/plugins/dna/dna.c                     |    4 +-
 ldap/servers/plugins/http/http_client.c            |    2 +-
 ldap/servers/plugins/linkedattrs/linked_attrs.c    |    2 +-
 ldap/servers/plugins/memberof/memberof.c           |    2 +-
 ldap/servers/plugins/pam_passthru/pam_ptpreop.c    |    2 +-
 ldap/servers/plugins/passthru/ptpreop.c            |    2 +-
 ldap/servers/plugins/presence/presence.c           |    2 +-
 ldap/servers/plugins/pwdstorage/pwd_init.c         |   26 ++--
 ldap/servers/plugins/referint/referint.c           |    2 +-
 ldap/servers/plugins/replication/repl5_init.c      |   16 ++--
 ldap/servers/plugins/replication/repl_init.c       |   12 +-
 ldap/servers/plugins/replication/winsync-plugin.h  |    2 +-
 ldap/servers/plugins/retrocl/retrocl.c             |    6 +-
 ldap/servers/plugins/rever/rever.c                 |    2 +-
 ldap/servers/plugins/roles/roles_plugin.c          |    2 +-
 ldap/servers/plugins/schema_reload/schema_reload.c |    2 +-
 ldap/servers/plugins/statechange/statechange.c     |    2 +-
 ldap/servers/plugins/syntaxes/bin.c                |    8 +-
 ldap/servers/plugins/syntaxes/bitstring.c          |    2 +-
 ldap/servers/plugins/syntaxes/ces.c                |    4 +-
 ldap/servers/plugins/syntaxes/cis.c                |   14 +-
 ldap/servers/plugins/syntaxes/deliverymethod.c     |    2 +-
 ldap/servers/plugins/syntaxes/dn.c                 |    2 +-
 ldap/servers/plugins/syntaxes/facsimile.c          |    2 +-
 ldap/servers/plugins/syntaxes/guide.c              |    4 +-
 ldap/servers/plugins/syntaxes/int.c                |    2 +-
 ldap/servers/plugins/syntaxes/nameoptuid.c         |    2 +-
 ldap/servers/plugins/syntaxes/numericstring.c      |    2 +-
 ldap/servers/plugins/syntaxes/sicis.c              |    2 +-
 ldap/servers/plugins/syntaxes/tel.c                |    2 +-
 ldap/servers/plugins/syntaxes/teletex.c            |    2 +-
 ldap/servers/plugins/syntaxes/telex.c              |    2 +-
 ldap/servers/plugins/uiduniq/7bit.c                |    2 +-
 ldap/servers/plugins/uiduniq/uid.c                 |    2 +-
 ldap/servers/plugins/usn/usn.c                     |    2 +-
 ldap/servers/plugins/vattrsp_template/vattrsp.c    |    2 +-
 ldap/servers/plugins/views/views.c                 |    2 +-
 ldap/servers/slapd/back-ldbm/init.c                |    2 +-
 ldap/servers/slapd/back-ldbm/upgrade.c             |    2 +-
 ldap/servers/slapd/back-ldif/init.c                |    2 +-
 ldap/servers/slapd/log.c                           |    2 +-
 ldap/servers/slapd/passwd_extop.c                  |    2 +-
 ldap/servers/slapd/slap.h                          |    4 +-
 ldap/servers/slapd/start_tls_extop.c               |    2 +-
 ldap/servers/slapd/test-plugins/testbind.c         |    2 +-
 ldap/servers/slapd/test-plugins/testdatainterop.c  |    2 +-
 ldap/servers/slapd/test-plugins/testentry.c        |    2 +-
 ldap/servers/slapd/test-plugins/testgetip.c        |    2 +-
 ldap/servers/slapd/test-plugins/testpostop.c       |    2 +-
 ldap/servers/slapd/test-plugins/testpreop.c        |    2 +-
 ldap/servers/slapd/test-plugins/testsaslbind.c     |    2 +-
 63 files changed, 286 insertions(+), 161 deletions(-)
 create mode 100644 VERSION.sh

diff --git a/Makefile.am b/Makefile.am
index 676b5cf..95eec14 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,7 +11,9 @@ QUOTE := $(NULLSTRING)"# a double quote"
 BUILDNUM := $(shell perl $(srcdir)/buildnum.pl)
 NQBUILDNUM := $(subst \,,$(subst $(QUOTE),,$(BUILDNUM)))
 DEBUG_DEFINES = @debug_defs@
-DS_DEFINES = -DBUILD_NUM=$(BUILDNUM) -DVENDOR="\"$(vendor)\"" -DBRAND="\"$(brand)\"" -DCAPBRAND="\"$(capbrand)\""
+# the -U undefines these symbols - should use the corresponding DS_ ones instead - see configure.ac
+DS_DEFINES = -DBUILD_NUM=$(BUILDNUM) -DVENDOR="\"$(vendor)\"" -DBRAND="\"$(brand)\"" -DCAPBRAND="\"$(capbrand)\"" \
+	-UPACKAGE_VERSION -UPACKAGE_TARNAME -UPACKAGE_STRING -UPACKAGE_BUGREPORT
 DS_INCLUDES = -I$(srcdir)/ldap/include -I$(srcdir)/ldap/servers/slapd -I$(srcdir)/include -I.
 # these paths are dependent on the settings of prefix and exec_prefix which may be specified
 # at make time.  So we cannot use AC_DEFINE in the configure.ac because that would set the
@@ -1367,3 +1369,18 @@ endif
 	if [ ! -d $(dir $@) ] ; then mkdir -p $(dir $@) ; fi
 	$(fixupcmd) $^ > $@
 
+# if distdir is a git tag, use that for the git archive tag, else
+# just assume a developer build and use HEAD
+git-archive:
+	if [ -n "$(SRCDISTDIR)" -a -d "$(SRCDISTDIR)" ] ; then \
+		srcdistdir=$(SRCDISTDIR) ; \
+	else \
+		srcdistdir=`pwd` ; \
+	fi ; \
+	cd $(srcdir) ; \
+	if git show-ref --tags -q $(distdir) ; then \
+		gittag=$(distdir) ; \
+	else \
+		gittag=HEAD ; \
+	fi ; \
+	git archive --prefix=$(distdir)/ $$gittag | bzip2 > $$srcdistdir/$(distdir).tar.bz2
diff --git a/VERSION.sh b/VERSION.sh
new file mode 100644
index 0000000..cc6e1d6
--- /dev/null
+++ b/VERSION.sh
@@ -0,0 +1,50 @@
+# brand is lower case - used for names that don't appear to end users
+# brand is used for file naming - should contain no spaces
+brand=389
+# capbrand is the properly capitalized brand name that appears to end users
+# may contain spaces
+capbrand=389
+# vendor is the properly formatted vendor/manufacturer name that appears to end users
+vendor="389 Project"
+
+# PACKAGE_VERSION is constructed from these
+VERSION_MAJOR=1
+VERSION_MINOR=2
+VERSION_MAINT=5
+# if this is a PRERELEASE, set VERSION_PREREL
+# otherwise, comment it out
+# be sure to include the dot prefix in the prerel
+VERSION_PREREL=.a1
+# NOTES on VERSION_PREREL
+# use aN for an alpha release e.g. a1, a2, etc.
+# use rcN for a release candidate e.g. rc1, rc2, etc.
+# for extra clarification, the date can be appended to the prerel e.g.
+# RC1.`date +%Y%m%d`
+# a git commit may also be used
+
+if test -n "$VERSION_PREREL"; then
+# if the source is from a git repo, put the last commit
+# in the version
+# if this is not a git repo, git log will say
+#  fatal: Not a git repository
+# to stderr and stdout will be empty
+# this tells git to print the short commit hash from the last commit
+    COMMIT=`cd $srcdir ; git log -1 --pretty=format:%h`
+    if test -n "$COMMIT" ; then
+        VERSION_PREREL=$VERSION_PREREL.git$COMMIT
+    fi
+fi
+
+# the real version used throughout configure and make
+# NOTE: because of autoconf/automake harshness, we cannot override the settings
+# below in C code - there is no way to override the default #defines
+# for these set with AC_INIT - so configure.ac should AC_DEFINE
+# DS_PACKAGE_VERSION DS_PACKAGE_TARNAME DS_PACKAGE_BUGREPORT
+# for use in C code - other code (perl scripts, shell scripts, Makefiles)
+# can use PACKAGE_VERSION et. al.
+PACKAGE_VERSION=$VERSION_MAJOR.$VERSION_MINOR.${VERSION_MAINT}$VERSION_PREREL
+# the name of the source tarball - see make dist
+PACKAGE_TARNAME=${brand}-ds-base
+# url for bug reports
+PACKAGE_BUGREPORT="${PACKAGE_BUGREPORT}enter_bug.cgi?product=$brand"
+PACKAGE_STRING="$PACKAGE_TARNAME $PACKAGE_VERSION"
diff --git a/configure.ac b/configure.ac
index 7f1fbce..e891e05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,11 +1,21 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.59)
-# This version is the version returned by ns-slapd -v
-AC_INIT([dirsrv], [1.2.4], [http://bugzilla.redhat.com/])
+AC_INIT([dirsrv],[1.0],[http://bugzilla.redhat.com/])
 # AC_CONFIG_HEADER must be called right after AC_INIT.
 AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([1.9 foreign subdir-objects])
+# include the version information
+. $srcdir/VERSION.sh
+AC_DEFINE_UNQUOTED([DS_PACKAGE_VERSION], "$PACKAGE_VERSION", [package version])
+AC_DEFINE_UNQUOTED([DS_PACKAGE_TARNAME], "$PACKAGE_TARNAME", [package tarball name])
+AC_DEFINE_UNQUOTED([DS_PACKAGE_BUGREPORT], "$PACKAGE_BUGREPORT", [package bug report url])
+AC_DEFINE_UNQUOTED([DS_PACKAGE_STRING], "$PACKAGE_STRING", [package string])
+AM_INIT_AUTOMAKE([1.9 foreign subdir-objects dist-bzip2 no-dist-gzip no-define])
+# define these for automake distdir
+VERSION=$PACKAGE_VERSION
+PACKAGE=$PACKAGE_TARNAME
+AC_DEFINE_UNQUOTED([VERSION], "$VERSION", [package version])
+AC_DEFINE_UNQUOTED([PACKAGE], "$PACKAGE", [package tar name])
 AM_MAINTAINER_MODE
 AC_CANONICAL_HOST
 
@@ -185,10 +195,6 @@ AM_CONDITIONAL(enable_presence,test "$enable_presence" = "yes")
 # the default prefix - override with --prefix or --with-fhs
 AC_PREFIX_DEFAULT([/opt/$PACKAGE_NAME])
 
-brand=389
-capbrand=389
-vendor="389 Project"
-
 m4_include(m4/fhs.m4)
 
 # installation paths - by default, we store everything
diff --git a/ldap/servers/plugins/acl/aclplugin.c b/ldap/servers/plugins/acl/aclplugin.c
index f2b9f0f..881d0f1 100644
--- a/ldap/servers/plugins/acl/aclplugin.c
+++ b/ldap/servers/plugins/acl/aclplugin.c
@@ -47,7 +47,7 @@
  */
 #include "acl.h"
 
-static Slapi_PluginDesc pdesc = { "acl", VENDOR, PACKAGE_VERSION, "acl access check plugin" };
+static Slapi_PluginDesc pdesc = { "acl", VENDOR, DS_PACKAGE_VERSION, "acl access check plugin" };
 char *plugin_name = ACL_PLUGIN_NAME;
 
 /* Prototypes */
diff --git a/ldap/servers/plugins/bitwise/bitwise.c b/ldap/servers/plugins/bitwise/bitwise.c
index 6a4dc65..7c88c93 100644
--- a/ldap/servers/plugins/bitwise/bitwise.c
+++ b/ldap/servers/plugins/bitwise/bitwise.c
@@ -191,7 +191,7 @@ bitwise_filter_create (Slapi_PBlock* pb)
     return LDAP_SUCCESS;
 }
 
-static Slapi_PluginDesc pdesc = { "bitwise", VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "bitwise", VENDOR, DS_PACKAGE_VERSION,
               "bitwise match plugin" };
 
 int /* LDAP error code */
diff --git a/ldap/servers/plugins/chainingdb/cb_init.c b/ldap/servers/plugins/chainingdb/cb_init.c
index 0f12d3b..21a54d5 100644
--- a/ldap/servers/plugins/chainingdb/cb_init.c
+++ b/ldap/servers/plugins/chainingdb/cb_init.c
@@ -44,7 +44,7 @@
 
 Slapi_PluginDesc chainingdbdesc = { CB_PLUGIN_NAME,
 				    VENDOR,
-				    PACKAGE_VERSION,
+				    DS_PACKAGE_VERSION,
 				    CB_PLUGIN_DESCRIPTION };
 
 
diff --git a/ldap/servers/plugins/collation/orfilter.c b/ldap/servers/plugins/collation/orfilter.c
index ed2ffe2..d947e02 100644
--- a/ldap/servers/plugins/collation/orfilter.c
+++ b/ldap/servers/plugins/collation/orfilter.c
@@ -969,7 +969,7 @@ or_indexer_create (Slapi_PBlock* pb)
     return rc;
 }
 
-static Slapi_PluginDesc pdesc = { "orderingrule", VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "orderingrule", VENDOR, DS_PACKAGE_VERSION,
               "internationalized ordering rule plugin" };
 
 #define SLAPI_ORPLUGIN_NAME	pdesc.spd_description
diff --git a/ldap/servers/plugins/cos/cos.c b/ldap/servers/plugins/cos/cos.c
index 7935110..78ae5d6 100644
--- a/ldap/servers/plugins/cos/cos.c
+++ b/ldap/servers/plugins/cos/cos.c
@@ -132,7 +132,7 @@ int cos_close( Slapi_PBlock *pb );
 int cos_post_op( Slapi_PBlock *pb );
 
 
-static Slapi_PluginDesc pdesc = { "cos", VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "cos", VENDOR, DS_PACKAGE_VERSION,
 	"class of service plugin" };
 
 static void * cos_plugin_identity = NULL;
diff --git a/ldap/servers/plugins/deref/deref.c b/ldap/servers/plugins/deref/deref.c
index 306988f..5bbab13 100644
--- a/ldap/servers/plugins/deref/deref.c
+++ b/ldap/servers/plugins/deref/deref.c
@@ -59,7 +59,7 @@ static int g_plugin_started = 0;
 
 static Slapi_PluginDesc pdesc = { DEREF_FEATURE_DESC,
                                   VENDOR,
-                                  PACKAGE_VERSION,
+                                  DS_PACKAGE_VERSION,
                                   DEREF_PLUGIN_DESC };
 
 /*
diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c
index d35cd8c..337cd23 100644
--- a/ldap/servers/plugins/dna/dna.c
+++ b/ldap/servers/plugins/dna/dna.c
@@ -123,12 +123,12 @@
 
 static Slapi_PluginDesc pdesc = { DNA_FEATURE_DESC,
                                   VENDOR,
-                                  PACKAGE_VERSION,
+                                  DS_PACKAGE_VERSION,
                                   DNA_PLUGIN_DESC };
 
 static Slapi_PluginDesc exop_pdesc = { DNA_EXOP_FEATURE_DESC,
                                        VENDOR,
-                                       PACKAGE_VERSION,
+                                       DS_PACKAGE_VERSION,
                                        DNA_EXOP_DESC };
 
 
diff --git a/ldap/servers/plugins/http/http_client.c b/ldap/servers/plugins/http/http_client.c
index 2203327..821f895 100644
--- a/ldap/servers/plugins/http/http_client.c
+++ b/ldap/servers/plugins/http/http_client.c
@@ -121,7 +121,7 @@ static void *api[7];
  */
 static Slapi_PluginDesc pdesc = { "http-client",
 								  VENDOR,
-								  PACKAGE_VERSION,
+								  DS_PACKAGE_VERSION,
 								  "HTTP Client plugin" };
 
 static Slapi_ComponentId *plugin_id = NULL;
diff --git a/ldap/servers/plugins/linkedattrs/linked_attrs.c b/ldap/servers/plugins/linkedattrs/linked_attrs.c
index edaf5db..822f6c0 100644
--- a/ldap/servers/plugins/linkedattrs/linked_attrs.c
+++ b/ldap/servers/plugins/linkedattrs/linked_attrs.c
@@ -58,7 +58,7 @@ static int g_plugin_started = 0;
 
 static Slapi_PluginDesc pdesc = { LINK_FEATURE_DESC,
                                   VENDOR,
-                                  PACKAGE_VERSION,
+                                  DS_PACKAGE_VERSION,
                                   LINK_PLUGIN_DESC };
 
 /*
diff --git a/ldap/servers/plugins/memberof/memberof.c b/ldap/servers/plugins/memberof/memberof.c
index 7589443..85bcdcb 100644
--- a/ldap/servers/plugins/memberof/memberof.c
+++ b/ldap/servers/plugins/memberof/memberof.c
@@ -73,7 +73,7 @@
 #include "memberof.h"
 
 static Slapi_PluginDesc pdesc = { "memberof", VENDOR,
-	PACKAGE_VERSION, "memberof plugin" };
+	DS_PACKAGE_VERSION, "memberof plugin" };
 
 static void* _PluginID = NULL;
 static Slapi_Mutex *memberof_operation_lock = 0;
diff --git a/ldap/servers/plugins/pam_passthru/pam_ptpreop.c b/ldap/servers/plugins/pam_passthru/pam_ptpreop.c
index 39c13fc..9e14c26 100644
--- a/ldap/servers/plugins/pam_passthru/pam_ptpreop.c
+++ b/ldap/servers/plugins/pam_passthru/pam_ptpreop.c
@@ -46,7 +46,7 @@
 
 #include "pam_passthru.h"
 
-static Slapi_PluginDesc pdesc = { "pam_passthruauth",  VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "pam_passthruauth",  VENDOR, DS_PACKAGE_VERSION,
 	"PAM pass through authentication plugin" };
 
 static void * pam_passthruauth_plugin_identity = NULL;
diff --git a/ldap/servers/plugins/passthru/ptpreop.c b/ldap/servers/plugins/passthru/ptpreop.c
index 959310f..e566c64 100644
--- a/ldap/servers/plugins/passthru/ptpreop.c
+++ b/ldap/servers/plugins/passthru/ptpreop.c
@@ -47,7 +47,7 @@
 
 #include "passthru.h"
 
-static Slapi_PluginDesc pdesc = { "passthruauth",  VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "passthruauth",  VENDOR, DS_PACKAGE_VERSION,
 	"pass through authentication plugin" };
 
 /*
diff --git a/ldap/servers/plugins/presence/presence.c b/ldap/servers/plugins/presence/presence.c
index fcb390a..5e47841 100644
--- a/ldap/servers/plugins/presence/presence.c
+++ b/ldap/servers/plugins/presence/presence.c
@@ -153,7 +153,7 @@ extern "C" {
 
 static Slapi_PluginDesc pdesc = { "IM Presence",
 								  VENDOR,
-								  PACKAGE_VERSION,
+								  DS_PACKAGE_VERSION,
 	"presence plugin" };
 
 /**
diff --git a/ldap/servers/plugins/pwdstorage/pwd_init.c b/ldap/servers/plugins/pwdstorage/pwd_init.c
index 1bd24fd..23b7417 100644
--- a/ldap/servers/plugins/pwdstorage/pwd_init.c
+++ b/ldap/servers/plugins/pwdstorage/pwd_init.c
@@ -47,33 +47,33 @@
 
 #include "pwdstorage.h"
 
-static Slapi_PluginDesc sha_pdesc = { "sha-password-storage-scheme", VENDOR, PACKAGE_VERSION, "Secure Hashing Algorithm (SHA)" };
+static Slapi_PluginDesc sha_pdesc = { "sha-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "Secure Hashing Algorithm (SHA)" };
 
-static Slapi_PluginDesc ssha_pdesc = { "ssha-password-storage-scheme", VENDOR, PACKAGE_VERSION, "Salted Secure Hashing Algorithm (SSHA)" };
+static Slapi_PluginDesc ssha_pdesc = { "ssha-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "Salted Secure Hashing Algorithm (SSHA)" };
 
-static Slapi_PluginDesc sha256_pdesc = { "sha256-password-storage-scheme", VENDOR, PACKAGE_VERSION, "Secure Hashing Algorithm (SHA256)" };
+static Slapi_PluginDesc sha256_pdesc = { "sha256-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "Secure Hashing Algorithm (SHA256)" };
 
-static Slapi_PluginDesc ssha256_pdesc = { "ssha256-password-storage-scheme", VENDOR, PACKAGE_VERSION, "Salted Secure Hashing Algorithm (SSHA256)" };
+static Slapi_PluginDesc ssha256_pdesc = { "ssha256-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "Salted Secure Hashing Algorithm (SSHA256)" };
 
-static Slapi_PluginDesc sha384_pdesc = { "sha384-password-storage-scheme", VENDOR, PACKAGE_VERSION, "Secure Hashing Algorithm (SHA384)" };
+static Slapi_PluginDesc sha384_pdesc = { "sha384-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "Secure Hashing Algorithm (SHA384)" };
 
-static Slapi_PluginDesc ssha384_pdesc = { "ssha384-password-storage-scheme", VENDOR, PACKAGE_VERSION, "Salted Secure Hashing Algorithm (SSHA384)" };
+static Slapi_PluginDesc ssha384_pdesc = { "ssha384-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "Salted Secure Hashing Algorithm (SSHA384)" };
 
-static Slapi_PluginDesc sha512_pdesc = { "sha512-password-storage-scheme", VENDOR, PACKAGE_VERSION, "Secure Hashing Algorithm (SHA512)" };
+static Slapi_PluginDesc sha512_pdesc = { "sha512-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "Secure Hashing Algorithm (SHA512)" };
 
-static Slapi_PluginDesc ssha512_pdesc = { "ssha512-password-storage-scheme", VENDOR, PACKAGE_VERSION, "Salted Secure Hashing Algorithm (SSHA512)" };
+static Slapi_PluginDesc ssha512_pdesc = { "ssha512-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "Salted Secure Hashing Algorithm (SSHA512)" };
 
 #ifndef _WIN32
-static Slapi_PluginDesc crypt_pdesc = { "crypt-password-storage-scheme", VENDOR, PACKAGE_VERSION, "Unix crypt algorithm (CRYPT)" };
+static Slapi_PluginDesc crypt_pdesc = { "crypt-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "Unix crypt algorithm (CRYPT)" };
 #endif
 
-static Slapi_PluginDesc clear_pdesc = { "clear-password-storage-scheme", VENDOR, PACKAGE_VERSION, "No encryption (CLEAR)" };
+static Slapi_PluginDesc clear_pdesc = { "clear-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "No encryption (CLEAR)" };
 
-static Slapi_PluginDesc ns_mta_md5_pdesc = { "NS-MTA-MD5-password-storage-scheme", VENDOR, PACKAGE_VERSION, "Netscape MD5 (NS-MTA-MD5)" };
+static Slapi_PluginDesc ns_mta_md5_pdesc = { "NS-MTA-MD5-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "Netscape MD5 (NS-MTA-MD5)" };
 
-static Slapi_PluginDesc md5_pdesc = { "md5-password-storage-scheme", VENDOR, PACKAGE_VERSION, "MD5 hash algorithm (MD5)" };
+static Slapi_PluginDesc md5_pdesc = { "md5-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "MD5 hash algorithm (MD5)" };
 
-static Slapi_PluginDesc smd5_pdesc = { "smd5-password-storage-scheme", VENDOR, PACKAGE_VERSION, "Salted MD5 hash algorithm (SMD5)" };
+static Slapi_PluginDesc smd5_pdesc = { "smd5-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "Salted MD5 hash algorithm (SMD5)" };
 
 static char *plugin_name = "NSPwdStoragePlugin";
 
diff --git a/ldap/servers/plugins/referint/referint.c b/ldap/servers/plugins/referint/referint.c
index 0a44310..70fccd2 100644
--- a/ldap/servers/plugins/referint/referint.c
+++ b/ldap/servers/plugins/referint/referint.c
@@ -92,7 +92,7 @@ int keeprunning = 0;
 static PRLock 		*keeprunning_mutex = NULL; 
 static PRCondVar        *keeprunning_cv = NULL; 
 
-static Slapi_PluginDesc pdesc = { "referint", VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "referint", VENDOR, DS_PACKAGE_VERSION,
 	"referential integrity plugin" };
 
 static void* referint_plugin_identity = NULL;
diff --git a/ldap/servers/plugins/replication/repl5_init.c b/ldap/servers/plugins/replication/repl5_init.c
index 2c45179..2c4a581 100644
--- a/ldap/servers/plugins/replication/repl5_init.c
+++ b/ldap/servers/plugins/replication/repl5_init.c
@@ -125,14 +125,14 @@ static char *response_name_list[] = {
 
 /* ----------------------------- Multi-Master Replication Plugin */
 
-static Slapi_PluginDesc multimasterdesc = {"replication-multimaster", VENDOR, PACKAGE_VERSION, "Multi-master Replication Plugin"};
-static Slapi_PluginDesc multimasterpreopdesc = {"replication-multimaster-preop", VENDOR, PACKAGE_VERSION, "Multi-master replication pre-operation plugin"};
-static Slapi_PluginDesc multimasterpostopdesc = {"replication-multimaster-postop", VENDOR, PACKAGE_VERSION, "Multi-master replication post-operation plugin"};
-static Slapi_PluginDesc multimasterinternalpreopdesc = {"replication-multimaster-internalpreop", VENDOR, PACKAGE_VERSION, "Multi-master replication internal pre-operation plugin"};
-static Slapi_PluginDesc multimasterinternalpostopdesc = {"replication-multimaster-internalpostop", VENDOR, PACKAGE_VERSION, "Multimaster replication internal post-operation plugin"};
-static Slapi_PluginDesc multimasterbepreopdesc = {"replication-multimaster-bepreop", VENDOR, PACKAGE_VERSION, "Multimaster replication bepre-operation plugin"};
-static Slapi_PluginDesc multimasterbepostopdesc = {"replication-multimaster-bepostop", VENDOR, PACKAGE_VERSION, "Multimaster replication bepost-operation plugin"};
-static Slapi_PluginDesc multimasterextopdesc = { "replication-multimaster-extop", VENDOR, PACKAGE_VERSION, "Multimaster replication extended-operation plugin" };
+static Slapi_PluginDesc multimasterdesc = {"replication-multimaster", VENDOR, DS_PACKAGE_VERSION, "Multi-master Replication Plugin"};
+static Slapi_PluginDesc multimasterpreopdesc = {"replication-multimaster-preop", VENDOR, DS_PACKAGE_VERSION, "Multi-master replication pre-operation plugin"};
+static Slapi_PluginDesc multimasterpostopdesc = {"replication-multimaster-postop", VENDOR, DS_PACKAGE_VERSION, "Multi-master replication post-operation plugin"};
+static Slapi_PluginDesc multimasterinternalpreopdesc = {"replication-multimaster-internalpreop", VENDOR, DS_PACKAGE_VERSION, "Multi-master replication internal pre-operation plugin"};
+static Slapi_PluginDesc multimasterinternalpostopdesc = {"replication-multimaster-internalpostop", VENDOR, DS_PACKAGE_VERSION, "Multimaster replication internal post-operation plugin"};
+static Slapi_PluginDesc multimasterbepreopdesc = {"replication-multimaster-bepreop", VENDOR, DS_PACKAGE_VERSION, "Multimaster replication bepre-operation plugin"};
+static Slapi_PluginDesc multimasterbepostopdesc = {"replication-multimaster-bepostop", VENDOR, DS_PACKAGE_VERSION, "Multimaster replication bepost-operation plugin"};
+static Slapi_PluginDesc multimasterextopdesc = { "replication-multimaster-extop", VENDOR, DS_PACKAGE_VERSION, "Multimaster replication extended-operation plugin" };
 
 static int multimaster_stopped_flag; /* A flag which is set when all the plugin threads are to stop */
 static int multimaster_started_flag = 0;
diff --git a/ldap/servers/plugins/replication/repl_init.c b/ldap/servers/plugins/replication/repl_init.c
index 7177ff6..5c89759 100644
--- a/ldap/servers/plugins/replication/repl_init.c
+++ b/ldap/servers/plugins/replication/repl_init.c
@@ -82,12 +82,12 @@ void plugin_init_debug_level(int *level_ptr)
 
 /* ----------------------------- Legacy Replication Plugin */
 
-static Slapi_PluginDesc legacydesc = { "replication-legacy", VENDOR, PACKAGE_VERSION, "Legacy Replication Plugin" };
-static Slapi_PluginDesc legacypreopdesc = { "replication-legacy-preop", VENDOR, PACKAGE_VERSION, "Legacy replication pre-operation plugin" };
-static Slapi_PluginDesc legacypostopdesc = { "replication-legacy-postop", VENDOR, PACKAGE_VERSION, "Legacy replication post-operation plugin" };
-static Slapi_PluginDesc legacyinternalpreopdesc = { "replication-legacy-internalpreop", VENDOR, PACKAGE_VERSION, "Legacy replication internal pre-operation plugin" };
-static Slapi_PluginDesc legacyinternalpostopdesc = { "replication-legacy-internalpostop", VENDOR, PACKAGE_VERSION, "Legacy replication internal post-operation plugin" };
-static Slapi_PluginDesc legacyentrydesc = { "replication-legacy-entry", VENDOR, PACKAGE_VERSION, "Legacy replication entry plugin" };
+static Slapi_PluginDesc legacydesc = { "replication-legacy", VENDOR, DS_PACKAGE_VERSION, "Legacy Replication Plugin" };
+static Slapi_PluginDesc legacypreopdesc = { "replication-legacy-preop", VENDOR, DS_PACKAGE_VERSION, "Legacy replication pre-operation plugin" };
+static Slapi_PluginDesc legacypostopdesc = { "replication-legacy-postop", VENDOR, DS_PACKAGE_VERSION, "Legacy replication post-operation plugin" };
+static Slapi_PluginDesc legacyinternalpreopdesc = { "replication-legacy-internalpreop", VENDOR, DS_PACKAGE_VERSION, "Legacy replication internal pre-operation plugin" };
+static Slapi_PluginDesc legacyinternalpostopdesc = { "replication-legacy-internalpostop", VENDOR, DS_PACKAGE_VERSION, "Legacy replication internal post-operation plugin" };
+static Slapi_PluginDesc legacyentrydesc = { "replication-legacy-entry", VENDOR, DS_PACKAGE_VERSION, "Legacy replication entry plugin" };
 
 static int legacy_stopped; /* A flag which is set when all the plugin threads are to stop */        
 
diff --git a/ldap/servers/plugins/replication/winsync-plugin.h b/ldap/servers/plugins/replication/winsync-plugin.h
index e6260d2..5a0f65d 100644
--- a/ldap/servers/plugins/replication/winsync-plugin.h
+++ b/ldap/servers/plugins/replication/winsync-plugin.h
@@ -492,7 +492,7 @@ test_winsync_destroy_agmt_cb(void *cbdata, const Slapi_DN *ds_subtree,
 static Slapi_PluginDesc test_winsync_pdesc = {
     "test-winsync-plugin",
     VENDOR,
-    PACKAGE_VERSION,
+    DS_PACKAGE_VERSION,
     "test winsync plugin"
 };
 
diff --git a/ldap/servers/plugins/retrocl/retrocl.c b/ldap/servers/plugins/retrocl/retrocl.c
index 0fb15c2..f598e3d 100644
--- a/ldap/servers/plugins/retrocl/retrocl.c
+++ b/ldap/servers/plugins/retrocl/retrocl.c
@@ -81,9 +81,9 @@ char **retrocl_attributes = NULL;
 
 /* ----------------------------- Retrocl Plugin */
 
-static Slapi_PluginDesc retrocldesc = {"retrocl", VENDOR, PACKAGE_VERSION, "Retrocl Plugin"};
-static Slapi_PluginDesc retroclpostopdesc = {"retrocl-postop", VENDOR, PACKAGE_VERSION, "retrocl post-operation plugin"};
-static Slapi_PluginDesc retroclinternalpostopdesc = {"retrocl-internalpostop", VENDOR, PACKAGE_VERSION, "retrocl internal post-operation plugin"};
+static Slapi_PluginDesc retrocldesc = {"retrocl", VENDOR, DS_PACKAGE_VERSION, "Retrocl Plugin"};
+static Slapi_PluginDesc retroclpostopdesc = {"retrocl-postop", VENDOR, DS_PACKAGE_VERSION, "retrocl post-operation plugin"};
+static Slapi_PluginDesc retroclinternalpostopdesc = {"retrocl-internalpostop", VENDOR, DS_PACKAGE_VERSION, "retrocl internal post-operation plugin"};
 
 
 /*
diff --git a/ldap/servers/plugins/rever/rever.c b/ldap/servers/plugins/rever/rever.c
index 50b61ff..0a49975 100644
--- a/ldap/servers/plugins/rever/rever.c
+++ b/ldap/servers/plugins/rever/rever.c
@@ -46,7 +46,7 @@
 
 #include "rever.h"
 
-static Slapi_PluginDesc pdesc = { "des-storage-scheme", VENDOR, PACKAGE_VERSION, "DES storage scheme plugin" };
+static Slapi_PluginDesc pdesc = { "des-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "DES storage scheme plugin" };
 
 static char *plugin_name = "ReverStoragePlugin";
 
diff --git a/ldap/servers/plugins/roles/roles_plugin.c b/ldap/servers/plugins/roles/roles_plugin.c
index 92a64ed..89bcdb5 100644
--- a/ldap/servers/plugins/roles/roles_plugin.c
+++ b/ldap/servers/plugins/roles/roles_plugin.c
@@ -61,7 +61,7 @@
 static void * roles_plugin_identity = NULL;
 
 static Slapi_PluginDesc pdesc = { "roles",
-		VENDOR, PACKAGE_VERSION, "roles plugin" };
+		VENDOR, DS_PACKAGE_VERSION, "roles plugin" };
 
 #ifdef _WIN32
 int *module_ldap_debug = 0;
diff --git a/ldap/servers/plugins/schema_reload/schema_reload.c b/ldap/servers/plugins/schema_reload/schema_reload.c
index b47d425..293350c 100644
--- a/ldap/servers/plugins/schema_reload/schema_reload.c
+++ b/ldap/servers/plugins/schema_reload/schema_reload.c
@@ -78,7 +78,7 @@
 static PRLock *schemareload_lock = NULL;
 
 static Slapi_PluginDesc pdesc = { "schemareload",
-    VENDOR, PACKAGE_VERSION,
+    VENDOR, DS_PACKAGE_VERSION,
     "task plugin to reload schema files" };
 
 static int schemareload_add(Slapi_PBlock *pb, Slapi_Entry *e,
diff --git a/ldap/servers/plugins/statechange/statechange.c b/ldap/servers/plugins/statechange/statechange.c
index 8db0591..016975a 100644
--- a/ldap/servers/plugins/statechange/statechange.c
+++ b/ldap/servers/plugins/statechange/statechange.c
@@ -89,7 +89,7 @@ static void _statechange_vattr_cache_invalidator_callback(Slapi_Entry *e, char *
 static SCNotify *statechange_find_notify(char *dn, char *filter, notify_callback func);
 
 
-static Slapi_PluginDesc pdesc = { "statechange", VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "statechange", VENDOR, DS_PACKAGE_VERSION,
 	"state change notification service plugin" };
 
 
diff --git a/ldap/servers/plugins/syntaxes/bin.c b/ldap/servers/plugins/syntaxes/bin.c
index 791f31c..229e142 100644
--- a/ldap/servers/plugins/syntaxes/bin.c
+++ b/ldap/servers/plugins/syntaxes/bin.c
@@ -79,22 +79,22 @@ static char *fax_names[] = { "FAX", FAX_SYNTAX_OID, 0 };
  * a number of attributes in our default schema.  We should try to eliminate
  * it's use and remove support for it. */
 static Slapi_PluginDesc bin_pdesc = {
-	"bin-syntax", VENDOR, PACKAGE_VERSION,
+	"bin-syntax", VENDOR, DS_PACKAGE_VERSION,
 	"binary attribute syntax plugin"
 };
 
 static Slapi_PluginDesc octetstring_pdesc = {
-	"octetstring-syntax", VENDOR, PACKAGE_VERSION,
+	"octetstring-syntax", VENDOR, DS_PACKAGE_VERSION,
 	"octet string attribute syntax plugin"
 };
 
 static Slapi_PluginDesc jpeg_pdesc = {
-	"jpeg-syntax", VENDOR, PACKAGE_VERSION,
+	"jpeg-syntax", VENDOR, DS_PACKAGE_VERSION,
 	"JPEG attribute syntax plugin"
 };
 
 static Slapi_PluginDesc fax_pdesc = {
-	"fax-syntax", VENDOR, PACKAGE_VERSION,
+	"fax-syntax", VENDOR, DS_PACKAGE_VERSION,
 	"Fax attribute syntax plugin"
 };
 
diff --git a/ldap/servers/plugins/syntaxes/bitstring.c b/ldap/servers/plugins/syntaxes/bitstring.c
index d5eb7cc..70738f1 100644
--- a/ldap/servers/plugins/syntaxes/bitstring.c
+++ b/ldap/servers/plugins/syntaxes/bitstring.c
@@ -63,7 +63,7 @@ static int bitstring_validate(struct berval *val);
 /* the first name is the official one from RFC 4517 */
 static char *names[] = { "Bit String", "bitstring", BITSTRING_SYNTAX_OID, 0 };
 
-static Slapi_PluginDesc pdesc = { "bitstring-syntax", VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "bitstring-syntax", VENDOR, DS_PACKAGE_VERSION,
 	"Bit String attribute syntax plugin" };
 
 int
diff --git a/ldap/servers/plugins/syntaxes/ces.c b/ldap/servers/plugins/syntaxes/ces.c
index 07f9ba8..077afc1 100644
--- a/ldap/servers/plugins/syntaxes/ces.c
+++ b/ldap/servers/plugins/syntaxes/ces.c
@@ -70,10 +70,10 @@ static char *ia5_names[] = { "IA5String", "ces", "caseexactstring",
 static char *uri_names[] = { "URI", "1.3.6.1.4.1.4401.1.1.1",0};
 
 static Slapi_PluginDesc ia5_pdesc = { "ces-syntax", VENDOR,
-	PACKAGE_VERSION, "caseExactString attribute syntax plugin" };
+	DS_PACKAGE_VERSION, "caseExactString attribute syntax plugin" };
 
 static Slapi_PluginDesc uri_pdesc = { "uri-syntax", VENDOR,
-	PACKAGE_VERSION, "uri attribute syntax plugin" };
+	DS_PACKAGE_VERSION, "uri attribute syntax plugin" };
 
 
 /*
diff --git a/ldap/servers/plugins/syntaxes/cis.c b/ldap/servers/plugins/syntaxes/cis.c
index 2a4c802..4a15e5e 100644
--- a/ldap/servers/plugins/syntaxes/cis.c
+++ b/ldap/servers/plugins/syntaxes/cis.c
@@ -153,31 +153,31 @@ n\" "
 
 
 static Slapi_PluginDesc dirstring_pdesc = { "directorystring-syntax",
-		VENDOR, PACKAGE_VERSION,
+		VENDOR, DS_PACKAGE_VERSION,
 		"DirectoryString attribute syntax plugin" };
 
 static Slapi_PluginDesc boolean_pdesc = { "boolean-syntax",
-		VENDOR, PACKAGE_VERSION,
+		VENDOR, DS_PACKAGE_VERSION,
 		"Boolean attribute syntax plugin" };
 
 static Slapi_PluginDesc time_pdesc = { "time-syntax",
-		VENDOR, PACKAGE_VERSION,
+		VENDOR, DS_PACKAGE_VERSION,
 		"GeneralizedTime attribute syntax plugin" };
 
 static Slapi_PluginDesc country_pdesc = { "countrystring-syntax",
-		VENDOR, PACKAGE_VERSION,
+		VENDOR, DS_PACKAGE_VERSION,
 		"Country String attribute syntax plugin" };
 
 static Slapi_PluginDesc postal_pdesc = { "postaladdress-syntax",
-		VENDOR, PACKAGE_VERSION,
+		VENDOR, DS_PACKAGE_VERSION,
 		"Postal Address attribute syntax plugin" };
 
 static Slapi_PluginDesc oid_pdesc = { "oid-syntax",
-		VENDOR, PACKAGE_VERSION,
+		VENDOR, DS_PACKAGE_VERSION,
 		"OID attribute syntax plugin" };
 
 static Slapi_PluginDesc printable_pdesc = { "printablestring-syntax",
-		VENDOR, PACKAGE_VERSION,
+		VENDOR, DS_PACKAGE_VERSION,
 		"Printable String attribtue syntax plugin" };
 
 
diff --git a/ldap/servers/plugins/syntaxes/deliverymethod.c b/ldap/servers/plugins/syntaxes/deliverymethod.c
index 67c9b5a..c643156 100644
--- a/ldap/servers/plugins/syntaxes/deliverymethod.c
+++ b/ldap/servers/plugins/syntaxes/deliverymethod.c
@@ -64,7 +64,7 @@ static int pdm_validate(const char *start, const char *end);
 /* the first name is the official one from RFC 4517 */
 static char *names[] = { "Delivery Method", "delivery", DELIVERYMETHOD_SYNTAX_OID, 0 };
 
-static Slapi_PluginDesc pdesc = { "delivery-syntax", VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "delivery-syntax", VENDOR, DS_PACKAGE_VERSION,
 	"Delivery Method attribute syntax plugin" };
 
 int
diff --git a/ldap/servers/plugins/syntaxes/dn.c b/ldap/servers/plugins/syntaxes/dn.c
index c3f8287..9a41a05 100644
--- a/ldap/servers/plugins/syntaxes/dn.c
+++ b/ldap/servers/plugins/syntaxes/dn.c
@@ -63,7 +63,7 @@ static int dn_validate( struct berval *val );
 static char *names[] = { "DN", DN_SYNTAX_OID, 0 };
 
 static Slapi_PluginDesc pdesc = { "dn-syntax", VENDOR,
-	PACKAGE_VERSION, "distinguished name attribute syntax plugin" };
+	DS_PACKAGE_VERSION, "distinguished name attribute syntax plugin" };
 
 int
 dn_init( Slapi_PBlock *pb )
diff --git a/ldap/servers/plugins/syntaxes/facsimile.c b/ldap/servers/plugins/syntaxes/facsimile.c
index 2000978..34fedb1 100644
--- a/ldap/servers/plugins/syntaxes/facsimile.c
+++ b/ldap/servers/plugins/syntaxes/facsimile.c
@@ -64,7 +64,7 @@ static int fax_parameter_validate(const char *start, const char *end);
 /* the first name is the official one from RFC 4517 */
 static char *names[] = { "Facsimile Telephone Number", "facsimile", FACSIMILE_SYNTAX_OID, 0 };
 
-static Slapi_PluginDesc pdesc = { "facsimile-syntax", VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "facsimile-syntax", VENDOR, DS_PACKAGE_VERSION,
 	"Facsimile Telephone Number attribute syntax plugin" };
 
 int
diff --git a/ldap/servers/plugins/syntaxes/guide.c b/ldap/servers/plugins/syntaxes/guide.c
index 0b2e174..ec9fd6f 100644
--- a/ldap/servers/plugins/syntaxes/guide.c
+++ b/ldap/servers/plugins/syntaxes/guide.c
@@ -70,11 +70,11 @@ static char *guide_names[] = { "Guide", "guide", GUIDE_SYNTAX_OID, 0 };
 static char *enhancedguide_names[] = { "Enhanced Guide", "enhancedguide",
 		ENHANCEDGUIDE_SYNTAX_OID, 0 };
 
-static Slapi_PluginDesc guide_pdesc = { "guide-syntax", VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc guide_pdesc = { "guide-syntax", VENDOR, DS_PACKAGE_VERSION,
 	"Guide attribute syntax plugin" };
 
 static Slapi_PluginDesc enhancedguide_pdesc = { "enhancedguide-syntax",
-		VENDOR, PACKAGE_VERSION,
+		VENDOR, DS_PACKAGE_VERSION,
 		"Enhanced Guide attribute syntax plugin" };
 
 int
diff --git a/ldap/servers/plugins/syntaxes/int.c b/ldap/servers/plugins/syntaxes/int.c
index 2d98d06..ace9365 100644
--- a/ldap/servers/plugins/syntaxes/int.c
+++ b/ldap/servers/plugins/syntaxes/int.c
@@ -63,7 +63,7 @@ static char *names[] = { "INTEGER", "int", INTEGER_SYNTAX_OID, 0 };
 #define INTEGERORDERINGMATCH_OID "2.5.13.15"
 
 static Slapi_PluginDesc pdesc = { "int-syntax", VENDOR,
-	PACKAGE_VERSION, "integer attribute syntax plugin" };
+	DS_PACKAGE_VERSION, "integer attribute syntax plugin" };
 
 static Slapi_MatchingRuleEntry
 integerMatch = { INTEGERMATCH_OID, NULL /* no alias? */,
diff --git a/ldap/servers/plugins/syntaxes/nameoptuid.c b/ldap/servers/plugins/syntaxes/nameoptuid.c
index fe28313..b46ac53 100644
--- a/ldap/servers/plugins/syntaxes/nameoptuid.c
+++ b/ldap/servers/plugins/syntaxes/nameoptuid.c
@@ -63,7 +63,7 @@ static int nameoptuid_validate(struct berval *val);
 /* the first name is the official one from RFC 4517 */
 static char *names[] = { "Name And Optional UID", "nameoptuid", NAMEANDOPTIONALUID_SYNTAX_OID, 0 };
 
-static Slapi_PluginDesc pdesc = { "nameoptuid-syntax", VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "nameoptuid-syntax", VENDOR, DS_PACKAGE_VERSION,
 	"Name And Optional UID attribute syntax plugin" };
 
 int
diff --git a/ldap/servers/plugins/syntaxes/numericstring.c b/ldap/servers/plugins/syntaxes/numericstring.c
index 2a38538..acda9ac 100644
--- a/ldap/servers/plugins/syntaxes/numericstring.c
+++ b/ldap/servers/plugins/syntaxes/numericstring.c
@@ -64,7 +64,7 @@ static char *names[] = { "Numeric String", "numstr", NUMERICSTRING_SYNTAX_OID, 0
 #define NUMERICSTRINGSUBSTRINGMATCH_OID	"2.5.13.10"
 
 static Slapi_PluginDesc pdesc = { "numstr-syntax", VENDOR,
-	PACKAGE_VERSION, "numeric string attribute syntax plugin" };
+	DS_PACKAGE_VERSION, "numeric string attribute syntax plugin" };
 
 static Slapi_MatchingRuleEntry
 numericStringMatch = { NUMERICSTRINGMATCH_OID, NULL /* no alias? */,
diff --git a/ldap/servers/plugins/syntaxes/sicis.c b/ldap/servers/plugins/syntaxes/sicis.c
index bcc80c0..dd4781a 100644
--- a/ldap/servers/plugins/syntaxes/sicis.c
+++ b/ldap/servers/plugins/syntaxes/sicis.c
@@ -69,7 +69,7 @@ static char *names[] = { "SpaceInsensitiveString",
 		SPACE_INSENSITIVE_STRING_SYNTAX_OID, 0 };
 
 static Slapi_PluginDesc pdesc = { "spaceinsensitivestring-syntax",
-	VENDOR, PACKAGE_VERSION,
+	VENDOR, DS_PACKAGE_VERSION,
 	"space insensitive string attribute syntax plugin" };
 
 int
diff --git a/ldap/servers/plugins/syntaxes/tel.c b/ldap/servers/plugins/syntaxes/tel.c
index 8ea3f9e..8c74908 100644
--- a/ldap/servers/plugins/syntaxes/tel.c
+++ b/ldap/servers/plugins/syntaxes/tel.c
@@ -63,7 +63,7 @@ static int tel_validate(struct berval *val);
 /* the first name is the official one from RFC 2252 */
 static char *names[] = { "TelephoneNumber", "tel", TELEPHONE_SYNTAX_OID, 0 };
 
-static Slapi_PluginDesc pdesc = { "tele-syntax", VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "tele-syntax", VENDOR, DS_PACKAGE_VERSION,
 	"telephoneNumber attribute syntax plugin" };
 
 int
diff --git a/ldap/servers/plugins/syntaxes/teletex.c b/ldap/servers/plugins/syntaxes/teletex.c
index 683af9f..0d1f36d 100644
--- a/ldap/servers/plugins/syntaxes/teletex.c
+++ b/ldap/servers/plugins/syntaxes/teletex.c
@@ -64,7 +64,7 @@ static int ttx_param_validate(const char *start, const char *end);
 /* the first name is the official one from RFC 4517 */
 static char *names[] = { "Teletex Terminal Identifier", "teletextermid", TELETEXTERMID_SYNTAX_OID, 0 };
 
-static Slapi_PluginDesc pdesc = { "teletextermid-syntax", VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "teletextermid-syntax", VENDOR, DS_PACKAGE_VERSION,
 	"Teletex Terminal Identifier attribute syntax plugin" };
 
 int
diff --git a/ldap/servers/plugins/syntaxes/telex.c b/ldap/servers/plugins/syntaxes/telex.c
index ed56ef4..456f8a2 100644
--- a/ldap/servers/plugins/syntaxes/telex.c
+++ b/ldap/servers/plugins/syntaxes/telex.c
@@ -63,7 +63,7 @@ static int telex_validate(struct berval *val);
 /* the first name is the official one from RFC 4517 */
 static char *names[] = { "Telex Number", "telexnumber", TELEXNUMBER_SYNTAX_OID, 0 };
 
-static Slapi_PluginDesc pdesc = { "telex-syntax", VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "telex-syntax", VENDOR, DS_PACKAGE_VERSION,
 	"Telex Number attribute syntax plugin" };
 
 int
diff --git a/ldap/servers/plugins/uiduniq/7bit.c b/ldap/servers/plugins/uiduniq/7bit.c
index 98f216a..56eef22 100644
--- a/ldap/servers/plugins/uiduniq/7bit.c
+++ b/ldap/servers/plugins/uiduniq/7bit.c
@@ -85,7 +85,7 @@
  */
 static char *plugin_name = "NS7bitAttr";
 static Slapi_PluginDesc
-pluginDesc = { "NS7bitAttr", VENDOR, PACKAGE_VERSION,
+pluginDesc = { "NS7bitAttr", VENDOR, DS_PACKAGE_VERSION,
   "Enforce  7-bit clean attribute values" };
 
 
diff --git a/ldap/servers/plugins/uiduniq/uid.c b/ldap/servers/plugins/uiduniq/uid.c
index 955e677..1464b52 100644
--- a/ldap/servers/plugins/uiduniq/uid.c
+++ b/ldap/servers/plugins/uiduniq/uid.c
@@ -95,7 +95,7 @@ static int search_one_berval(const char *baseDN, const char *attrName,
 static char *plugin_name = "NSUniqueAttr";
 static Slapi_PluginDesc
 pluginDesc = { 
-	"NSUniqueAttr", VENDOR, PACKAGE_VERSION,
+	"NSUniqueAttr", VENDOR, DS_PACKAGE_VERSION,
 	"Enforce unique attribute values" 
 };
 static void* plugin_identity = NULL;
diff --git a/ldap/servers/plugins/usn/usn.c b/ldap/servers/plugins/usn/usn.c
index 19b146a..992a9ae 100644
--- a/ldap/servers/plugins/usn/usn.c
+++ b/ldap/servers/plugins/usn/usn.c
@@ -42,7 +42,7 @@
 #include "usn.h"
 
 static Slapi_PluginDesc pdesc = {
-        "USN", VENDOR, PACKAGE_VERSION,
+        "USN", VENDOR, DS_PACKAGE_VERSION,
         "USN (Update Sequence Number) plugin" };
 
 static CSNGen *_usn_csngen = NULL;
diff --git a/ldap/servers/plugins/vattrsp_template/vattrsp.c b/ldap/servers/plugins/vattrsp_template/vattrsp.c
index b0c9671..c815761 100644
--- a/ldap/servers/plugins/vattrsp_template/vattrsp.c
+++ b/ldap/servers/plugins/vattrsp_template/vattrsp.c
@@ -93,7 +93,7 @@ static int vattrsp_vattr_types(
 		);
 
 
-static Slapi_PluginDesc pdesc = { "vattrexamplesp", VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "vattrexamplesp", VENDOR, DS_PACKAGE_VERSION,
 	"vattr service provider example plugin" };
 
 static void * vattrsp_plugin_identity = NULL;
diff --git a/ldap/servers/plugins/views/views.c b/ldap/servers/plugins/views/views.c
index 8563d19..68e991f 100644
--- a/ldap/servers/plugins/views/views.c
+++ b/ldap/servers/plugins/views/views.c
@@ -148,7 +148,7 @@ static int _internal_api_views_entry_dn_exists(char *view_dn, char *e_dn);
 static int _internal_api_views_entry_exists_general(char *view_dn, Slapi_Entry *e, char *e_dn);
 
 
-static Slapi_PluginDesc pdesc = { "views", VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "views", VENDOR, DS_PACKAGE_VERSION,
 	"virtual directory information tree views plugin" };
 
 static void * view_plugin_identity = NULL;
diff --git a/ldap/servers/slapd/back-ldbm/init.c b/ldap/servers/slapd/back-ldbm/init.c
index e52d8ea..e1c57ba 100644
--- a/ldap/servers/slapd/back-ldbm/init.c
+++ b/ldap/servers/slapd/back-ldbm/init.c
@@ -49,7 +49,7 @@
 static void *IDL_api[3];
 
 static Slapi_PluginDesc pdesc = { "ldbm-backend", VENDOR,
-        PACKAGE_VERSION, "high-performance LDAP backend database plugin" };
+        DS_PACKAGE_VERSION, "high-performance LDAP backend database plugin" };
 
 static int add_ldbm_internal_attr_syntax( const char *name, const char *oid,
 		const char *syntax, const char *mr_equality, unsigned long extraflags );
diff --git a/ldap/servers/slapd/back-ldbm/upgrade.c b/ldap/servers/slapd/back-ldbm/upgrade.c
index 94cbdcb..083b5ad 100644
--- a/ldap/servers/slapd/back-ldbm/upgrade.c
+++ b/ldap/servers/slapd/back-ldbm/upgrade.c
@@ -338,7 +338,7 @@ int ldbm_upgrade(ldbm_instance *inst, int action)
             {
                  LDAPDebug(LDAP_DEBUG_ANY, 
                    "ldbm_upgrade: Upgrading instance %s to %s%s is successfully done.\n",
-                   inst->inst_name, LDBM_VERSION_BASE, PACKAGE_VERSION);
+                   inst->inst_name, LDBM_VERSION_BASE, DS_PACKAGE_VERSION);
             }
             else
             {
diff --git a/ldap/servers/slapd/back-ldif/init.c b/ldap/servers/slapd/back-ldif/init.c
index ab74f2f..584c82a 100644
--- a/ldap/servers/slapd/back-ldif/init.c
+++ b/ldap/servers/slapd/back-ldif/init.c
@@ -51,7 +51,7 @@
 
 #include "back-ldif.h"
 
-static Slapi_PluginDesc pdesc = { "ldif-backend", "Netscape", PACKAGE_VERSION,
+static Slapi_PluginDesc pdesc = { "ldif-backend", "Netscape", DS_PACKAGE_VERSION,
 	"LDIF backend database plugin" };
 
 #ifdef _WIN32
diff --git a/ldap/servers/slapd/log.c b/ldap/servers/slapd/log.c
index 6470c06..ac6bdc7 100644
--- a/ldap/servers/slapd/log.c
+++ b/ldap/servers/slapd/log.c
@@ -1639,7 +1639,7 @@ log_write_title (LOGFD fp)
 	int err = 0;
 
 	PR_snprintf(buff, bufflen, "\t%s B%s\n",
-				fe_cfg->versionstring ? fe_cfg->versionstring : CAPBRAND "-Directory/" PACKAGE_VERSION,
+				fe_cfg->versionstring ? fe_cfg->versionstring : CAPBRAND "-Directory/" DS_PACKAGE_VERSION,
 				buildnum ? buildnum : "");
 	LOG_WRITE_NOW(fp, buff, strlen(buff), 0, err);
 
diff --git a/ldap/servers/slapd/passwd_extop.c b/ldap/servers/slapd/passwd_extop.c
index bba6d41..b5f30e0 100644
--- a/ldap/servers/slapd/passwd_extop.c
+++ b/ldap/servers/slapd/passwd_extop.c
@@ -85,7 +85,7 @@
 #define LDAP_EXTOP_PASSMOD_RANDOM_BYTES	6
 
 
-Slapi_PluginDesc passwdopdesc = { "passwd_modify_plugin", VENDOR, PACKAGE_VERSION,
+Slapi_PluginDesc passwdopdesc = { "passwd_modify_plugin", VENDOR, DS_PACKAGE_VERSION,
 	"Password Modify extended operation plugin" };
 
 /* Check SLAPI_USERPWD_ATTR attribute of the directory entry 
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index 35fc1f5..5860350 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -202,8 +202,8 @@ typedef struct symbol_t {
 #endif
 
 #define SLAPD_VENDOR_NAME	VENDOR
-#define SLAPD_VERSION_STR	CAPBRAND "-Directory/" PACKAGE_VERSION
-#define SLAPD_SHORT_VERSION_STR	PACKAGE_VERSION
+#define SLAPD_VERSION_STR	CAPBRAND "-Directory/" DS_PACKAGE_VERSION
+#define SLAPD_SHORT_VERSION_STR	DS_PACKAGE_VERSION
 
 typedef void	(*VFP)(void *);
 typedef void	(*VFPP)(void **);
diff --git a/ldap/servers/slapd/start_tls_extop.c b/ldap/servers/slapd/start_tls_extop.c
index def71db..dffaeea 100644
--- a/ldap/servers/slapd/start_tls_extop.c
+++ b/ldap/servers/slapd/start_tls_extop.c
@@ -69,7 +69,7 @@
 /* #define START_TLS_OID	"1.3.6.1.4.1.1466.20037" */
 
 
-Slapi_PluginDesc exopdesc = { "start_tls_plugin", VENDOR, PACKAGE_VERSION,
+Slapi_PluginDesc exopdesc = { "start_tls_plugin", VENDOR, DS_PACKAGE_VERSION,
 	"Start TLS extended operation plugin" };
 
 
diff --git a/ldap/servers/slapd/test-plugins/testbind.c b/ldap/servers/slapd/test-plugins/testbind.c
index c9c49df..a065279 100644
--- a/ldap/servers/slapd/test-plugins/testbind.c
+++ b/ldap/servers/slapd/test-plugins/testbind.c
@@ -74,7 +74,7 @@
 #include <string.h>
 #include "slapi-plugin.h"
 
-Slapi_PluginDesc bindpdesc = { "test-bind", VENDOR, PACKAGE_VERSION,
+Slapi_PluginDesc bindpdesc = { "test-bind", VENDOR, DS_PACKAGE_VERSION,
 	"sample bind pre-operation plugin" };
 
 static Slapi_ComponentId *plugin_id = NULL;
diff --git a/ldap/servers/slapd/test-plugins/testdatainterop.c b/ldap/servers/slapd/test-plugins/testdatainterop.c
index cc0e2fe..504f785 100644
--- a/ldap/servers/slapd/test-plugins/testdatainterop.c
+++ b/ldap/servers/slapd/test-plugins/testdatainterop.c
@@ -118,7 +118,7 @@
 /*
  * Static variables.
  */
-static Slapi_PluginDesc plugindesc = { PLUGIN_NAME, VENDOR, PACKAGE_VERSION,
+static Slapi_PluginDesc plugindesc = { PLUGIN_NAME, VENDOR, DS_PACKAGE_VERSION,
 	"sample pre-operation null suffix plugin" };
 
 static Slapi_ComponentId *plugin_id = NULL;
diff --git a/ldap/servers/slapd/test-plugins/testentry.c b/ldap/servers/slapd/test-plugins/testentry.c
index 9c1f32a..6d4a62b 100644
--- a/ldap/servers/slapd/test-plugins/testentry.c
+++ b/ldap/servers/slapd/test-plugins/testentry.c
@@ -95,7 +95,7 @@ nsslapd-pluginId: test-entry
 #include <string.h>
 #include "slapi-plugin.h"
 
-Slapi_PluginDesc entrypdesc = { "test-entry", VENDOR, PACKAGE_VERSION,
+Slapi_PluginDesc entrypdesc = { "test-entry", VENDOR, DS_PACKAGE_VERSION,
 	"sample entry modification plugin" };
 
 /* Entry store plug-in function */
diff --git a/ldap/servers/slapd/test-plugins/testgetip.c b/ldap/servers/slapd/test-plugins/testgetip.c
index 2a360b4..7e6f530 100644
--- a/ldap/servers/slapd/test-plugins/testgetip.c
+++ b/ldap/servers/slapd/test-plugins/testgetip.c
@@ -79,7 +79,7 @@
 #include "slapi-plugin.h"
 #include "nspr.h"
 
-Slapi_PluginDesc getippdesc = { "test-getip", VENDOR, PACKAGE_VERSION,
+Slapi_PluginDesc getippdesc = { "test-getip", VENDOR, DS_PACKAGE_VERSION,
 	"sample pre-operation plugin" };
 
 static char *netaddr2str( PRNetAddr *addrp, char *buf, size_t buflen );
diff --git a/ldap/servers/slapd/test-plugins/testpostop.c b/ldap/servers/slapd/test-plugins/testpostop.c
index d5291f3..c600adf 100644
--- a/ldap/servers/slapd/test-plugins/testpostop.c
+++ b/ldap/servers/slapd/test-plugins/testpostop.c
@@ -98,7 +98,7 @@ static char changelogfile[MAX_PATH+1];
 static char *changelogfile = "/tmp/changelog";
 #endif
 
-Slapi_PluginDesc postoppdesc = { "test-postop", VENDOR, PACKAGE_VERSION,
+Slapi_PluginDesc postoppdesc = { "test-postop", VENDOR, DS_PACKAGE_VERSION,
 	"sample post-operation plugin" };
 
 static void write_changelog( int optype, char *dn, void *change, int flag );
diff --git a/ldap/servers/slapd/test-plugins/testpreop.c b/ldap/servers/slapd/test-plugins/testpreop.c
index c44d741..9b3be6c 100644
--- a/ldap/servers/slapd/test-plugins/testpreop.c
+++ b/ldap/servers/slapd/test-plugins/testpreop.c
@@ -84,7 +84,7 @@
 #include <string.h>
 #include "slapi-plugin.h"
 
-Slapi_PluginDesc preoppdesc = { "test-preop", VENDOR, PACKAGE_VERSION,
+Slapi_PluginDesc preoppdesc = { "test-preop", VENDOR, DS_PACKAGE_VERSION,
 	"sample pre-operation plugin" };
 
 /* Pre-operation plug-in function */
diff --git a/ldap/servers/slapd/test-plugins/testsaslbind.c b/ldap/servers/slapd/test-plugins/testsaslbind.c
index e395950..0dc20e3 100644
--- a/ldap/servers/slapd/test-plugins/testsaslbind.c
+++ b/ldap/servers/slapd/test-plugins/testsaslbind.c
@@ -85,7 +85,7 @@ nsslapd-plugindescription: sample SASL bind pre-operation plugin
 #include <string.h>
 #include "slapi-plugin.h"
 
-Slapi_PluginDesc saslpdesc = { "test-saslbind", VENDOR, PACKAGE_VERSION,
+Slapi_PluginDesc saslpdesc = { "test-saslbind", VENDOR, DS_PACKAGE_VERSION,
 	"sample SASL bind pre-operation plugin" };
 
 
-- 
1.5.5.6

