[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bacula-devel] libdbi backend to catalog database


Hello,

Kern, this patch fix the make install question without break things.

So far only mysql and postgresql.

./configure --with-dbi --with-dbi-driver=mysql will configure the
scripts to databases. The output is:


  Host:                       i686-pc-linux-gnu -- debian lenny/sid
  Bacula version:             2.3.10 (24 February 2008)
  Source code location:       .
  Install binaries:           /home/jhf-notebook/tmp/bacula//sbin
  Install config files:       /home/jhf-notebook/tmp/bacula//etc
  Scripts directory:          /home/jhf-notebook/tmp/bacula//etc
  Archive directory:
  Working directory:          /home/jhf-notebook/tmp/bacula//var/bacula/working
  PID directory:              /var/run
  Subsys directory:           /var/run/subsys
  Man directory:              ${datarootdir}/man
  Data directory:             ${prefix}/share
  C Compiler:                 gcc 4.1.3
  C++ Compiler:               /usr/bin/g++ 4.1.3
  Compiler flags:              -g -O2 -Wall -fno-strict-aliasing
-fno-exceptions -fno-rtti
  Linker flags:
  Libraries:                  -lpthread -ldl
  Statically Linked Tools:    no
  Statically Linked FD:       no
  Statically Linked SD:       no
  Statically Linked DIR:      no
  Statically Linked CONS:     no
  Database type:              mysql                   <-------------------------
  Database lib:               -L/usr/local/lib -ldbi  <-------------------------
  Database name:              bacula
  Database user:              bacula

  Job Output Email:           root@localhost
  Traceback Email:            root@localhost
  SMTP Host Address:          localhost

  Director Port:              9101
  File daemon Port:           9102
  Storage daemon Port:        9103

  Director User:
  Director Group:
  Storage Daemon User:
  Storage DaemonGroup:
  File Daemon User:
  File Daemon Group:

  SQL binaries Directory      /usr/bin

  Large file support:         yes
  Bacula conio support:       yes -ltermcap
  readline support:           no
  TCP Wrappers support:       no
  TLS support:                no
  Encryption support:         no
  ZLIB support:               yes
  enable-smartalloc:          yes
  bat support:                no
  enable-gnome:               no
  enable-bwx-console:         no
  enable-tray-monitor:
  client-only:                no
  build-dird:                 yes
  build-stored:               yes
  ACL support:                no
  Python support:             no
  Batch insert enabled:       no






On Sun, Feb 24, 2008 at 7:05 PM, David Boyes <dboyes@xxxxxxxxxxxxxx> wrote:
> > > I will think more about this and do some explorations.
>  >
>  > I haven't really looked at where DB_TYPE is used, but we might want to
>  > implement a DB_TYPE and a new DB_PROG variable so that we can keep
>  your
>  > DBI
>  > type ...
>
>  This (IMHO) seems to be the Right Thing. Set DB_TYPE to DBI, and DB_PROG
>  to the correct database program identifier, triggering script install
>  and run on DB_PROG. I think it's the least surprising method.
>
>
>
>
>  -------------------------------------------------------------------------
>  This SF.net email is sponsored by: Microsoft
>  Defy all challenges. Microsoft(R) Visual Studio 2008.
>  http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>  _______________________________________________
>  Bacula-devel mailing list
>  Bacula-devel@xxxxxxxxxxxxxxxxxxxxx
>  https://lists.sourceforge.net/lists/listinfo/bacula-devel
>



-- 
-----------------------------------------------------------
João Henrique Freitas - joaohf_at_gmail.com
Campinas-SP-Brasil
BSD051283
LPI 1
http://joaohf.pbwiki.com
http://www.livejournal.com/users/joaohf/
Index: autoconf/configure.in
===================================================================
--- autoconf/configure.in	(revisão 6468)
+++ autoconf/configure.in	(cópia de trabalho)
@@ -1332,6 +1332,8 @@
 
 BA_CHECK_DBI_DB
 
+BA_CHECK_DBI_DRIVER
+
 AC_SUBST(cats)
 AC_SUBST(DB_TYPE)
 
@@ -1361,6 +1363,11 @@
    fi
 fi
 
+if test x$DB_TYPE = xdbi; then
+   DB_TYPE=$DB_PROG
+   db_type=$DB_PROG
+fi
+
 if test $support_batch_insert = yes ; then
    AC_DEFINE(HAVE_BATCH_FILE_INSERT, 1, [Set if DB batch insert code enabled])
 fi
Index: autoconf/bacula-macros/db.m4
===================================================================
--- autoconf/bacula-macros/db.m4	(revisão 6468)
+++ autoconf/bacula-macros/db.m4	(cópia de trabalho)
@@ -118,7 +118,67 @@
 
 ])
 
+AC_DEFUN([BA_CHECK_DBI_DRIVER],
+[
+db_found=no
+db_prog=no
+AC_MSG_CHECKING(for DBI drivers support)
+AC_ARG_WITH(dbi-driver,
+[
+  --with-dbi-driver@<:@=DRIVER@:>@     Suport for DBI driver.  DRIVER is 
+                          the one DBI driver like Mysql, Postgresql, others.
+                          Default is to not configure any driver.],
+[
+  if test "$withval" != "no"; then
+     case $withval in
+        "mysql")
+           db_prog="mysql"
+           if test -f /usr/local/mysql/bin/mysql; then
+              SQL_BINDIR=/usr/local/mysql/bin
+           elif test -f /usr/bin/mysql; then
+              SQL_BINDIR=/usr/bin
+           elif test -f /usr/local/bin/mysql; then
+              SQL_BINDIR=/usr/local/bin
+           else
+              AC_MSG_RESULT(no)
+              AC_MSG_ERROR(Unable to find mysql in standard locations)
+           fi
+        ;;
+        "postgresql")
+           db_prog="postgresql"
+           PG_CONFIG=`which pg_config`
+           if test -n "$PG_CONFIG";then
+              SQL_BINDIR=`"$PG_CONFIG" --bindir`
+           elif test -f /usr/local/bin/psql; then
+              SQL_BINDIR=/usr/local/bin
+           elif test -f /usr/bin/psql; then
+              SQL_BINDIR=/usr/bin
+           else
+              AC_MSG_RESULT(no)
+              AC_MSG_ERROR(Unable to find psql in standard locations)
+          fi
+        ;;
+        *)
+           AC_MSG_RESULT(no)
+           AC_MSG_ERROR(Unable to set DBI driver. $withval is not supported)
+        ;;
+     esac
 
+     AC_MSG_RESULT(yes)
+     DB_PROG=$db_prog
+
+  else
+     AC_MSG_RESULT(no)
+  fi
+],[
+  AC_MSG_RESULT(no)
+])
+AC_SUBST(SQL_BINDIR)
+AC_SUBST(DB_PROG)
+
+])
+
+
 AC_DEFUN([BA_CHECK_MYSQL_DB],
 [
 db_found=no
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bacula-devel mailing list
Bacula-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/bacula-devel


This mailing list archive is a service of Copilot Consulting.