DIRD_DIR="src/dird"
DIR_TOOLS="DIRTOOLS"
-DIR_PLUGIN_DIR="src/plugins/dir"
+# DIR_PLUGIN_DIR="src/plugins/dir"
if test x$build_dird = xyes; then
DIRD_DIR="src/dird"
AC_SUBST(DIRD_DIR)
AC_SUBST(DIR_TOOLS)
-AC_SUBST(DIR_PLUGIN_DIR)
+# AC_SUBST(DIR_PLUGIN_DIR)
dnl -------------------------------------------
dnl stored (default on)
fi
fi
if test x$support_ldap_bpam = xyes; then
- DIR_PLUGIN_DIR="${DIR_PLUGIN_DIR} src/plugins/dir/ldap/src"
+ DIR_PLUGIN_DIR="${DIR_PLUGIN_DIR} src/plugins/dir/ldap"
fi
AC_SUBST(BPAM_LDAP_TARGET)
include Makefile.inc
.c.lo:
- $(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) $(CFLAGS) -I${SRCDIR} -I${DIRDIR} -DTEST_PROGRAM -c $<
+ @echo "Compiling $< ..."
+ $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) $(CFLAGS) -I${SRCDIR} -I${DIRDIR} -I${LIBDIR} -DWORKDIR=\"$(DESTDIR)$(working_dir)\" -c $<
-all: dirpluglib.lo
+%.lo: %.c %.h
+ @echo "Pattern compiling $< ..."
+ $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) $(CFLAGS) -I${SRCDIR} -I${DIRDIR} -I${LIBDIR} -DWORKDIR=\"$(DESTDIR)$(working_dir)\" -c $(@:.lo=.c)
-example-plugin-dir.lo: example-plugin-dir.c ${DIRDIR}/dir_plugins.h
- $(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CFLAGS) -I../.. -I${DIRDIR} -c example-plugin-dir.c
+all: dirpluglib.lo example-plugin-dir.la test-authentication-api-dir.la
-example-plugin-dir.la: Makefile example-plugin-dir.lo
- $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -shared example-plugin-dir.lo -o $@ -rpath $(plugindir) -module -export-dynamic -avoid-version
+# example-plugin-dir.lo: example-plugin-dir.c ${DIRDIR}/dir_plugins.h
+# $(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CFLAGS) -I../.. -I${DIRDIR} -c example-plugin-dir.c
-test-authentication-api-dir.lo: test-authentication-api-dir.c ${DIRDIR}/dir_plugins.h
- $(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CFLAGS) -I../.. -I${DIRDIR} -c test-authentication-api-dir.c
+example-plugin-dir.la: example-plugin-dir.lo
+ @echo "Linking $(@:.la=.so) ..."
+ $(NO_ECHO)$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -shared example-plugin-dir.lo -o $@ -rpath $(plugindir) -module -export-dynamic -avoid-version
+
+# test-authentication-api-dir.lo: test-authentication-api-dir.c ${DIRDIR}/dir_plugins.h
+# $(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CFLAGS) -I../.. -I${DIRDIR} -c test-authentication-api-dir.c
-test-authentication-api-dir.la: Makefile test-authentication-api-dir.lo dirpluglib.lo
+test-authentication-api-dir.la: test-authentication-api-dir.lo dirpluglib.lo
@echo "Linking $(@:.la=.so) ..."
$(NO_ECHO)$(LIBTOOL_LINK) --silent $(CXX) $(LDFLAGS) -shared $^ -o $@ -rpath $(plugindir) -module -export-dynamic -avoid-version
install: all
- $(MKDIR) $(DESTDIR)$(plugindir)
+ $(NO_ECHO)$(MKDIR) $(DESTDIR)$(plugindir)
+
+install-bpam-ldap:
+ $(MAKE) -C ldap install
$(LIBTOOL_CLEAN_TARGET):
- find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
- $(RMF) *.la
- $(RMF) -r .libs _libs
+ $(NO_ECHO)find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
+ $(NO_ECHO)$(RMF) *.la
+ $(NO_ECHO)$(RMF) -r .libs _libs
clean: $(LIBTOOL_CLEAN_TARGET)
- rm -f main *.so *.o 1 2 3
+ $(NO_ECHO)rm -f main *.so *.o 1 2 3
distclean: clean
- rm -f Makefile
+ $(NO_ECHO)rm -f Makefile
$(LIBTOOL_UNINSTALL_TARGET):
- $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(plugindir)/example-plugin-dir.la
+ $(NO_ECHO)$(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(plugindir)/example-plugin-dir.la
uninstall: $(LIBTOOL_UNINSTALL_TARGET)
#
#
-include ../../Makefile.inc
+include ../Makefile.inc
LDAPSRC = ldap-dir.c
LDAPTESTSRC = ldaptest.c
install-ldap: ldap-dir.la
@echo "Installing plugin $(^:.la=.so) ..."
- $(MKDIR) $(DESTDIR)$(plugindir)
+ $(NO_ECHO)$(MKDIR) $(DESTDIR)$(plugindir)
$(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) ldap-dir.la $(DESTDIR)$(plugindir)
$(NO_ECHO)$(RMF) $(DESTDIR)$(plugindir)/ldap-dir.la
@echo "Installing $< ..."
$(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) $< $(DESTDIR)$(sbindir)
-Makefile: Makefile.in $(topdir)/config.status
- cd $(topdir) \
- && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
$(LIBTOOL_CLEAN_TARGET):
- @find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
- @$(RMF) *.la
- @$(RMF) -r .libs _libs
+ $(NO_ECHO)find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
+ $(NO_ECHO)$(RMF) *.la
+ $(NO_ECHO)$(RMF) -r .libs _libs
clean: $(LIBTOOL_CLEAN_TARGET)
- @rm -f main ldaptest *.so *.o
+ $(NO_ECHO)rm -f main ldaptest *.so *.o
distclean: clean
- @rm -f Makefile *.la *.lo
- @rm -rf .libs
+ $(NO_ECHO)rm -f Makefile *.la *.lo
+ $(NO_ECHO)rm -rf .libs
$(LIBTOOL_UNINSTALL_TARGET):
$(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(plugindir)/ldap-dir.so
{
if [ $? != 0 ] ; then
echo "Bad exit code giving up"
- exit 1
+ exit 1
fi
}
fi
fi
scripts/create_sed
-# In default bacula-dir.conf.in, change default file
+# In default bacula-dir.conf.in, change default file
# to backup to be build directory
echo "s%File = @sbindir@%File = @BUILD_DIR@%g" >tmp/t$$
sed -f tmp/t$$ build/src/dird/bacula-dir.conf.in >tmp/o$$
make ${MAKEOPT}
check_exit_code
make install
+ make install-plugins
fi
if [ a${KEEP_SOURCE} = a ]; then
rm -rf examples patches
start_local_slapd
# Authentication Plugin = "ldap:binddn=@BINDDN@ bindpass=@BINDPASS@ url=ldap://localhost:3890 query=@LDAPQUERY@"
-db_name=`cat ${tmp}/ldap_db_name`
+db_name=$(cat ${tmp}/ldap_db_name)
BINDDN="cn=root,dc=$db_name,dc=bacula,dc=com"
BINDPASS=rootroot
LDAPQUERY="dc=$db_name,dc=bacula,dc=com/(cn=%u)"
run_bacula
# now check if we have ldap-dir loaded
-if [ `grep ldap-dir ${tmp}/log.out | wc -l` -lt 1 ]
+if [ "$(grep -c ldap-dir ${tmp}/log.out)" -lt 1 ]
then
echo "BPAM LDAP Plugin is not loaded, cannot perform the test!"
exit 1
estat=0
# check invalid login
-printf "admin\nadmin\nstatus dir\nquit\n" | ${bin}/bconsole -p -C ldaptest -c bconsole.auth-ldap-plugin.conf 2>&1 > ${tmp}/log1.out
-if [ `grep Version: ${tmp}/log1.out | wc -l` -gt 0 ]
+printf "admin\nadmin\nstatus dir\nquit\n" | ${bin}/bconsole -p -C ldaptest -c bconsole.auth-ldap-plugin.conf > ${tmp}/log1.out 2>&1
+if [ "$(grep -c Version: ${tmp}/log1.out)" -gt 0 ]
then
printf "failed ... "
estat=1
else
- if [ `grep "LDAP Authentication Successfull" ${working}/*.trace | wc -l` -gt 0 ]
+ if [ "$(grep -c "LDAP Authentication Successfull" ${working}/*.trace)" -gt 0 ]
then
estat=2
fi
fi
# check proper login
-printf "root\nrootroot\nstatus dir\nquit\n" | ${bin}/bconsole -p -C ldaptest -c bconsole.auth-ldap-plugin.conf 2>&1 > ${tmp}/log2.out
-if [ `grep Version: ${tmp}/log2.out | wc -l` -lt 1 ]
+printf "root\nrootroot\nstatus dir\nquit\n" | ${bin}/bconsole -p -C ldaptest -c bconsole.auth-ldap-plugin.conf > ${tmp}/log2.out 2>&1
+if [ "$(grep -c Version: ${tmp}/log2.out)" -lt 1 ]
then
printf "failed ... "
estat=3
else
- if [ `grep "LDAP Authentication Successfull" ${working}/*.trace | wc -l` -lt 1 ]
+ if [ "$(grep -c "LDAP Authentication Successfull" ${working}/*.trace)" -lt 1 ]
then
estat=4
fi