[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bacula-commits
Subject:    [Bacula-commits] git: Bacula branch, Branch-5.1,
From:       "Eric Bollengier" <ricozz () users ! sourceforge ! net>
Date:       2011-02-06 8:51:44
Message-ID: E1Pm0LS-0005Qd-IH () sfp-scmshell-3 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Bacula".

The branch, Branch-5.1 has been updated
       via  06ee149a06cbffab1ec6f10b93ac5f461ec99213 (commit)
       via  0dd3f6cfafc0899ffc9152923d990e99321721fe (commit)
       via  45f3a23973f420c984ea7c5c6c4188a78deeadd3 (commit)
       via  dfec01ffa09adbb49ef63f2ad3a08fe15db69b5b (commit)
       via  57fe052650a7f4f313708fac4a8eebfcc3bbfedf (commit)
       via  da724229b1aa259c2c26061814adc16b54ec67a1 (commit)
       via  13c649f1ddfb95ab917bba812c999cecc6e513d0 (commit)
       via  b82a3b4e5ebd950bec1d2aa15ef2866308d3c93c (commit)
       via  355d4ebfbd57ec466089b4fdbd91c6edb99f5860 (commit)
       via  e89934e7365a7c5ea68b0a5c7c0286176178c754 (commit)
       via  5a4351f1961bf70c1792f57dc01bbf0041567489 (commit)
       via  5c0a6486c49960c1bac1cb362de6374e5eef3d7a (commit)
       via  4e805b62792ce139043c2b095dfcb87e373d4439 (commit)
      from  e3be3ee6d5b0c05d31849a85431b580b71aaaea0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 06ee149a06cbffab1ec6f10b93ac5f461ec99213
Author: Eric Bollengier <eric@eb.homelinux.org>
Date:   Sun Feb 6 09:36:57 2011 +0100

    Fix chgrp on bacula-x.conf

commit 0dd3f6cfafc0899ffc9152923d990e99321721fe
Author: Eric Bollengier <eric@eb.homelinux.org>
Date:   Sun Feb 6 09:21:44 2011 +0100

    Allow using sql_fetch_field() in db_sql_query() callback for SQLite

commit 45f3a23973f420c984ea7c5c6c4188a78deeadd3
Author: Eric Bollengier <eric@eb.homelinux.org>
Date:   Sat Feb 5 20:40:32 2011 +0100

    Use old list_result() in db_list_xxx for good formating

commit dfec01ffa09adbb49ef63f2ad3a08fe15db69b5b
Author: Kern Sibbald <kern@sibbald.com>
Date:   Fri Feb 4 17:05:20 2011 +0100

    Increase Windows backup/restore privileges possible fix to Virtual Disk ticket

commit 57fe052650a7f4f313708fac4a8eebfcc3bbfedf
Author: Eric Bollengier <eric@eb.homelinux.org>
Date:   Sat Feb 5 11:30:39 2011 +0100

    Use db_escape_string() in all db_xxx functions

commit da724229b1aa259c2c26061814adc16b54ec67a1
Author: Kern Sibbald <kern@sibbald.com>
Date:   Sat Feb 5 14:28:22 2011 +0100

    Pull src/lib/Makefile.in from master

commit 13c649f1ddfb95ab917bba812c999cecc6e513d0
Author: Marco van Wieringen <mvw@planets.elm.net>
Date:   Thu Feb 3 21:25:19 2011 +0100

    Add configure magic for detecting getpagesize

commit b82a3b4e5ebd950bec1d2aa15ef2866308d3c93c
Author: Marco van Wieringen <mvw@planets.elm.net>
Date:   Thu Feb 3 21:07:38 2011 +0100

    Implement mntent_cache on top of the new htable code using a small htable big \
buffer of 128 Kb to start with.

commit 355d4ebfbd57ec466089b4fdbd91c6edb99f5860
Author: Marco van Wieringen <mvw@planets.elm.net>
Date:   Thu Feb 3 20:56:41 2011 +0100

    Added support to htable for giving a hint on the number of pages to allocate for \
the buffer used for hash_mallocs so we can have htables without the previous default \
of 10 Mb.

commit e89934e7365a7c5ea68b0a5c7c0286176178c754
Author: Kern Sibbald <kern@sibbald.com>
Date:   Sat Feb 5 14:08:20 2011 +0100

    Implement chgrp on bacula-x.conf if user configs a Dir/SD/FD group

commit 5a4351f1961bf70c1792f57dc01bbf0041567489
Author: Kern Sibbald <kern@sibbald.com>
Date:   Sat Feb 5 13:22:21 2011 +0100

    Rebuild configure

commit 5c0a6486c49960c1bac1cb362de6374e5eef3d7a
Author: Kern Sibbald <kern@sibbald.com>
Date:   Sat Feb 5 13:18:53 2011 +0100

    Remove old scripts no longer used

commit 4e805b62792ce139043c2b095dfcb87e373d4439
Author: Kern Sibbald <kern@sibbald.com>
Date:   Sat Feb 5 12:57:15 2011 +0100

    Add patch from bug #1574 for Scientific Linux spec

-----------------------------------------------------------------------

Summary of changes:
diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in
index 2fb4214..c84e7e8 100644
--- a/bacula/autoconf/config.h.in
+++ b/bacula/autoconf/config.h.in
@@ -414,7 +414,7 @@
 /* Define to 1 if you have the `getmntinfo' function. */
 #undef HAVE_GETMNTINFO
 
-/* Define to 1 if you have the `getpagesize' function. */
+/* Set if have getpagesize */
 #undef HAVE_GETPAGESIZE
 
 /* Define to 1 if you have the `getpid' function. */
diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in
index 1fd9a90..690b548 100644
--- a/bacula/autoconf/configure.in
+++ b/bacula/autoconf/configure.in
@@ -2399,6 +2399,7 @@ AC_CHECK_FUNCS( \
    [echo 'configure: cannot find needed function.'; exit 1]
 )
 
+AC_CHECK_FUNCS(getpagesize, [AC_DEFINE(HAVE_GETPAGESIZE, 1, [Set if have \
getpagesize])])  AC_CHECK_FUNCS(malloc_trim, [AC_DEFINE(HAVE_MALLOC_TRIM, 1, [Set if \
have malloc_trim])])  
 AC_CHECK_FUNCS(fchdir, [AC_DEFINE(HAVE_FCHDIR)])
@@ -3238,13 +3239,8 @@ fi
 AC_OUTPUT([autoconf/Make.common \
 	   Makefile \
 	   manpages/Makefile \
-	   scripts/startmysql \
-	   scripts/stopmysql \
 	   scripts/btraceback \
-	   scripts/startit \
-	   scripts/stopit \
 	   scripts/bconsole \
-	   scripts/gconsole \
 	   scripts/bacula \
 	   scripts/bacula-ctl-dir \
 	   scripts/bacula-ctl-fd \
@@ -3380,9 +3376,9 @@ chmod 755 install_conf_file build-depkgs-qt-console
 cd ${BUILD_DIR}
 
 cd scripts
-chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
+chmod 755 bacula btraceback mtx-changer
 chmod 755 dvd-handler dvd-simulator
-chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
+chmod 755 bconsole mtx-changer devel_bacula logrotate
 cd ..
 
 c=updatedb
diff --git a/bacula/configure b/bacula/configure
index 5a581c5..53f7c3a 100755
--- a/bacula/configure
+++ b/bacula/configure
@@ -20985,7 +20985,48 @@ fi
 TERM_LIB=""
 ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" \
"$ac_includes_default"  if test "x$ac_cv_header_curses_h" = x""yes; then :
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lncurses" >&5
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltinfo" >&5
+$as_echo_n "checking for tgetent in -ltinfo... " >&6; }
+if test "${ac_cv_lib_tinfo_tgetent+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltinfo  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char tgetent ();
+int
+main ()
+{
+return tgetent ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_tinfo_tgetent=yes
+else
+  ac_cv_lib_tinfo_tgetent=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_tgetent" >&5
+$as_echo "$ac_cv_lib_tinfo_tgetent" >&6; }
+if test "x$ac_cv_lib_tinfo_tgetent" = x""yes; then :
+   TERM_LIB="-ltinfo"
+else
+
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lncurses" \
>&5  $as_echo_n "checking for tgetent in -lncurses... " >&6; }
 if test "${ac_cv_lib_ncurses_tgetent+set}" = set; then :
   $as_echo_n "(cached) " >&6
@@ -21024,7 +21065,8 @@ $as_echo "$ac_cv_lib_ncurses_tgetent" >&6; }
 if test "x$ac_cv_lib_ncurses_tgetent" = x""yes; then :
    TERM_LIB="-lncurses"
 else
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermcap" >&5
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermcap" >&5
 $as_echo_n "checking for tgetent in -ltermcap... " >&6; }
 if test "${ac_cv_lib_termcap_tgetent+set}" = set; then :
   $as_echo_n "(cached) " >&6
@@ -21068,6 +21110,9 @@ fi
 fi
 
 
+fi
+
+
 else
     for ac_header in curses.h
 do :
@@ -22143,13 +22188,13 @@ $as_echo "#define HAVE_OPENSSL_EXPORT_LIBRARY 1" \
>>confdefs.h  fi
 
    if test "$support_crypto" = "yes"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_PKEY_encrypt_old in \
                -lssl" >&5
-$as_echo_n "checking for EVP_PKEY_encrypt_old in -lssl... " >&6; }
-if test "${ac_cv_lib_ssl_EVP_PKEY_encrypt_old+set}" = set; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_PKEY_encrypt_old in \
-lcrypto" >&5 +$as_echo_n "checking for EVP_PKEY_encrypt_old in -lcrypto... " >&6; }
+if test "${ac_cv_lib_crypto_EVP_PKEY_encrypt_old+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lssl  $LIBS"
+LIBS="-lcrypto  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -22169,17 +22214,17 @@ return EVP_PKEY_encrypt_old ();
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_ssl_EVP_PKEY_encrypt_old=yes
+  ac_cv_lib_crypto_EVP_PKEY_encrypt_old=yes
 else
-  ac_cv_lib_ssl_EVP_PKEY_encrypt_old=no
+  ac_cv_lib_crypto_EVP_PKEY_encrypt_old=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \
                $ac_cv_lib_ssl_EVP_PKEY_encrypt_old" >&5
-$as_echo "$ac_cv_lib_ssl_EVP_PKEY_encrypt_old" >&6; }
-if test "x$ac_cv_lib_ssl_EVP_PKEY_encrypt_old" = x""yes; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \
$ac_cv_lib_crypto_EVP_PKEY_encrypt_old" >&5 +$as_echo \
"$ac_cv_lib_crypto_EVP_PKEY_encrypt_old" >&6; } +if test \
"x$ac_cv_lib_crypto_EVP_PKEY_encrypt_old" = x""yes; then :  
 $as_echo "#define HAVE_OPENSSLv1 1" >>confdefs.h
 
@@ -23705,35 +23750,35 @@ case `echo $DB_BACKENDS | wc -w | sed -e 's/^ *//'` in
    1)
       DEFAULT_DB_TYPE="${DB_BACKENDS}"
       if test x$use_libtool = xno; then
-         SHARED_CATALOG_TARGETS=""
+	 SHARED_CATALOG_TARGETS=""
       else
-         SHARED_CATALOG_TARGETS="libbaccats-${DEFAULT_DB_TYPE}.la"
+	 SHARED_CATALOG_TARGETS="libbaccats-${DEFAULT_DB_TYPE}.la"
       fi
       ;;
    *)
                         DEFAULT_DB_TYPE=`echo ${DB_BACKENDS} | cut -d' ' -f1`
 
                         if test x$use_libtool = xno; then
-         echo " "
-         echo " "
-         echo "You have specified two or more of the"
-         echo "supported databases: MySQL, PostgreSQL, Ingres, SQLite3 or DBI."
-         echo "This is not permitted when not using libtool Please reconfigure."
-         echo " "
-         echo "Aborting the configuration ..."
-         echo " "
-         echo " "
-         exit 1
+	 echo " "
+	 echo " "
+	 echo "You have specified two or more of the"
+	 echo "supported databases: MySQL, PostgreSQL, Ingres, SQLite3 or DBI."
+	 echo "This is not permitted when not using libtool Please reconfigure."
+	 echo " "
+	 echo "Aborting the configuration ..."
+	 echo " "
+	 echo " "
+	 exit 1
       fi
 
       SHARED_CATALOG_TARGETS=""
       for db_type in ${DB_BACKENDS}
       do
-         if test -z "${SHARED_CATALOG_TARGETS}"; then
-            SHARED_CATALOG_TARGETS="libbaccats-${db_type}.la"
-         else
-            SHARED_CATALOG_TARGETS="${SHARED_CATALOG_TARGETS} \
                libbaccats-${db_type}.la"
-         fi
+	 if test -z "${SHARED_CATALOG_TARGETS}"; then
+	    SHARED_CATALOG_TARGETS="libbaccats-${db_type}.la"
+	 else
+	    SHARED_CATALOG_TARGETS="${SHARED_CATALOG_TARGETS} libbaccats-${db_type}.la"
+	 fi
       done
       ;;
 esac
@@ -23752,7 +23797,7 @@ support_batch_insert=yes
 if test "${enable_batch_insert+set}" = set; then :
   enableval=$enable_batch_insert;
        if test x$enableval = xno; then
-          support_batch_insert=no
+	  support_batch_insert=no
        fi
 
 
@@ -24051,11 +24096,11 @@ fi
       test "x$ac_cv_lib_pq_PQputCopyData" = "xyes"
       pkg=$?
       if test $pkg = 0; then
-         if test $support_batch_insert = yes ; then
+	 if test $support_batch_insert = yes ; then
 
 $as_echo "#define HAVE_DBI_BATCH_FILE_INSERT 1" >>confdefs.h
 
-         fi
+	 fi
       fi
    fi
 else
@@ -27511,6 +27556,20 @@ fi
 done
 
 
+for ac_func in getpagesize
+do :
+  ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
+if test "x$ac_cv_func_getpagesize" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GETPAGESIZE 1
+_ACEOF
+
+$as_echo "#define HAVE_GETPAGESIZE 1" >>confdefs.h
+
+fi
+done
+
+
 for ac_func in malloc_trim
 do :
   ac_fn_c_check_func "$LINENO" "malloc_trim" "ac_cv_func_malloc_trim"
@@ -28567,15 +28626,15 @@ $as_echo "$ac_cv_lib_acl_acl_get_file" >&6; }
 if test "x$ac_cv_lib_acl_acl_get_file" = x""yes; then :
 
 	     have_acl=yes
-             if test $have_afs = yes; then
-                                                                if test -d \
                /usr/lib64/; then
-                   FDLIBS="-L/usr/lib64 -lacl $FDLIBS"
-                else
-                   FDLIBS="-L/usr/lib -lacl $FDLIBS"
-                fi
-             else
-                FDLIBS="-lacl $FDLIBS"
-             fi
+	     if test $have_afs = yes; then
+								if test -d /usr/lib64/; then
+		   FDLIBS="-L/usr/lib64 -lacl $FDLIBS"
+		else
+		   FDLIBS="-L/usr/lib -lacl $FDLIBS"
+		fi
+	     else
+		FDLIBS="-lacl $FDLIBS"
+	     fi
 
 
 fi
@@ -28622,7 +28681,7 @@ $as_echo "$ac_cv_lib_pacl_acl_get_file" >&6; }
 if test "x$ac_cv_lib_pacl_acl_get_file" = x""yes; then :
 
 	     have_acl=yes
-             FDLIBS="-lpacl $FDLIBS"
+	     FDLIBS="-lpacl $FDLIBS"
 
 
 fi
@@ -28630,7 +28689,7 @@ fi
    fi
 
             if test $have_acl = no -a \
-           x${HAVE_SUN_OS_TRUE} = x; then
+	   x${HAVE_SUN_OS_TRUE} = x; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acltotext in -lsec" >&5
 $as_echo_n "checking for acltotext in -lsec... " >&6; }
 if test "${ac_cv_lib_sec_acltotext+set}" = set; then :
@@ -28670,9 +28729,9 @@ $as_echo "$ac_cv_lib_sec_acltotext" >&6; }
 if test "x$ac_cv_lib_sec_acltotext" = x""yes; then :
 
 	     have_acl=yes
-             FDLIBS="-lsec $FDLIBS"
+	     FDLIBS="-lsec $FDLIBS"
 
-             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_totext in \
-lsec" >&5 +	     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_totext in \
-lsec" >&5  $as_echo_n "checking for acl_totext in -lsec... " >&6; }
 if test "${ac_cv_lib_sec_acl_totext+set}" = set; then :
   $as_echo_n "(cached) " >&6
@@ -28710,7 +28769,7 @@ fi
 $as_echo "$ac_cv_lib_sec_acl_totext" >&6; }
 if test "x$ac_cv_lib_sec_acl_totext" = x""yes; then :
 
-                    have_extended_acl=yes
+		    have_extended_acl=yes
 
 
 fi
@@ -28722,16 +28781,16 @@ fi
    fi
 
             if test $have_acl = no -a \
-           x${HAVE_AIX_OS_TRUE} = x; then
+	   x${HAVE_AIX_OS_TRUE} = x; then
       ac_fn_c_check_func "$LINENO" "acl_get" "ac_cv_func_acl_get"
 if test "x$ac_cv_func_acl_get" = x""yes; then :
 
 	     have_acl=yes
 
-             ac_fn_c_check_func "$LINENO" "aclx_get" "ac_cv_func_aclx_get"
+	     ac_fn_c_check_func "$LINENO" "aclx_get" "ac_cv_func_aclx_get"
 if test "x$ac_cv_func_aclx_get" = x""yes; then :
 
-                    have_extended_acl=yes
+		    have_extended_acl=yes
 
 
 fi
@@ -28777,8 +28836,8 @@ fi
 have_xattr=no
 if test x$support_xattr = xyes -o x$support_xattr = xauto; then
                if test x${HAVE_FREEBSD_OS_TRUE} = x -o \
-           x${HAVE_NETBSD_OS_TRUE} = x -o \
-           x${HAVE_OPENBSD_OS_TRUE} = x; then
+	   x${HAVE_NETBSD_OS_TRUE} = x -o \
+	   x${HAVE_OPENBSD_OS_TRUE} = x; then
       ac_fn_c_check_header_mongrel "$LINENO" "sys/extattr.h" \
"ac_cv_header_sys_extattr_h" "$ac_includes_default"  if test \
"x$ac_cv_header_sys_extattr_h" = x""yes; then :  
@@ -28822,7 +28881,7 @@ done
 
 
       if test $have_xattr = no; then
-         for ac_func in extattr_get_file extattr_set_file extattr_list_file
+	 for ac_func in extattr_get_file extattr_set_file extattr_list_file
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -28832,7 +28891,7 @@ eval as_val=\$$as_ac_var
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
-	        have_xattr=yes
+		have_xattr=yes
 
 $as_echo "#define HAVE_EXTATTR_GET_FILE 1" >>confdefs.h
 
@@ -28850,8 +28909,8 @@ done
       fi
 
       if test $have_xattr = yes; then
-         have_extattr_string_in_libc=no
-         for ac_func in extattr_namespace_to_string extattr_string_to_namespace
+	 have_extattr_string_in_libc=no
+	 for ac_func in extattr_namespace_to_string extattr_string_to_namespace
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -28861,7 +28920,7 @@ eval as_val=\$$as_ac_var
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
-	        have_extattr_string_in_libc=yes
+		have_extattr_string_in_libc=yes
 
 $as_echo "#define HAVE_EXTATTR_NAMESPACE_TO_STRING 1" >>confdefs.h
 
@@ -28874,7 +28933,7 @@ fi
 done
 
 
-                                    if test $have_extattr_string_in_libc = no; then
+	 	 	 	 if test $have_extattr_string_in_libc = no; then
 	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for \
extattr_namespace_to_string extattr_string_to_namespace in -lutil" >&5  $as_echo_n \
"checking for extattr_namespace_to_string extattr_string_to_namespace in -lutil... " \
>&6; }  if test "${ac_cv_lib_util_extattr_namespace_to_string_extattr_string_to_namespace+set}" \
> = set; then :
@@ -28924,12 +28983,12 @@ $as_echo "#define HAVE_EXTATTR_STRING_TO_NAMESPACE 1" \
>>confdefs.h  
 fi
 
-         fi
+	 fi
       fi
    fi
 
                if test $have_xattr = no -a \
-           x${HAVE_AIX_OS_TRUE} = x; then
+	   x${HAVE_AIX_OS_TRUE} = x; then
       ac_fn_c_check_header_mongrel "$LINENO" "sys/ea.h" "ac_cv_header_sys_ea_h" \
"$ac_includes_default"  if test "x$ac_cv_header_sys_ea_h" = x""yes; then :
 
@@ -28994,7 +29053,7 @@ done
    fi
 
                if test $have_xattr = no -a \
-           x${HAVE_OSF1_OS_TRUE} = x; then
+	   x${HAVE_OSF1_OS_TRUE} = x; then
       ac_fn_c_check_header_mongrel "$LINENO" "sys/proplist.h" \
"ac_cv_header_sys_proplist_h" "$ac_includes_default"  if test \
"x$ac_cv_header_sys_proplist_h" = x""yes; then :  
@@ -29037,7 +29096,7 @@ done
    fi
 
                if test $have_xattr = no -a \
-           x${HAVE_SUN_OS_TRUE} = x; then
+	   x${HAVE_SUN_OS_TRUE} = x; then
       ac_fn_c_check_header_mongrel "$LINENO" "sys/attr.h" "ac_cv_header_sys_attr_h" \
"$ac_includes_default"  if test "x$ac_cv_header_sys_attr_h" = x""yes; then :
 
@@ -29777,7 +29836,7 @@ if test "x${subsysdir}" = "x${sbindir}" ; then
    exit 1
 fi
 
-ac_config_files="$ac_config_files autoconf/Make.common Makefile manpages/Makefile \
scripts/startmysql scripts/stopmysql scripts/btraceback scripts/startit \
scripts/stopit scripts/bconsole scripts/gconsole scripts/bacula \
scripts/bacula-ctl-dir scripts/bacula-ctl-fd scripts/bacula-ctl-sd \
scripts/devel_bacula scripts/Makefile scripts/logrotate scripts/bacula.desktop.gnome1 \
scripts/bacula.desktop.gnome2 scripts/bacula.desktop.gnome1.consolehelper \
scripts/bacula.desktop.gnome2.consolehelper scripts/bacula.desktop.gnome1.xsu \
scripts/bacula.desktop.gnome2.xsu scripts/bgnome-console.console_apps \
scripts/mtx-changer scripts/disk-changer scripts/dvd-handler scripts/dvd-simulator \
scripts/bacula-tray-monitor.desktop scripts/logwatch/Makefile \
scripts/logwatch/logfile.bacula.conf scripts/wxconsole.console_apps \
scripts/wxconsole.desktop.consolehelper scripts/wxconsole.desktop.xsu \
scripts/bat.desktop scripts/bat.desktop.xsu scripts/bat.desktop.consolehelper \
scripts/bat.console_apps src/Makefile src/host.h src/console/Makefile \
src/console/bconsole.conf src/qt-console/tray-monitor/tray-monitor.pro \
src/qt-console/tray-monitor/tray-monitor.conf src/qt-console/bat.conf \
src/qt-console/bat.pro src/qt-console/bat.pro.mingw32 \
src/qt-console/install_conf_file src/wx-console/Makefile \
src/wx-console/bwx-console.conf src/tray-monitor/Makefile \
src/tray-monitor/tray-monitor.conf src/dird/Makefile src/dird/bacula-dir.conf \
src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile \
src/filed/bacula-fd.conf src/cats/Makefile src/cats/make_catalog_backup.pl \
src/cats/make_catalog_backup src/cats/delete_catalog_backup \
src/cats/create_postgresql_database src/cats/update_postgresql_tables \
src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges \
src/cats/drop_postgresql_tables src/cats/drop_postgresql_database \
src/cats/create_mysql_database src/cats/update_mysql_tables \
src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables \
src/cats/drop_mysql_database src/cats/create_sqlite3_database src/c \
ats/update_sqlite3_tables src/cats/make_sqlite3_tables \
src/cats/grant_sqlite3_privileges src/cats/drop_sqlite3_tables \
src/cats/drop_sqlite3_database src/cats/create_ingres_database \
src/cats/update_ingres_tables src/cats/make_ingres_tables \
src/cats/grant_ingres_privileges src/cats/drop_ingres_tables \
src/cats/drop_ingres_database src/cats/sqlite src/cats/mysql \
src/cats/create_bacula_database src/cats/update_bacula_tables \
src/cats/grant_bacula_privileges src/cats/make_bacula_tables \
src/cats/drop_bacula_tables src/cats/drop_bacula_database src/findlib/Makefile \
src/tools/Makefile src/plugins/fd/Makefile src/plugins/sd/Makefile \
src/plugins/dir/Makefile src/win32/Makefile.inc po/Makefile.in \
updatedb/update_mysql_tables_9_to_10 updatedb/update_sqlite3_tables_9_to_10 \
updatedb/update_postgresql_tables_9_to_10 updatedb/update_mysql_tables_10_to_11 \
updatedb/update_sqlite3_tables_10_to_11 updatedb/update_postgresql_tables_10_to_11 \
updatedb/update_mysql_tables_11_to_12 updatedb/update_sqlite3_tables_11_to_12 \
updatedb/update_postgresql_tables_11_to_12 examples/nagios/check_bacula/Makefile \
$PFILES" +ac_config_files="$ac_config_files autoconf/Make.common Makefile \
manpages/Makefile scripts/btraceback scripts/bconsole scripts/bacula \
scripts/bacula-ctl-dir scripts/bacula-ctl-fd scripts/bacula-ctl-sd \
scripts/devel_bacula scripts/Makefile scripts/logrotate scripts/bacula.desktop.gnome1 \
scripts/bacula.desktop.gnome2 scripts/bacula.desktop.gnome1.consolehelper \
scripts/bacula.desktop.gnome2.consolehelper scripts/bacula.desktop.gnome1.xsu \
scripts/bacula.desktop.gnome2.xsu scripts/bgnome-console.console_apps \
scripts/mtx-changer scripts/disk-changer scripts/dvd-handler scripts/dvd-simulator \
scripts/bacula-tray-monitor.desktop scripts/logwatch/Makefile \
scripts/logwatch/logfile.bacula.conf scripts/wxconsole.console_apps \
scripts/wxconsole.desktop.consolehelper scripts/wxconsole.desktop.xsu \
scripts/bat.desktop scripts/bat.desktop.xsu scripts/bat.desktop.consolehelper \
scripts/bat.console_apps src/Makefile src/host.h src/console/Makefile \
src/console/bconsole.conf src/qt-console/tray-monitor/tray-monitor.pro \
src/qt-console/tray-monitor/tray-monitor.conf src/qt-console/bat.conf \
src/qt-console/bat.pro src/qt-console/bat.pro.mingw32 \
src/qt-console/install_conf_file src/wx-console/Makefile \
src/wx-console/bwx-console.conf src/tray-monitor/Makefile \
src/tray-monitor/tray-monitor.conf src/dird/Makefile src/dird/bacula-dir.conf \
src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile \
src/filed/bacula-fd.conf src/cats/Makefile src/cats/make_catalog_backup.pl \
src/cats/make_catalog_backup src/cats/delete_catalog_backup \
src/cats/create_postgresql_database src/cats/update_postgresql_tables \
src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges \
src/cats/drop_postgresql_tables src/cats/drop_postgresql_database \
src/cats/create_mysql_database src/cats/update_mysql_tables \
src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables \
src/cats/drop_mysql_database src/cats/create_sqlite3_database \
src/cats/update_sqlite3_tables src/cats/make_sqlite3_tables \
src/cats/grant_sqlite3_privile ges src/cats/drop_sqlite3_tables \
src/cats/drop_sqlite3_database src/cats/create_ingres_database \
src/cats/update_ingres_tables src/cats/make_ingres_tables \
src/cats/grant_ingres_privileges src/cats/drop_ingres_tables \
src/cats/drop_ingres_database src/cats/sqlite src/cats/mysql \
src/cats/create_bacula_database src/cats/update_bacula_tables \
src/cats/grant_bacula_privileges src/cats/make_bacula_tables \
src/cats/drop_bacula_tables src/cats/drop_bacula_database src/findlib/Makefile \
src/tools/Makefile src/plugins/fd/Makefile src/plugins/sd/Makefile \
src/plugins/dir/Makefile src/win32/Makefile.inc po/Makefile.in \
updatedb/update_mysql_tables_9_to_10 updatedb/update_sqlite3_tables_9_to_10 \
updatedb/update_postgresql_tables_9_to_10 updatedb/update_mysql_tables_10_to_11 \
updatedb/update_sqlite3_tables_10_to_11 updatedb/update_postgresql_tables_10_to_11 \
updatedb/update_mysql_tables_11_to_12 updatedb/update_sqlite3_tables_11_to_12 \
updatedb/update_postgresql_tables_11_to_12 examples/nagios/check_bacula/Makefile \
$PFILES"  
 ac_config_commands="$ac_config_commands default"
 
@@ -30838,13 +30897,8 @@ do
     "autoconf/Make.common") CONFIG_FILES="$CONFIG_FILES autoconf/Make.common" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "manpages/Makefile") CONFIG_FILES="$CONFIG_FILES manpages/Makefile" ;;
-    "scripts/startmysql") CONFIG_FILES="$CONFIG_FILES scripts/startmysql" ;;
-    "scripts/stopmysql") CONFIG_FILES="$CONFIG_FILES scripts/stopmysql" ;;
     "scripts/btraceback") CONFIG_FILES="$CONFIG_FILES scripts/btraceback" ;;
-    "scripts/startit") CONFIG_FILES="$CONFIG_FILES scripts/startit" ;;
-    "scripts/stopit") CONFIG_FILES="$CONFIG_FILES scripts/stopit" ;;
     "scripts/bconsole") CONFIG_FILES="$CONFIG_FILES scripts/bconsole" ;;
-    "scripts/gconsole") CONFIG_FILES="$CONFIG_FILES scripts/gconsole" ;;
     "scripts/bacula") CONFIG_FILES="$CONFIG_FILES scripts/bacula" ;;
     "scripts/bacula-ctl-dir") CONFIG_FILES="$CONFIG_FILES scripts/bacula-ctl-dir" ;;
     "scripts/bacula-ctl-fd") CONFIG_FILES="$CONFIG_FILES scripts/bacula-ctl-fd" ;;
@@ -32492,13 +32546,12 @@ if test "${support_bat}" = "yes" ; then
       as_fn_error "Could not find qmake $PATH. Check your Qt installation" "$LINENO" \
5  fi
 
-   QMAKEBIN="qmake"
    cd src/qt-console
    echo "Creating bat Makefile"
    touch bat
    chmod 755 bat
    rm -f Makefile
-   $QMAKEBIN
+   $QMAKE
    ${MAKE:-make} clean
    cd ${BUILD_DIR}
 fi
@@ -32513,9 +32566,9 @@ chmod 755 install_conf_file build-depkgs-qt-console
 cd ${BUILD_DIR}
 
 cd scripts
-chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
+chmod 755 bacula btraceback mtx-changer
 chmod 755 dvd-handler dvd-simulator
-chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
+chmod 755 bconsole mtx-changer devel_bacula logrotate
 cd ..
 
 c=updatedb
diff --git a/bacula/platforms/rpm/bacula-bat.spec \
b/bacula/platforms/rpm/bacula-bat.spec deleted file mode 100644
index 5d97ea3..0000000
--- a/bacula/platforms/rpm/bacula-bat.spec
+++ /dev/null
@@ -1,316 +0,0 @@
-# Bacula RPM spec file
-#
-# Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
-
-# Platform Build Configuration
-
-# basic defines for every build
-%define _release           1
-%define _version           5.0.1
-%define depkgs_qt_version  28Jul09
-
-# this is the QT version in depkgs_qt
-%define qt4ver             4.3.4
-
-%define _packager D. Scott Barninger <barninger@fairfieldcomputers.com>
-
-%define manpage_ext gz
-
-%define single_dir 0
-%{?single_dir_install:%define single_dir 1}
-
-# Installation Directory locations
-%if %{single_dir}
-%define _prefix        /opt/bacula
-%define _sbindir       /opt/bacula/bin
-%define _bindir        /opt/bacula/bin
-%define _subsysdir     /opt/bacula/working
-%define sqlite_bindir  /opt/bacula/sqlite
-%define _mandir        /usr/share/man
-%define sysconf_dir    /opt/bacula/etc
-%define script_dir     /opt/bacula/scripts
-%define working_dir    /opt/bacula/working
-%define pid_dir        /opt/bacula/working
-%define plugin_dir     /opt/bacula/plugins
-%define lib_dir        /opt/bacula/lib
-%else
-%define _prefix        /usr
-%define _sbindir       %_prefix/sbin
-%define _bindir        %_prefix/bin
-%define _subsysdir     /var/lock/subsys
-%define sqlite_bindir  %_libdir/bacula/sqlite
-%define _mandir        %_prefix/share/man
-%define sysconf_dir    /etc/bacula
-%define script_dir     %_libdir/bacula
-%define working_dir    /var/lib/bacula
-%define pid_dir        /var/run
-%define plugin_dir     %_libdir/bacula/plugins
-%define lib_dir        %_libdir/bacula/lib
-%endif
-
-# Daemon user:group Don't change them unless you know what you are doing
-%define director_daemon_user    bacula
-%define daemon_group            bacula
-
-#--------------------------------------------------------------------------
-# it should not be necessary to change anything below here for a release
-# except for patch macros in the setup section
-#--------------------------------------------------------------------------
-
-%{?contrib_packager:%define _packager %{contrib_packager}}
-
-%{expand: %%define gccver %(rpm -q --queryformat %%{version} gcc)}
-%{expand: %%define gccrel %(rpm -q --queryformat %%{release} gcc)}
-
-%define staticqt 1
-%{?nobuild_staticqt:%define staticqt 0}
-
-# determine what platform we are building on
-%define fedora 0
-%define suse 0
-%define mdk 0
-
-%if %{_vendor} == redhat
-        %define fedora 1
-        %define _dist %(cat /etc/redhat-release)
-%endif
-%if %{_vendor} == suse
-        %define suse 1
-        %define _dist %(grep -i SuSE /etc/SuSE-release)
-%endif
-%if %{_vendor} == Mandriva
-        %define mdk 1
-        %define _dist %(grep Mand /etc/mandrake-release)
-%endif
-%if ! %{fedora} && ! %{suse} && ! %{mdk}
-%{error: Unknown platform. Please examine the spec file.}
-exit 1
-%endif
-
-Summary: Bacula - The Network Backup Solution
-Name: bacula-bat
-Version: %{_version}
-Release: %{_release}
-Group: System Environment/Daemons
-License: AGPLv3
-BuildRoot: %{_tmppath}/%{name}-root
-URL: http://www.bacula.org/
-Vendor: The Bacula Team
-Packager: %{_packager}
-Prefix: %{_prefix}
-Distribution: %{_dist}
-
-Source0: http://www.prdownloads.sourceforge.net/bacula/bacula-%{version}.tar.gz
-Source1: http://www.prdownloads.sourceforge.net/bacula/depkgs-qt-%{depkgs_qt_version}.tar.gz
                
-
-BuildRequires: gcc, gcc-c++, make, autoconf
-BuildRequires: libstdc++-devel = %{gccver}-%{gccrel}, zlib-devel
-BuildRequires: openssl-devel, fontconfig-devel, libpng-devel, libstdc++-devel, \
                zlib-devel
-
-Requires: openssl
-Requires: fontconfig
-Requires: libgcc
-Requires: libpng
-Requires: libstdc++
-Requires: zlib
-Requires: bacula-libs
-
-%if %{suse}
-Requires: /usr/bin/kdesu
-Requires: freetype2
-BuildRequires: freetype2-devel
-%else
-Requires: usermode
-Requires: freetype
-BuildRequires: freetype-devel
-%endif
-
-# Source directory locations
-%define depkgs_qt ../depkgs-qt
-
-# define the basic package description
-%define blurb Bacula - The Leading Open Source Backup Solution.
-%define blurb2 Bacula is a set of computer programs that permit you (or the system
-%define blurb3 administrator) to manage backup, recovery, and verification of \
                computer
-%define blurb4 data across a network of computers of different kinds. In technical \
                terms,
-%define blurb5 it is a network client/server based backup program. Bacula is \
                relatively
-%define blurb6 easy to use and efficient, while offering many advanced storage \
                management
-%define blurb7 features that make it easy to find and recover lost or damaged files.
-%define blurb8 Bacula source code has been released under the AGPL version 3 \
                license.
-
-Summary: Bacula - The Network Backup Solution
-Group: System Environment/Daemons
-
-%description
-%{blurb}
-
-%{blurb2}
-%{blurb3}
-%{blurb4}
-%{blurb5}
-%{blurb6}
-%{blurb7}
-%{blurb8}
-
-This is the Bacula Administration Tool (bat) graphical user interface package.
-It is an add-on to the client or server packages.
-
-%prep
-%setup -T -n bacula-%{_version} -b 0
-%setup -T -D -n bacula-%{_version} -b 1
-
-%build
-
-
-cwd=${PWD}
-%if ! %{staticqt}
-export QTDIR=$(pkg-config --variable=prefix QtCore)
-export QTINC=$(pkg-config --variable=includedir QtCore)
-export QTLIB=$(pkg-config --variable=libdir QtCore)
-export PATH=${QTDIR}/bin/:${PATH}
-%else
-cd %{depkgs_qt}
-make qt4 <<EOF
-yes
-EOF
-qtdir=${PWD}
-export PATH=${qtdir}/qt4/bin:$PATH
-export QTDIR=${qtdir}/qt4/
-export QTINC=${qtdir}/qt4/include/
-export QTLIB=${qtdir}/qt4/lib/
-export QMAKESPEC=${qtdir}/qt-x11-opensource-src-%{qt4ver}/mkspecs/linux-g++/
-cd ${cwd}
-%endif
-
-# Main Bacula configuration with bat
-%configure \
-        --prefix=%{_prefix} \
-        --sbindir=%{_sbindir} \
-        --sysconfdir=%{sysconf_dir} \
-        --mandir=%{_mandir} \
-        --with-scriptdir=%{script_dir} \
-        --with-working-dir=%{working_dir} \
-        --with-plugindir=%{script_dir} \
-        --with-pid-dir=%{pid_dir} \
-        --with-subsys-dir=%{_subsysdir} \
-        --enable-smartalloc \
-        --enable-bat \
-        --without-qwt \
-        --enable-client-only \
-        --with-dir-user=%{director_daemon_user} \
-        --with-dir-group=%{daemon_group} \
-        --with-sd-user=%{storage_daemon_user} \
-        --with-sd-group=%{storage_daemon_group} \
-        --with-fd-user=%{file_daemon_user} \
-        --with-fd-group=%{daemon_group} \
-        --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
-        --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
-        --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
-        --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
-        --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
-        --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
-        --with-openssl
-
-make
-
-%install
-mkdir -p $RPM_BUILD_ROOT/usr/share/applications
-mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
-%if ! %{suse}
-mkdir -p $RPM_BUILD_ROOT/etc/pam.d
-mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
-mkdir -p $RPM_BUILD_ROOT%{_sbindir}
-mkdir -p $RPM_BUILD_ROOT/usr/bin
-%endif
-
-cd src/qt-console
-make DESTDIR=$RPM_BUILD_ROOT install
-cd ../..
-
-rm -rf $RPM_BUILD_ROOT%{_prefix}/share/doc/bacula
-
-%if %{suse}
-cp -p src/qt-console/images/bat_icon.png \
                $RPM_BUILD_ROOT/usr/share/pixmaps/bat_icon.png
-cp -p scripts/bat.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/bat.desktop
-touch $RPM_BUILD_ROOT%{sysconf_dir}/bat.kdesu
-%else
-cp -p src/qt-console/images/bat_icon.png \
                $RPM_BUILD_ROOT/usr/share/pixmaps/bat_icon.png
-cp -p scripts/bat.desktop.consolehelper \
                $RPM_BUILD_ROOT/usr/share/applications/bat.desktop
-cp -p scripts/bat.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/bat
-cp -p scripts/bat.pamd $RPM_BUILD_ROOT/etc/pam.d/bat
-ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/bat
-%endif
-
-%files
-%defattr(-,root,root)
-%attr(-, root, %{daemon_group}) %{_sbindir}/bat
-%attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
-%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bat.conf
-/usr/share/pixmaps/bat_icon.png
-/usr/share/applications/bat.desktop
-
-# if user is a member of daemon_group then kdesu will run bat as user
-%if %{suse}
-%attr(0660, root, %{daemon_group}) %{sysconf_dir}/bat.kdesu
-%endif
-
-%if ! %{suse}
-# add the console helper files
-%config(noreplace,missingok) /etc/pam.d/bat
-%config(noreplace,missingok) /etc/security/console.apps/bat
-/usr/bin/bat
-%endif
-
-%pre
-# create the daemon group
-HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
-if [ -z "$HAVE_BACULA" ]; then
-    %{groupadd} -r %{daemon_group} > /dev/null 2>&1
-    echo "The group %{daemon_group} has been added to %{group_file}."
-    echo "See the manual chapter \"Running Bacula\" for details."
-fi
-
-
-%post
-if [ -d %{sysconf_dir} ]; then
-   cd %{sysconf_dir}
-   for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX \
XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX \
XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX \
XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX \
                XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
-      pass=`openssl rand -base64 33`
-      for file in *.conf; do
-         need_password=`grep ${string} $file 2>/dev/null`
-         if [ -n "$need_password" ]; then
-            sed "s@${string}@${pass}@g" $file > $file.new
-            cp -f $file.new $file; rm -f $file.new
-         fi
-      done
-   done
-# put actual hostname in conf file
-   host=`hostname`
-   string="XXX_HOSTNAME_XXX"
-   for file in *.conf; do
-      need_host=`grep ${string} $file 2>/dev/null`
-      if [ -n "$need_host" ]; then
-         sed "s@${string}@${host}@g" $file >$file.new
-         cp -f $file.new $file; rm -f $file.new
-      fi
-   done
-fi
-/sbin/ldconfig
-
-%clean
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
-rm -rf $RPM_BUILD_DIR/depkgs-qt
-
-%changelog
-* Sun Mar 14 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- Fix for QT mkspecs location on FC12
-- allow user to build without embedded static QT
-* Sat Feb 27 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- add dependency on bacula-libs
-* Sat Feb 13 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- create file to allow bat to run nonroot with kdesu
-- add dependency information
-* Sat Jan 30 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- fix consolehelper/xsu for suse packages
-* Sat Aug 1 2009 Kern Sibbald <kern@sibbald.com>
-- Split bat into separate bacula-bat.spec
diff --git a/bacula/platforms/rpm/bacula-docs.spec \
b/bacula/platforms/rpm/bacula-docs.spec deleted file mode 100644
index bc9d2ca..0000000
--- a/bacula/platforms/rpm/bacula-docs.spec
+++ /dev/null
@@ -1,89 +0,0 @@
-# Bacula RPM spec file
-#
-# Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
-
-# Platform Build Configuration
-
-# basic defines for every build
-%define _release           1
-%define _version           5.0.0
-%define _packager D. Scott Barninger <barninger@fairfieldcomputers.com>
-
-%define _prefix        /usr
-%define _sbindir       %_prefix/sbin
-%define _mandir        %_prefix/share/man
-
-
-#--------------------------------------------------------------------------
-# it should not be necessary to change anything below here for a release
-# except for patch macros in the setup section
-#--------------------------------------------------------------------------
-
-%{?contrib_packager:%define _packager %{contrib_packager}}
-
-Summary: Bacula - The Network Backup Solution
-Name: bacula-docs
-Version: %{_version}
-Release: %{_release}
-Group: System Environment/Daemons
-License: AGPLv3
-BuildRoot: %{_tmppath}/%{name}-root
-URL: http://www.bacula.org/
-Vendor: The Bacula Team
-Packager: %{_packager}
-BuildArchitectures: noarch
-Prefix: %{_prefix}
-Distribution: Bacula Documentation
-
-Source: %{name}-%{_version}.tar.bz2
-
-# Source directory locations
-%define _docsrc .
-
-# define the basic package description
-%define blurb Bacula - The Leading Open Source Backup Solution.
-%define blurb2 Bacula is a set of computer programs that permit you (or the system
-%define blurb3 administrator) to manage backup, recovery, and verification of \
                computer
-%define blurb4 data across a network of computers of different kinds. In technical \
                terms,
-%define blurb5 it is a network client/server based backup program. Bacula is \
                relatively
-%define blurb6 easy to use and efficient, while offering many advanced storage \
                management
-%define blurb7 features that make it easy to find and recover lost or damaged files.
-%define blurb8 Bacula source code has been released under the AGPL version 3 \
                license.
-
-Summary: Bacula - The Network Backup Solution
-Group: System Environment/Daemons
-
-%description
-%{blurb}
-
-%{blurb2}
-%{blurb3}
-%{blurb4}
-%{blurb5}
-%{blurb6}
-%{blurb7}
-%{blurb8}
-
-This package installs the Bacula pdf and html documentation.
-
-%prep
-%setup
-
-
-%clean
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
-rm -rf $RPM_BUILD_DIR/%{name}-%{_version}
-
-%files
-%doc %{_docsrc}/manuals/en/console/console %{_docsrc}/manuals/en/console/console.pdf
-%doc %{_docsrc}/manuals/en/developers/developers \
                %{_docsrc}/manuals/en/developers/developers.pdf
-%doc %{_docsrc}/manuals/en/main/main %{_docsrc}/manuals/en/main/main.pdf
-%doc %{_docsrc}/manuals/en/misc/misc %{_docsrc}/manuals/en/misc/misc.pdf
-%doc %{_docsrc}/manuals/en/problems/problems \
                %{_docsrc}/manuals/en/problems/problems.pdf
-%doc %{_docsrc}/manuals/en/utility/utility %{_docsrc}/manuals/en/utility/utility.pdf
-
-%changelog
-* Sat Jan 30 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- change source file to bz2, update for new doc structure
-* Sat Aug 1 2009 Kern Sibbald <kern@sibbald.com>
-- Split docs into separate bacula-docs.spec
diff --git a/bacula/platforms/rpm/bacula-mtx.spec \
b/bacula/platforms/rpm/bacula-mtx.spec deleted file mode 100644
index fa5ec20..0000000
--- a/bacula/platforms/rpm/bacula-mtx.spec
+++ /dev/null
@@ -1,119 +0,0 @@
-# Bacula RPM spec file
-#
-# Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
-
-# Platform Build Configuration
-
-# basic defines for every build
-%define _release           1
-%define _version           5.0.0
-%define depkgs_version     18Feb09
-%define _packager D. Scott Barninger <barninger@fairfieldcomputers.com>
-
-%define manpage_ext gz
-
-%define single_dir 0
-%{?single_dir_install:%define single_dir 1}
-
-# Installation Directory locations
-%define _prefix        /usr
-%define _sbindir       %_prefix/sbin
-%define _bindir        %_prefix/bin
-%define _subsysdir     /var/lock/subsys
-%define sqlite_bindir  %_libdir/bacula/sqlite
-%define _mandir        %_prefix/share/man
-%define sysconf_dir    /etc/bacula
-%define script_dir     %_libdir/bacula
-%define working_dir    /var/lib/bacula
-%define pid_dir        /var/run
-%define plugin_dir     %_libdir/bacula/plugins
-%define lib_dir        %_libdir/bacula/lib
-
-#--------------------------------------------------------------------------
-# it should not be necessary to change anything below here for a release
-# except for patch macros in the setup section
-#--------------------------------------------------------------------------
-
-%{?contrib_packager:%define _packager %{contrib_packager}}
-
-Summary: Bacula - The Network Backup Solution
-Name: bacula-mtx
-Version: %{_version}
-Release: %{_release}
-Group: System Environment/Daemons
-License: AGPLv3
-BuildRoot: %{_tmppath}/%{name}-root
-URL: http://www.bacula.org/
-Vendor: The Bacula Team
-Packager: %{_packager}
-Prefix: %{_prefix}
-Distribution: Bacula Bat
-
-Source: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
                
-
-# define the basic package description
-%define blurb Bacula - The Leading Open Source Backup Solution.
-%define blurb2 Bacula is a set of computer programs that permit you (or the system
-%define blurb3 administrator) to manage backup, recovery, and verification of \
                computer
-%define blurb4 data across a network of computers of different kinds. In technical \
                terms,
-%define blurb5 it is a network client/server based backup program. Bacula is \
                relatively
-%define blurb6 easy to use and efficient, while offering many advanced storage \
                management
-%define blurb7 features that make it easy to find and recover lost or damaged files.
-%define blurb8 Bacula source code has been released under the AGPL version 3 \
                license.
-
-Summary: Bacula - The Network Backup Solution
-Group: System Environment/Daemons
-
-%description
-%{blurb}
-
-%{blurb2}
-%{blurb3}
-%{blurb4}
-%{blurb5}
-%{blurb6}
-%{blurb7}
-%{blurb8}
-
-This is Bacula's version of mtx tape utilities for Linux distributions that
-do not provide their own mtx package
-
-%prep
-%setup -T -n depkgs -b 0
-
-%build
-
-make mtx
-
-%install
-make \
-        prefix=$RPM_BUILD_ROOT%{_prefix} \
-        sbindir=$RPM_BUILD_ROOT%{_sbindir} \
-        sysconfdir=$RPM_BUILD_ROOT%{sysconf_dir} \
-        scriptdir=$RPM_BUILD_ROOT%{script_dir} \
-        working_dir=$RPM_BUILD_ROOT%{working_dir} \
-        piddir=$RPM_BUILD_ROOT%{pid_dir} \
-        mandir=$RPM_BUILD_ROOT%{_mandir} \
-        mtx-install
-
-%files
-%defattr(-,root,root)
-%attr(-, root, %{storage_daemon_group}) %{_sbindir}/loaderinfo
-%attr(-, root, %{storage_daemon_group}) %{_sbindir}/mtx
-%attr(-, root, %{storage_daemon_group}) %{_sbindir}/scsitape
-%attr(-, root, %{storage_daemon_group}) %{_sbindir}/tapeinfo
-%attr(-, root, %{storage_daemon_group}) %{_sbindir}/scsieject
-%{_mandir}/man1/loaderinfo.1.%{manpage_ext}
-%{_mandir}/man1/mtx.1.%{manpage_ext}
-%{_mandir}/man1/scsitape.1.%{manpage_ext}
-%{_mandir}/man1/tapeinfo.1.%{manpage_ext}
-%{_mandir}/man1/scsieject.1.%{manpage_ext}
-
-
-%clean
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
-rm -rf $RPM_BUILD_DIR/depkgs
-
-%changelog
-* Sat Aug 1 2009 Kern Sibbald <kern@sibbald.com>
-- Split mtx out into bacula-mtx.spec
diff --git a/bacula/platforms/rpm/bacula.spec b/bacula/platforms/rpm/bacula.spec
deleted file mode 100644
index 201370f..0000000
--- a/bacula/platforms/rpm/bacula.spec
+++ /dev/null
@@ -1,1550 +0,0 @@
-# Bacula RPM spec file
-#
-# Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
-
-# Platform Build Configuration
-
-# basic defines for every build
-%define _release           1
-%define _version           5.0.3
-%define _packager D. Scott Barninger <barninger@fairfieldcomputers.com>
-%define depkgs_version 18Dec09
-
-# postgresql defines - defaults for most platforms
-# pass changes if required
-# versions less than 8 are no longer supported
-%define postgres_version 8
-%{?postgresql_version:%define postgres_version %{postgresql_version}}
-%define postgres_package postgresql84
-%{?postgresql_package:%define postgres_package %{postgresql_package}}
-%define postgres_server_package postgresql84-server
-%{?postgresql_server_package:%define postgres_server_package \
                %{postgresql_server_package}}
-%define postgres_devel_package postgresql84-devel
-%{?postgresql_devel_package:%define postgres_devel_package \
                %{postgresql_devel_package}}
-
-%define single_dir 1
-%{?single_dir_install:%define single_dir 1}
-
-# Installation Directory locations
-%if %{single_dir}
-%define _prefix        /opt/bacula
-%define _sbindir       /opt/bacula/bin
-%define _bindir        /opt/bacula/bin
-%define _subsysdir     /opt/bacula/working
-%define sqlite_bindir  /opt/bacula/sqlite
-%define _mandir        /usr/share/man
-%define sysconf_dir    /opt/bacula/etc
-%define script_dir     /opt/bacula/scripts
-%define working_dir    /opt/bacula/working
-%define pid_dir        /opt/bacula/working
-%define plugin_dir     /opt/bacula/plugins
-%define lib_dir        /opt/bacula/lib
-%else
-%define _prefix        /usr
-%define _sbindir       %_prefix/sbin
-%define _bindir        %_prefix/bin
-%define _subsysdir     /var/lock/subsys
-%define sqlite_bindir %_libdir/bacula/sqlite
-%define _mandir        %_prefix/share/man
-%define sysconf_dir    /etc/bacula
-%define script_dir     %_libdir/bacula
-%define working_dir    /var/lib/bacula
-%define pid_dir        /var/run
-%define plugin_dir     %_libdir/bacula/plugins
-%define lib_dir        %_libdir/bacula/lib
-%endif
-
-# Daemon user:group Don't change them unless you know what you are doing
-%define director_daemon_user    bacula
-%define storage_daemon_user     bacula
-%define file_daemon_user        root
-%define daemon_group            bacula
-# group that has write access to tape devices, usually disk on Linux
-%define storage_daemon_group    disk
-
-%define depkgs ../depkgs
-
-# probems with mandriva build: 
-# nothing provides libbonobo2_0-devel, nothing provides libbonoboui2_0-devel
-
-# set Macros by opensuse_bs, see \
                http://en.opensuse.org/Build_Service/cross_distribution_package_how_to
                
-#openSUSE 11.1          %if 0%{?suse_version} == 1110  
-#openSUSE 11.0          %if 0%{?suse_version} == 1100   
-#openSUSE 10.3          %if 0%{?suse_version} == 1030   
-#openSUSE 10.2          %if 0%{?suse_version} == 1020   
-#SUSE Linux 10.1        %if 0%{?suse_version} == 1010   
-#SUSE Linux 10.0        %if 0%{?suse_version} == 1000   
-#SUSE Linux 9.3         %if 0%{?suse_version} == 930    
-#SLES 9                 %if 0%{?sles_version} == 9      also set: %if \
                0%{?suse_version} == 910
-#SLE 10                 %if 0%{?sles_version} == 10     also set: %if \
                0%{?suse_version} == 1010
-#SLE 11                 %if 0%{?sles_version} == 11     also set: %if \
                0%{?suse_version} == 1110
-#CentOS 5               %if 0%{?centos_version} == 501  
-#RHEL 4                 %if 0%{?rhel_version} == 406    
-#RHEL 5                 %if 0%{?rhel_version} == 501    
-#Fedora 6 with Extras   %if 0%{?fedora_version} == 6    
-#Fedora 7 with Extras   %if 0%{?fedora_version} == 7    
-#Fedora 8 with Extras   %if 0%{?fedora_version} == 8    
-#Fedora 9 with Extras   %if 0%{?fedora_version} == 9    
-#Fedora 10 with Extras  %if 0%{?fedora_version} == 10   
-#Mandriva 2006          %if 0%{?mandriva_version} == 2006       
-#Mandriva 2007          %if 0%{?mandriva_version} == 2007       
-#Mandriva 2008          %if 0%{?mandriva_version} == 2008       
-
-
-%if 0%{?opensuse_bs}
-# am I running in opensuse build service?
-# TODO: seems to make problems
-
-# Build Service: Determine Distribution
-
-%ifarch x86_64
- %define build_x86_64 1
-%endif
-
-
-%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
-BuildRequires: GConf2-devel
-BuildRequires: freetype-devel
-BuildRequires: libtermcap-devel
-BuildRequires: shadow-utils
-%endif
-
-
-%if 0%{?mandriva_version} == 2007
-%define build_mdv 1
-%define _dist "Mandriva 2007"
-%endif
-
-%if 0%{?fedora_version} == 8
-%define build_fc8 1
-%define _dist "Fedora Core 8"
-BuildRequires: redhat-release
-%endif
-
-%if 0%{?fedora_version} == 9
-%define build_fc9 1
-%define _dist "Fedora Core 9"
-BuildRequires: redhat-release
-%endif
-
-
-%if 0%{?fedora_version} == 10
-%define build_fc9 1
-%define _dist "Fedora Core 10"
-BuildRequires: PolicyKit-gnome
-BuildRequires: fedora-release
-%endif
-
-%if 0%{?fedora_version} == 11
-%define build_fc9 1
-%define _dist "Fedora Core 11"
-BuildRequires: PolicyKit-gnome
-BuildRequires: fedora-release
-%endif
-
-%if 0%{?rhel_version} == 501
-%define build_rhel5 1
-%define _dist "Red Hat Enterprise Linux Server release 5"
-BuildRequires: redhat-release
-%endif
-
-%if 0%{?rhel_version} == 406
-%define build_rhel4 1
-%define _dist "Red Hat Enterprise Linux Server release 4"
-BuildRequires: redhat-release
-%endif
-
-
-%if 0%{?centos_version} == 501
-%define build_centos5 1
-%define _dist "CentOS 5"
-BuildRequires: redhat-release
-%endif
-
-
-%if 0%{?suse_version} == 1020
-%define build_su102 1
-%define _dist "OpenSUSE 10.2"
-BuildRequires: suse-release
-%endif
-
-
-%if 0%{?suse_version} == 1030
-%define build_su103 1
-%define _dist "OpenSUSE 10.3"
-BuildRequires: suse-release
-%endif
-
-%if 0%{?suse_version} == 1100
-%define build_su110 1
-%define _dist "SUSE 11"
-BuildRequires: suse-release
-%endif
-
-
-%if 0%{?suse_version} == 1110
-%define build_su111 1
-%define _dist "SUSE 11"
-%endif
-
-%if 0%{?suse_version} == 1120
-%define build_su112 1
-%define _dist "SUSE 11"
-%endif
-
-
-%if 0%{?sles_version} == 9
-%define build_su9 1
-%define _dist "SLES 9"
-%endif
-
-
-%if 0%{?sles_version} == 10
-%define build_su10 1
-%define _dist "SLE 10"
-%endif
-
-
-%if 0%{?sles_version} == 11
-%define build_su111 1
-%define _dist "SLES 11"
-%endif
-
-%endif 
-# opensuse-bs?
-
-
-# any patches for this release
-# be sure to check the setup section for patch macros
-
-#--------------------------------------------------------------------------
-# it should not be necessary to change anything below here for a release
-# except for patch macros in the setup section
-#--------------------------------------------------------------------------
-
-%{?contrib_packager:%define _packager %{contrib_packager}}
-
-Summary: Bacula - The Network Backup Solution
-Name: bacula
-Version: %{_version}
-Release: %{_release}
-Group: System Environment/Daemons
-License: AGPLv3
-BuildRoot: %{_tmppath}/%{name}-root
-URL: http://www.bacula.org/
-Vendor: The Bacula Team
-Packager: %{_packager}
-Prefix: %{_prefix}
-
-Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
-# opensuse build service changes the release itself
-# what happens if the release is not 1? DSB
-%if 0%{?opensuse_bs}
-Source1: Release_Notes-%{version}-1.tar.gz
-%else
-Source1: Release_Notes-%{version}-%{release}.tar.gz
-%endif
-Source2: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
                
-
-# define the basic package description
-%define blurb Bacula - The Leading Open Source Backup Solution.
-%define blurb2 Bacula is a set of computer programs that permit you (or the system
-%define blurb3 administrator) to manage backup, recovery, and verification of \
                computer
-%define blurb4 data across a network of computers of different kinds. In technical \
                terms,
-%define blurb5 it is a network client/server based backup program. Bacula is \
                relatively
-%define blurb6 easy to use and efficient, while offering many advanced storage \
                management
-%define blurb7 features that make it easy to find and recover lost or damaged files.
-%define blurb8 Bacula source code has been released under the AGPL version 3 \
                license.
-
-%define user_file  /etc/passwd
-%define group_file /etc/group
-
-# program locations
-%define useradd  /usr/sbin/useradd
-%define groupadd /usr/sbin/groupadd
-%define usermod  /usr/sbin/usermod
-
-# platform defines - set one below or define the build_xxx on the command line
-# RedHat builds
-%define rh7 0
-%{?build_rh7:%define rh7 1}
-%define rh8 0
-%{?build_rh8:%define rh8 1}
-%define rh9 0
-%{?build_rh9:%define rh9 1}
-# Fedora Core build
-%define fc1 0
-%{?build_fc1:%define fc1 1}
-%define fc3 0
-%{?build_fc3:%define fc3 1}
-%define fc4 0
-%{?build_fc4:%define fc4 1}
-%define fc5 0
-%{?build_fc5:%define fc5 1}
-%define fc6 0
-%{?build_fc6:%define fc6 1}
-%define fc7 0
-%{?build_fc7:%define fc7 1}
-%define fc8 0
-%{?build_fc8:%define fc8 1}
-%define fc9 0
-%{?build_fc9:%define fc9 1}
-%define fc10 0
-%{?build_fc10:%define fc10 1}
-%define fc11 0
-%{?build_fc11:%define fc11 1}
-%define fc12 0
-%{?build_fc12:%define fc12 1}
-# Whitebox Enterprise build
-%define wb3 0
-%{?build_wb3:%define wb3 1}
-# RedHat Enterprise builds
-%define rhel3 0
-%{?build_rhel3:%define rhel3 1}
-%{?build_rhel3:%define wb3 1}
-%define rhel4 0
-%{?build_rhel4:%define rhel4 1}
-%{?build_rhel4:%define fc3 1}
-%define rhel5 0
-%{?build_rhel5:%define rhel5 1}
-%{?build_rhel5:%define fc6 1}
-# CentOS build
-%define centos3 0
-%{?build_centos3:%define centos3 1}
-%{?build_centos3:%define wb3 1}
-%define centos4 0
-%{?build_centos4:%define centos4 1}
-%{?build_centos4:%define fc3 1}
-%define centos5 0
-%{?build_centos5:%define centos5 1}
-%{?build_centos5:%define fc6 1}
-# SL build
-%define sl3 0
-%{?build_sl3:%define sl3 1}
-%{?build_sl3:%define wb3 1}
-%define sl4 0
-%{?build_sl4:%define sl4 1}
-%{?build_sl4:%define fc3 1}
-%define sl5 0
-%{?build_sl5:%define sl5 1}
-%{?build_sl5:%define fc6 1}
-# SuSE build
-%define su9 0
-%{?build_su9:%define su9 1}
-%define su10 0
-%{?build_su10:%define su10 1}
-%define su102 0
-%{?build_su102:%define su102 1}
-%define su103 0
-%{?build_su103:%define su103 1}
-%define su110 0
-%{?build_su110:%define su110 1}
-%define su111 0
-%{?build_su111:%define su111 1}
-%define su112 0
-%{?build_su112:%define su112 1}
-# Mandrake builds
-%define mdk 0
-%{?build_mdk:%define mdk 1}
-%define mdv 0
-%{?build_mdv:%define mdv 1}
-%{?build_mdv:%define mdk 1}
-
-# client only build
-%define client_only 0
-%{?build_client_only:%define client_only 1}
-
-# Setup some short cuts
-%define rhat 0
-%if %{rh7} || %{rh8} || %{rh9}
-%define rhat 1
-%endif
-%define fed 0
-%if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc6} || %{fc7} || %{fc8} || %{fc9} || \
                %{fc10} || %{fc11} || %{fc12}
-%define fed 1
-%endif
-%define suse 0
-%if %{su9} || %{su10} || %{su102} || %{su103} || %{su110} || %{su111} || %{su112}
-%define suse 1
-%endif
-%define rhel 0
-%if %{rhel3} || %{rhel4} || %{rhel5} || %{centos3} || %{centos4} || %{centos5}
-%define rhel 1
-%endif
-%define scil 0
-%if %{sl3} || %{sl4} || %{sl5}
-%define scil 1
-%endif
-
-
-# test for a platform definition
-%if !%{rhat} && !%{rhel} && !%{fed} && !%{wb3} && !%{suse} && !%{mdk} && !%{scil}
-%{error: You must specify a platform. Please examine the spec file.}
-exit 1
-%endif
-
-# distribution-specific directory for logwatch
-%if %{wb3} || %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{fc4}
-%define logwatch_dir /etc/log.d
-%else
-%define logwatch_dir /etc/logwatch
-%endif
-
-# database defines
-# set for database support desired or define the build_xxx on the command line
-%define mysql 0
-%{?build_mysql:%define mysql 1}
-%define sqlite 0
-%{?build_sqlite:%define sqlite 1}
-%define postgresql 0
-%{?build_postgresql:%define postgresql 1}
-
-# test for a database definition
-%if ! %{mysql} && ! %{sqlite} && ! %{postgresql} && ! %{client_only}
-%{error: You must specify database support, by passing one of the following to \
                rpmbuild:}
-%{error:   --define build_postgresql=1}
-%{error:   --define build_sqlite=1}
-%{error:   --define build_mysql=1}
-exit 1
-%endif
-
-%if %{mysql}
-%define db_backend mysql
-%endif
-%if %{sqlite}
-%define db_backend sqlite3
-%endif
-%if %{postgresql}
-%define db_backend postgresql
-%endif
-
-# 64 bit support
-%define x86_64 0
-%{?build_x86_64:%define x86_64 1}
-
-# check what distribution we are
-%if %{rhat} || %{rhel}
-%define _dist %(grep Red /etc/redhat-release)
-%endif
-%if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc7} || %{fc8} || %{fc9} || %{fc10} || \
                %{fc11} || %{fc12}
-%define _dist %(grep Fedora /etc/redhat-release)
-%endif
-%if %{centos5} || %{centos4} || %{centos3}
-%define _dist %(grep CentOS /etc/redhat-release)
-%endif
-%if %{sl5} ||%{sl4} || %{sl3}
-%define _dist %(grep 'Scientific Linux' /etc/redhat-release)
-%endif
-%if %{wb3} && ! %{rhel3} && ! %{centos3} && ! %{sl3}
-%define _dist %(grep White /etc/whitebox-release)
-%endif
-%if %{suse}
-%define _dist %(grep -i SuSE /etc/SuSE-release)
-%endif
-%if %{mdk}
-%define _dist %(grep Mand /etc/mandrake-release)
-%endif
-%{?DISTNAME:%define _dist %{DISTNAME}}
-
-# only set Disribution if not in opensuse build service, as it sets it itself
-%if ! 0%{?opensuse_bs}
-Distribution: %{_dist}
-%endif
-
-%if 0%{?opensuse_bs} &&  %{mysql} && %{suse}
-# needed in opensuse_bs, as rpm is installed during build process
-BuildRequires: libmysqlclient-devel
-BuildRequires: mysql-client
-BuildRequires: mysql
-%endif
-%if 0%{?opensuse_bs} &&  %{suse} && %{postgresql}
-BuildRequires: %{postgres_package}
-BuildRequires: %{postgres_server_package}
-%endif
-BuildRequires: openssl
-
-%if 0%{?opensuse_bs} && %{suse}
-BuildRequires: pwdutils
-BuildRequires: sysconfig
-%endif
-
-# should we turn on python support
-%define python 0
-%{?build_python:%define python 1}
-
-# should we enable tcp wrappers support
-%define tcpwrappers 0
-%{?build_tcpwrappers:%define tcpwrappers 1}
-
-# Mandriva somehow forces the manpage file extension to bz2 rather than gz
-%if %{mdk}
-%define manpage_ext bz2
-%else
-%define manpage_ext gz
-%endif
-
-# for client only build
-%if %{client_only}
-%define mysql 0
-%define postgresql 0
-%define sqlite 0
-%endif
-
-BuildRequires: gcc, gcc-c++, make, autoconf
-BuildRequires: glibc, glibc-devel
-BuildRequires: ncurses-devel, perl, readline-devel
-BuildRequires: libstdc++-devel, zlib-devel
-BuildRequires: openssl-devel
-BuildRequires: libacl-devel
-BuildRequires: pkgconfig
-%if ! %{rh7}
-BuildRequires: libxml2-devel
-%endif
-%if %{python}
-BuildRequires: python, python-devel
-%{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')}
-%endif
-
-%if %{rh7}
-BuildRequires: libxml-devel
-%endif
-%if %{mdk}
-BuildRequires: libstdc++-static-devel
-BuildRequires: glibc-static-devel
-%endif
-
-%if %{suse}
-BuildRequires: termcap
-%else
-BuildRequires: libtermcap-devel
-%endif
-
-%if %{sqlite}
-BuildRequires: sqlite-devel
-%endif
-
-%if %{mysql}
-BuildRequires: mysql-devel
-%endif
-
-%if %{postgresql} && %{wb3}
-BuildRequires: rh-postgresql-devel >= %{postgres_version}
-%endif
-
-%if %{postgresql} && ! %{wb3}
-BuildRequires: %{postgres_devel_package} >= %{postgres_version}
-%endif
-
-%description
-%{blurb}
-
-%{blurb2}
-%{blurb3}
-%{blurb4}
-%{blurb5}
-%{blurb6}
-%{blurb7}
-%{blurb8}
-
-%if %{mysql}
-%package mysql
-%endif
-%if %{sqlite}
-%package sqlite
-%endif
-%if %{postgresql}
-%package postgresql
-%endif
-
-Summary: Bacula - The Network Backup Solution
-Group: System Environment/Daemons
-Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
-Conflicts: bacula-client
-
-Requires: ncurses, libstdc++, zlib, openssl
-Requires: glibc, readline, %{name}-libs
-
-%if %{suse}
-Conflicts: bacula
-Requires: termcap
-%else
-Requires: libtermcap
-%endif
-
-%if %{mysql}
-Requires: mysql
-%endif
-
-%if %{postgresql} && %{wb3}
-Requires: rh-postgresql >= 7
-%endif
-%if %{postgresql} && ! %{wb3}
-Requires: postgresql >= 7
-%endif
-
-%if %{mysql}
-%description mysql
-%endif
-%if %{sqlite}
-%description sqlite
-%endif
-%if %{postgresql}
-%description postgresql
-%endif
-
-%if %{python}
-Requires: python >= %{pyver}
-%endif
-
-%{blurb}
-
-%{blurb2}
-%{blurb3}
-%{blurb4}
-%{blurb5}
-%{blurb6}
-%{blurb7}
-%{blurb8}
-
-%if %{mysql}
-This build requires MySQL to be installed separately as the catalog database.
-%endif
-%if %{postgresql}
-This build requires PostgreSQL to be installed separately as the catalog database.
-%endif
-%if %{sqlite}
-This build incorporates sqlite3 as the catalog database, statically compiled.
-%endif
-%if %{python}
-This build includes python scripting support.
-%endif
-%if %{tcpwrappers}
-This build includes tcp-wrappers support.
-%endif
-
-%package client
-Summary: Bacula - The Network Backup Solution
-Group: System Environment/Daemons
-Provides: bacula-fd
-Conflicts: bacula-mysql
-Conflicts: bacula-sqlite
-Conflicts: bacula-postgresql
-
-%if %{suse}
-Provides: bacula
-%endif
-
-Requires: libstdc++, zlib, openssl
-Requires: glibc, readline, %{name}-libs
-
-%if %{suse}
-Requires: termcap
-%else
-Requires: libtermcap
-%endif
-
-%if %{python}
-Requires: python >= %{pyver}
-%endif
-
-%description client
-%{blurb}
-
-%{blurb2}
-%{blurb3}
-%{blurb4}
-%{blurb5}
-%{blurb6}
-%{blurb7}
-%{blurb8}
-
-This is the File daemon (Client) only package. It includes the command line 
-console program.
-%if %{python}
-This build includes python scripting support.
-%endif
-%if %{tcpwrappers}
-This build includes tcp-wrappers support.
-%endif
-
-%if ! %{client_only}
-%package updatedb
-
-Summary: Bacula - The Network Backup Solution
-Group: System Environment/Daemons
-
-%description updatedb
-%{blurb}
-
-%{blurb2}
-%{blurb3}
-%{blurb4}
-%{blurb5}
-%{blurb6}
-%{blurb7}
-%{blurb8}
-
-This package installs scripts for updating older versions of the bacula
-database.
-%endif
-
-%package libs
-
-Summary: Bacula - The Network Backup Solution
-Group: System Environment/Daemons
-
-%description libs
-%{blurb}
-
-%{blurb2}
-%{blurb3}
-%{blurb4}
-%{blurb5}
-%{blurb6}
-%{blurb7}
-%{blurb8}
-
-This package installs the shared libraries used by many bacula programs.
-
-# Must explicitly enable debug pkg on SuSE
-# but not in opensuse_bs
-%if %{suse} && ! 0%{?opensuse_bs}
-%debug_package
-%endif
-
-%prep
-%setup
-%setup -T -D -b 1
-%setup -T -D -b 2
-
-%build
-
-%if %{suse}
-export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap -L/usr/lib64/termcap"
-%endif
-
-cwd=${PWD}
-%if %{sqlite}
-cd %{depkgs}
-make sqlite3
-cd ${cwd}
-%endif
-
-
-%if %{sqlite}
-# patches for the bundled sqlite scripts
-
-# patch the make_sqlite_tables script for installation bindir
-patch src/cats/make_sqlite3_tables.in src/cats/make_sqlite3_tables.in.patch
-
-# patch the create_sqlite_database script for installation bindir
-patch src/cats/create_sqlite3_database.in src/cats/create_sqlite3_database.in.patch
-
-# patch the make_catalog_backup script for installation bindir
-patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
-
-# patch the update_sqlite_tables script for installation bindir
-patch src/cats/update_sqlite3_tables.in src/cats/update_sqlite3_tables.in.patch
-
-# patch the bacula-dir init script to remove sqlite service
-%if %{sqlite} && %{suse}
-patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
-%endif
-%endif
-
-# 64 bit lib location hacks
-# as of 1.39.18 it should not be necessary to enable x86_64 as configure is
-# reported to be fixed to properly detect lib locations.
-%if %{x86_64}
-export LDFLAGS="${LDFLAGS} -L/usr/lib64"
-%endif
-%if %{mysql} && %{x86_64}
-export LDFLAGS="${LDFLAGS} -L/usr/lib64/mysql"
-%endif
-%if %{python} && %{x86_64}
-export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}"
-%endif
-
-# Main Bacula configuration
-%configure \
-        --prefix=%{_prefix} \
-        --sbindir=%{_sbindir} \
-        --sysconfdir=%{sysconf_dir} \
-        --mandir=%{_mandir} \
-        --with-scriptdir=%{script_dir} \
-        --with-working-dir=%{working_dir} \
-        --with-plugindir=%{script_dir} \
-        --with-pid-dir=%{pid_dir} \
-        --with-subsys-dir=%{_subsysdir} \
-        --enable-smartalloc \
-        --disable-gnome \
-        --disable-bwx-console \
-        --disable-tray-monitor \
-        --disable-conio \
-        --enable-readline \
-%if %{mysql}
-        --with-mysql \
-%endif
-%if %{sqlite}
-        --with-sqlite3=${cwd}/%{depkgs}/sqlite3 \
-%endif
-%if %{postgresql}
-        --with-postgresql \
-%endif
-        --disable-bat \
-%if %{python}
-        --with-python \
-%endif
-%if %{tcpwrappers}
-        --with-tcp-wrappers  \
-%endif
-%if %{client_only}
-        --enable-client-only \
-%endif
-%if %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{wb3} 
-        --disable-batch-insert \
-%endif
-        --with-dir-user=%{director_daemon_user} \
-        --with-dir-group=%{daemon_group} \
-        --with-sd-user=%{storage_daemon_user} \
-        --with-sd-group=%{storage_daemon_group} \
-        --with-fd-user=%{file_daemon_user} \
-        --with-fd-group=%{daemon_group} \
-        --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
-        --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
-        --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
-        --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
-        --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
-        --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
-        --with-openssl
-
-make -j3
-
-%install
- 
-cwd=${PWD}
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
-mkdir -p $RPM_BUILD_ROOT/etc/init.d
-mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
-mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles
-mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/conf/services
-mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services
-mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared
-mkdir -p $RPM_BUILD_ROOT%{script_dir}/updatedb
-
-mkdir -p $RPM_BUILD_ROOT/etc/pam.d
-mkdir -p $RPM_BUILD_ROOT%{_sbindir}
-
-%if %{sqlite}
-mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
-%endif
-
-make DESTDIR=$RPM_BUILD_ROOT install
-
-%if %{client_only}
-# Program docs not installed on client
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-dir.8.%{manpage_ext}
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-sd.8.%{manpage_ext}
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bcopy.8.%{manpage_ext}
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bextract.8.%{manpage_ext}
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bls.8.%{manpage_ext}
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bscan.8.%{manpage_ext}
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/btape.8.%{manpage_ext}
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.%{manpage_ext}
-rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bsmtp.1.%{manpage_ext}
-%endif
-# Docs for programs that are depreciated
-rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext}
-rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext}
-rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext}
-rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole
-
-# fixme - make installs the mysql scripts for sqlite build
-%if %{sqlite}
-rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
-rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
-rm -f $RPM_BUILD_ROOT%{script_dir}/grant_mysql_privileges
-%endif
-
-# fixme - make installs the mysql scripts for postgresql build
-%if %{postgresql}
-rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
-rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
-%endif
-
-# install the init scripts
-%if %{suse}
-cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
-cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
-cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
-%endif
-%if %{mdk}
-cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
-cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
-cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
-%endif
-%if ! %{suse} && ! %{mdk}
-cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
-cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
-cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
-%endif
-chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
-%if %{client_only}
-rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-dir
-rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-sd
-%endif
-
-# install sqlite
-%if %{sqlite}
-cp -p %{depkgs}/sqlite3/sqlite3 $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3
-cp -p %{depkgs}/sqlite3/sqlite3.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3.h
-cp -p %{depkgs}/sqlite3/libsqlite3.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite3.a
-%endif
-
-
-# install the logrotate file
-cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
-
-# install the updatedb scripts
-cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/
-
-# install the sample-query.sql file
-%if ! %{client_only}
-cp -p examples/sample-query.sql $RPM_BUILD_ROOT%{script_dir}/sample-query.sql
-%endif
-
-# install the logwatch scripts
-%if ! %{client_only}
-cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula
-cp -p scripts/logwatch/applybaculadate \
                $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate
-cp -p scripts/logwatch/logfile.bacula.conf \
                $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf
-cp -p scripts/logwatch/services.bacula.conf \
                $RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf
-chmod 755 $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula
-chmod 755 $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate
-chmod 644 $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf
-chmod 644 $RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf
-%endif
-
-# now clean up permissions that are left broken by the install
-chmod o-rwx $RPM_BUILD_ROOT%{working_dir}
-
-# fix me - building enable-client-only installs files not included in bacula-client \
                package
-%if %{client_only}
-rm -f $RPM_BUILD_ROOT%{script_dir}/bacula
-rm -f $RPM_BUILD_ROOT%{script_dir}/bacula_config
-rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-dir
-rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-sd
-rm -f $RPM_BUILD_ROOT%{script_dir}/disk-changer
-rm -f $RPM_BUILD_ROOT%{script_dir}/dvd-handler
-rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer
-rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
-rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
-rm -rf $RPM_BUILD_ROOT%{script_dir}/updatedb
-rm -f $RPM_BUILD_ROOT%{script_dir}/bconsole
-rm -f $RPM_BUILD_ROOT%{script_dir}/bpipe-fd.so
-rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer.conf
-rm -f $RPM_BUILD_ROOT%{_sbindir}/bacula
-%endif
-
-%clean
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
-%if 0%{?opensuse_bs}
-rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-1.txt
-%else
-rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
-%endif
-
-
-%if %{mysql}
-# MySQL specific files
-%files mysql
-%defattr(-, root, root)
-%attr(-, root, %{daemon_group}) %{script_dir}/create_mysql_database
-%attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_database
-%attr(-, root, %{daemon_group}) %{script_dir}/make_mysql_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/update_mysql_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/grant_mysql_privileges
-%attr(-, root, %{daemon_group}) %{script_dir}/startmysql
-%attr(-, root, %{daemon_group}) %{script_dir}/stopmysql
-%{_libdir}/libbacsql*
-%endif
-
-%if %{sqlite}
-%files sqlite
-%defattr(-,root,root)
-%attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite3_database
-%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_database
-%attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite3_privileges
-%attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite3_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite3_tables
-%{sqlite_bindir}/libsqlite3.a
-%{sqlite_bindir}/sqlite3.h
-%{sqlite_bindir}/sqlite3
-%endif
-
-
-
-%if %{postgresql}
-%files postgresql
-%defattr(-,root,root)
-%attr(-, root, %{daemon_group}) %{script_dir}/create_postgresql_database
-%attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_database
-%attr(-, root, %{daemon_group}) %{script_dir}/make_postgresql_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/update_postgresql_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/grant_postgresql_privileges
-%{_libdir}/libbacsql*
-%endif
-
-# The rest is DB backend independent
-
-%if ! %{client_only}
-%attr(-, root, %{daemon_group}) %dir %{script_dir}
-%attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
-%attr(-, root, %{daemon_group}) %{script_dir}/bacula
-%attr(-, root, %{daemon_group}) %{script_dir}/bacula_config
-%attr(-, root, %{daemon_group}) %{script_dir}/bconsole
-%attr(-, root, %{daemon_group}) %{script_dir}/create_bacula_database
-%attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_database
-%attr(-, root, %{daemon_group}) %{script_dir}/grant_bacula_privileges
-%attr(-, root, %{daemon_group}) %{script_dir}/make_bacula_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/update_bacula_tables
-%attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup
-%attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup.pl
-%attr(-, root, %{daemon_group}) %{script_dir}/delete_catalog_backup
-%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
-%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
-%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.mdb
-%attr(-, root, %{daemon_group}) %{script_dir}/disk-changer
-%attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-dir
-%attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
-%attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd
-%attr(-, root, %{daemon_group}) %{script_dir}/bpipe-fd.so
-%attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
-%attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
-%attr(-, root, %{daemon_group}) %{_sbindir}/dbcheck
-%attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler
-%attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
-%attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer
-%attr(-, root, %{storage_daemon_group}) %config(noreplace) \
                %{script_dir}/mtx-changer.conf
-
-/etc/logrotate.d/bacula
-%{logwatch_dir}/scripts/services/bacula
-%{logwatch_dir}/scripts/shared/applybaculadate
-%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-dir.conf
-%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
-%attr(-, root, %{storage_daemon_group}) %config(noreplace) \
                %{sysconf_dir}/bacula-sd.conf
-%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
-%attr(-, root, %{daemon_group}) %config(noreplace) \
                %{logwatch_dir}/conf/logfiles/bacula.conf
-%attr(-, root, %{daemon_group}) %config(noreplace) \
                %{logwatch_dir}/conf/services/bacula.conf
-%attr(-, root, %{daemon_group}) %config(noreplace) %{script_dir}/query.sql
-%attr(-, root, %{daemon_group}) %{script_dir}/sample-query.sql
-
-%attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir}
-
-%{_sbindir}/bacula-dir
-%{_sbindir}/bacula-fd
-%{_sbindir}/bacula-sd
-%{_sbindir}/bacula
-%{_sbindir}/bcopy
-%{_sbindir}/bextract
-%{_sbindir}/bls
-%{_sbindir}/bscan
-%{_sbindir}/btape
-%{_sbindir}/btraceback
-%{_sbindir}/bconsole
-%{_sbindir}/bsmtp
-%{_sbindir}/bregex
-%{_sbindir}/bwild
-%{_mandir}/man8/bacula-fd.8.%{manpage_ext}
-%{_mandir}/man8/bacula-dir.8.%{manpage_ext}
-%{_mandir}/man8/bacula-sd.8.%{manpage_ext}
-%{_mandir}/man8/bacula.8.%{manpage_ext}
-%{_mandir}/man8/bconsole.8.%{manpage_ext}
-%{_mandir}/man8/bcopy.8.%{manpage_ext}
-%{_mandir}/man8/bextract.8.%{manpage_ext}
-%{_mandir}/man8/bls.8.%{manpage_ext}
-%{_mandir}/man8/bscan.8.%{manpage_ext}
-%{_mandir}/man8/btape.8.%{manpage_ext}
-%{_mandir}/man8/btraceback.8.%{manpage_ext}
-%{_mandir}/man8/dbcheck.8.%{manpage_ext}
-%{_mandir}/man1/bsmtp.1.%{manpage_ext}
-%{_mandir}/man1/bat.1.%{manpage_ext}
-%_prefix/share/doc/*
-
-# opensuse build service changes the release itself
-%if 0%{?opensuse_bs}
-%doc ../Release_Notes-%{version}-1.txt
-%else
-%doc ../Release_Notes-%{version}-%{release}.txt
-%endif
-%endif
-
-%if %{mysql}
-%pre mysql
-# test for bacula database older than version 13
-# note: this ASSUMES no password has been set for bacula database
-DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
-%endif
-
-%if %{sqlite}
-%pre sqlite
-# are we upgrading from sqlite to sqlite3?
-if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
-        echo "This version of bacula-sqlite involves an upgrade to sqlite3."
-        echo "Your catalog database file is not compatible with sqlite3, thus"
-        echo "you will need to dump the data, delete the old file, and re-run"
-        echo "this rpm upgrade."
-        echo ""
-        echo "Backing up your current database..."
-        echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db > \
                %{working_dir}/bacula_backup.sql
-        mv %{working_dir}/bacula.db %{working_dir}/bacula.db.old
-        echo "Your catalog data has been saved in %{working_dir}/bacula_backup.sql \
                and your"
-        echo "catalog file has been renamed %{working_dir}/bacula.db.old."
-        echo ""
-        echo "Please re-run this rpm package upgrade."
-        echo "After the upgrade is complete, restore your catalog"
-        echo "with the following commands:"
-        echo "%{script_dir}/drop_sqlite3_tables"
-        echo "cd %{working_dir}"
-        echo "%{sqlite_bindir}/sqlite3 $* bacula.db < bacula_backup.sql"
-        echo "chown bacula.bacula bacula.db"
-        exit 1
-fi
-# test for bacula database older than version 12 and sqlite3
-if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite3 ];then
-        DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null \
                %{working_dir}/bacula.db | tail -n 1`
-%endif
-
-%if %{postgresql}
-%pre postgresql
-DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
-%endif
-
-%if ! %{client_only}
-if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "12" ]; then
-    echo "This bacula upgrade will update a bacula database from version 12 to 13."
-    echo "You appear to be running database version $DB_VER. You must first update"
-    echo "your database to version 12 and then install this upgrade. The \
                alternative"
-    echo "is to use %{script_dir}/drop_%{db_backend}_tables to delete all your your \
                current"
-    echo "catalog information, then do the upgrade. Information on updating a"
-    echo "database older than version 12 can be found in the release notes."
-    exit 1
-fi
-%endif
-
-%if %{sqlite}
-fi
-%endif
-
-%if ! %{client_only}
-# check for and copy %{sysconf_dir}/console.conf to bconsole.conf
-if [ -s %{sysconf_dir}/console.conf ];then
-    cp -p %{sysconf_dir}/console.conf %{sysconf_dir}/bconsole.conf
-fi
-
-# create the daemon users and groups
-# first create the groups if they don't exist
-HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
-if [ -z "$HAVE_BACULA" ]; then
-        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
-        echo "The group %{daemon_group} has been added to %{group_file}."
-        echo "See the manual chapter \"Running Bacula\" for details."
-fi
-HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
-if [ -z "$HAVE_BACULA" ]; then
-        %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
-        echo "The group %{storage_daemon_group} has been added to %{group_file}."
-        echo "See the manual chapter \"Running Bacula\" for details."
-fi
-# now create the users if they do not exist
-# we do not use the -g option allowing the primary group to be set to system default
-# this will be a unique group on redhat type systems or the group users on some \
                systems
-HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
-if [ -z "$HAVE_BACULA" ]; then
-        %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s \
                /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1
-        echo "The user %{storage_daemon_user} has been added to %{user_file}."
-        echo "See the manual chapter \"Running Bacula\" for details."
-fi
-HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
-if [ -z "$HAVE_BACULA" ]; then
-        %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s \
                /sbin/nologin %{director_daemon_user} > /dev/null 2>&1
-        echo "The user %{director_daemon_user} has been added to %{user_file}."
-        echo "See the manual chapter \"Running Bacula\" for details."
-fi
-HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
-if [ -z "$HAVE_BACULA" ]; then
-        %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s \
                /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
-        echo "The user %{file_daemon_user} has been added to %{user_file}."
-        echo "See the manual chapter \"Running Bacula\" for details."
-fi
-# now we add the supplementary groups, this is ok to call even if the users already \
                exist
-# we only do this if the user is NOT root
-IS_ROOT=%{director_daemon_user}
-if [ "$IS_ROOT" != "root" ]; then
-%{usermod} -G %{daemon_group} %{director_daemon_user}
-fi
-IS_ROOT=%{storage_daemon_user}
-if [ "$IS_ROOT" != "root" ]; then
-%{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
-fi
-IS_ROOT=%{file_daemon_user}
-if [ "$IS_ROOT" != "root" ]; then
-%{usermod} -G %{daemon_group} %{file_daemon_user}
-fi
-%endif
-
-%if %{mysql}
-%post mysql
-%endif
-%if %{sqlite}
-%post sqlite
-%endif
-%if %{postgresql}
-%post postgresql
-%endif
-%if ! %{client_only}
-# add our links
-if [ "$1" -ge 1 ] ; then
-%if %{suse} && %{mysql}
-  /sbin/chkconfig --add mysql
-%endif
-%if %{suse} && %{postgresql}
-  /sbin/chkconfig --add postgresql
-%endif
-  /sbin/chkconfig --add bacula-dir
-  /sbin/chkconfig --add bacula-fd
-  /sbin/chkconfig --add bacula-sd
-fi
-%endif
-
-%if %{mysql}
-
-#check, if mysql can be called successfully at all
-if mysql 2>/dev/null bacula -e 'select * from Version;' ; then
-
-# test for an existing database
-# note: this ASSUMES no password has been set for bacula database
-DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
-
-# grant privileges and create tables if they do not exist
-if [ -z "$DB_VER" ]; then
-    echo "Hmm, it doesn't look like you have an existing database."
-    echo "Granting privileges for MySQL user bacula..."
-    %{script_dir}/grant_mysql_privileges
-    echo "Creating MySQL bacula database..."
-    %{script_dir}/create_mysql_database
-    echo "Creating bacula tables..."
-    %{script_dir}/make_mysql_tables
-
-# check to see if we need to upgrade a 3.x database
-elif [ "$DB_VER" -lt "13" ]; then
-    echo "This release requires an upgrade to your bacula database."
-    echo "Backing up your current database..."
-    mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
-    echo "Upgrading bacula database ..."
-    %{script_dir}/update_mysql_tables
-    echo "If bacula works correctly you can remove the backup file \
                %{working_dir}/bacula_backup.sql.bz2"
-
-fi
-fi
-%endif
-
-%if %{sqlite}
-# test for an existing database
-if [ -s %{working_dir}/bacula.db ]; then
-        DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null \
                %{working_dir}/bacula.db | tail -n 1`
-        # check to see if we need to upgrade a 3.x database
-        if [ "$DB_VER" -lt "13" ] && [ "$DB_VER" -ge "12" ]; then
-                echo "This release requires an upgrade to your bacula database."
-                echo "Backing up your current database..."
-                echo ".dump" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | \
                bzip2 > %{working_dir}/bacula_backup.sql.bz2
-                echo "Upgrading bacula database ..."
-                %{script_dir}/update_sqlite3_tables
-                echo "If bacula works correctly you can remove the backup file \
                %{working_dir}/bacula_backup.sql.bz2"
-        fi
-else
-        # create the database and tables
-        echo "Hmm, doesn't look like you have an existing database."
-        echo "Creating SQLite database..."
-        %{script_dir}/create_sqlite3_database
-        chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db
-        echo "Creating the SQLite tables..."
-        %{script_dir}/make_sqlite3_tables
-fi
-%endif
-
-%if %{postgresql}
-# check if psql can be called successfully at all
-if echo 'select * from Version;' | psql bacula 2>/dev/null; then
-
-# test for an existing database
-# note: this ASSUMES no password has been set for bacula database
-DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
-
-# grant privileges and create tables if they do not exist
-if [ -z "$DB_VER" ]; then
-    echo "Hmm, doesn't look like you have an existing database."
-    echo "Creating PostgreSQL bacula database..."
-    %{script_dir}/create_postgresql_database
-    echo "Creating bacula tables..."
-    %{script_dir}/make_postgresql_tables
-    echo "Granting privileges for PostgreSQL user bacula..."
-    %{script_dir}/grant_postgresql_privileges
-
-# check to see if we need to upgrade a 5.0.x database
-elif [ "$DB_VER" -lt "13" ]; then
-    echo "This release requires an upgrade to your bacula database."
-    echo "Backing up your current database..."
-    pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
-    echo "Upgrading bacula database ..."
-    %{script_dir}/update_postgresql_tables
-    echo "If bacula works correctly you can remove the backup file \
                %{working_dir}/bacula_backup.sql.bz2"
-        
-fi
-fi
-%endif
-
-%if ! %{client_only}
-if [ -d %{sysconf_dir} ]; then
-   cd %{sysconf_dir}
-   for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX \
XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX \
XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX \
XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX \
                XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
-      pass=`openssl rand -base64 33`
-      for file in *.conf; do
-         sed "s@${string}@${pass}@g" $file > $file.new
-         cp -f $file.new $file; rm -f $file.new
-      done
-   done
-# put actual hostname in conf file
-   host=`hostname`
-   string="XXX_HOSTNAME_XXX"
-   for file in *.conf; do
-      sed "s@${string}@${host}@g" $file >$file.new
-      cp -f $file.new $file; rm -f $file.new
-   done
-fi
-%endif
-
-
-%if %{mysql}
-%preun mysql
-%endif
-%if %{sqlite}
-%preun sqlite
-%endif
-%if %{postgresql}
-%preun postgresql
-%endif
-
-%if ! %{client_only}
-# delete our links
-if [ $1 = 0 ]; then
-  /sbin/chkconfig --del bacula-dir
-  /sbin/chkconfig --del bacula-fd
-  /sbin/chkconfig --del bacula-sd
-fi
-%endif
-
-%files client
-%defattr(-,root,root)
-%attr(-, root, %{daemon_group}) %dir %{script_dir}
-%attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
-%{script_dir}/bacula-ctl-fd
-/etc/init.d/bacula-fd
-
-/etc/logrotate.d/bacula
-
-%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
-%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
-%attr(-, root, %{daemon_group}) %dir %{working_dir}
-
-%{_sbindir}/bacula-fd
-%{_sbindir}/btraceback
-%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
-%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
-%{_sbindir}/bconsole
-%{_mandir}/man8/bacula-fd.8.%{manpage_ext}
-%{_mandir}/man8/bacula.8.%{manpage_ext}
-%{_mandir}/man8/bconsole.8.%{manpage_ext}
-%{_mandir}/man8/btraceback.8.%{manpage_ext}
-%{_mandir}/man1/bat.1.%{manpage_ext}
-%_prefix/share/doc/*
-
-%pre client
-# create the daemon group and user
-HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
-if [ -z "$HAVE_BACULA" ]; then
-    %{groupadd} -r %{daemon_group} > /dev/null 2>&1
-    echo "The group %{daemon_group} has been added to %{group_file}."
-    echo "See the manual chapter \"Running Bacula\" for details."
-fi
-# we do not use the -g option allowing the primary group to be set to system default
-# this will be a unique group on redhat type systems or the group users on some \
                systems
-HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
-if [ -z "$HAVE_BACULA" ]; then
-    %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s \
                /sbin/nologin %{file_daemon_user} > /dev/null 2>&1
-    echo "The user %{file_daemon_user} has been added to %{user_file}."
-    echo "See the manual chapter \"Running Bacula\" for details."
-fi
-# now we add the supplementary group, this is ok to call even if the user already \
                exists
-# we only do this if the user is NOT root
-IS_ROOT=%{file_daemon_user}
-if [ "$IS_ROOT" != "root" ]; then
-%{usermod} -G %{daemon_group} %{file_daemon_user}
-fi
-
-%post client
-# add our link
-if [ "$1" -ge 1 ] ; then
-   /sbin/chkconfig --add bacula-fd
-fi
-
-if [ -d %{sysconf_dir} ]; then
-   cd %{sysconf_dir}
-   for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX \
XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX \
XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX \
XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX \
                XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
-      pass=`openssl rand -base64 33`
-      for file in *.conf; do
-         sed "s@${string}@${pass}@g" $file > $file.new
-         cp -f $file.new $file; rm -f $file.new
-      done
-   done
-# put actual hostname in conf file
-   host=`hostname`
-   string="XXX_HOSTNAME_XXX"
-   for file in *.conf; do
-      sed "s@${string}@${host}@g" $file >$file.new
-      cp -f $file.new $file; rm -f $file.new
-   done
-fi
-
-%preun client
-# delete our link
-if [ $1 = 0 ]; then
-   /sbin/chkconfig --del bacula-fd
-fi
-
-%files libs
-%defattr(-,root,root)
-%{_libdir}/libbac-*
-%{_libdir}/libbac.*
-%{_libdir}/libbaccfg*
-%{_libdir}/libbacfind*
-%{_libdir}/libbacpy*
-
-%post libs
-/sbin/ldconfig
-exit 0
-
-%postun libs
-/sbin/ldconfig
-exit 0
-
-%if ! %{client_only}
-%files updatedb
-%defattr(-,root,%{daemon_group})
-%{script_dir}/updatedb/*
-#oensuse_bs: directories not owned by any package
-#%{script_dir}/updatedb
-
-%pre updatedb
-# create the daemon group
-HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
-if [ -z "$HAVE_BACULA" ]; then
-    %{groupadd} -r %{daemon_group} > /dev/null 2>&1
-    echo "The group %{daemon_group} has been added to %{group_file}."
-    echo "See the manual chapter \"Running Bacula\" for details."
-fi
-
-%post updatedb
-echo "The database update scripts were installed to %{script_dir}/updatedb"
-%endif
-
-%changelog
-* Mon Sep 06 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-* Mon Sep 06 2010 Kern Sibbald <kern@sibbald.com>
-- 5.0.3
-- change license to AGPL v3
-- add defines for postgresql version and packages, require version 8 or greater
-- adjusted package description
-- fix bug with libbacsql files
-* Sun Mar 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- remove --without-qwt from configure statement
-* Sat Feb 27 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- move shared libraries into bacula-libs package
-* Sat Feb 20 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- remove deprecated mysql4 and mysql5 build defines
-- add build support for tcpwrappers
-- remove bacula_config file for client only build
-- remove requirements for database server packages
-- enable readline support
-- add fc11 and fc12
-* Sat Feb 13 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- 5.0.1
-- fix client only build
-- clean up requirements for termcap
-- query.sql now empty by default so we install sample-query.sql along side it
-- remove old nobuild_mtx switch
-* Sun Feb 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- fix mysql database upgrade
-* Fri Feb 05 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- fix permissions of dbcheck
-- misc. cleanup
-* Sat Jan 30 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- 5.0.0
-- add su112 and fc10 builds, remove doc package declaration.
-- fix source path for logwatch files.
-- restore static bundled build of sqlite (who took that out?) and remove use
-- of system sqlite. we don't support use of sqlite2.
-- upgrade database from version 11 to 12.
-* Mon Aug 10 2009 Philipp Storz <philipp.storz@dass-it.de>
-- changes to work with opensuse build service
-* Sat Aug 1 2009 Kern Sibbald <kern@sibbald.com>
-- Split docs into separate bacula-docs.spec, bacula-bat.spec and bacula-mtx.spec
-- removed build of rescue, gnome console and wxconsole
-* Sat Jun 20 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- Fix bat install which is now handled by make and uses shared libs
-* Sat May 16 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- fix libxml dependency for rh7 per Pasi Kärkkäinen <pasik@iki.fi>
-* Mon May 04 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- Fix post ldconfig problem in client only build
-* Sun May 03 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- remove more files installed by client-only build not needed by client package
-- remove libbacsql files from client package
-* Sat May 02 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- 3.0.1
-- update for new docs configuration
-* Sat Apr 25 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- add switch to pass Distribution tag
-* Sun Apr 5 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- 3.0.0 release
-- database update version 10 to 11
-- make now installs docs so we rm from buildroot
-- add shared libs in %_libdir and other misc new files
-* Wed Dec 31 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- add su111 target
-* Sat Nov 08 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- set paths for QT using pkgconfig
-* Sat Oct 11 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- release 2.4.3 update depkgs to 11Sep08 remove file nmshack from mtx package
-* Sun Sep 07 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- adjust /opt/bacula install
-- add build switch to supress rescue package
-* Sun Aug 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- add support for install to /opt/bacula
-* Sun Aug 17 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- remove libtermcap dependancy for FC9
-* Mon Aug 04 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- fix bat dependencies
-* Sat Jun 28 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- add su110 target
-* Sat May 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- add fc9 target
-* Sun Mar 30 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- FHS compatibility changes
-* Sat Feb 16 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- remove fix for false buffer overflow detection with glibc >= 2.7
-* Sat Feb 09 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
-- fix for false buffer overflow detection with glibc >= 2.7
diff --git a/bacula/platforms/rpms/bacula-bat.spec \
b/bacula/platforms/rpms/bacula-bat.spec new file mode 100644
index 0000000..5d97ea3
--- /dev/null
+++ b/bacula/platforms/rpms/bacula-bat.spec
@@ -0,0 +1,316 @@
+# Bacula RPM spec file
+#
+# Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
+
+# Platform Build Configuration
+
+# basic defines for every build
+%define _release           1
+%define _version           5.0.1
+%define depkgs_qt_version  28Jul09
+
+# this is the QT version in depkgs_qt
+%define qt4ver             4.3.4
+
+%define _packager D. Scott Barninger <barninger@fairfieldcomputers.com>
+
+%define manpage_ext gz
+
+%define single_dir 0
+%{?single_dir_install:%define single_dir 1}
+
+# Installation Directory locations
+%if %{single_dir}
+%define _prefix        /opt/bacula
+%define _sbindir       /opt/bacula/bin
+%define _bindir        /opt/bacula/bin
+%define _subsysdir     /opt/bacula/working
+%define sqlite_bindir  /opt/bacula/sqlite
+%define _mandir        /usr/share/man
+%define sysconf_dir    /opt/bacula/etc
+%define script_dir     /opt/bacula/scripts
+%define working_dir    /opt/bacula/working
+%define pid_dir        /opt/bacula/working
+%define plugin_dir     /opt/bacula/plugins
+%define lib_dir        /opt/bacula/lib
+%else
+%define _prefix        /usr
+%define _sbindir       %_prefix/sbin
+%define _bindir        %_prefix/bin
+%define _subsysdir     /var/lock/subsys
+%define sqlite_bindir  %_libdir/bacula/sqlite
+%define _mandir        %_prefix/share/man
+%define sysconf_dir    /etc/bacula
+%define script_dir     %_libdir/bacula
+%define working_dir    /var/lib/bacula
+%define pid_dir        /var/run
+%define plugin_dir     %_libdir/bacula/plugins
+%define lib_dir        %_libdir/bacula/lib
+%endif
+
+# Daemon user:group Don't change them unless you know what you are doing
+%define director_daemon_user    bacula
+%define daemon_group            bacula
+
+#--------------------------------------------------------------------------
+# it should not be necessary to change anything below here for a release
+# except for patch macros in the setup section
+#--------------------------------------------------------------------------
+
+%{?contrib_packager:%define _packager %{contrib_packager}}
+
+%{expand: %%define gccver %(rpm -q --queryformat %%{version} gcc)}
+%{expand: %%define gccrel %(rpm -q --queryformat %%{release} gcc)}
+
+%define staticqt 1
+%{?nobuild_staticqt:%define staticqt 0}
+
+# determine what platform we are building on
+%define fedora 0
+%define suse 0
+%define mdk 0
+
+%if %{_vendor} == redhat
+        %define fedora 1
+        %define _dist %(cat /etc/redhat-release)
+%endif
+%if %{_vendor} == suse
+        %define suse 1
+        %define _dist %(grep -i SuSE /etc/SuSE-release)
+%endif
+%if %{_vendor} == Mandriva
+        %define mdk 1
+        %define _dist %(grep Mand /etc/mandrake-release)
+%endif
+%if ! %{fedora} && ! %{suse} && ! %{mdk}
+%{error: Unknown platform. Please examine the spec file.}
+exit 1
+%endif
+
+Summary: Bacula - The Network Backup Solution
+Name: bacula-bat
+Version: %{_version}
+Release: %{_release}
+Group: System Environment/Daemons
+License: AGPLv3
+BuildRoot: %{_tmppath}/%{name}-root
+URL: http://www.bacula.org/
+Vendor: The Bacula Team
+Packager: %{_packager}
+Prefix: %{_prefix}
+Distribution: %{_dist}
+
+Source0: http://www.prdownloads.sourceforge.net/bacula/bacula-%{version}.tar.gz
+Source1: http://www.prdownloads.sourceforge.net/bacula/depkgs-qt-%{depkgs_qt_version}.tar.gz
 +
+BuildRequires: gcc, gcc-c++, make, autoconf
+BuildRequires: libstdc++-devel = %{gccver}-%{gccrel}, zlib-devel
+BuildRequires: openssl-devel, fontconfig-devel, libpng-devel, libstdc++-devel, \
zlib-devel +
+Requires: openssl
+Requires: fontconfig
+Requires: libgcc
+Requires: libpng
+Requires: libstdc++
+Requires: zlib
+Requires: bacula-libs
+
+%if %{suse}
+Requires: /usr/bin/kdesu
+Requires: freetype2
+BuildRequires: freetype2-devel
+%else
+Requires: usermode
+Requires: freetype
+BuildRequires: freetype-devel
+%endif
+
+# Source directory locations
+%define depkgs_qt ../depkgs-qt
+
+# define the basic package description
+%define blurb Bacula - The Leading Open Source Backup Solution.
+%define blurb2 Bacula is a set of computer programs that permit you (or the system
+%define blurb3 administrator) to manage backup, recovery, and verification of \
computer +%define blurb4 data across a network of computers of different kinds. In \
technical terms, +%define blurb5 it is a network client/server based backup program. \
Bacula is relatively +%define blurb6 easy to use and efficient, while offering many \
advanced storage management +%define blurb7 features that make it easy to find and \
recover lost or damaged files. +%define blurb8 Bacula source code has been released \
under the AGPL version 3 license. +
+Summary: Bacula - The Network Backup Solution
+Group: System Environment/Daemons
+
+%description
+%{blurb}
+
+%{blurb2}
+%{blurb3}
+%{blurb4}
+%{blurb5}
+%{blurb6}
+%{blurb7}
+%{blurb8}
+
+This is the Bacula Administration Tool (bat) graphical user interface package.
+It is an add-on to the client or server packages.
+
+%prep
+%setup -T -n bacula-%{_version} -b 0
+%setup -T -D -n bacula-%{_version} -b 1
+
+%build
+
+
+cwd=${PWD}
+%if ! %{staticqt}
+export QTDIR=$(pkg-config --variable=prefix QtCore)
+export QTINC=$(pkg-config --variable=includedir QtCore)
+export QTLIB=$(pkg-config --variable=libdir QtCore)
+export PATH=${QTDIR}/bin/:${PATH}
+%else
+cd %{depkgs_qt}
+make qt4 <<EOF
+yes
+EOF
+qtdir=${PWD}
+export PATH=${qtdir}/qt4/bin:$PATH
+export QTDIR=${qtdir}/qt4/
+export QTINC=${qtdir}/qt4/include/
+export QTLIB=${qtdir}/qt4/lib/
+export QMAKESPEC=${qtdir}/qt-x11-opensource-src-%{qt4ver}/mkspecs/linux-g++/
+cd ${cwd}
+%endif
+
+# Main Bacula configuration with bat
+%configure \
+        --prefix=%{_prefix} \
+        --sbindir=%{_sbindir} \
+        --sysconfdir=%{sysconf_dir} \
+        --mandir=%{_mandir} \
+        --with-scriptdir=%{script_dir} \
+        --with-working-dir=%{working_dir} \
+        --with-plugindir=%{script_dir} \
+        --with-pid-dir=%{pid_dir} \
+        --with-subsys-dir=%{_subsysdir} \
+        --enable-smartalloc \
+        --enable-bat \
+        --without-qwt \
+        --enable-client-only \
+        --with-dir-user=%{director_daemon_user} \
+        --with-dir-group=%{daemon_group} \
+        --with-sd-user=%{storage_daemon_user} \
+        --with-sd-group=%{storage_daemon_group} \
+        --with-fd-user=%{file_daemon_user} \
+        --with-fd-group=%{daemon_group} \
+        --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
+        --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
+        --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
+        --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
+        --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
+        --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
+        --with-openssl
+
+make
+
+%install
+mkdir -p $RPM_BUILD_ROOT/usr/share/applications
+mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
+%if ! %{suse}
+mkdir -p $RPM_BUILD_ROOT/etc/pam.d
+mkdir -p $RPM_BUILD_ROOT/etc/security/console.apps
+mkdir -p $RPM_BUILD_ROOT%{_sbindir}
+mkdir -p $RPM_BUILD_ROOT/usr/bin
+%endif
+
+cd src/qt-console
+make DESTDIR=$RPM_BUILD_ROOT install
+cd ../..
+
+rm -rf $RPM_BUILD_ROOT%{_prefix}/share/doc/bacula
+
+%if %{suse}
+cp -p src/qt-console/images/bat_icon.png \
$RPM_BUILD_ROOT/usr/share/pixmaps/bat_icon.png +cp -p scripts/bat.desktop.xsu \
$RPM_BUILD_ROOT/usr/share/applications/bat.desktop +touch \
$RPM_BUILD_ROOT%{sysconf_dir}/bat.kdesu +%else
+cp -p src/qt-console/images/bat_icon.png \
$RPM_BUILD_ROOT/usr/share/pixmaps/bat_icon.png +cp -p \
scripts/bat.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bat.desktop \
+cp -p scripts/bat.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/bat +cp -p \
scripts/bat.pamd $RPM_BUILD_ROOT/etc/pam.d/bat +ln -sf consolehelper \
$RPM_BUILD_ROOT/usr/bin/bat +%endif
+
+%files
+%defattr(-,root,root)
+%attr(-, root, %{daemon_group}) %{_sbindir}/bat
+%attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
+%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bat.conf
+/usr/share/pixmaps/bat_icon.png
+/usr/share/applications/bat.desktop
+
+# if user is a member of daemon_group then kdesu will run bat as user
+%if %{suse}
+%attr(0660, root, %{daemon_group}) %{sysconf_dir}/bat.kdesu
+%endif
+
+%if ! %{suse}
+# add the console helper files
+%config(noreplace,missingok) /etc/pam.d/bat
+%config(noreplace,missingok) /etc/security/console.apps/bat
+/usr/bin/bat
+%endif
+
+%pre
+# create the daemon group
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
+if [ -z "$HAVE_BACULA" ]; then
+    %{groupadd} -r %{daemon_group} > /dev/null 2>&1
+    echo "The group %{daemon_group} has been added to %{group_file}."
+    echo "See the manual chapter \"Running Bacula\" for details."
+fi
+
+
+%post
+if [ -d %{sysconf_dir} ]; then
+   cd %{sysconf_dir}
+   for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX \
XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX \
XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX \
XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX \
XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do +      pass=`openssl rand -base64 \
33` +      for file in *.conf; do
+         need_password=`grep ${string} $file 2>/dev/null`
+         if [ -n "$need_password" ]; then
+            sed "s@${string}@${pass}@g" $file > $file.new
+            cp -f $file.new $file; rm -f $file.new
+         fi
+      done
+   done
+# put actual hostname in conf file
+   host=`hostname`
+   string="XXX_HOSTNAME_XXX"
+   for file in *.conf; do
+      need_host=`grep ${string} $file 2>/dev/null`
+      if [ -n "$need_host" ]; then
+         sed "s@${string}@${host}@g" $file >$file.new
+         cp -f $file.new $file; rm -f $file.new
+      fi
+   done
+fi
+/sbin/ldconfig
+
+%clean
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
+rm -rf $RPM_BUILD_DIR/depkgs-qt
+
+%changelog
+* Sun Mar 14 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- Fix for QT mkspecs location on FC12
+- allow user to build without embedded static QT
+* Sat Feb 27 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add dependency on bacula-libs
+* Sat Feb 13 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- create file to allow bat to run nonroot with kdesu
+- add dependency information
+* Sat Jan 30 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix consolehelper/xsu for suse packages
+* Sat Aug 1 2009 Kern Sibbald <kern@sibbald.com>
+- Split bat into separate bacula-bat.spec
diff --git a/bacula/platforms/rpms/bacula-docs.spec \
b/bacula/platforms/rpms/bacula-docs.spec new file mode 100644
index 0000000..bc9d2ca
--- /dev/null
+++ b/bacula/platforms/rpms/bacula-docs.spec
@@ -0,0 +1,89 @@
+# Bacula RPM spec file
+#
+# Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
+
+# Platform Build Configuration
+
+# basic defines for every build
+%define _release           1
+%define _version           5.0.0
+%define _packager D. Scott Barninger <barninger@fairfieldcomputers.com>
+
+%define _prefix        /usr
+%define _sbindir       %_prefix/sbin
+%define _mandir        %_prefix/share/man
+
+
+#--------------------------------------------------------------------------
+# it should not be necessary to change anything below here for a release
+# except for patch macros in the setup section
+#--------------------------------------------------------------------------
+
+%{?contrib_packager:%define _packager %{contrib_packager}}
+
+Summary: Bacula - The Network Backup Solution
+Name: bacula-docs
+Version: %{_version}
+Release: %{_release}
+Group: System Environment/Daemons
+License: AGPLv3
+BuildRoot: %{_tmppath}/%{name}-root
+URL: http://www.bacula.org/
+Vendor: The Bacula Team
+Packager: %{_packager}
+BuildArchitectures: noarch
+Prefix: %{_prefix}
+Distribution: Bacula Documentation
+
+Source: %{name}-%{_version}.tar.bz2
+
+# Source directory locations
+%define _docsrc .
+
+# define the basic package description
+%define blurb Bacula - The Leading Open Source Backup Solution.
+%define blurb2 Bacula is a set of computer programs that permit you (or the system
+%define blurb3 administrator) to manage backup, recovery, and verification of \
computer +%define blurb4 data across a network of computers of different kinds. In \
technical terms, +%define blurb5 it is a network client/server based backup program. \
Bacula is relatively +%define blurb6 easy to use and efficient, while offering many \
advanced storage management +%define blurb7 features that make it easy to find and \
recover lost or damaged files. +%define blurb8 Bacula source code has been released \
under the AGPL version 3 license. +
+Summary: Bacula - The Network Backup Solution
+Group: System Environment/Daemons
+
+%description
+%{blurb}
+
+%{blurb2}
+%{blurb3}
+%{blurb4}
+%{blurb5}
+%{blurb6}
+%{blurb7}
+%{blurb8}
+
+This package installs the Bacula pdf and html documentation.
+
+%prep
+%setup
+
+
+%clean
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
+rm -rf $RPM_BUILD_DIR/%{name}-%{_version}
+
+%files
+%doc %{_docsrc}/manuals/en/console/console %{_docsrc}/manuals/en/console/console.pdf
+%doc %{_docsrc}/manuals/en/developers/developers \
%{_docsrc}/manuals/en/developers/developers.pdf +%doc %{_docsrc}/manuals/en/main/main \
%{_docsrc}/manuals/en/main/main.pdf +%doc %{_docsrc}/manuals/en/misc/misc \
%{_docsrc}/manuals/en/misc/misc.pdf +%doc %{_docsrc}/manuals/en/problems/problems \
%{_docsrc}/manuals/en/problems/problems.pdf +%doc \
%{_docsrc}/manuals/en/utility/utility %{_docsrc}/manuals/en/utility/utility.pdf +
+%changelog
+* Sat Jan 30 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- change source file to bz2, update for new doc structure
+* Sat Aug 1 2009 Kern Sibbald <kern@sibbald.com>
+- Split docs into separate bacula-docs.spec
diff --git a/bacula/platforms/rpms/bacula-mtx.spec \
b/bacula/platforms/rpms/bacula-mtx.spec new file mode 100644
index 0000000..fa5ec20
--- /dev/null
+++ b/bacula/platforms/rpms/bacula-mtx.spec
@@ -0,0 +1,119 @@
+# Bacula RPM spec file
+#
+# Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
+
+# Platform Build Configuration
+
+# basic defines for every build
+%define _release           1
+%define _version           5.0.0
+%define depkgs_version     18Feb09
+%define _packager D. Scott Barninger <barninger@fairfieldcomputers.com>
+
+%define manpage_ext gz
+
+%define single_dir 0
+%{?single_dir_install:%define single_dir 1}
+
+# Installation Directory locations
+%define _prefix        /usr
+%define _sbindir       %_prefix/sbin
+%define _bindir        %_prefix/bin
+%define _subsysdir     /var/lock/subsys
+%define sqlite_bindir  %_libdir/bacula/sqlite
+%define _mandir        %_prefix/share/man
+%define sysconf_dir    /etc/bacula
+%define script_dir     %_libdir/bacula
+%define working_dir    /var/lib/bacula
+%define pid_dir        /var/run
+%define plugin_dir     %_libdir/bacula/plugins
+%define lib_dir        %_libdir/bacula/lib
+
+#--------------------------------------------------------------------------
+# it should not be necessary to change anything below here for a release
+# except for patch macros in the setup section
+#--------------------------------------------------------------------------
+
+%{?contrib_packager:%define _packager %{contrib_packager}}
+
+Summary: Bacula - The Network Backup Solution
+Name: bacula-mtx
+Version: %{_version}
+Release: %{_release}
+Group: System Environment/Daemons
+License: AGPLv3
+BuildRoot: %{_tmppath}/%{name}-root
+URL: http://www.bacula.org/
+Vendor: The Bacula Team
+Packager: %{_packager}
+Prefix: %{_prefix}
+Distribution: Bacula Bat
+
+Source: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
 +
+# define the basic package description
+%define blurb Bacula - The Leading Open Source Backup Solution.
+%define blurb2 Bacula is a set of computer programs that permit you (or the system
+%define blurb3 administrator) to manage backup, recovery, and verification of \
computer +%define blurb4 data across a network of computers of different kinds. In \
technical terms, +%define blurb5 it is a network client/server based backup program. \
Bacula is relatively +%define blurb6 easy to use and efficient, while offering many \
advanced storage management +%define blurb7 features that make it easy to find and \
recover lost or damaged files. +%define blurb8 Bacula source code has been released \
under the AGPL version 3 license. +
+Summary: Bacula - The Network Backup Solution
+Group: System Environment/Daemons
+
+%description
+%{blurb}
+
+%{blurb2}
+%{blurb3}
+%{blurb4}
+%{blurb5}
+%{blurb6}
+%{blurb7}
+%{blurb8}
+
+This is Bacula's version of mtx tape utilities for Linux distributions that
+do not provide their own mtx package
+
+%prep
+%setup -T -n depkgs -b 0
+
+%build
+
+make mtx
+
+%install
+make \
+        prefix=$RPM_BUILD_ROOT%{_prefix} \
+        sbindir=$RPM_BUILD_ROOT%{_sbindir} \
+        sysconfdir=$RPM_BUILD_ROOT%{sysconf_dir} \
+        scriptdir=$RPM_BUILD_ROOT%{script_dir} \
+        working_dir=$RPM_BUILD_ROOT%{working_dir} \
+        piddir=$RPM_BUILD_ROOT%{pid_dir} \
+        mandir=$RPM_BUILD_ROOT%{_mandir} \
+        mtx-install
+
+%files
+%defattr(-,root,root)
+%attr(-, root, %{storage_daemon_group}) %{_sbindir}/loaderinfo
+%attr(-, root, %{storage_daemon_group}) %{_sbindir}/mtx
+%attr(-, root, %{storage_daemon_group}) %{_sbindir}/scsitape
+%attr(-, root, %{storage_daemon_group}) %{_sbindir}/tapeinfo
+%attr(-, root, %{storage_daemon_group}) %{_sbindir}/scsieject
+%{_mandir}/man1/loaderinfo.1.%{manpage_ext}
+%{_mandir}/man1/mtx.1.%{manpage_ext}
+%{_mandir}/man1/scsitape.1.%{manpage_ext}
+%{_mandir}/man1/tapeinfo.1.%{manpage_ext}
+%{_mandir}/man1/scsieject.1.%{manpage_ext}
+
+
+%clean
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
+rm -rf $RPM_BUILD_DIR/depkgs
+
+%changelog
+* Sat Aug 1 2009 Kern Sibbald <kern@sibbald.com>
+- Split mtx out into bacula-mtx.spec
diff --git a/bacula/platforms/rpms/bacula.spec b/bacula/platforms/rpms/bacula.spec
new file mode 100644
index 0000000..c58218f
--- /dev/null
+++ b/bacula/platforms/rpms/bacula.spec
@@ -0,0 +1,1573 @@
+# Bacula RPM spec file
+#
+# Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
+
+# Platform Build Configuration
+
+# basic defines for every build
+%define _release           1
+%define _version           5.0.3
+%define _packager D. Scott Barninger <barninger@fairfieldcomputers.com>
+%define depkgs_version 18Dec09
+
+# postgresql defines - defaults for most platforms
+# pass changes if required
+# versions less than 8 are no longer supported
+%define postgres_version 8
+%{?postgresql_version:%define postgres_version %{postgresql_version}}
+%define postgres_package postgresql84
+%{?postgresql_package:%define postgres_package %{postgresql_package}}
+%define postgres_server_package postgresql84-server
+%{?postgresql_server_package:%define postgres_server_package \
%{postgresql_server_package}} +%define postgres_devel_package postgresql84-devel
+%{?postgresql_devel_package:%define postgres_devel_package \
%{postgresql_devel_package}} +
+%define single_dir 1
+%{?single_dir_install:%define single_dir 1}
+
+# Installation Directory locations
+%if %{single_dir}
+%define _prefix        /opt/bacula
+%define _sbindir       /opt/bacula/bin
+%define _bindir        /opt/bacula/bin
+%define _subsysdir     /opt/bacula/working
+%define sqlite_bindir  /opt/bacula/sqlite
+%define _mandir        /usr/share/man
+%define sysconf_dir    /opt/bacula/etc
+%define script_dir     /opt/bacula/scripts
+%define working_dir    /opt/bacula/working
+%define pid_dir        /opt/bacula/working
+%define plugin_dir     /opt/bacula/plugins
+%define lib_dir        /opt/bacula/lib
+%else
+%define _prefix        /usr
+%define _sbindir       %_prefix/sbin
+%define _bindir        %_prefix/bin
+%define _subsysdir     /var/lock/subsys
+%define sqlite_bindir %_libdir/bacula/sqlite
+%define _mandir        %_prefix/share/man
+%define sysconf_dir    /etc/bacula
+%define script_dir     %_libdir/bacula
+%define working_dir    /var/lib/bacula
+%define pid_dir        /var/run
+%define plugin_dir     %_libdir/bacula/plugins
+%define lib_dir        %_libdir/bacula/lib
+%endif
+
+# Daemon user:group Don't change them unless you know what you are doing
+%define director_daemon_user    bacula
+%define storage_daemon_user     bacula
+%define file_daemon_user        root
+%define daemon_group            bacula
+# group that has write access to tape devices, usually disk on Linux
+%define storage_daemon_group    disk
+
+%define depkgs ../depkgs
+
+# probems with mandriva build: 
+# nothing provides libbonobo2_0-devel, nothing provides libbonoboui2_0-devel
+
+# set Macros by opensuse_bs, see \
http://en.opensuse.org/Build_Service/cross_distribution_package_how_to +#openSUSE \
11.1          %if 0%{?suse_version} == 1110   +#openSUSE 11.0          %if \
0%{?suse_version} == 1100    +#openSUSE 10.3          %if 0%{?suse_version} == 1030   \
 +#openSUSE 10.2          %if 0%{?suse_version} == 1020   
+#SUSE Linux 10.1        %if 0%{?suse_version} == 1010   
+#SUSE Linux 10.0        %if 0%{?suse_version} == 1000   
+#SUSE Linux 9.3         %if 0%{?suse_version} == 930    
+#SLES 9                 %if 0%{?sles_version} == 9      also set: %if \
0%{?suse_version} == 910 +#SLE 10                 %if 0%{?sles_version} == 10     \
also set: %if 0%{?suse_version} == 1010 +#SLE 11                 %if \
0%{?sles_version} == 11     also set: %if 0%{?suse_version} == 1110 +#CentOS 5        \
%if 0%{?centos_version} == 501   +#RHEL 4                 %if 0%{?rhel_version} == \
406     +#RHEL 5                 %if 0%{?rhel_version} == 501    
+#Fedora 6 with Extras   %if 0%{?fedora_version} == 6    
+#Fedora 7 with Extras   %if 0%{?fedora_version} == 7    
+#Fedora 8 with Extras   %if 0%{?fedora_version} == 8    
+#Fedora 9 with Extras   %if 0%{?fedora_version} == 9    
+#Fedora 10 with Extras  %if 0%{?fedora_version} == 10   
+#Mandriva 2006          %if 0%{?mandriva_version} == 2006       
+#Mandriva 2007          %if 0%{?mandriva_version} == 2007       
+#Mandriva 2008          %if 0%{?mandriva_version} == 2008       
+#SCIENTIFIC LINUX 3     %if 0%{?sl_version} == 3
+#SCIENTIFIC LINUX 4     %if 0%{?sl_version} == 4
+#SCIENTIFIC LINUX 5     %if 0%{?sl_version} == 5
+
+
+
+%if 0%{?opensuse_bs}
+# am I running in opensuse build service?
+# TODO: seems to make problems
+
+# Build Service: Determine Distribution
+
+%ifarch x86_64
+ %define build_x86_64 1
+%endif
+
+
+%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
+BuildRequires: GConf2-devel
+BuildRequires: freetype-devel
+BuildRequires: libtermcap-devel
+BuildRequires: shadow-utils
+%endif
+
+
+%if 0%{?mandriva_version} == 2007
+%define build_mdv 1
+%define _dist "Mandriva 2007"
+%endif
+
+%if 0%{?fedora_version} == 8
+%define build_fc8 1
+%define _dist "Fedora Core 8"
+BuildRequires: redhat-release
+%endif
+
+%if 0%{?fedora_version} == 9
+%define build_fc9 1
+%define _dist "Fedora Core 9"
+BuildRequires: redhat-release
+%endif
+
+
+%if 0%{?fedora_version} == 10
+%define build_fc9 1
+%define _dist "Fedora Core 10"
+BuildRequires: PolicyKit-gnome
+BuildRequires: fedora-release
+%endif
+
+%if 0%{?fedora_version} == 11
+%define build_fc9 1
+%define _dist "Fedora Core 11"
+BuildRequires: PolicyKit-gnome
+BuildRequires: fedora-release
+%endif
+
+%if 0%{?rhel_version} == 501
+%define build_rhel5 1
+%define _dist "Red Hat Enterprise Linux Server release 5"
+BuildRequires: redhat-release
+%endif
+
+%if 0%{?rhel_version} == 406
+%define build_rhel4 1
+%define _dist "Red Hat Enterprise Linux Server release 4"
+BuildRequires: redhat-release
+%endif
+
+
+%if 0%{?centos_version} == 501
+%define build_centos5 1
+%define _dist "CentOS 5"
+BuildRequires: redhat-release
+%endif
+
+
+%if 0%{?suse_version} == 1020
+%define build_su102 1
+%define _dist "OpenSUSE 10.2"
+BuildRequires: suse-release
+%endif
+
+
+%if 0%{?suse_version} == 1030
+%define build_su103 1
+%define _dist "OpenSUSE 10.3"
+BuildRequires: suse-release
+%endif
+
+%if 0%{?suse_version} == 1100
+%define build_su110 1
+%define _dist "SUSE 11"
+BuildRequires: suse-release
+%endif
+
+
+%if 0%{?suse_version} == 1110
+%define build_su111 1
+%define _dist "SUSE 11"
+%endif
+
+%if 0%{?suse_version} == 1120
+%define build_su112 1
+%define _dist "SUSE 11"
+%endif
+
+
+%if 0%{?sles_version} == 9
+%define build_su9 1
+%define _dist "SLES 9"
+%endif
+
+
+%if 0%{?sles_version} == 10
+%define build_su10 1
+%define _dist "SLE 10"
+%endif
+
+
+%if 0%{?sles_version} == 11
+%define build_su111 1
+%define _dist "SLES 11"
+%endif
+
++%if 0%{?sl_version} == 3
++%define build_sl3
++%define _dist "Scientific Linux release 3"
++BuildRequires: fedora-release
++%endif
++
++%if 0%{?sl_version} == 4
++%define build_sl4
++%define _dist "Scientific Linux release 4"
++BuildRequires: fedora-release
++%endif
++
++%if 0%{?sl_version} == 5
++%define build_sl5
++%define _dist "Scientific Linux release 5"
++BuildRequires: fedora-release
++%endif
+
+
+%endif 
+# opensuse-bs?
+
+
+# any patches for this release
+# be sure to check the setup section for patch macros
+
+#--------------------------------------------------------------------------
+# it should not be necessary to change anything below here for a release
+# except for patch macros in the setup section
+#--------------------------------------------------------------------------
+
+%{?contrib_packager:%define _packager %{contrib_packager}}
+
+Summary: Bacula - The Network Backup Solution
+Name: bacula
+Version: %{_version}
+Release: %{_release}
+Group: System Environment/Daemons
+License: AGPLv3
+BuildRoot: %{_tmppath}/%{name}-root
+URL: http://www.bacula.org/
+Vendor: The Bacula Team
+Packager: %{_packager}
+Prefix: %{_prefix}
+
+Source0: http://www.prdownloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
+# opensuse build service changes the release itself
+# what happens if the release is not 1? DSB
+%if 0%{?opensuse_bs}
+Source1: Release_Notes-%{version}-1.tar.gz
+%else
+Source1: Release_Notes-%{version}-%{release}.tar.gz
+%endif
+Source2: http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.tar.gz
 +
+# define the basic package description
+%define blurb Bacula - The Leading Open Source Backup Solution.
+%define blurb2 Bacula is a set of computer programs that permit you (or the system
+%define blurb3 administrator) to manage backup, recovery, and verification of \
computer +%define blurb4 data across a network of computers of different kinds. In \
technical terms, +%define blurb5 it is a network client/server based backup program. \
Bacula is relatively +%define blurb6 easy to use and efficient, while offering many \
advanced storage management +%define blurb7 features that make it easy to find and \
recover lost or damaged files. +%define blurb8 Bacula source code has been released \
under the AGPL version 3 license. +
+%define user_file  /etc/passwd
+%define group_file /etc/group
+
+# program locations
+%define useradd  /usr/sbin/useradd
+%define groupadd /usr/sbin/groupadd
+%define usermod  /usr/sbin/usermod
+
+# platform defines - set one below or define the build_xxx on the command line
+# RedHat builds
+%define rh7 0
+%{?build_rh7:%define rh7 1}
+%define rh8 0
+%{?build_rh8:%define rh8 1}
+%define rh9 0
+%{?build_rh9:%define rh9 1}
+# Fedora Core build
+%define fc1 0
+%{?build_fc1:%define fc1 1}
+%define fc3 0
+%{?build_fc3:%define fc3 1}
+%define fc4 0
+%{?build_fc4:%define fc4 1}
+%define fc5 0
+%{?build_fc5:%define fc5 1}
+%define fc6 0
+%{?build_fc6:%define fc6 1}
+%define fc7 0
+%{?build_fc7:%define fc7 1}
+%define fc8 0
+%{?build_fc8:%define fc8 1}
+%define fc9 0
+%{?build_fc9:%define fc9 1}
+%define fc10 0
+%{?build_fc10:%define fc10 1}
+%define fc11 0
+%{?build_fc11:%define fc11 1}
+%define fc12 0
+%{?build_fc12:%define fc12 1}
+# Whitebox Enterprise build
+%define wb3 0
+%{?build_wb3:%define wb3 1}
+# RedHat Enterprise builds
+%define rhel3 0
+%{?build_rhel3:%define rhel3 1}
+%{?build_rhel3:%define wb3 1}
+%define rhel4 0
+%{?build_rhel4:%define rhel4 1}
+%{?build_rhel4:%define fc3 1}
+%define rhel5 0
+%{?build_rhel5:%define rhel5 1}
+%{?build_rhel5:%define fc6 1}
+# CentOS build
+%define centos3 0
+%{?build_centos3:%define centos3 1}
+%{?build_centos3:%define wb3 1}
+%define centos4 0
+%{?build_centos4:%define centos4 1}
+%{?build_centos4:%define fc3 1}
+%define centos5 0
+%{?build_centos5:%define centos5 1}
+%{?build_centos5:%define fc6 1}
+# SL build
+%define sl3 0
+%{?build_sl3:%define sl3 1}
+%{?build_sl3:%define wb3 1}
+%define sl4 0
+%{?build_sl4:%define sl4 1}
+%{?build_sl4:%define fc3 1}
+%define sl5 0
+%{?build_sl5:%define sl5 1}
+%{?build_sl5:%define fc6 1}
+# SuSE build
+%define su9 0
+%{?build_su9:%define su9 1}
+%define su10 0
+%{?build_su10:%define su10 1}
+%define su102 0
+%{?build_su102:%define su102 1}
+%define su103 0
+%{?build_su103:%define su103 1}
+%define su110 0
+%{?build_su110:%define su110 1}
+%define su111 0
+%{?build_su111:%define su111 1}
+%define su112 0
+%{?build_su112:%define su112 1}
+# Mandrake builds
+%define mdk 0
+%{?build_mdk:%define mdk 1}
+%define mdv 0
+%{?build_mdv:%define mdv 1}
+%{?build_mdv:%define mdk 1}
+
+# client only build
+%define client_only 0
+%{?build_client_only:%define client_only 1}
+
+# Setup some short cuts
+%define rhat 0
+%if %{rh7} || %{rh8} || %{rh9}
+%define rhat 1
+%endif
+%define fed 0
+%if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc6} || %{fc7} || %{fc8} || %{fc9} || \
%{fc10} || %{fc11} || %{fc12} +%define fed 1
+%endif
+%define suse 0
+%if %{su9} || %{su10} || %{su102} || %{su103} || %{su110} || %{su111} || %{su112}
+%define suse 1
+%endif
+%define rhel 0
+%if %{rhel3} || %{rhel4} || %{rhel5} || %{centos3} || %{centos4} || %{centos5}
+%define rhel 1
+%endif
+%define scil 0
+%if %{sl3} || %{sl4} || %{sl5}
+%define scil 1
+%endif
+
+
+# test for a platform definition
+%if !%{rhat} && !%{rhel} && !%{fed} && !%{wb3} && !%{suse} && !%{mdk} && !%{scil}
+%{error: You must specify a platform. Please examine the spec file.}
+exit 1
+%endif
+
+# distribution-specific directory for logwatch
+%if %{wb3} || %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{fc4}
+%define logwatch_dir /etc/log.d
+%else
+%define logwatch_dir /etc/logwatch
+%endif
+
+# database defines
+# set for database support desired or define the build_xxx on the command line
+%define mysql 0
+%{?build_mysql:%define mysql 1}
+%define sqlite 0
+%{?build_sqlite:%define sqlite 1}
+%define postgresql 0
+%{?build_postgresql:%define postgresql 1}
+
+# test for a database definition
+%if ! %{mysql} && ! %{sqlite} && ! %{postgresql} && ! %{client_only}
+%{error: You must specify database support, by passing one of the following to \
rpmbuild:} +%{error:   --define build_postgresql=1}
+%{error:   --define build_sqlite=1}
+%{error:   --define build_mysql=1}
+exit 1
+%endif
+
+%if %{mysql}
+%define db_backend mysql
+%endif
+%if %{sqlite}
+%define db_backend sqlite3
+%endif
+%if %{postgresql}
+%define db_backend postgresql
+%endif
+
+# 64 bit support
+%define x86_64 0
+%{?build_x86_64:%define x86_64 1}
+
+# check what distribution we are
+%if %{rhat} || %{rhel}
+%define _dist %(grep Red /etc/redhat-release)
+%endif
+%if %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{fc7} || %{fc8} || %{fc9} || %{fc10} || \
%{fc11} || %{fc12} +%define _dist %(grep Fedora /etc/redhat-release)
+%endif
+%if %{centos5} || %{centos4} || %{centos3}
+%define _dist %(grep CentOS /etc/redhat-release)
+%endif
+%if %{sl5} ||%{sl4} || %{sl3}
+%define _dist %(grep 'Scientific Linux' /etc/redhat-release)
+%endif
+%if %{wb3} && ! %{rhel3} && ! %{centos3} && ! %{sl3}
+%define _dist %(grep White /etc/whitebox-release)
+%endif
+%if %{suse}
+%define _dist %(grep -i SuSE /etc/SuSE-release)
+%endif
+%if %{mdk}
+%define _dist %(grep Mand /etc/mandrake-release)
+%endif
+%{?DISTNAME:%define _dist %{DISTNAME}}
+
+# only set Disribution if not in opensuse build service, as it sets it itself
+%if ! 0%{?opensuse_bs}
+Distribution: %{_dist}
+%endif
+
+%if 0%{?opensuse_bs} &&  %{mysql} && %{suse}
+# needed in opensuse_bs, as rpm is installed during build process
+BuildRequires: libmysqlclient-devel
+BuildRequires: mysql-client
+BuildRequires: mysql
+%endif
+%if 0%{?opensuse_bs} &&  %{suse} && %{postgresql}
+BuildRequires: %{postgres_package}
+BuildRequires: %{postgres_server_package}
+%endif
+BuildRequires: openssl
+
+%if 0%{?opensuse_bs} && %{suse}
+BuildRequires: pwdutils
+BuildRequires: sysconfig
+%endif
+
+# should we turn on python support
+%define python 0
+%{?build_python:%define python 1}
+
+# should we enable tcp wrappers support
+%define tcpwrappers 0
+%{?build_tcpwrappers:%define tcpwrappers 1}
+
+# Mandriva somehow forces the manpage file extension to bz2 rather than gz
+%if %{mdk}
+%define manpage_ext bz2
+%else
+%define manpage_ext gz
+%endif
+
+# for client only build
+%if %{client_only}
+%define mysql 0
+%define postgresql 0
+%define sqlite 0
+%endif
+
+BuildRequires: gcc, gcc-c++, make, autoconf
+BuildRequires: glibc, glibc-devel
+BuildRequires: ncurses-devel, perl, readline-devel
+BuildRequires: libstdc++-devel, zlib-devel
+BuildRequires: openssl-devel
+BuildRequires: libacl-devel
+BuildRequires: pkgconfig
+%if ! %{rh7}
+BuildRequires: libxml2-devel
+%endif
+%if %{python}
+BuildRequires: python, python-devel
+%{expand: %%define pyver %(python -c 'import sys;print(sys.version[0:3])')}
+%endif
+
+%if %{rh7}
+BuildRequires: libxml-devel
+%endif
+%if %{mdk}
+BuildRequires: libstdc++-static-devel
+BuildRequires: glibc-static-devel
+%endif
+
+%if %{suse}
+BuildRequires: termcap
+%else
+BuildRequires: libtermcap-devel
+%endif
+
+%if %{sqlite}
+BuildRequires: sqlite-devel
+%endif
+
+%if %{mysql}
+BuildRequires: mysql-devel
+%endif
+
+%if %{postgresql} && %{wb3}
+BuildRequires: rh-postgresql-devel >= %{postgres_version}
+%endif
+
+%if %{postgresql} && ! %{wb3}
+BuildRequires: %{postgres_devel_package} >= %{postgres_version}
+%endif
+
+%description
+%{blurb}
+
+%{blurb2}
+%{blurb3}
+%{blurb4}
+%{blurb5}
+%{blurb6}
+%{blurb7}
+%{blurb8}
+
+%if %{mysql}
+%package mysql
+%endif
+%if %{sqlite}
+%package sqlite
+%endif
+%if %{postgresql}
+%package postgresql
+%endif
+
+Summary: Bacula - The Network Backup Solution
+Group: System Environment/Daemons
+Provides: bacula-dir, bacula-sd, bacula-fd, bacula-server
+Conflicts: bacula-client
+
+Requires: ncurses, libstdc++, zlib, openssl
+Requires: glibc, readline, %{name}-libs
+
+%if %{suse}
+Conflicts: bacula
+Requires: termcap
+%else
+Requires: libtermcap
+%endif
+
+%if %{mysql}
+Requires: mysql
+%endif
+
+%if %{postgresql} && %{wb3}
+Requires: rh-postgresql >= 7
+%endif
+%if %{postgresql} && ! %{wb3}
+Requires: postgresql >= 7
+%endif
+
+%if %{mysql}
+%description mysql
+%endif
+%if %{sqlite}
+%description sqlite
+%endif
+%if %{postgresql}
+%description postgresql
+%endif
+
+%if %{python}
+Requires: python >= %{pyver}
+%endif
+
+%{blurb}
+
+%{blurb2}
+%{blurb3}
+%{blurb4}
+%{blurb5}
+%{blurb6}
+%{blurb7}
+%{blurb8}
+
+%if %{mysql}
+This build requires MySQL to be installed separately as the catalog database.
+%endif
+%if %{postgresql}
+This build requires PostgreSQL to be installed separately as the catalog database.
+%endif
+%if %{sqlite}
+This build incorporates sqlite3 as the catalog database, statically compiled.
+%endif
+%if %{python}
+This build includes python scripting support.
+%endif
+%if %{tcpwrappers}
+This build includes tcp-wrappers support.
+%endif
+
+%package client
+Summary: Bacula - The Network Backup Solution
+Group: System Environment/Daemons
+Provides: bacula-fd
+Conflicts: bacula-mysql
+Conflicts: bacula-sqlite
+Conflicts: bacula-postgresql
+
+%if %{suse}
+Provides: bacula
+%endif
+
+Requires: libstdc++, zlib, openssl
+Requires: glibc, readline, %{name}-libs
+
+%if %{suse}
+Requires: termcap
+%else
+Requires: libtermcap
+%endif
+
+%if %{python}
+Requires: python >= %{pyver}
+%endif
+
+%description client
+%{blurb}
+
+%{blurb2}
+%{blurb3}
+%{blurb4}
+%{blurb5}
+%{blurb6}
+%{blurb7}
+%{blurb8}
+
+This is the File daemon (Client) only package. It includes the command line 
+console program.
+%if %{python}
+This build includes python scripting support.
+%endif
+%if %{tcpwrappers}
+This build includes tcp-wrappers support.
+%endif
+
+%if ! %{client_only}
+%package updatedb
+
+Summary: Bacula - The Network Backup Solution
+Group: System Environment/Daemons
+
+%description updatedb
+%{blurb}
+
+%{blurb2}
+%{blurb3}
+%{blurb4}
+%{blurb5}
+%{blurb6}
+%{blurb7}
+%{blurb8}
+
+This package installs scripts for updating older versions of the bacula
+database.
+%endif
+
+%package libs
+
+Summary: Bacula - The Network Backup Solution
+Group: System Environment/Daemons
+
+%description libs
+%{blurb}
+
+%{blurb2}
+%{blurb3}
+%{blurb4}
+%{blurb5}
+%{blurb6}
+%{blurb7}
+%{blurb8}
+
+This package installs the shared libraries used by many bacula programs.
+
+# Must explicitly enable debug pkg on SuSE
+# but not in opensuse_bs
+%if %{suse} && ! 0%{?opensuse_bs}
+%debug_package
+%endif
+
+%prep
+%setup
+%setup -T -D -b 1
+%setup -T -D -b 2
+
+%build
+
+%if %{suse}
+export LDFLAGS="${LDFLAGS} -L/usr/lib/termcap -L/usr/lib64/termcap"
+%endif
+
+cwd=${PWD}
+%if %{sqlite}
+cd %{depkgs}
+make sqlite3
+cd ${cwd}
+%endif
+
+
+%if %{sqlite}
+# patches for the bundled sqlite scripts
+
+# patch the make_sqlite_tables script for installation bindir
+patch src/cats/make_sqlite3_tables.in src/cats/make_sqlite3_tables.in.patch
+
+# patch the create_sqlite_database script for installation bindir
+patch src/cats/create_sqlite3_database.in src/cats/create_sqlite3_database.in.patch
+
+# patch the make_catalog_backup script for installation bindir
+patch src/cats/make_catalog_backup.in src/cats/make_catalog_backup.in.patch
+
+# patch the update_sqlite_tables script for installation bindir
+patch src/cats/update_sqlite3_tables.in src/cats/update_sqlite3_tables.in.patch
+
+# patch the bacula-dir init script to remove sqlite service
+%if %{sqlite} && %{suse}
+patch platforms/suse/bacula-dir.in platforms/suse/bacula-dir-suse-sqlite.patch
+%endif
+%endif
+
+# 64 bit lib location hacks
+# as of 1.39.18 it should not be necessary to enable x86_64 as configure is
+# reported to be fixed to properly detect lib locations.
+%if %{x86_64}
+export LDFLAGS="${LDFLAGS} -L/usr/lib64"
+%endif
+%if %{mysql} && %{x86_64}
+export LDFLAGS="${LDFLAGS} -L/usr/lib64/mysql"
+%endif
+%if %{python} && %{x86_64}
+export LDFLAGS="${LDFLAGS} -L/usr/lib64/python%{pyver}"
+%endif
+
+# Main Bacula configuration
+%configure \
+        --prefix=%{_prefix} \
+        --sbindir=%{_sbindir} \
+        --sysconfdir=%{sysconf_dir} \
+        --mandir=%{_mandir} \
+        --with-scriptdir=%{script_dir} \
+        --with-working-dir=%{working_dir} \
+        --with-plugindir=%{script_dir} \
+        --with-pid-dir=%{pid_dir} \
+        --with-subsys-dir=%{_subsysdir} \
+        --enable-smartalloc \
+        --disable-gnome \
+        --disable-bwx-console \
+        --disable-tray-monitor \
+        --disable-conio \
+        --enable-readline \
+%if %{mysql}
+        --with-mysql \
+%endif
+%if %{sqlite}
+        --with-sqlite3=${cwd}/%{depkgs}/sqlite3 \
+%endif
+%if %{postgresql}
+        --with-postgresql \
+%endif
+        --disable-bat \
+%if %{python}
+        --with-python \
+%endif
+%if %{tcpwrappers}
+        --with-tcp-wrappers  \
+%endif
+%if %{client_only}
+        --enable-client-only \
+%endif
+%if %{rh7} || %{rh8} || %{rh9} || %{fc1} || %{fc3} || %{wb3} 
+        --disable-batch-insert \
+%endif
+        --with-dir-user=%{director_daemon_user} \
+        --with-dir-group=%{daemon_group} \
+        --with-sd-user=%{storage_daemon_user} \
+        --with-sd-group=%{storage_daemon_group} \
+        --with-fd-user=%{file_daemon_user} \
+        --with-fd-group=%{daemon_group} \
+        --with-dir-password="XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX" \
+        --with-fd-password="XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX" \
+        --with-sd-password="XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX" \
+        --with-mon-dir-password="XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX" \
+        --with-mon-fd-password="XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX" \
+        --with-mon-sd-password="XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX" \
+        --with-openssl
+
+make -j3
+
+%install
+ 
+cwd=${PWD}
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
+mkdir -p $RPM_BUILD_ROOT/etc/init.d
+mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
+mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles
+mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/conf/services
+mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services
+mkdir -p $RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared
+mkdir -p $RPM_BUILD_ROOT%{script_dir}/updatedb
+
+mkdir -p $RPM_BUILD_ROOT/etc/pam.d
+mkdir -p $RPM_BUILD_ROOT%{_sbindir}
+
+%if %{sqlite}
+mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir}
+%endif
+
+make DESTDIR=$RPM_BUILD_ROOT install
+
+%if %{client_only}
+# Program docs not installed on client
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-dir.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-sd.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bcopy.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bextract.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bls.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bscan.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/btape.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bsmtp.1.%{manpage_ext}
+%endif
+# Docs for programs that are depreciated
+rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole
+
+# fixme - make installs the mysql scripts for sqlite build
+%if %{sqlite}
+rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
+rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
+rm -f $RPM_BUILD_ROOT%{script_dir}/grant_mysql_privileges
+%endif
+
+# fixme - make installs the mysql scripts for postgresql build
+%if %{postgresql}
+rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
+rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
+%endif
+
+# install the init scripts
+%if %{suse}
+cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
+cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
+cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
+%endif
+%if %{mdk}
+cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
+cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
+cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
+%endif
+%if ! %{suse} && ! %{mdk}
+cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir
+cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd
+cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd
+%endif
+chmod 0754 $RPM_BUILD_ROOT/etc/init.d/*
+%if %{client_only}
+rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-dir
+rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-sd
+%endif
+
+# install sqlite
+%if %{sqlite}
+cp -p %{depkgs}/sqlite3/sqlite3 $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3
+cp -p %{depkgs}/sqlite3/sqlite3.h $RPM_BUILD_ROOT%{sqlite_bindir}/sqlite3.h
+cp -p %{depkgs}/sqlite3/libsqlite3.a $RPM_BUILD_ROOT%{sqlite_bindir}/libsqlite3.a
+%endif
+
+
+# install the logrotate file
+cp -p scripts/logrotate $RPM_BUILD_ROOT/etc/logrotate.d/bacula
+
+# install the updatedb scripts
+cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/
+
+# install the sample-query.sql file
+%if ! %{client_only}
+cp -p examples/sample-query.sql $RPM_BUILD_ROOT%{script_dir}/sample-query.sql
+%endif
+
+# install the logwatch scripts
+%if ! %{client_only}
+cp -p scripts/logwatch/bacula $RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula
+cp -p scripts/logwatch/applybaculadate \
$RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate +cp -p \
scripts/logwatch/logfile.bacula.conf \
$RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf +cp -p \
scripts/logwatch/services.bacula.conf \
$RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf +chmod 755 \
$RPM_BUILD_ROOT%{logwatch_dir}/scripts/services/bacula +chmod 755 \
$RPM_BUILD_ROOT%{logwatch_dir}/scripts/shared/applybaculadate +chmod 644 \
$RPM_BUILD_ROOT%{logwatch_dir}/conf/logfiles/bacula.conf +chmod 644 \
$RPM_BUILD_ROOT%{logwatch_dir}/conf/services/bacula.conf +%endif
+
+# now clean up permissions that are left broken by the install
+chmod o-rwx $RPM_BUILD_ROOT%{working_dir}
+
+# fix me - building enable-client-only installs files not included in bacula-client \
package +%if %{client_only}
+rm -f $RPM_BUILD_ROOT%{script_dir}/bacula
+rm -f $RPM_BUILD_ROOT%{script_dir}/bacula_config
+rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-dir
+rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-sd
+rm -f $RPM_BUILD_ROOT%{script_dir}/disk-changer
+rm -f $RPM_BUILD_ROOT%{script_dir}/dvd-handler
+rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer
+rm -f $RPM_BUILD_ROOT%{script_dir}/startmysql
+rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql
+rm -rf $RPM_BUILD_ROOT%{script_dir}/updatedb
+rm -f $RPM_BUILD_ROOT%{script_dir}/bconsole
+rm -f $RPM_BUILD_ROOT%{script_dir}/bpipe-fd.so
+rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer.conf
+rm -f $RPM_BUILD_ROOT%{_sbindir}/bacula
+%endif
+
+%clean
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
+%if 0%{?opensuse_bs}
+rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-1.txt
+%else
+rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt
+%endif
+
+
+%if %{mysql}
+# MySQL specific files
+%files mysql
+%defattr(-, root, root)
+%attr(-, root, %{daemon_group}) %{script_dir}/create_mysql_database
+%attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_database
+%attr(-, root, %{daemon_group}) %{script_dir}/make_mysql_tables
+%attr(-, root, %{daemon_group}) %{script_dir}/drop_mysql_tables
+%attr(-, root, %{daemon_group}) %{script_dir}/update_mysql_tables
+%attr(-, root, %{daemon_group}) %{script_dir}/grant_mysql_privileges
+%attr(-, root, %{daemon_group}) %{script_dir}/startmysql
+%attr(-, root, %{daemon_group}) %{script_dir}/stopmysql
+%{_libdir}/libbacsql*
+%endif
+
+%if %{sqlite}
+%files sqlite
+%defattr(-,root,root)
+%attr(-, root, %{daemon_group}) %{script_dir}/create_sqlite3_database
+%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_database
+%attr(-, root, %{daemon_group}) %{script_dir}/grant_sqlite3_privileges
+%attr(-, root, %{daemon_group}) %{script_dir}/make_sqlite3_tables
+%attr(-, root, %{daemon_group}) %{script_dir}/drop_sqlite3_tables
+%attr(-, root, %{daemon_group}) %{script_dir}/update_sqlite3_tables
+%{sqlite_bindir}/libsqlite3.a
+%{sqlite_bindir}/sqlite3.h
+%{sqlite_bindir}/sqlite3
+%endif
+
+
+
+%if %{postgresql}
+%files postgresql
+%defattr(-,root,root)
+%attr(-, root, %{daemon_group}) %{script_dir}/create_postgresql_database
+%attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_database
+%attr(-, root, %{daemon_group}) %{script_dir}/make_postgresql_tables
+%attr(-, root, %{daemon_group}) %{script_dir}/drop_postgresql_tables
+%attr(-, root, %{daemon_group}) %{script_dir}/update_postgresql_tables
+%attr(-, root, %{daemon_group}) %{script_dir}/grant_postgresql_privileges
+%{_libdir}/libbacsql*
+%endif
+
+# The rest is DB backend independent
+
+%if ! %{client_only}
+%attr(-, root, %{daemon_group}) %dir %{script_dir}
+%attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
+%attr(-, root, %{daemon_group}) %{script_dir}/bacula
+%attr(-, root, %{daemon_group}) %{script_dir}/bacula_config
+%attr(-, root, %{daemon_group}) %{script_dir}/bconsole
+%attr(-, root, %{daemon_group}) %{script_dir}/create_bacula_database
+%attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_database
+%attr(-, root, %{daemon_group}) %{script_dir}/grant_bacula_privileges
+%attr(-, root, %{daemon_group}) %{script_dir}/make_bacula_tables
+%attr(-, root, %{daemon_group}) %{script_dir}/drop_bacula_tables
+%attr(-, root, %{daemon_group}) %{script_dir}/update_bacula_tables
+%attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup
+%attr(-, root, %{daemon_group}) %{script_dir}/make_catalog_backup.pl
+%attr(-, root, %{daemon_group}) %{script_dir}/delete_catalog_backup
+%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
+%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
+%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.mdb
+%attr(-, root, %{daemon_group}) %{script_dir}/disk-changer
+%attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-dir
+%attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd
+%attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd
+%attr(-, root, %{daemon_group}) %{script_dir}/bpipe-fd.so
+%attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir
+%attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd
+%attr(-, root, %{daemon_group}) %{_sbindir}/dbcheck
+%attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler
+%attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd
+%attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer
+%attr(-, root, %{storage_daemon_group}) %config(noreplace) \
%{script_dir}/mtx-changer.conf +
+/etc/logrotate.d/bacula
+%{logwatch_dir}/scripts/services/bacula
+%{logwatch_dir}/scripts/shared/applybaculadate
+%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-dir.conf
+%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
+%attr(-, root, %{storage_daemon_group}) %config(noreplace) \
%{sysconf_dir}/bacula-sd.conf +%attr(-, root, %{daemon_group}) %config(noreplace) \
%{sysconf_dir}/bconsole.conf +%attr(-, root, %{daemon_group}) %config(noreplace) \
%{logwatch_dir}/conf/logfiles/bacula.conf +%attr(-, root, %{daemon_group}) \
%config(noreplace) %{logwatch_dir}/conf/services/bacula.conf +%attr(-, root, \
%{daemon_group}) %config(noreplace) %{script_dir}/query.sql +%attr(-, root, \
%{daemon_group}) %{script_dir}/sample-query.sql +
+%attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{working_dir}
+
+%{_sbindir}/bacula-dir
+%{_sbindir}/bacula-fd
+%{_sbindir}/bacula-sd
+%{_sbindir}/bacula
+%{_sbindir}/bcopy
+%{_sbindir}/bextract
+%{_sbindir}/bls
+%{_sbindir}/bscan
+%{_sbindir}/btape
+%{_sbindir}/btraceback
+%{_sbindir}/bconsole
+%{_sbindir}/bsmtp
+%{_sbindir}/bregex
+%{_sbindir}/bwild
+%{_mandir}/man8/bacula-fd.8.%{manpage_ext}
+%{_mandir}/man8/bacula-dir.8.%{manpage_ext}
+%{_mandir}/man8/bacula-sd.8.%{manpage_ext}
+%{_mandir}/man8/bacula.8.%{manpage_ext}
+%{_mandir}/man8/bconsole.8.%{manpage_ext}
+%{_mandir}/man8/bcopy.8.%{manpage_ext}
+%{_mandir}/man8/bextract.8.%{manpage_ext}
+%{_mandir}/man8/bls.8.%{manpage_ext}
+%{_mandir}/man8/bscan.8.%{manpage_ext}
+%{_mandir}/man8/btape.8.%{manpage_ext}
+%{_mandir}/man8/btraceback.8.%{manpage_ext}
+%{_mandir}/man8/dbcheck.8.%{manpage_ext}
+%{_mandir}/man1/bsmtp.1.%{manpage_ext}
+%{_mandir}/man1/bat.1.%{manpage_ext}
+%_prefix/share/doc/*
+
+# opensuse build service changes the release itself
+%if 0%{?opensuse_bs}
+%doc ../Release_Notes-%{version}-1.txt
+%else
+%doc ../Release_Notes-%{version}-%{release}.txt
+%endif
+%endif
+
+%if %{mysql}
+%pre mysql
+# test for bacula database older than version 13
+# note: this ASSUMES no password has been set for bacula database
+DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
+%endif
+
+%if %{sqlite}
+%pre sqlite
+# are we upgrading from sqlite to sqlite3?
+if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite ];then
+        echo "This version of bacula-sqlite involves an upgrade to sqlite3."
+        echo "Your catalog database file is not compatible with sqlite3, thus"
+        echo "you will need to dump the data, delete the old file, and re-run"
+        echo "this rpm upgrade."
+        echo ""
+        echo "Backing up your current database..."
+        echo ".dump" | %{sqlite_bindir}/sqlite %{working_dir}/bacula.db > \
%{working_dir}/bacula_backup.sql +        mv %{working_dir}/bacula.db \
%{working_dir}/bacula.db.old +        echo "Your catalog data has been saved in \
%{working_dir}/bacula_backup.sql and your" +        echo "catalog file has been \
renamed %{working_dir}/bacula.db.old." +        echo ""
+        echo "Please re-run this rpm package upgrade."
+        echo "After the upgrade is complete, restore your catalog"
+        echo "with the following commands:"
+        echo "%{script_dir}/drop_sqlite3_tables"
+        echo "cd %{working_dir}"
+        echo "%{sqlite_bindir}/sqlite3 $* bacula.db < bacula_backup.sql"
+        echo "chown bacula.bacula bacula.db"
+        exit 1
+fi
+# test for bacula database older than version 12 and sqlite3
+if [ -s %{working_dir}/bacula.db ] && [ -s %{sqlite_bindir}/sqlite3 ];then
+        DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null \
%{working_dir}/bacula.db | tail -n 1` +%endif
+
+%if %{postgresql}
+%pre postgresql
+DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
+%endif
+
+%if ! %{client_only}
+if [ -n "$DB_VER" ] && [ "$DB_VER" -lt "12" ]; then
+    echo "This bacula upgrade will update a bacula database from version 12 to 13."
+    echo "You appear to be running database version $DB_VER. You must first update"
+    echo "your database to version 12 and then install this upgrade. The \
alternative" +    echo "is to use %{script_dir}/drop_%{db_backend}_tables to delete \
all your your current" +    echo "catalog information, then do the upgrade. \
Information on updating a" +    echo "database older than version 12 can be found in \
the release notes." +    exit 1
+fi
+%endif
+
+%if %{sqlite}
+fi
+%endif
+
+%if ! %{client_only}
+# check for and copy %{sysconf_dir}/console.conf to bconsole.conf
+if [ -s %{sysconf_dir}/console.conf ];then
+    cp -p %{sysconf_dir}/console.conf %{sysconf_dir}/bconsole.conf
+fi
+
+# create the daemon users and groups
+# first create the groups if they don't exist
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
+if [ -z "$HAVE_BACULA" ]; then
+        %{groupadd} -r %{daemon_group} > /dev/null 2>&1
+        echo "The group %{daemon_group} has been added to %{group_file}."
+        echo "See the manual chapter \"Running Bacula\" for details."
+fi
+HAVE_BACULA=`grep %{storage_daemon_group} %{group_file} 2>/dev/null`
+if [ -z "$HAVE_BACULA" ]; then
+        %{groupadd} -r %{storage_daemon_group} > /dev/null 2>&1
+        echo "The group %{storage_daemon_group} has been added to %{group_file}."
+        echo "See the manual chapter \"Running Bacula\" for details."
+fi
+# now create the users if they do not exist
+# we do not use the -g option allowing the primary group to be set to system default
+# this will be a unique group on redhat type systems or the group users on some \
systems +HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null`
+if [ -z "$HAVE_BACULA" ]; then
+        %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -s \
/sbin/nologin %{storage_daemon_user} > /dev/null 2>&1 +        echo "The user \
%{storage_daemon_user} has been added to %{user_file}." +        echo "See the manual \
chapter \"Running Bacula\" for details." +fi
+HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null`
+if [ -z "$HAVE_BACULA" ]; then
+        %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s \
/sbin/nologin %{director_daemon_user} > /dev/null 2>&1 +        echo "The user \
%{director_daemon_user} has been added to %{user_file}." +        echo "See the \
manual chapter \"Running Bacula\" for details." +fi
+HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
+if [ -z "$HAVE_BACULA" ]; then
+        %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s \
/sbin/nologin %{file_daemon_user} > /dev/null 2>&1 +        echo "The user \
%{file_daemon_user} has been added to %{user_file}." +        echo "See the manual \
chapter \"Running Bacula\" for details." +fi
+# now we add the supplementary groups, this is ok to call even if the users already \
exist +# we only do this if the user is NOT root
+IS_ROOT=%{director_daemon_user}
+if [ "$IS_ROOT" != "root" ]; then
+%{usermod} -G %{daemon_group} %{director_daemon_user}
+fi
+IS_ROOT=%{storage_daemon_user}
+if [ "$IS_ROOT" != "root" ]; then
+%{usermod} -G %{daemon_group},%{storage_daemon_group} %{storage_daemon_user}
+fi
+IS_ROOT=%{file_daemon_user}
+if [ "$IS_ROOT" != "root" ]; then
+%{usermod} -G %{daemon_group} %{file_daemon_user}
+fi
+%endif
+
+%if %{mysql}
+%post mysql
+%endif
+%if %{sqlite}
+%post sqlite
+%endif
+%if %{postgresql}
+%post postgresql
+%endif
+%if ! %{client_only}
+# add our links
+if [ "$1" -ge 1 ] ; then
+%if %{suse} && %{mysql}
+  /sbin/chkconfig --add mysql
+%endif
+%if %{suse} && %{postgresql}
+  /sbin/chkconfig --add postgresql
+%endif
+  /sbin/chkconfig --add bacula-dir
+  /sbin/chkconfig --add bacula-fd
+  /sbin/chkconfig --add bacula-sd
+fi
+%endif
+
+%if %{mysql}
+
+#check, if mysql can be called successfully at all
+if mysql 2>/dev/null bacula -e 'select * from Version;' ; then
+
+# test for an existing database
+# note: this ASSUMES no password has been set for bacula database
+DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`
+
+# grant privileges and create tables if they do not exist
+if [ -z "$DB_VER" ]; then
+    echo "Hmm, it doesn't look like you have an existing database."
+    echo "Granting privileges for MySQL user bacula..."
+    %{script_dir}/grant_mysql_privileges
+    echo "Creating MySQL bacula database..."
+    %{script_dir}/create_mysql_database
+    echo "Creating bacula tables..."
+    %{script_dir}/make_mysql_tables
+
+# check to see if we need to upgrade a 3.x database
+elif [ "$DB_VER" -lt "13" ]; then
+    echo "This release requires an upgrade to your bacula database."
+    echo "Backing up your current database..."
+    mysqldump -f --opt bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
+    echo "Upgrading bacula database ..."
+    %{script_dir}/update_mysql_tables
+    echo "If bacula works correctly you can remove the backup file \
%{working_dir}/bacula_backup.sql.bz2" +
+fi
+fi
+%endif
+
+%if %{sqlite}
+# test for an existing database
+if [ -s %{working_dir}/bacula.db ]; then
+        DB_VER=`echo "select * from Version;" | %{sqlite_bindir}/sqlite3 2>/dev/null \
%{working_dir}/bacula.db | tail -n 1` +        # check to see if we need to upgrade a \
3.x database +        if [ "$DB_VER" -lt "13" ] && [ "$DB_VER" -ge "12" ]; then
+                echo "This release requires an upgrade to your bacula database."
+                echo "Backing up your current database..."
+                echo ".dump" | %{sqlite_bindir}/sqlite3 %{working_dir}/bacula.db | \
bzip2 > %{working_dir}/bacula_backup.sql.bz2 +                echo "Upgrading bacula \
database ..." +                %{script_dir}/update_sqlite3_tables
+                echo "If bacula works correctly you can remove the backup file \
%{working_dir}/bacula_backup.sql.bz2" +        fi
+else
+        # create the database and tables
+        echo "Hmm, doesn't look like you have an existing database."
+        echo "Creating SQLite database..."
+        %{script_dir}/create_sqlite3_database
+        chown %{director_daemon_user}.%{daemon_group} %{working_dir}/bacula.db
+        echo "Creating the SQLite tables..."
+        %{script_dir}/make_sqlite3_tables
+fi
+%endif
+
+%if %{postgresql}
+# check if psql can be called successfully at all
+if echo 'select * from Version;' | psql bacula 2>/dev/null; then
+
+# test for an existing database
+# note: this ASSUMES no password has been set for bacula database
+DB_VER=`echo 'select * from Version;' | psql bacula 2>/dev/null | tail -3 | head -1`
+
+# grant privileges and create tables if they do not exist
+if [ -z "$DB_VER" ]; then
+    echo "Hmm, doesn't look like you have an existing database."
+    echo "Creating PostgreSQL bacula database..."
+    %{script_dir}/create_postgresql_database
+    echo "Creating bacula tables..."
+    %{script_dir}/make_postgresql_tables
+    echo "Granting privileges for PostgreSQL user bacula..."
+    %{script_dir}/grant_postgresql_privileges
+
+# check to see if we need to upgrade a 5.0.x database
+elif [ "$DB_VER" -lt "13" ]; then
+    echo "This release requires an upgrade to your bacula database."
+    echo "Backing up your current database..."
+    pg_dump bacula | bzip2 > %{working_dir}/bacula_backup.sql.bz2
+    echo "Upgrading bacula database ..."
+    %{script_dir}/update_postgresql_tables
+    echo "If bacula works correctly you can remove the backup file \
%{working_dir}/bacula_backup.sql.bz2" +        
+fi
+fi
+%endif
+
+%if ! %{client_only}
+if [ -d %{sysconf_dir} ]; then
+   cd %{sysconf_dir}
+   for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX \
XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX \
XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX \
XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX \
XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do +      pass=`openssl rand -base64 \
33` +      for file in *.conf; do
+         sed "s@${string}@${pass}@g" $file > $file.new
+         cp -f $file.new $file; rm -f $file.new
+      done
+   done
+# put actual hostname in conf file
+   host=`hostname`
+   string="XXX_HOSTNAME_XXX"
+   for file in *.conf; do
+      sed "s@${string}@${host}@g" $file >$file.new
+      cp -f $file.new $file; rm -f $file.new
+   done
+fi
+%endif
+
+
+%if %{mysql}
+%preun mysql
+%endif
+%if %{sqlite}
+%preun sqlite
+%endif
+%if %{postgresql}
+%preun postgresql
+%endif
+
+%if ! %{client_only}
+# delete our links
+if [ $1 = 0 ]; then
+  /sbin/chkconfig --del bacula-dir
+  /sbin/chkconfig --del bacula-fd
+  /sbin/chkconfig --del bacula-sd
+fi
+%endif
+
+%files client
+%defattr(-,root,root)
+%attr(-, root, %{daemon_group}) %dir %{script_dir}
+%attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
+%{script_dir}/bacula-ctl-fd
+/etc/init.d/bacula-fd
+
+/etc/logrotate.d/bacula
+
+%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bacula-fd.conf
+%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bconsole.conf
+%attr(-, root, %{daemon_group}) %dir %{working_dir}
+
+%{_sbindir}/bacula-fd
+%{_sbindir}/btraceback
+%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.gdb
+%attr(-, root, %{daemon_group}) %{script_dir}/btraceback.dbx
+%{_sbindir}/bconsole
+%{_mandir}/man8/bacula-fd.8.%{manpage_ext}
+%{_mandir}/man8/bacula.8.%{manpage_ext}
+%{_mandir}/man8/bconsole.8.%{manpage_ext}
+%{_mandir}/man8/btraceback.8.%{manpage_ext}
+%{_mandir}/man1/bat.1.%{manpage_ext}
+%_prefix/share/doc/*
+
+%pre client
+# create the daemon group and user
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
+if [ -z "$HAVE_BACULA" ]; then
+    %{groupadd} -r %{daemon_group} > /dev/null 2>&1
+    echo "The group %{daemon_group} has been added to %{group_file}."
+    echo "See the manual chapter \"Running Bacula\" for details."
+fi
+# we do not use the -g option allowing the primary group to be set to system default
+# this will be a unique group on redhat type systems or the group users on some \
systems +HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null`
+if [ -z "$HAVE_BACULA" ]; then
+    %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -s \
/sbin/nologin %{file_daemon_user} > /dev/null 2>&1 +    echo "The user \
%{file_daemon_user} has been added to %{user_file}." +    echo "See the manual \
chapter \"Running Bacula\" for details." +fi
+# now we add the supplementary group, this is ok to call even if the user already \
exists +# we only do this if the user is NOT root
+IS_ROOT=%{file_daemon_user}
+if [ "$IS_ROOT" != "root" ]; then
+%{usermod} -G %{daemon_group} %{file_daemon_user}
+fi
+
+%post client
+# add our link
+if [ "$1" -ge 1 ] ; then
+   /sbin/chkconfig --add bacula-fd
+fi
+
+if [ -d %{sysconf_dir} ]; then
+   cd %{sysconf_dir}
+   for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX \
XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX \
XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX \
XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX \
XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do +      pass=`openssl rand -base64 \
33` +      for file in *.conf; do
+         sed "s@${string}@${pass}@g" $file > $file.new
+         cp -f $file.new $file; rm -f $file.new
+      done
+   done
+# put actual hostname in conf file
+   host=`hostname`
+   string="XXX_HOSTNAME_XXX"
+   for file in *.conf; do
+      sed "s@${string}@${host}@g" $file >$file.new
+      cp -f $file.new $file; rm -f $file.new
+   done
+fi
+
+%preun client
+# delete our link
+if [ $1 = 0 ]; then
+   /sbin/chkconfig --del bacula-fd
+fi
+
+%files libs
+%defattr(-,root,root)
+%{_libdir}/libbac-*
+%{_libdir}/libbac.*
+%{_libdir}/libbaccfg*
+%{_libdir}/libbacfind*
+%{_libdir}/libbacpy*
+
+%post libs
+/sbin/ldconfig
+exit 0
+
+%postun libs
+/sbin/ldconfig
+exit 0
+
+%if ! %{client_only}
+%files updatedb
+%defattr(-,root,%{daemon_group})
+%{script_dir}/updatedb/*
+#oensuse_bs: directories not owned by any package
+#%{script_dir}/updatedb
+
+%pre updatedb
+# create the daemon group
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
+if [ -z "$HAVE_BACULA" ]; then
+    %{groupadd} -r %{daemon_group} > /dev/null 2>&1
+    echo "The group %{daemon_group} has been added to %{group_file}."
+    echo "See the manual chapter \"Running Bacula\" for details."
+fi
+
+%post updatedb
+echo "The database update scripts were installed to %{script_dir}/updatedb"
+%endif
+
+%changelog
+* Mon Sep 06 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
+* Mon Sep 06 2010 Kern Sibbald <kern@sibbald.com>
+- 5.0.3
+- change license to AGPL v3
+- add defines for postgresql version and packages, require version 8 or greater
+- adjusted package description
+- fix bug with libbacsql files
+* Sun Mar 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- remove --without-qwt from configure statement
+* Sat Feb 27 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- move shared libraries into bacula-libs package
+* Sat Feb 20 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- remove deprecated mysql4 and mysql5 build defines
+- add build support for tcpwrappers
+- remove bacula_config file for client only build
+- remove requirements for database server packages
+- enable readline support
+- add fc11 and fc12
+* Sat Feb 13 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- 5.0.1
+- fix client only build
+- clean up requirements for termcap
+- query.sql now empty by default so we install sample-query.sql along side it
+- remove old nobuild_mtx switch
+* Sun Feb 07 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix mysql database upgrade
+* Fri Feb 05 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix permissions of dbcheck
+- misc. cleanup
+* Sat Jan 30 2010 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- 5.0.0
+- add su112 and fc10 builds, remove doc package declaration.
+- fix source path for logwatch files.
+- restore static bundled build of sqlite (who took that out?) and remove use
+- of system sqlite. we don't support use of sqlite2.
+- upgrade database from version 11 to 12.
+* Mon Aug 10 2009 Philipp Storz <philipp.storz@dass-it.de>
+- changes to work with opensuse build service
+* Sat Aug 1 2009 Kern Sibbald <kern@sibbald.com>
+- Split docs into separate bacula-docs.spec, bacula-bat.spec and bacula-mtx.spec
+- removed build of rescue, gnome console and wxconsole
+* Sat Jun 20 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- Fix bat install which is now handled by make and uses shared libs
+* Sat May 16 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix libxml dependency for rh7 per Pasi Kärkkäinen <pasik@iki.fi>
+* Mon May 04 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- Fix post ldconfig problem in client only build
+* Sun May 03 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- remove more files installed by client-only build not needed by client package
+- remove libbacsql files from client package
+* Sat May 02 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- 3.0.1
+- update for new docs configuration
+* Sat Apr 25 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add switch to pass Distribution tag
+* Sun Apr 5 2009 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- 3.0.0 release
+- database update version 10 to 11
+- make now installs docs so we rm from buildroot
+- add shared libs in %_libdir and other misc new files
+* Wed Dec 31 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add su111 target
+* Sat Nov 08 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- set paths for QT using pkgconfig
+* Sat Oct 11 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- release 2.4.3 update depkgs to 11Sep08 remove file nmshack from mtx package
+* Sun Sep 07 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- adjust /opt/bacula install
+- add build switch to supress rescue package
+* Sun Aug 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add support for install to /opt/bacula
+* Sun Aug 17 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- remove libtermcap dependancy for FC9
+* Mon Aug 04 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix bat dependencies
+* Sat Jun 28 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add su110 target
+* Sat May 24 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- add fc9 target
+* Sun Mar 30 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- FHS compatibility changes
+* Sat Feb 16 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- remove fix for false buffer overflow detection with glibc >= 2.7
+* Sat Feb 09 2008 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- fix for false buffer overflow detection with glibc >= 2.7
diff --git a/bacula/scripts/Makefile.in b/bacula/scripts/Makefile.in
index 3295014..5dee735 100755
--- a/bacula/scripts/Makefile.in
+++ b/bacula/scripts/Makefile.in
@@ -1,5 +1,4 @@
 # 
-# Version $Id$
 # 
 @MCOMMON@
 
@@ -33,8 +32,6 @@ installdirs:
 	$(MKDIR) $(DESTDIR)$(mandir)
 
 install: installdirs
-	$(INSTALL_SCRIPT) startmysql $(DESTDIR)$(scriptdir)/startmysql
-	$(INSTALL_SCRIPT) stopmysql $(DESTDIR)$(scriptdir)/stopmysql
 	$(INSTALL_SCRIPT) bconsole $(DESTDIR)$(scriptdir)/bconsole
 	$(INSTALL_SCRIPT) bacula $(DESTDIR)$(scriptdir)/bacula
 	$(INSTALL_SCRIPT) bacula_config $(DESTDIR)$(scriptdir)/bacula_config
@@ -73,8 +70,6 @@ install: installdirs
 
 
 uninstall:
-	(cd $(DESTDIR)$(scriptdir); $(RMF) startmysql)
-	(cd $(DESTDIR)$(scriptdir); $(RMF) stopmysql)
 	(cd $(DESTDIR)$(scriptdir); $(RMF) bconsole)
 	(cd $(DESTDIR)$(scriptdir); $(RMF) bacula)
 	(cd $(DESTDIR)$(scriptdir); $(RMF) bacula_config)
@@ -94,24 +89,24 @@ uninstall:
 Makefile: Makefile.in
 	cd $(topdir) \
 	    && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-	chmod 755 startmysql stopmysql bacula startit stopit btraceback
+	chmod 755 bacula btraceback
 	chmod 755 bacula-ctl-dir bacula-ctl-fd bacula-ctl-sd bacula_config
-	chmod 755 disk-changer mtx-changer dvd-handler bconsole gconsole
+	chmod 755 disk-changer mtx-changer dvd-handler bconsole
 
 Makefiles:
 	$(SHELL) config.status
-	chmod 755 startmysql stopmysql bacula startit stopit btraceback
+	chmod 755 bacula btraceback
 	chmod 755 bacula-ctl-dir bacula-ctl-fd bacula-ctl-sd
-	chmod 755 mtx-changer dvd-handler bconsole gconsole
+	chmod 755 mtx-changer dvd-handler bconsole
 
 clean:
 	@$(RMF) *~ 1 2 3
 
 # clean for distribution
 distclean: clean
-	@$(RMF) startmysql stopmysql bacula fd startit stopit btraceback
+	@$(RMF) bacula fd btraceback
 	@$(RMF) bacula-ctl-dir bacula-ctl-fd bacula-ctl-sd bacula_config
-	@$(RMF) bconsole gconsole logrotate bacula.desktop 
+	@$(RMF) bconsole logrotate bacula.desktop 
 	@$(RMF) bacula.desktop.gnome1 bacula.desktop.gnome2 mtx-changer dvd-handler
 	@$(RMF) gnome-console.console_apps bacula.desktop.gnome2.xsu
 	@$(RMF) bgnome-console.console_apps
diff --git a/bacula/scripts/gconsole.in b/bacula/scripts/gconsole.in
deleted file mode 100755
index a8db17c..0000000
--- a/bacula/scripts/gconsole.in
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-#
-# Run bgnome-console with test config file
-#
-if [ $# = 1 ] ; then
-   echo "doing bgnome-console $1.conf"
-   @sbindir@/bgnome-console -c $1.conf
-else
-   @sbindir@/bgnome-console -c @sysconfdir@/bgnome-console.conf
-fi
diff --git a/bacula/scripts/startit.in b/bacula/scripts/startit.in
deleted file mode 100755
index da7ce84..0000000
--- a/bacula/scripts/startit.in
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-@BUILD_DIR@/scripts/devel_bacula start $1
diff --git a/bacula/scripts/startmysql.in b/bacula/scripts/startmysql.in
deleted file mode 100755
index dc35bd7..0000000
--- a/bacula/scripts/startmysql.in
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-cd @SQL_BINDIR@
-if [ -x ./safe_mysqld ]; then
-  ./safe_mysqld $* &
-  exit $?
-fi
-if [ -x ./mysqld_safe ]; then
-  ./mysqld_safe $* &
-  exit $?
-fi
-echo "Neither safe_mysqld nor mysqld_safe found!"
-exit 1
diff --git a/bacula/scripts/stopit.in b/bacula/scripts/stopit.in
deleted file mode 100755
index 80503ee..0000000
--- a/bacula/scripts/stopit.in
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-@BUILD_DIR@/scripts/bacula stop
diff --git a/bacula/scripts/stopmysql.in b/bacula/scripts/stopmysql.in
deleted file mode 100755
index 9bf117b..0000000
--- a/bacula/scripts/stopmysql.in
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-@SQL_BINDIR@/mysqladmin shutdown
diff --git a/bacula/src/cats/bdb_sqlite.h b/bacula/src/cats/bdb_sqlite.h
index c03e02e..7226b35 100644
--- a/bacula/src/cats/bdb_sqlite.h
+++ b/bacula/src/cats/bdb_sqlite.h
@@ -32,8 +32,10 @@
 class B_DB_SQLITE: public B_DB_PRIV {
 private:
    struct sqlite3 *m_db_handle;
-   char **m_result;
+   char **m_result;             /* sql_store_results() and sql_query() */
+   char **m_col_names;          /* used to access fields when using db_sql_query() \
*/  char *m_sqlite_errmsg;
+   SQL_FIELD m_sql_field;       /* used when using db_sql_query() and \
sql_fetch_field() */  
 public:
    B_DB_SQLITE(JCR *jcr, const char *db_driver, const char *db_name,
@@ -42,6 +44,13 @@ public:
                bool mult_db_connections, bool disable_batch_insert);
    ~B_DB_SQLITE();
 
+   /* Used internaly by sqlite.c to access fields in db_sql_query() */
+   void set_column_names(char **res, int nb) { 
+      m_col_names = res; 
+      m_num_fields = nb;
+      m_field_number = 0;
+   }
+
    /* low level operations */
    bool db_open_database(JCR *jcr);
    void db_close_database(JCR *jcr);
diff --git a/bacula/src/cats/cats.h b/bacula/src/cats/cats.h
index 6105fa2..d6bd623 100644
--- a/bacula/src/cats/cats.h
+++ b/bacula/src/cats/cats.h
@@ -558,6 +558,7 @@ public:
  * Some functions exported by sql.c for use within the cats directory.
  */
 int list_result(void *vctx, int cols, char **row);
+void list_result(JCR *jcr, B_DB *mdb, DB_LIST_HANDLER *send, void *ctx, e_list_type \
type);  void list_dashes(B_DB *mdb, DB_LIST_HANDLER *send, void *ctx);
 int get_sql_record_max(JCR *jcr, B_DB *mdb);
 bool check_tables_version(JCR *jcr, B_DB *mdb);
diff --git a/bacula/src/cats/sql.c b/bacula/src/cats/sql.c
index 143c82e..3bb8a9c 100644
--- a/bacula/src/cats/sql.c
+++ b/bacula/src/cats/sql.c
@@ -568,6 +568,124 @@ vertical_list:
    return 0;
 }
 
+/*
+ * If full_list is set, we list vertically, otherwise, we
+ * list on one line horizontally.
+ */
+void
+list_result(JCR *jcr, B_DB *mdb, DB_LIST_HANDLER *send, void *ctx, e_list_type type)
+{
+   SQL_FIELD *field;
+   SQL_ROW row;
+   int i, col_len, max_len = 0;
+   char buf[2000], ewc[30];
+
+   Dmsg0(800, "list_result starts\n");
+   if (sql_num_rows(mdb) == 0) {
+      send(ctx, _("No results to list.\n"));
+      return;
+   }
+
+   Dmsg1(800, "list_result starts looking at %d fields\n", sql_num_fields(mdb));
+   /* determine column display widths */
+   sql_field_seek(mdb, 0);
+   for (i = 0; i < sql_num_fields(mdb); i++) {
+      Dmsg1(800, "list_result processing field %d\n", i);
+      field = sql_fetch_field(mdb);
+      if (!field) {
+         break;
+      }
+      col_len = cstrlen(field->name);
+      if (type == VERT_LIST) {
+         if (col_len > max_len) {
+            max_len = col_len;
+         }
+      } else {
+         if (sql_field_is_numeric(mdb, field->type) && (int)field->max_length > 0) { \
/* fixup for commas */ +            field->max_length += (field->max_length - 1) / 3;
+         }  
+         if (col_len < (int)field->max_length) {
+            col_len = field->max_length;
+         }  
+         if (col_len < 4 && !sql_field_is_not_null(mdb, field->flags)) {
+            col_len = 4;                 /* 4 = length of the word "NULL" */
+         }
+         field->max_length = col_len;    /* reset column info */
+      }
+   }
+
+   Dmsg0(800, "list_result finished first loop\n");
+   if (type == VERT_LIST) {
+      goto vertical_list;
+   }
+
+   Dmsg1(800, "list_result starts second loop looking at %d fields\n", \
sql_num_fields(mdb)); +   list_dashes(mdb, send, ctx);
+   send(ctx, "|");
+   sql_field_seek(mdb, 0);
+   for (i = 0; i < sql_num_fields(mdb); i++) {
+      Dmsg1(800, "list_result looking at field %d\n", i);
+      field = sql_fetch_field(mdb);
+      if (!field) {
+         break;
+      }
+      max_len = max_length(field->max_length);
+      bsnprintf(buf, sizeof(buf), " %-*s |", max_len, field->name);
+      send(ctx, buf);
+   }
+   send(ctx, "\n");
+   list_dashes(mdb, send, ctx);
+
+   Dmsg1(800, "list_result starts third loop looking at %d fields\n", \
sql_num_fields(mdb)); +   while ((row = sql_fetch_row(mdb)) != NULL) {
+      sql_field_seek(mdb, 0);
+      send(ctx, "|");
+      for (i = 0; i < sql_num_fields(mdb); i++) {
+         field = sql_fetch_field(mdb);
+         if (!field) {
+            break;
+         }
+         max_len = max_length(field->max_length);
+         if (row[i] == NULL) {
+            bsnprintf(buf, sizeof(buf), " %-*s |", max_len, "NULL");
+         } else if (sql_field_is_numeric(mdb, field->type) && !jcr->gui && \
is_an_integer(row[i])) { +            bsnprintf(buf, sizeof(buf), " %*s |", max_len,
+                      add_commas(row[i], ewc));
+         } else {
+            bsnprintf(buf, sizeof(buf), " %-*s |", max_len, row[i]);
+         }
+         send(ctx, buf);
+      }
+      send(ctx, "\n");
+   }
+   list_dashes(mdb, send, ctx);
+   return;
+
+vertical_list:
+
+   Dmsg1(800, "list_result starts vertical list at %d fields\n", \
sql_num_fields(mdb)); +   while ((row = sql_fetch_row(mdb)) != NULL) {
+      sql_field_seek(mdb, 0);
+      for (i = 0; i < sql_num_fields(mdb); i++) {
+         field = sql_fetch_field(mdb);
+         if (!field) {
+            break;
+         }
+         if (row[i] == NULL) {
+            bsnprintf(buf, sizeof(buf), " %*s: %s\n", max_len, field->name, "NULL");
+         } else if (sql_field_is_numeric(mdb, field->type) && !jcr->gui && \
is_an_integer(row[i])) { +            bsnprintf(buf, sizeof(buf), " %*s: %s\n", \
max_len, field->name, +                add_commas(row[i], ewc));
+         } else {
+            bsnprintf(buf, sizeof(buf), " %*s: %s\n", max_len, field->name, row[i]);
+         }
+         send(ctx, buf);
+      }
+      send(ctx, "\n");
+   }
+   return;
+}
+
 /* 
  * Open a new connexion to mdb catalog. This function is used
  * by batch and accurate mode.
diff --git a/bacula/src/cats/sql_create.c b/bacula/src/cats/sql_create.c
index 5048923..53b4a69 100644
--- a/bacula/src/cats/sql_create.c
+++ b/bacula/src/cats/sql_create.c
@@ -68,6 +68,8 @@ db_create_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr)


hooks/post-receive
-- 
Bacula

------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
Bacula-commits mailing list
Bacula-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic