Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > main-backports-src > by-pkgid > 33d0881b7912d809109c62956da3ce1e > files > 31

openldap-2.4.25-4mdv2010.2.src.rpm

diff -p -up openldap-2.4.25/contrib/slapd-modules/acl/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/acl/Makefile
--- openldap-2.4.25/contrib/slapd-modules/acl/Makefile.contribmake	2011-03-29 15:43:32.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/acl/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -0,0 +1,48 @@
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted only as authorized by the OpenLDAP
+# Public License.
+#
+# A copy of this license is available in the file LICENSE in the
+# top-level directory of the distribution or, alternatively, at
+# <http://www.OpenLDAP.org/license.html>.
+
+CPPFLAGS+=-I../../../include -I../../../servers/slapd 
+CPPFLAGS+=-DSLAPD_OVER_ACL=SLAPD_MOD_DYNAMIC
+LIBTOOL=../../../libtool
+
+ldap_subdir = openldap
+prefix=/usr/local
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../servers/slapd/slapd
+
+all: posixgroup.la
+
+%.lo:	%.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $<
+
+%.la:   %.lo
+	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
+		   -rpath $(PREFIX)/lib -module -o $@ $<
+
+clean:
+	rm -rf *.lo *.la *.o .libs/
+
+install: posixgroup.la
+	mkdir -p $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
+
+test: posixgroup.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/addpartial/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/addpartial/Makefile
--- openldap-2.4.25/contrib/slapd-modules/addpartial/Makefile.contribmake	2009-01-21 02:18:19.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/addpartial/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -1,13 +1,47 @@
-# $OpenLDAP: pkg/ldap/contrib/slapd-modules/addpartial/Makefile,v 1.1.2.4 2009/01/21 00:18:19 quanah Exp $
-OPENLDAP_SRC=../../..
-OPENLDAP_BLD=../../..
-CPPFLAGS+=-I${OPENLDAP_SRC}/include -I${OPENLDAP_SRC}/servers/slapd -I${OPENLDAP_BLD}/include
-CC=gcc
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted only as authorized by the OpenLDAP
+# Public License.
+#
+# A copy of this license is available in the file LICENSE in the
+# top-level directory of the distribution or, alternatively, at
+# <http://www.OpenLDAP.org/license.html>.
 
-all: addpartial-overlay.so
+CPPFLAGS+=-I../../../include -I../../../servers/slapd 
+LIBTOOL=../../../libtool
 
-addpartial-overlay.so: addpartial-overlay.c
-	$(CC) -shared $(CPPFLAGS) $(LDFLAGS) -Wall -o $@ $?
+ldap_subdir = openldap
+prefix=/usr/local
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../servers/slapd/slapd
+
+all: addpartial.la
+
+%.lo:	addpartial-overlay.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $< -o addpartial.lo
+
+%.la:   %.lo
+	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
+		   -rpath $(PREFIX)/lib -module -o $@ $<
 
 clean:
-	rm addpartial-overlay.so
+	rm -rf *.lo *.la *.o .libs/
+
+install: addpartial.la
+	mkdir -p $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
+
+test: addpartial.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/allop/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/allop/Makefile
--- openldap-2.4.25/contrib/slapd-modules/allop/Makefile.contribmake	2011-03-29 15:43:32.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/allop/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -0,0 +1,47 @@
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted only as authorized by the OpenLDAP
+# Public License.
+#
+# A copy of this license is available in the file LICENSE in the
+# top-level directory of the distribution or, alternatively, at
+# <http://www.OpenLDAP.org/license.html>.
+
+CPPFLAGS+=-I../../../include -I../../../servers/slapd 
+LIBTOOL=../../../libtool
+
+ldap_subdir = openldap
+prefix=/usr/local
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../servers/slapd/slapd
+
+all: allop.la
+
+%.lo:	%.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $<
+
+%.la:   %.lo
+	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
+		   -rpath $(PREFIX)/lib -module -o $@ $<
+
+clean:
+	rm -rf *.lo *.la *.o .libs/
+
+install: allop.la
+	mkdir -p $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
+
+test: allop.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/allowed/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/allowed/Makefile
--- openldap-2.4.25/contrib/slapd-modules/allowed/Makefile.contribmake	2011-01-05 01:49:30.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/allowed/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -1,8 +1,6 @@
-# $OpenLDAP: pkg/ldap/contrib/slapd-modules/allowed/Makefile,v 1.1.2.4 2011/01/04 23:49:30 kurt Exp $
-# This work is part of OpenLDAP Software <http://www.openldap.org/>.
-#
-# Copyright 1998-2011 The OpenLDAP Foundation.
-# Copyright 2004 Howard Chu, Symas Corp. All Rights Reserved.
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
+# All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted only as authorized by the OpenLDAP
@@ -12,35 +10,39 @@
 # top-level directory of the distribution or, alternatively, at
 # <http://www.OpenLDAP.org/license.html>.
 
-PREFIX=/opt/openldap-HEAD
-
+CPPFLAGS+=-I../../../include -I../../../servers/slapd 
+CPPFLAGS+=-DSLAPD_OVER_ALLOWED=SLAPD_MOD_DYNAMIC
 LIBTOOL=../../../libtool
-OPT=-g -O2
-CC=gcc
-
-DEFS=-DSLAPD_OVER_ALLOWED=SLAPD_MOD_DYNAMIC
-
-LDAP_INC=-I../../../include -I../../../servers/slapd
-INCS=$(LDAP_INC)
-
-LDAP_LIB=-lldap_r -llber -L../../../lib
-LDAP_LIB=
-LIBS=$(LDAP_LIB)
-
-all:	allowed.la
-
-
-allowed.lo:	allowed.c
-	$(LIBTOOL) --mode=compile $(CC) $(OPT) $(DEFS) $(INCS) -c $?
 
-allowed.la:	allowed.lo
-	$(LIBTOOL) --mode=link $(CC) $(OPT) -version-info 0:0:0 \
-	-rpath $(PREFIX)/lib -module -o $@ $? $(LIBS)
+ldap_subdir = openldap
+prefix=/usr/local
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../servers/slapd/slapd
+
+all: allowed.la
+
+%.lo:	%.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $<
+
+%.la:   %.lo
+	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
+		   -rpath $(PREFIX)/lib -module -o $@ $<
 
 clean:
-	rm -f allowed.o allowed.lo allowed.la
+	rm -rf *.lo *.la *.o .libs/
 
 install: allowed.la
-	mkdir -p $(PREFIX)/libexec/openldap
-	$(LIBTOOL) --mode=install cp allowed.la $(PREFIX)/libexec/openldap
-	$(LIBTOOL) --finish $(PREFIX)/libexec/openldap
+	mkdir -p $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
+
+test: allowed.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/autogroup/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/autogroup/Makefile
--- openldap-2.4.25/contrib/slapd-modules/autogroup/Makefile.contribmake	2011-01-04 21:29:39.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/autogroup/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -1,6 +1,17 @@
-LIBTOOL=../../../libtool
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted only as authorized by the OpenLDAP
+# Public License.
+#
+# A copy of this license is available in the file LICENSE in the
+# top-level directory of the distribution or, alternatively, at
+# <http://www.OpenLDAP.org/license.html>.
 
-CPPFLAGS+=-I../../../include -I../../../servers/slapd
+CPPFLAGS+=-I../../../include -I../../../servers/slapd 
+LIBTOOL=../../../libtool
 
 ldap_subdir = openldap
 prefix=/usr/local
@@ -8,20 +19,29 @@ exec_prefix = $(prefix)
 libdir = $(exec_prefix)/lib
 libexecdir = $(exec_prefix)/libexec
 moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../servers/slapd/slapd
 
 all: autogroup.la
 
-autogroup.lo:	autogroup.c
-	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $?
+%.lo:	%.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $<
 
-autogroup.la:	autogroup.lo
+%.la:   %.lo
 	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
-	-rpath $(libdir) -module -o $@ $? 
+		   -rpath $(PREFIX)/lib -module -o $@ $<
 
 clean:
-	rm -f autogroup.lo autogroup.la
+	rm -rf *.lo *.la *.o .libs/
 
 install: autogroup.la
 	mkdir -p $(DESTDIR)$(moduledir)
-	$(LIBTOOL) --mode=install cp autogroup.la $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
 	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
+
+test: autogroup.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/cloak/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/cloak/Makefile
--- openldap-2.4.25/contrib/slapd-modules/cloak/Makefile.contribmake	2011-03-24 20:15:01.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/cloak/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -1,17 +1,48 @@
-# $OpenLDAP: pkg/ldap/contrib/slapd-modules/cloak/Makefile,v 1.2.2.2 2011/03/24 18:15:01 quanah Exp $
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted only as authorized by the OpenLDAP
+# Public License.
+#
+# A copy of this license is available in the file LICENSE in the
+# top-level directory of the distribution or, alternatively, at
+# <http://www.OpenLDAP.org/license.html>.
+
 CPPFLAGS+=-I../../../include -I../../../servers/slapd 
 CPPFLAGS+=-DSLAPD_OVER_CLOAK=SLAPD_MOD_DYNAMIC
-LIBS=-lldap_r -llber -lcrypto
 LIBTOOL=../../../libtool
 
+ldap_subdir = openldap
+prefix=/usr/local
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../servers/slapd/slapd
+
 all: cloak.la
 
-cloak.lo:    cloak.c
-	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -c $?
+%.lo:	%.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $<
 
-cloak.la:    cloak.lo
+%.la:   %.lo
 	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
-		   -rpath $(PREFIX)/lib -module -o $@ $? $(LIBS)
+		   -rpath $(PREFIX)/lib -module -o $@ $<
 
 clean:
-	rm cloak.lo cloak.la
+	rm -rf *.lo *.la *.o .libs/
+
+install: cloak.la
+	mkdir -p $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
+
+test: cloak.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/denyop/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/denyop/Makefile
--- openldap-2.4.25/contrib/slapd-modules/denyop/Makefile.contribmake	2011-03-29 15:43:32.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/denyop/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -0,0 +1,48 @@
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted only as authorized by the OpenLDAP
+# Public License.
+#
+# A copy of this license is available in the file LICENSE in the
+# top-level directory of the distribution or, alternatively, at
+# <http://www.OpenLDAP.org/license.html>.
+
+CPPFLAGS+=-I../../../include -I../../../servers/slapd 
+CPPFLAGS+=-DSLAPD_OVER_DENYOP=SLAPD_MOD_DYNAMIC
+LIBTOOL=../../../libtool
+
+ldap_subdir = openldap
+prefix=/usr/local
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../servers/slapd/slapd
+
+all: denyop.la
+
+%.lo:	%.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $<
+
+%.la:   %.lo
+	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
+		   -rpath $(PREFIX)/lib -module -o $@ $<
+
+clean:
+	rm -rf *.lo *.la *.o .libs/
+
+install: denyop.la
+	mkdir -p $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
+
+test: denyop.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/dsaschema/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/dsaschema/Makefile
--- openldap-2.4.25/contrib/slapd-modules/dsaschema/Makefile.contribmake	2011-03-29 15:43:32.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/dsaschema/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -0,0 +1,47 @@
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted only as authorized by the OpenLDAP
+# Public License.
+#
+# A copy of this license is available in the file LICENSE in the
+# top-level directory of the distribution or, alternatively, at
+# <http://www.OpenLDAP.org/license.html>.
+
+CPPFLAGS+=-I../../../include -I../../../servers/slapd 
+LIBTOOL=../../../libtool
+
+ldap_subdir = openldap
+prefix=/usr/local
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../servers/slapd/slapd
+
+all: dsaschema.la
+
+%.lo:	%.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $<
+
+%.la:   %.lo
+	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
+		   -rpath $(PREFIX)/lib -module -o $@ $<
+
+clean:
+	rm -rf *.lo *.la *.o .libs/
+
+install: dsaschema.la
+	mkdir -p $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
+
+test: dsaschema.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/dupent/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/dupent/Makefile
--- openldap-2.4.25/contrib/slapd-modules/dupent/Makefile.contribmake	2011-01-05 01:49:32.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/dupent/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -1,8 +1,6 @@
-# $OpenLDAP: pkg/ldap/contrib/slapd-modules/dupent/Makefile,v 1.1.2.3 2011/01/04 23:49:32 kurt Exp $
-# This work is part of OpenLDAP Software <http://www.openldap.org/>.
-#
-# Copyright 1998-2011 The OpenLDAP Foundation.
-# Copyright 2004 Howard Chu, Symas Corp. All Rights Reserved.
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
+# All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted only as authorized by the OpenLDAP
@@ -12,41 +10,39 @@
 # top-level directory of the distribution or, alternatively, at
 # <http://www.OpenLDAP.org/license.html>.
 
+CPPFLAGS+=-I../../../include -I../../../servers/slapd 
+CPPFLAGS+=-DSLAPD_OVER_DUPENT=SLAPD_MOD_DYNAMIC -g -O2
 LIBTOOL=../../../libtool
-OPT=-DSLAPD_OVER_DUPENT=2 -g -O2
-#LIBTOOL=../../../../ldap-devel/libtool
-#OPT=-DSLAPD_OVER_DUPENT=2 -g -O0
-CC=gcc
-
-LDAP_INC=-I../../../include -I../../../servers/slapd
-#LDAP_INC=-I../../../include -I../../../servers/slapd -I../../../../ldap-devel/include
-INCS=$(LDAP_INC)
-
-LDAP_LIB=-lldap_r -llber
-LIBS=$(LDAP_LIB)
 
+ldap_subdir = openldap
 prefix=/usr/local
-exec_prefix=$(prefix)
-ldap_subdir=/openldap
-
-libdir=$(exec_prefix)/lib
-libexecdir=$(exec_prefix)/libexec
-moduledir = $(libexecdir)$(ldap_subdir)
-
-all:	dupent.la
-
-
-dupent.lo:	dupent.c
-	$(LIBTOOL) --mode=compile $(CC) $(OPT) $(DEFS) $(INCS) -c $?
-
-dupent.la:	dupent.lo
-	$(LIBTOOL) --mode=link $(CC) $(OPT) -version-info 0:0:0 \
-	-rpath $(moduledir) -module -o $@ $? $(LIBS)
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../servers/slapd/slapd
+
+all: dupent.la
+
+%.lo:	%.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $<
+
+%.la:   %.lo
+	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
+		   -rpath $(PREFIX)/lib -module -o $@ $<
 
 clean:
-	rm -f dupent.lo dupent.la
+	rm -rf *.lo *.la *.o .libs/
 
 install: dupent.la
 	mkdir -p $(DESTDIR)$(moduledir)
-	$(LIBTOOL) --mode=install cp dupent.la $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
 
+test: dupent.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/kinit/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/kinit/Makefile
--- openldap-2.4.25/contrib/slapd-modules/kinit/Makefile.contribmake	2011-03-29 15:43:32.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/kinit/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -0,0 +1,47 @@
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted only as authorized by the OpenLDAP
+# Public License.
+#
+# A copy of this license is available in the file LICENSE in the
+# top-level directory of the distribution or, alternatively, at
+# <http://www.OpenLDAP.org/license.html>.
+
+CPPFLAGS+=-I../../../include -I../../../servers/slapd 
+LIBTOOL=../../../libtool
+
+ldap_subdir = openldap
+prefix=/usr/local
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../servers/slapd/slapd
+
+all: kinit.la
+
+%.lo:	%.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $<
+
+%.la:   %.lo
+	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
+		   -rpath $(PREFIX)/lib -module -o $@ $< -lkrb5
+
+clean:
+	rm -rf *.lo *.la *.o .libs/
+
+install: kinit.la
+	mkdir -p $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
+
+test: kinit.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/lastbind/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/lastbind/Makefile
--- openldap-2.4.25/contrib/slapd-modules/lastbind/Makefile.contribmake	2011-03-25 21:39:47.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/lastbind/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -1,5 +1,5 @@
-# $OpenLDAP: pkg/ldap/contrib/slapd-modules/lastbind/Makefile,v 1.2.2.4 2011/03/25 19:39:47 quanah Exp $
-# Copyright 2009 Jonathan Clarke <jonathan@phillipoux.net>.
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -12,23 +12,37 @@
 
 CPPFLAGS+=-I../../../include -I../../../servers/slapd 
 CPPFLAGS+=-DSLAPD_OVER_LASTBIND=SLAPD_MOD_DYNAMIC
-#LIBTOOL=libtool
 LIBTOOL=../../../libtool
 
+ldap_subdir = openldap
 prefix=/usr/local
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../servers/slapd/slapd
 
 all: lastbind.la
 
-lastbind.lo:    lastbind.c
-	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $?
+%.lo:	%.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $<
 
-lastbind.la:    lastbind.lo
+%.la:   %.lo
 	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
-		   -rpath $(prefix)/lib -module -o $@ $?
+		   -rpath $(PREFIX)/lib -module -o $@ $<
 
 clean:
-	rm -rf lastbind.lo lastbind.la lastbind.o .libs/
+	rm -rf *.lo *.la *.o .libs/
 
 install: lastbind.la
-	mkdir -p $(prefix)/libexec/openldap
-	$(LIBTOOL) --mode=install cp lastbind.la $(prefix)/libexec/openldap
+	mkdir -p $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
+
+test: lastbind.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/lastmod/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/lastmod/Makefile
--- openldap-2.4.25/contrib/slapd-modules/lastmod/Makefile.contribmake	2011-03-29 15:43:32.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/lastmod/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -0,0 +1,48 @@
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted only as authorized by the OpenLDAP
+# Public License.
+#
+# A copy of this license is available in the file LICENSE in the
+# top-level directory of the distribution or, alternatively, at
+# <http://www.OpenLDAP.org/license.html>.
+
+CPPFLAGS+=-I../../../include -I../../../servers/slapd 
+CPPFLAGS+=-DSLAPD_OVER_LASTMOD=SLAPD_MOD_DYNAMIC
+LIBTOOL=../../../libtool
+
+ldap_subdir = openldap
+prefix=/usr/local
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../servers/slapd/slapd
+
+all: lastmod.la
+
+%.lo:	%.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $<
+
+%.la:   %.lo
+	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
+		   -rpath $(PREFIX)/lib -module -o $@ $<
+
+clean:
+	rm -rf *.lo *.la *.o .libs/
+
+install: lastmod.la
+	mkdir -p $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
+
+test: lastmod.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/noopsrch/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/noopsrch/Makefile
--- openldap-2.4.25/contrib/slapd-modules/noopsrch/Makefile.contribmake	2011-01-05 01:49:32.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/noopsrch/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -1,8 +1,6 @@
-# $OpenLDAP: pkg/ldap/contrib/slapd-modules/noopsrch/Makefile,v 1.1.2.3 2011/01/04 23:49:32 kurt Exp $
-# This work is part of OpenLDAP Software <http://www.openldap.org/>.
-#
-# Copyright 1998-2011 The OpenLDAP Foundation.
-# Copyright 2004 Howard Chu, Symas Corp. All Rights Reserved.
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
+# All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted only as authorized by the OpenLDAP
@@ -12,41 +10,39 @@
 # top-level directory of the distribution or, alternatively, at
 # <http://www.OpenLDAP.org/license.html>.
 
+CPPFLAGS+=-I../../../include -I../../../servers/slapd 
+CPPFLAGS+=-DSLAPD_OVER_NOOPSRCH=SLAPD_MOD_DYNAMIC -g -O2
 LIBTOOL=../../../libtool
-OPT=-DSLAPD_OVER_NOOPSRCH=2 -g -O2
-#LIBTOOL=../../../../ldap-devel/libtool
-#OPT=-DSLAPD_OVER_NOOPSRCH=2 -g -O0
-CC=gcc
-
-LDAP_INC=-I../../../include -I../../../servers/slapd
-#LDAP_INC=-I../../../include -I../../../servers/slapd -I../../../../ldap-devel/include
-INCS=$(LDAP_INC)
-
-LDAP_LIB=-lldap_r -llber
-LIBS=$(LDAP_LIB)
 
+ldap_subdir = openldap
 prefix=/usr/local
-exec_prefix=$(prefix)
-ldap_subdir=/openldap
-
-libdir=$(exec_prefix)/lib
-libexecdir=$(exec_prefix)/libexec
-moduledir = $(libexecdir)$(ldap_subdir)
-
-all:	noopsrch.la
-
-
-noopsrch.lo:	noopsrch.c
-	$(LIBTOOL) --mode=compile $(CC) $(OPT) $(DEFS) $(INCS) -c $?
-
-noopsrch.la:	noopsrch.lo
-	$(LIBTOOL) --mode=link $(CC) $(OPT) -version-info 0:0:0 \
-	-rpath $(moduledir) -module -o $@ $? $(LIBS)
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../servers/slapd/slapd
+
+all: noopsrch.la
+
+%.lo:	%.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $<
+
+%.la:   %.lo
+	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
+		   -rpath $(PREFIX)/lib -module -o $@ $<
 
 clean:
-	rm -f noopsrch.lo noopsrch.la
+	rm -rf *.lo *.la *.o .libs/
 
 install: noopsrch.la
 	mkdir -p $(DESTDIR)$(moduledir)
-	$(LIBTOOL) --mode=install cp noopsrch.la $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
 
+test: noopsrch.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/nops/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/nops/Makefile
--- openldap-2.4.25/contrib/slapd-modules/nops/Makefile.contribmake	2009-04-28 01:35:48.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/nops/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -1,23 +1,48 @@
-# $OpenLDAP: pkg/ldap/contrib/slapd-modules/nops/Makefile,v 1.1.2.4 2009/04/27 23:35:48 quanah Exp $
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted only as authorized by the OpenLDAP
+# Public License.
+#
+# A copy of this license is available in the file LICENSE in the
+# top-level directory of the distribution or, alternatively, at
+# <http://www.OpenLDAP.org/license.html>.
+
 CPPFLAGS+=-I../../../include -I../../../servers/slapd 
 CPPFLAGS+=-DSLAPD_OVER_NOPS=SLAPD_MOD_DYNAMIC
-LIBS=-L$(PREFIX)/lib -lldap_r -llber -lcrypto
+LIBTOOL=../../../libtool
+
+ldap_subdir = openldap
+prefix=/usr/local
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../servers/slapd/slapd
 
 all: nops.la
 
-nops.lo:    nops.c
-	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -c $?
+%.lo:	%.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $<
 
-nops.la:    nops.lo
+%.la:   %.lo
 	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
-		   -rpath $(PREFIX)/lib -module -o $@ $? $(LIBS)
+		   -rpath $(PREFIX)/lib -module -o $@ $<
 
 clean:
-	rm -f nops.lo nops.la
+	rm -rf *.lo *.la *.o .libs/
 
 install: nops.la
-	mkdir -p $(PREFIX)/lib/openldap 
-	mkdir -p $(PREFIX)/man/man5
-	$(LIBTOOL) --mode=install cp nops.la $(PREFIX)/lib/openldap
-	$(LIBTOOL) --finish $(PREFIX)/lib
-	cp nops.5 $(PREFIX)/man/man5
+	mkdir -p $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
+
+test: nops.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/nssov/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/nssov/Makefile
--- openldap-2.4.25/contrib/slapd-modules/nssov/Makefile.contribmake	2011-01-05 01:49:33.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/nssov/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -28,7 +28,7 @@
 INCS=$(LDAP_INC) $(NLDAPD_INC)
 
 LDAP_LIB=-lldap_r -llber
-LIBS=$(LDAP_LIB)
+LIBS=-L../../../libraries/liblber -L../../../libraries/libldap_r $(LDAP_LIB)
 
 prefix=/usr/local
 exec_prefix=$(prefix)
@@ -39,6 +39,7 @@ libexecdir=$(exec_prefix)/libexec
 moduledir = $(libexecdir)$(ldap_subdir)
 sysconfdir = $(prefix)/etc$(ldap_subdir)
 schemadir = $(sysconfdir)/schema
+slapd=../../../servers/slapd/slapd
 
 all:	nssov.la
 
@@ -59,7 +60,7 @@
 
 nssov.la:	$(OBJS) $(XOBJS)
 	$(LIBTOOL) --mode=link $(CC) $(OPT) -version-info 0:0:0 \
-	-rpath $(libdir) -module -o $@ $(OBJS) $(XOBJS) $(LIBS)
+	-rpath $(moduledir) -module -o $@ $(OBJS) $(XOBJS) $(LIBS)
 
 install: nssov.la
 	mkdir -p $(DESTDIR)$(moduledir)
@@ -69,3 +70,11 @@ install: nssov.la
 clean:
 	rm -f *.*o *.la .libs/*
 	rm -rf .libs
+
+test: nssov.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/passwd/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/passwd/Makefile
--- openldap-2.4.25/contrib/slapd-modules/passwd/Makefile.contribmake	2009-04-28 03:06:14.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/passwd/Makefile	2011-03-29 16:49:58.000000000 +0200
@@ -1,37 +1,52 @@
-# $OpenLDAP: pkg/ldap/contrib/slapd-modules/passwd/Makefile,v 1.2.2.2 2009/04/28 01:06:14 quanah Exp $
-CPPFLAGS+=-I../../../include -I../../../servers/slapd
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted only as authorized by the OpenLDAP
+# Public License.
+#
+# A copy of this license is available in the file LICENSE in the
+# top-level directory of the distribution or, alternatively, at
+# <http://www.OpenLDAP.org/license.html>.
+
+CPPFLAGS+=-I../../../include -I../../../servers/slapd 
+LIBTOOL=../../../libtool
+SUBDIRS = sha2
+
+ldap_subdir = openldap
+prefix=/usr/local
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../servers/slapd/slapd
 
 all: kerberos.la netscape.la radius.la
 
-kerberos.lo:	kerberos.c
-	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -DHAVE_KRB5 -Wall -c $?
+%.lo:	%.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $<
 
-kerberos.la:	kerberos.lo
+kerberos.la:   kerberos.lo
 	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
-	-rpath $(PREFIX)/lib -module -o $@ $? -lkrb5
+		   -rpath $(PREFIX)/lib -module -o $@ $< -lkrb5
 
-netscape.lo:	netscape.c
-	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $?
-
-netscape.la:	netscape.lo
-	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
-	-rpath $(PREFIX)/lib -module -o $@ $? 
-
-radius.lo:	radius.c
-	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $?
-
-radius.la:	radius.lo
+%.la:   %.lo
 	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
-	-rpath $(PREFIX)/lib -module -o $@ $? -lradius
+		   -rpath $(PREFIX)/lib -module -o $@ $<
 
 clean:
-	rm -f kerberos.lo kerberos.la
-	rm -f netscape.lo netscape.la
-	rm -f radius.lo radius.la
+	rm -rf *.lo *.la *.o .libs/
 
 install: kerberos.la netscape.la radius.la
-	mkdir -p $(PREFIX)/lib/openldap
-	$(LIBTOOL) --mode=install cp kerberos.la $(PREFIX)/lib/openldap
-	$(LIBTOOL) --mode=install cp netscape.la $(PREFIX)/lib/openldap
-	$(LIBTOOL) --mode=install cp radius.la $(PREFIX)/lib/openldap
-	$(LIBTOOL) --finish $(PREFIX)/lib
+	mkdir -p $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
+
+test: kerberos.la netscape.la radius.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/passwd/sha2/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/passwd/sha2/Makefile
--- openldap-2.4.25/contrib/slapd-modules/passwd/sha2/Makefile.contribmake	2009-01-26 23:07:06.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/passwd/sha2/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -1,15 +1,47 @@
-# $OpenLDAP: pkg/ldap/contrib/slapd-modules/passwd/sha2/Makefile,v 1.1.2.1 2009/01/26 21:07:06 quanah Exp $
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted only as authorized by the OpenLDAP
+# Public License.
+#
+# A copy of this license is available in the file LICENSE in the
+# top-level directory of the distribution or, alternatively, at
+# <http://www.OpenLDAP.org/license.html>.
 
-OPENLDAP := ../../../..
+CPPFLAGS+=-I../../../../include -I../../../../servers/slapd 
+LIBTOOL=../../../../libtool
 
-#CCFLAGS = -Wall -g -DSLAPD_SHA2_DEBUG
-CCFLAGS = -Wall -g
+ldap_subdir = openldap
+prefix=/usr/local
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../../servers/slapd/slapd
 
-slapd-sha2.so: slapd-sha2.o sha2.o
-	$(CC) -I$(OPENLDAP)/include -shared -Wall -g $^ -o $@
+all: sha2.la
 
-%.o: %.c
-	$(CC) -I$(OPENLDAP)/include $(CCFLAGS) -c $<
+%.lo:	slapd-sha2.c sha2.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $<
+
+%.la:   slapd-sha2.lo sha2.lo
+	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
+		   -rpath $(PREFIX)/lib -module -o $@ $<
 
 clean:
-	@rm -f slapd-sha2.so *.o
+	rm -rf *.lo *.la *.o .libs/
+
+install: sha2.la
+	mkdir -p $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
+
+test: sha2.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done
diff -p -up openldap-2.4.25/contrib/slapd-modules/trace/Makefile.contribmake openldap-2.4.25/contrib/slapd-modules/trace/Makefile
--- openldap-2.4.25/contrib/slapd-modules/trace/Makefile.contribmake	2011-03-29 15:43:32.000000000 +0200
+++ openldap-2.4.25/contrib/slapd-modules/trace/Makefile	2011-03-29 15:43:32.000000000 +0200
@@ -0,0 +1,48 @@
+# $$
+# Copyright 2011 Buchan Milne <bgmilne@staff.telkomsa.net>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted only as authorized by the OpenLDAP
+# Public License.
+#
+# A copy of this license is available in the file LICENSE in the
+# top-level directory of the distribution or, alternatively, at
+# <http://www.OpenLDAP.org/license.html>.
+
+CPPFLAGS+=-I../../../include -I../../../servers/slapd 
+CPPFLAGS+=-DSLAPD_OVER_TRACE=SLAPD_MOD_DYNAMIC
+LIBTOOL=../../../libtool
+
+ldap_subdir = openldap
+prefix=/usr/local
+exec_prefix = $(prefix)
+libdir = $(exec_prefix)/lib
+libexecdir = $(exec_prefix)/libexec
+moduledir = $(exec_prefix)/libexec/$(ldap_subdir)
+slapd=../../../servers/slapd/slapd
+
+all: trace.la
+
+%.lo:	%.c
+	$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) -Wall -c $<
+
+%.la:   %.lo
+	$(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
+		   -rpath $(PREFIX)/lib -module -o $@ $<
+
+clean:
+	rm -rf *.lo *.la *.o .libs/
+
+install: trace.la
+	mkdir -p $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --mode=install cp $? $(DESTDIR)$(moduledir)
+	$(LIBTOOL) --finish $(DESTDIR)$(moduledir)
+
+test: trace.la
+	@for i in $?;do \
+		echo "Testing loading module $$i"; \
+		echo "modulepath ." > test-slapd.conf; \
+		echo "moduleload $$i" >> test-slapd.conf; \
+		$(slapd) -T test -f test-slapd.conf && rm -f test-slapd.conf; \
+	done