[bacula] 5.2.2

Tom Callaway spot at fedoraproject.org
Wed Nov 30 14:56:04 UTC 2011


commit 16d9a36e02513f5ca105935ab8f70549b276dc70
Author: Tom "spot" Callaway <tcallawa at redhat.com>
Date:   Wed Nov 30 09:55:59 2011 -0500

    5.2.2

 .gitignore                             |    2 +
 bacula-5.2.1-bat-pamd.patch            |   12 +
 bacula-5.2.2-dsolink.patch             |  196 ++++++
 bacula-5.2.2-qt-console-optflags.patch |   12 +
 bacula.spec                            | 1069 +++++++++++++-------------------
 sources                                |    4 +-
 6 files changed, 659 insertions(+), 636 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 0e301bd..ca56dc2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,5 @@ bacula-5.0.2.tar.gz
 bacula-docs-5.0.2.tar.bz2
 bacula-5.0.3.tar.gz
 bacula-docs-5.0.3.tar.bz2
+/bacula-5.2.2.tar.gz
+/bacula-docs-5.2.2.tar.bz2
diff --git a/bacula-5.2.1-bat-pamd.patch b/bacula-5.2.1-bat-pamd.patch
new file mode 100644
index 0000000..12d7927
--- /dev/null
+++ b/bacula-5.2.1-bat-pamd.patch
@@ -0,0 +1,12 @@
+--- bacula-5.2.1/scripts/bat.pamd.orig        2007-07-11 18:42:33.000000000 +0200
++++ bacula-5.2.1/scripts/bat.pamd     2007-07-11 18:42:57.000000000 +0200
+@@ -1,7 +1,7 @@
+ #%PAM-1.0
+ auth       sufficient   pam_rootok.so
+ auth       sufficient   pam_timestamp.so
+-auth       required     pam_stack.so service=system-auth
++auth       include      system-auth
+ session    optional     pam_xauth.so
+ session    optional     pam_timestamp.so
+ account    required     pam_permit.so
+
diff --git a/bacula-5.2.2-dsolink.patch b/bacula-5.2.2-dsolink.patch
new file mode 100644
index 0000000..5c54e29
--- /dev/null
+++ b/bacula-5.2.2-dsolink.patch
@@ -0,0 +1,196 @@
+diff -up bacula-5.2.2/src/console/Makefile.in.dsolink bacula-5.2.2/src/console/Makefile.in
+--- bacula-5.2.2/src/console/Makefile.in.dsolink	2011-11-26 09:08:12.000000000 -0500
++++ bacula-5.2.2/src/console/Makefile.in	2011-11-29 16:32:39.897821119 -0500
+@@ -48,7 +48,7 @@ all: Makefile bconsole @STATIC_CONS@
+ 
+ bconsole: Makefile $(CONSOBJS) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE)
+ 	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) $(CONS_LDFLAGS) -L../lib -L../cats -o $@ $(CONSOBJS) \
+-	      $(DLIB) $(CONS_LIBS) -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) \
++	      $(DLIB) $(CONS_LIBS) -lbaccfg -lbac -lm -lz $(LIBS) $(GETTEXT_LIBS) \
+ 	      $(OPENSSL_LIBS)
+ 
+ static-bconsole: Makefile $(CONSOBJS) ../lib/libbac.a ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE)
+diff -up bacula-5.2.2/src/dird/Makefile.in.dsolink bacula-5.2.2/src/dird/Makefile.in
+--- bacula-5.2.2/src/dird/Makefile.in.dsolink	2011-11-26 09:08:12.000000000 -0500
++++ bacula-5.2.2/src/dird/Makefile.in	2011-11-29 16:32:39.898821107 -0500
+@@ -69,7 +69,7 @@ bacula-dir: Makefile $(SVROBJS) ../lib/l
+ 	    ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
+ 	@echo "Linking $@ ..."
+ 	$(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \
+-	      -lbacfind -lbacsql -lbaccats -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(DLIB) $(DB_LIBS) $(LIBS) \
++	      -lbacfind -lbacsql -lbaccats -lbacpy -lbaccfg -lbac -lm -lz $(PYTHON_LIBS) $(DLIB) $(DB_LIBS) $(LIBS) \
+ 	      $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS)
+ 
+ static-bacula-dir:  Makefile $(SVROBJS) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) \
+diff -up bacula-5.2.2/src/qt-console/bat.pro.in.dsolink bacula-5.2.2/src/qt-console/bat.pro.in
+--- bacula-5.2.2/src/qt-console/bat.pro.in.dsolink	2011-11-26 09:08:12.000000000 -0500
++++ bacula-5.2.2/src/qt-console/bat.pro.in	2011-11-29 16:32:39.899821095 -0500
+@@ -19,7 +19,7 @@ TEMPLATE     = app
+ TARGET       = bat
+ DEPENDPATH  += .
+ INCLUDEPATH += .. . ./console ./restore ./select
+-LIBS        += -L../lib -lbaccfg -lbac -L../findlib -lbacfind @OPENSSL_LIBS@
++LIBS        += -L../lib -lbaccfg -lbac -L../findlib -lbacfind -ldl -lz @OPENSSL_LIBS@
+ LIBTOOL_LINK = @QMAKE_LIBTOOL@ --silent --tag=CXX --mode=link
+ LIBTOOL_INSTALL = @QMAKE_LIBTOOL@ --silent --mode=install
+ QMAKE_LINK   = $${LIBTOOL_LINK} $(CXX)
+diff -up bacula-5.2.2/src/stored/Makefile.in.dsolink bacula-5.2.2/src/stored/Makefile.in
+--- bacula-5.2.2/src/stored/Makefile.in.dsolink	2011-11-26 09:08:12.000000000 -0500
++++ bacula-5.2.2/src/stored/Makefile.in	2011-11-29 16:32:39.899821095 -0500
+@@ -96,7 +96,7 @@ all: Makefile bacula-sd @STATIC_SD@ bls
+ bacula-sd: Makefile $(SDOBJS) ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+ 	@echo "Linking $@ ..."
+ 	$(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -o $@ $(SDOBJS) $(ZLIBS) \
+-	   -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(DLIB) $(LIBS) $(WRAPLIBS) \
++	   -lbacpy -lbaccfg -lbac -lm -lz $(PYTHON_LIBS) $(DLIB) $(LIBS) $(WRAPLIBS) \
+ 	$(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS)
+ 
+ static-bacula-sd: Makefile $(SDOBJS) ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+@@ -112,7 +112,7 @@ btape.o: btape.c
+ 
+ btape: Makefile  $(TAPEOBJS) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE)
+ 	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -o $@ $(TAPEOBJS) \
+-	   -lbaccfg -lbac $(DLIB) -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	   -lbaccfg -lbac $(DLIB) -lm -lz $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ bls.o:	bls.c
+ 	@echo "Compiling $<"
+@@ -122,7 +122,7 @@ bls.o:	bls.c
+ bls:	Makefile $(BLSOBJS) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+ 	@echo "Compiling $<"
+ 	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(BLSOBJS) $(DLIB) \
+-	   -lbacfind -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	   -lbacfind -lbaccfg -lbac -lm -lz $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ bextract.o: bextract.c
+ 	@echo "Compiling $<"
+@@ -132,7 +132,7 @@ bextract.o: bextract.c
+ bextract: Makefile $(BEXTOBJS) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+ 	@echo "Compiling $<"
+ 	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(BEXTOBJS) $(DLIB) $(ZLIBS) $(LZOLIBS) \
+-	   -lbacfind -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	   -lbacfind -lbaccfg -lbac -lm -lz $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ bscan.o: bscan.c
+ 	@echo "Compiling $<"
+@@ -142,7 +142,7 @@ bscan.o: bscan.c
+ bscan:	Makefile $(SCNOBJS) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) \
+ 	../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE)
+ 	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SCNOBJS) \
+-	   -lbacsql -lbaccats $(DB_LIBS) $(ZLIBS) -lbacfind -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	   -lbacsql -lbaccats $(DB_LIBS) $(ZLIBS) -lbacfind -lbaccfg -lbac -lm -lz $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ bcopy.o: bcopy.c
+ 	@echo "Compiling $<"
+@@ -151,7 +151,7 @@ bcopy.o: bcopy.c
+ 
+ bcopy:	Makefile $(COPYOBJS) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+ 	$(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -o $@ $(COPYOBJS) \
+-	   -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	   -lbaccfg -lbac -lm -lz $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
+ 	cd $(topdir) \
+diff -up bacula-5.2.2/src/tools/Makefile.in.dsolink bacula-5.2.2/src/tools/Makefile.in
+--- bacula-5.2.2/src/tools/Makefile.in.dsolink	2011-11-26 09:08:12.000000000 -0500
++++ bacula-5.2.2/src/tools/Makefile.in	2011-11-29 16:34:56.795171642 -0500
+@@ -58,22 +58,22 @@ all: Makefile $(TOOLS) gigaslam grow
+ 	@echo " "
+ 
+ bsmtp: Makefile bsmtp.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)	    
+-	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -o $@ bsmtp.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -o $@ bsmtp.o -lbac -lm -lz $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ bregtest: Makefile bregtest.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)	   
+-	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -o $@ bregtest.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -o $@ bregtest.o -lbac -lm -lz $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ dbcheck: Makefile dbcheck.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) \
+ 	 ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) $(DIRCONFOBJS)
+ 	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -L../cats -o $@ dbcheck.o $(DIRCONFOBJS) \
+-	  -lbaccats -lbacsql -lbaccfg -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	  -lbaccats -lbacsql -lbaccfg -lbac -lm -lz $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ fstype: Makefile fstype.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
+-	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ fstype.o -lbacfind -lbac -lm \
++	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ fstype.o -lbacfind -lbac -lm -lz \
+ 	  $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ drivetype: Makefile drivetype.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
+-	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ drivetype.o -lbacfind -lbac -lm \
++	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ drivetype.o -lbacfind -lbac -lm -lz \
+ 	  $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ dird_conf.o: ../dird/dird_conf.c
+@@ -88,34 +88,34 @@ inc_conf.o: ../dird/inc_conf.c
+ testfind: Makefile ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) \
+ 	  ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) $(FINDOBJS)
+ 	$(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -o $@ $(FINDOBJS) -L. -L../lib -L../findlib \
+-	  $(DLIB) -lbacfind -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	  $(DLIB) -lbacfind -lbaccfg -lbac -lm -lz $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ testls: Makefile ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) testls.o
+ 	$(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ testls.o \
+-	  $(DLIB) -lbacfind -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	  $(DLIB) -lbacfind -lbac -lm -lz $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ bregex: Makefile ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) bregex.o
+ 	$(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ bregex.o \
+-	  $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	  $(DLIB) -lbac -lm -lz $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ bwild:	Makefile ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) bwild.o
+ 	$(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ bwild.o \
+-	  $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	  $(DLIB) -lbac -lm -lz $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ bbatch: Makefile ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) \
+ 	../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) bbatch.o
+ 	$(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L../cats -L. -L../lib -o $@ bbatch.o \
+-	  -lbaccats -lbacsql -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	  -lbaccats -lbacsql -lbac -lm -lz $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ bvfs_test: Makefile ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) \
+ 	   ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) bvfs_test.o
+ 	$(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L../cats -L. -L../lib -L../findlib -o $@ bvfs_test.o  \
+-	  -lbaccats -lbacsql -lbacfind -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	  -lbaccats -lbacsql -lbacfind -lbac -lm -lz $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ ing_test: Makefile ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) \
+ 	  ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) ing_test.o
+ 	$(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L../cats -L. -L../lib -L../findlib -o $@ ing_test.o  \
+-	  -lbaccats -lbacsql -lbacfind -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	  -lbaccats -lbacsql -lbacfind -lbac -lm -lz $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ cats_test.o: cats_test.c
+ 	echo "Compiling $<"
+@@ -123,7 +123,7 @@ cats_test.o: cats_test.c
+ 
+ cats_test: Makefile ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) cats_test.o
+ 	$(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L../cats -L. -L../lib -L../findlib -o $@ cats_test.o  \
+-	  -lbaccats -lbacsql -lbacfind -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	  -lbaccats -lbacsql -lbacfind -lbac -lm -lz $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ gigaslam.o: gigaslam.c
+ 	$(CXX) $(CFLAGS) -c $<	
+@@ -132,7 +132,7 @@ gigaslam: gigaslam.o
+ 	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -o $@ gigaslam.o
+ 
+ grow: Makefile grow.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+-	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -o $@ grow.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
++	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -o $@ grow.o -lbac -lm -lz $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
+ 
+ Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
+ 	cd $(topdir) \
+diff -up bacula-5.2.2/src/tray-monitor/Makefile.in.dsolink bacula-5.2.2/src/tray-monitor/Makefile.in
+--- bacula-5.2.2/src/tray-monitor/Makefile.in.dsolink	2011-11-26 09:08:12.000000000 -0500
++++ bacula-5.2.2/src/tray-monitor/Makefile.in	2011-11-29 16:32:39.902821059 -0500
+@@ -45,7 +45,7 @@ all: Makefile bacula-tray-monitor
+ 
+ bacula-tray-monitor: Makefile $(MONITOROBJS) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
+ 	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) $(MONITOR_LDFLAGS) -L../lib -o $@ \
+-	  $(MONITOROBJS) $(DLIB) -lbaccfg -lbac -lm $(LIBS) $(OPENSSL_LIBS)
++	  $(MONITOROBJS) $(DLIB) -lbaccfg -lbac -lm -lz $(LIBS) $(OPENSSL_LIBS)
+ 
+ Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
+ 	cd $(topdir) \
diff --git a/bacula-5.2.2-qt-console-optflags.patch b/bacula-5.2.2-qt-console-optflags.patch
new file mode 100644
index 0000000..e50cb5d
--- /dev/null
+++ b/bacula-5.2.2-qt-console-optflags.patch
@@ -0,0 +1,12 @@
+diff -up bacula-5.2.2/src/qt-console/bat.pro.in.optflags bacula-5.2.2/src/qt-console/bat.pro.in
+--- bacula-5.2.2/src/qt-console/bat.pro.in.optflags	2011-11-29 16:44:53.459899389 -0500
++++ bacula-5.2.2/src/qt-console/bat.pro.in	2011-11-29 16:48:46.749029323 -0500
+@@ -6,7 +6,7 @@
+ #
+ #   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ #    
+-CONFIG += qt debug @QWT@
++CONFIG += qt release @QWT@
+ 
+ bins.path = /$(DESTDIR)@sbindir@
+ bins.files = bat
diff --git a/bacula.spec b/bacula.spec
index 18a773c..c05baed 100644
--- a/bacula.spec
+++ b/bacula.spec
@@ -1,72 +1,58 @@
-%define working_dir	/var/spool/bacula
-%define script_dir	/usr/libexec/bacula
-#%define rescue_version	2.0.0
-%define docs_version	%{version}
-%define gui_version	%{version}
-%define config_dir	%{_sysconfdir}/bacula
-
-Summary: Cross platform network backup for Linux, Unix, Mac and Windows
-Name: bacula
-Version: 5.0.3
-Release: 13%{?dist}
+Name:			bacula
+Version:		5.2.2
+Release:		1%{?dist}
+Summary:		Cross platform network backup for Linux, Unix, Mac and Windows
 # See LICENSE for details
-License: GPLv2 with exceptions
-Group: System Environment/Daemons
-Source0: http://download.sourceforge.net/bacula/bacula-%{version}.tar.gz
-Source1: http://download.sourceforge.net/bacula/bacula-docs-%{docs_version}.tar.bz2
-#Source2: http://download.sourceforge.net/bacula/bacula-rescue-%{rescue_version}.tar.gz
-#Source3: bacula-gconsole.desktop
-Source4: bacula-wxconsole.desktop
-Source5: bacula-traymonitor.desktop
-Source6: bacula.logrotate
-Source7: bacula-fd.service
-Source8: bacula-dir.service
-Source9: bacula-sd.service
-#Source10: http://download.sourceforge.net/bacula/bacula-gui-%{gui_version}.tar.gz
-#Source11: bacula-web.apache
-Source12: bacula-bat.desktop
-Source13: bacula-traymonitor.console_apps
-Source14: bacula-wxconsole.console_apps
-Source15: bacula-checkconf
-
-#Patch0: bacula-director-configuration.patch
-Patch1: bacula-config.patch
-#Patch2: bacula-wxconsole.patch
-Patch3: bacula-pamd.patch
-#Patch4: 2.0.3-ampm.patch
-#Patch5: 2.0.3-maxbyteslist.patch
-#Patch6: 2.0.3-maxwaittime.patch
-#Patch7: 2.0.3-scheduler-next-hour.patch
-#Patch8: 2.0.3-verify.patch
-#Patch9: 2.0.3-tls-disconnect.patch
-#Patch10: bacula-web-smarty.patch
-#Patch11: bacula-2.4.3-orphaned-jobs.patch
-#Patch12: bacula-2.4.3-python26.patch
-#Patch13: bacula-3.0.2-openssl.patch
-Patch14: bacula-5.0.1-dsolink.patch
-Patch15: bacula-5.0.2-openssl.patch
-Patch16: bacula-5.0.2-config.patch
-Patch17: bacula-5.0.2-python27.patch
-Patch18: bacula-5.0.3-dsolink.patch
-Patch19: bacula-5.0.3-log-path.patch
-Patch20: bacula-5.0.3-sqlite-priv.patch
-Patch21: bacula-5.0.3-tray-dir.patch
-Patch22: bacula-5.0.3-mysql55.patch
-Patch23: bacula-5.0.3-maxvalue.patch
-
-URL: http://www.bacula.org
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires: openssl-devel, atk-devel, ncurses-devel, pango-devel, perl
-BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig
-BuildRequires: gtk2-devel, libgnomeui-devel, GConf2-devel
-BuildRequires: glibc-devel, ORBit2-devel, libart_lgpl-devel, freetype-devel
-BuildRequires: libbonobo-devel, libbonoboui-devel, bonobo-activation-devel
-BuildRequires: mysql-devel, cdrecord, postgresql-devel, wxGTK-devel
-BuildRequires: desktop-file-utils, python-devel, sqlite-devel, sed,
-BuildRequires: libacl-devel, latex2html, tetex-latex, tetex, ghostscript
-BuildRequires: dvipdfm, qwt-devel
-BuildRequires: tcp_wrappers-devel
-BuildRequires: systemd-units
+License:		GPLv2 with exceptions
+Group:			System Environment/Daemons
+URL:			http://www.bacula.org
+BuildRoot:		%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Source0:		http://www.bacula.org/downloads/Bacula-%{version}/%{name}-%{version}.tar.gz
+Source1:		http://www.bacula.org/downloads/Bacula-%{version}/%{name}-docs-%{version}.tar.bz2
+Source6:		bacula.logrotate
+Source7:		bacula-fd.init
+Source8:		bacula-dir.init
+Source9:		bacula-sd.init
+Source10:		bacula-fd.service
+Source11:		bacula-dir.service
+Source12:		bacula-sd.service
+Source13:		bacula-bat.desktop
+Source15:		bacula-fd.sysconfig
+Source16:		bacula-dir.sysconfig
+Source17:		bacula-sd.sysconfig
+Source18:		bacula-checkconf
+Patch1:			bacula-config.patch
+Patch2:			bacula-5.0.2-openssl.patch
+Patch3:			bacula-5.0.2-config.patch
+Patch4:			bacula-5.2.2-dsolink.patch
+Patch5:			bacula-5.0.3-log-path.patch
+Patch6:			bacula-5.0.3-sqlite-priv.patch
+Patch7:			bacula-5.2.1-bat-pamd.patch
+Patch8:			bacula-5.2.2-qt-console-optflags.patch
+BuildRequires:		openssl-devel, ncurses-devel, perl, glibc-devel
+BuildRequires:		libstdc++-devel, libxml2-devel, zlib-devel
+BuildRequires:		mysql-devel, postgresql-devel
+BuildRequires:		desktop-file-utils, python-devel, sqlite-devel, sed
+BuildRequires:		libacl-devel, latex2html, tetex-latex, tetex, ghostscript
+BuildRequires:		readline-devel
+
+%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
+BuildRequires:		qt-devel >= 4.6
+%endif
+
+%if 0%{?fedora} >= 7 || 0%{?rhel} >= 6
+BuildRequires:		tcp_wrappers-devel
+%else
+BuildRequires:		tcp_wrappers
+%endif
+
+%if 0%{?fedora} >= 9 || 0%{?rhel} >= 6
+BuildRequires:		dvipdfm
+%endif
+
+%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
+BuildRequires:		systemd-units
+%endif
 
 %description
 Bacula is a set of programs that allow you to manage the backup,
@@ -78,11 +64,11 @@ or damaged files.
 
 
 %package director-mysql
-Summary: Bacula Director with MySQL database support
-Group: System Environment/Daemons
-Provides: bacula-director = %{version}-%{release}
-Requires: bacula-director-common = %{version}-%{release}
-Requires: bacula-common = %{version}-%{release}
+Summary:		Bacula Director with MySQL database support
+Group:			System Environment/Daemons
+Provides:		bacula-director = %{version}-%{release}
+Requires:		bacula-director-common%{?_isa} = %{version}-%{release}
+Requires:		bacula-common%{?_isa} = %{version}-%{release}
 
 %description director-mysql
 Bacula is a set of programs that allow you to manage the backup,
@@ -95,11 +81,11 @@ This director has support for the MySQL database.
 
 
 %package director-sqlite
-Summary: Bacula Director with sqlite database support
-Group: System Environment/Daemons
-Provides: bacula-director = %{version}-%{release}
-Requires: bacula-director-common = %{version}-%{release}
-Requires: bacula-common = %{version}-%{release}
+Summary:		Bacula Director with sqlite database support
+Group:			System Environment/Daemons
+Provides:		bacula-director = %{version}-%{release}
+Requires:		bacula-director-common%{?_isa} = %{version}-%{release}
+Requires:		bacula-common%{?_isa} = %{version}-%{release}
 
 %description director-sqlite
 Bacula is a set of programs that allow you to manage the backup,
@@ -112,11 +98,11 @@ This director has support for the sqlite database.
 
 
 %package director-postgresql
-Summary: Bacula Director with PostgresSQL database support
-Group: System Environment/Daemons
-Provides: bacula-director = %{version}-%{release}
-Requires: bacula-director-common = %{version}-%{release}
-Requires: bacula-common = %{version}-%{release}
+Summary:		Bacula Director with PostgresSQL database support
+Group:			System Environment/Daemons
+Provides:		bacula-director = %{version}-%{release}
+Requires:		bacula-director-common%{?_isa} = %{version}-%{release}
+Requires:		bacula-common%{?_isa} = %{version}-%{release}
 
 %description director-postgresql
 Bacula is a set of programs that allow you to manage the backup,
@@ -129,17 +115,25 @@ This director has support for the PostgresSQL database.
 
 
 %package director-common
-Summary: Common Bacula Director files
-Group: System Environment/Daemons
-Requires: bacula-director = %{version}-%{release}
-Requires: bacula-common = %{version}-%{release}
-Requires: logwatch
-Requires(pre): fedora-usermgmt
-Requires(postun): fedora-usermgmt
-Requires(post): systemd-sysv
-Requires(post): systemd-units
-Requires(preun): systemd-units
-Requires(postun): systemd-units
+Summary:		Common Bacula Director files
+Group:			System Environment/Daemons
+Requires:		bacula-director = %{version}-%{release}
+Requires:		bacula-common%{?_isa} = %{version}-%{release}
+Requires:		logwatch
+Requires(pre):		fedora-usermgmt
+Requires(postun): 	fedora-usermgmt
+%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
+Requires(post):		systemd-sysv
+Requires(post):		systemd-units
+Requires(preun):	systemd-units
+Requires(postun):	systemd-units
+%else
+Requires(post):		/sbin/chkconfig
+Requires(preun):	/sbin/chkconfig
+Requires(preun):	/sbin/service
+Requires(postun):	/sbin/service
+%endif
+
 
 %description director-common
 Bacula is a set of programs that allow you to manage the backup,
@@ -154,13 +148,20 @@ bacula-director-sqlite or bacula-director-postgresql.
 
 
 %package client
-Summary: Bacula backup client
-Group: System Environment/Daemons
-Requires: bacula-common = %{version}-%{release}
-Requires(post): systemd-sysv
-Requires(post): systemd-units
-Requires(preun): systemd-units
-Requires(postun): systemd-units
+Summary:		Bacula backup client
+Group:			System Environment/Daemons
+Requires:		bacula-common%{?_isa} = %{version}-%{release}
+%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
+Requires(post):		systemd-sysv
+Requires(post):		systemd-units
+Requires(preun):	systemd-units
+Requires(postun):	systemd-units
+%else
+Requires(post):		/sbin/chkconfig
+Requires(preun):	/sbin/chkconfig
+Requires(preun):	/sbin/service
+Requires(postun):	/sbin/service
+%endif
 
 %description client
 Bacula is a set of programs that allow you to manage the backup,
@@ -172,14 +173,22 @@ system to be backed up.
 
 
 %package storage-common
-Summary: Common Bacula storage daemon files
-Group: System Environment/Daemons
-Requires: bacula-storage = %{version}-%{release}
-Requires: bacula-common = %{version}-%{release}
-Requires(post): systemd-sysv
-Requires(post): systemd-units
-Requires(preun): systemd-units
-Requires(postun): systemd-units
+Summary: 		Common Bacula storage daemon files
+Group:			System Environment/Daemons
+Requires:		bacula-storage = %{version}-%{release}
+Requires:		bacula-common%{?_isa} = %{version}-%{release}
+%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
+Requires(post):		systemd-sysv
+Requires(post):		systemd-units
+Requires(preun):	systemd-units
+Requires(postun):	systemd-units
+%else
+Requires(post):		/sbin/chkconfig
+Requires(preun):	/sbin/chkconfig
+Requires(preun):	/sbin/service
+Requires(postun):	/sbin/service
+%endif
+
 
 %description storage-common
 Bacula is a set of programs that allow you to manage the backup,
@@ -192,11 +201,11 @@ mass storage devices.
 
 
 %package storage-mysql
-Summary: MySQL Bacula storage daemon files
-Group: System Environment/Daemons
-Provides: bacula-storage = %{version}-%{release}
-Requires: bacula-storage-common = %{version}-%{release}
-Requires: bacula-common = %{version}-%{release}
+Summary:		MySQL Bacula storage daemon files
+Group:			System Environment/Daemons
+Provides:		bacula-storage = %{version}-%{release}
+Requires:		bacula-storage-common%{?_isa} = %{version}-%{release}
+Requires:		bacula-common%{?_isa} = %{version}-%{release}
 
 %description storage-mysql
 Bacula is a set of programs that allow you to manage the backup,
@@ -209,11 +218,11 @@ mass storage devices.
 
 
 %package storage-sqlite
-Summary: SQLite Bacula storage daemon files
-Group: System Environment/Daemons
-Provides: bacula-storage = %{version}-%{release}
-Requires: bacula-storage-common = %{version}-%{release}
-Requires: bacula-common = %{version}-%{release}
+Summary:		SQLite Bacula storage daemon files
+Group:			System Environment/Daemons
+Provides:		bacula-storage = %{version}-%{release}
+Requires:		bacula-storage-common%{?_isa} = %{version}-%{release}
+Requires:		bacula-common%{?_isa} = %{version}-%{release}
 
 %description storage-sqlite
 Bacula is a set of programs that allow you to manage the backup,
@@ -226,11 +235,11 @@ mass storage devices.
 
 
 %package storage-postgresql
-Summary: Common Bacula storage daemon files
-Group: System Environment/Daemons
-Provides: bacula-storage = %{version}-%{release}
-Requires: bacula-storage-common = %{version}-%{release}
-Requires: bacula-common = %{version}-%{release}
+Summary:		Common Bacula storage daemon files
+Group:			System Environment/Daemons
+Provides:		bacula-storage = %{version}-%{release}
+Requires:		bacula-storage-common%{?_isa} = %{version}-%{release}
+Requires:		bacula-common%{?_isa} = %{version}-%{release}
 
 %description storage-postgresql
 Bacula is a set of programs that allow you to manage the backup,
@@ -243,10 +252,11 @@ mass storage devices.
 
 
 %package common
-Summary: Common Bacula utilities
-Group: System Environment/Daemons
-Requires(pre): fedora-usermgmt
-Obsoletes: bacula-console-gnome <= 3.0.3
+Summary:		Common Bacula utilities
+Group:			System Environment/Daemons
+Requires(pre):		fedora-usermgmt
+Obsoletes:		bacula-console-gnome <= 2.4, bacula-traymonitor <= 2.4
+Obsoletes:		bacula-sysconfdir <= 2.4
 
 %description common
 Bacula is a set of programs that allow you to manage the backup,
@@ -268,24 +278,12 @@ This package contains the command-line management console for the bacula
 backup system.
 
 
-#%package console-gnome
-#Summary: Bacula console for the Gnome desktop environment
-#Group: System Environment/Daemons
-#Requires: bacula-common = %{version}-%{release}
-#Requires: usermode
-#
-#%description console-gnome
-#Bacula is a set of programs that allow you to manage the backup,
-#recovery, and verification of computer data across a network of
-#different computers. It is based on a client/server architecture.
-#
-#This package contains the gnome version of the bacula management console
-
+%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
 %package console-bat
-Summary: Bacula bat console
-Group: System Environment/Daemons
-Requires: bacula-common = %{version}-%{release}
-Requires: usermode
+Summary:		Bacula bat console
+Group:			System Environment/Daemons
+Requires:		bacula-common%{?_isa} = %{version}-%{release}
+Requires:		usermode
 
 %description console-bat
 Bacula is a set of programs that allow you to manage the backup,
@@ -293,55 +291,12 @@ recovery, and verification of computer data across a network of
 different computers. It is based on a client/server architecture.
 
 This package contains the bat version of the bacula management console
-
-
-%package console-wxwidgets
-Summary: Bacula console using the wx widgets toolkit
-Group: System Environment/Daemons
-Requires: bacula-common = %{version}-%{release}
-Requires: usermode
-
-%description console-wxwidgets
-Bacula is a set of programs that allow you to manage the backup,
-recovery, and verification of computer data across a network of
-different computers. It is based on a client/server architecture.
-
-This package contains the wxWidgets version of the bacula management 
-console.
-
-
-%package traymonitor
-Summary: Bacula monitor for the Gnome and KDE system tray
-Group: System Environment/Daemons
-Requires: bacula-common = %{version}-%{release}
-
-%description traymonitor
-Bacula is a set of programs that allow you to manage the backup,
-recovery, and verification of computer data across a network of
-different computers. It is based on a client/server architecture.
-
-This package contains the Gnome- and KDE-compatible tray monitor to 
-monitor your bacula server.
-
-
-#%package web
-#Summary: Bacula Web Interface for monitoring the Backup status
-#Group: System Environment/Daemons
-#Conflicts: bacula-storage-sqlite
-#Requires: php, webserver, php-pear-DB, php-gd, php-Smarty
-
-#%description web
-#Bacula is a set of programs that allow you to manage the backup,
-#recovery, and verification of computer data across a network of
-#different computers. It is based on a client/server architecture.
-
-#This package contains the bacula-web PHP application, which is
-#a management level tool for reporting Backup job status.
+%endif
 
 
 %package docs
-Summary: Bacula documentation
-Group: Documentation
+Summary:		Bacula documentation
+Group:			Documentation
 
 %description docs
 Bacula is a set of programs that allow you to manage the backup,
@@ -351,45 +306,29 @@ different computers. It is based on a client/server architecture.
 This package contains the documentation for most of the bacula-packages.
 
 
-%prep
-%setup -q -c -n bacula-%{version}
-%setup -q -a 1 -D -T
-#%setup -q -a 2 -D -T
-#%setup -q -a 10 -D -T
+%package -n nagios-plugins-bacula
+Summary:		Nagios Plugin - check_oracle
+Group:			Applications/System
 
-# Patching and other source preparation
-pushd bacula-%{version}
-#%patch0 -p1
-%patch1 -p1
-#%patch2 -p1
-%patch3 -p1
-#%patch4 -p0
-#%patch5 -p0
-#%patch6 -p0
-#%patch7 -p0
-#%patch8 -p0
-#%patch9 -p0
-#%patch11 -p0
-#%patch12 -p0
-#%patch13 -p2 -b .openssl
-%patch14 -p2
-%patch15 -p2 -b .openssl
-%patch16 -p2 -b .config
-%patch17 -p0 -b .python27
-%patch18 -p2
-%patch19 -p2 -b .log-path
-%patch20 -p0 -b .priv
-%patch21 -p2 -b .tray-dir
-%patch22 -p0 -b .mysql55
-#quoting MaxValue in sql scripts
-%patch23 -p1 -b .maxvalue
+%description -n nagios-plugins-bacula
+Provides check_bacula support for Nagios.
 
 
+%prep
+%setup -q
+%setup -q -a 1 -D -T
+%patch1 -p1
+%patch2 -p2 -b .openssl
+%patch3 -p2 -b .config
+%patch4 -p1 -b .dsolink
+%patch5 -p2 -b .log-path
+%patch6 -p0 -b .priv
+%patch7 -p1 -b .bat-pamd
+%patch8 -p1 -b .optflags
 
 # Remove execution permissions from files we're packaging as docs later on
 find examples -type f | xargs chmod -x
 find updatedb -type f | xargs chmod -x
-popd
 
 # Remove cvs left-overs
 find -name '.cvsignore' | xargs rm -f 
@@ -398,20 +337,9 @@ find -name '.cvsignore' | xargs rm -f
 find -type f -name '*.c' | xargs chmod -x 
 find -type f -name '*.h' | xargs chmod -x 
 
-# GUI Stuff is postponed for later
-#pushd bacula-gui-%{gui_version}
-#%patch10 -p0
-#popd
-
-# We are building the source several times, each with a different storage backend
-mkdir bacula-mysql bacula-postgresql bacula-sqlite
-
 %build
-# Shell function to configure and build a Bacula tree
-build() {
-cp -rl ../bacula-%{version}/* .
 export CFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/ncurses"
-export CPPFLAGS=-I%{_includedir}/ncurses
+export CPPFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/ncurses"
 export QMAKE=/usr/bin/qmake-qt4
 %configure \
 	--sysconfdir=%{_sysconfdir}/bacula \
@@ -427,15 +355,15 @@ export QMAKE=/usr/bin/qmake-qt4
 	--with-mon-dir-password=@@MON_DIR_PASSWORD@@ \
 	--with-mon-fd-password=@@MON_FD_PASSWORD@@ \
 	--with-mon-sd-password=@@MON_SD_PASSWORD@@ \
-	--with-working-dir=%{working_dir} \
-	--with-scriptdir=%{script_dir} \
+	--with-working-dir=%{_localstatedir}/spool/bacula \
+	--with-scriptdir=%{_libexecdir}/bacula \
+	--with-plugindir=%{_libdir}/bacula \
 	--with-smtp-host=localhost \
 	--with-subsys-dir=%{_localstatedir}/lock/subsys \
 	--with-pid-dir=%{_localstatedir}/run \
-	--enable-conio \
+	--disable-conio \
+	--enable-readline \
 	--enable-largefile \
-	--enable-bwx-console \
-	--enable-tray-monitor \
 	--enable-build-dird \
 	--enable-build-stored \
 	--with-openssl \
@@ -443,11 +371,11 @@ export QMAKE=/usr/bin/qmake-qt4
 	--with-python \
 	--enable-smartalloc \
 	--with-x \
-	--enable-bat \
-	--disable-libtool \
-	$*
-# Scratch this, it is trouble
-#	--with-readline \
+	--disable-rpath \
+	--with-sqlite3 \
+	--with-mysql \
+	--with-postgresql \
+	--enable-bat
 
 if test $? != 0; then 
   tail -500 config.log
@@ -455,269 +383,145 @@ if test $? != 0; then
   exit 1
 fi
 
-%{__make} %{?_smp_mflags} NO_ECHO=
-
-}				
-
-# Build sqlite director
-pushd bacula-sqlite
-%if 0%{?fedora}%{?rhel}
-	%if 0%{?fedora}
-		%if 0%{fedora} >= 5
-			%define	sqlite_suffix 3
-			build --with-sqlite3
-		%else
-			build --with-sqlite
-		%endif
-	%endif
-	%if 0%{?rhel}
-		%if 0%{rhel} >=  5
-			%define	sqlite_suffix 3
-			build --with-sqlite3
-		%else
-			build --with-sqlite
-		%endif
-	%endif
-%else
-	echo 'Neither %%{fedora} nor %%{rhel} are defined.'
-	echo 'Please call rpmbuild with at least --define "fedora 7" or --define "rhel 5"'
-	echo 'depending on your release version you are building on.'
-	exit 1
-%endif
+# Remove RPATH
+sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
+sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
 
-#Regen bat qt project file and build
-pushd src
-pushd qt-console
-/usr/bin/qmake-qt4
-make
-popd
-popd
-
-popd
+#%{__make} %{?_smp_mflags} NO_ECHO=
+%{__make} %{?_smp_mflags}
 
-# Build MySQL director
-pushd bacula-mysql
-	build --with-mysql
+pushd examples/nagios/check_bacula
+	CFLAGS="%{optflags}" %{__make} LIBS="-lpthread -ldl -lssl -lcrypto -lz"
 popd
-
-# Build PostgreSQL director
-pushd bacula-postgresql
-	build --with-postgresql
+%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
+pushd src/qt-console/tray-monitor
+	/usr/bin/qmake-qt4
+        %{__make} %{?_smp_mflags}
 popd
+%endif
 
 # Build the docs
-pushd bacula-docs-%{docs_version}
- %configure --with-bacula=%{_builddir}/bacula-%{version}/bacula-%{version}
- make
+pushd bacula-docs-%{version}
+	%configure --with-bacula=%{_builddir}/bacula-%{version}
+	make
 popd
 
 %install
 rm -rf %{buildroot}
 
-pushd bacula-sqlite
-	make install DESTDIR=%{buildroot}
-	mv %{buildroot}%{_sbindir}/bacula-dir  %{buildroot}%{_sbindir}/bacula-dir.sqlite
-	mv %{buildroot}%{_sbindir}/dbcheck  %{buildroot}%{_sbindir}/dbcheck.sqlite
-	mv %{buildroot}%{_sbindir}/bcopy  %{buildroot}%{_sbindir}/bcopy.sqlite
-	mv %{buildroot}%{_sbindir}/bscan  %{buildroot}%{_sbindir}/bscan.sqlite
-
-	for script in create_bacula_database drop_bacula_database drop_bacula_tables \
-			grant_bacula_privileges make_bacula_tables make_catalog_backup \
-			update_bacula_tables; do
-		mv %{buildroot}%{_libexecdir}/bacula/${script} %{buildroot}%{_libexecdir}/bacula/${script}.sqlite
-	done
-popd
-
-pushd bacula-mysql
-	make install DESTDIR=%{buildroot}
-	mv %{buildroot}%{_sbindir}/bacula-dir  %{buildroot}%{_sbindir}/bacula-dir.mysql
-	mv %{buildroot}%{_sbindir}/dbcheck  %{buildroot}%{_sbindir}/dbcheck.mysql
-	mv %{buildroot}%{_sbindir}/bcopy  %{buildroot}%{_sbindir}/bcopy.mysql
-	mv %{buildroot}%{_sbindir}/bscan  %{buildroot}%{_sbindir}/bscan.mysql
-
-	for script in create_bacula_database drop_bacula_database drop_bacula_tables \
-			grant_bacula_privileges make_bacula_tables make_catalog_backup \
-			update_bacula_tables; do
-		mv %{buildroot}%{_libexecdir}/bacula/${script} %{buildroot}%{_libexecdir}/bacula/${script}.mysql
-	done
-popd
-
-pushd bacula-postgresql
-	make install DESTDIR=%{buildroot}
-	mv %{buildroot}%{_sbindir}/bacula-dir  %{buildroot}%{_sbindir}/bacula-dir.postgresql
-	mv %{buildroot}%{_sbindir}/dbcheck  %{buildroot}%{_sbindir}/dbcheck.postgresql
-	mv %{buildroot}%{_sbindir}/bcopy  %{buildroot}%{_sbindir}/bcopy.postgresql
-	mv %{buildroot}%{_sbindir}/bscan  %{buildroot}%{_sbindir}/bscan.postgresql
-
-	for script in create_bacula_database drop_bacula_database drop_bacula_tables \
-			grant_bacula_privileges make_bacula_tables make_catalog_backup \
-			update_bacula_tables; do
-		mv %{buildroot}%{_libexecdir}/bacula/${script} %{buildroot}%{_libexecdir}/bacula/${script}.postgresql
-	done
-popd
-
-pushd bacula-docs-%{docs_version}
- # No install target anymore, we'll include the stuff directly in the %%files section
- #	make install DESTDIR=%{buildroot}
-popd
-
-# GUI is not being packaged yet
-#pushd bacula-gui-%{gui_version}/bacula-web
-#	mkdir -p %{buildroot}%{_datadir}/bacula-web
-#	cp -r -p * %{buildroot}%{_datadir}/bacula-web
-#	for f in ChangeLog CONTACT COPYING README TODO; do
-#		rm -f %{buildroot}%{_datadir}/bacula-web/$f
-#	done
-#	rm -f %{buildroot}%{_datadir}/bacula-web/tsmarty2c.php
-#	rm -rf %{buildroot}%{_datadir}/bacula-web/external_packages/smarty
-#	mv %{buildroot}%{_datadir}/bacula-web/configs/bacula.conf %{buildroot}%{_sysconfdir}/bacula/bacula-web.conf
-#	ln -sf /etc/bacula/bacula-web.conf %{buildroot}%{_datadir}/bacula-web/configs/bacula.conf
-#	install -D -m 644 %{SOURCE11} %{buildroot}%{_sysconfdir}/httpd/conf.d/bacula-web.conf
-#	mkdir -p %{buildroot}%{_localstatedir}/cache/bacula
-#popd
-
-
-# Rename some manpages
-# Not needed right-now
-#mv %{buildroot}%{_mandir}/man1/bacula-tray-monitor.1 %{buildroot}%{_mandir}/man1/tray-monitor.1
+make install DESTDIR=%{buildroot}
 
+# install the nagios plugin
+%{__mkdir_p} %{buildroot}%{_libdir}/nagios/plugins
+%{__install} -m0755 examples/nagios/check_bacula/check_bacula %{buildroot}%{_libdir}/nagios/plugins/
 
-# Fix some wrapper braindeadness
+# Remove unused stuff
 rm -f %{buildroot}%{_libexecdir}/bacula/bconsole
-rm -f %{buildroot}%{_libexecdir}/bacula/gconsole
-mv %{buildroot}%{_sbindir}/bwx-console %{buildroot}%{_sbindir}/bwxconsole
-mv %{buildroot}%{_sysconfdir}/bacula/bwx-console.conf %{buildroot}%{_sysconfdir}/bacula/bwxconsole.conf
+rm -f %{buildroot}%{_mandir}/man1/bacula-bwxconsole.1*
+rm -f %{buildroot}%{_mandir}/man1/bacula-tray-monitor.1*
+rm -f %{buildroot}%{_libdir}/libbaccats-%{version}.so
 
-
-# Desktop Integration for the console apps and the traymonitor
 mkdir -p %{buildroot}%{_bindir}
-install -m 644 -D bacula-sqlite/scripts/bacula.png %{buildroot}%{_datadir}/pixmaps/bacula.png
-#install -m 644 -D bacula-sqlite/scripts/bgnome-console.pamd %{buildroot}%{_sysconfdir}/pam.d/bgnome-console
-#install -m 644 -D bacula-sqlite/scripts/bgnome-console.console_apps %{buildroot}%{_sysconfdir}/security/console.apps/bgnome-console
-install -m 644 -D bacula-sqlite/src/wx-console/wxwin16x16.xpm %{buildroot}%{_datadir}/pixmaps/wxwin16x16.xpm
-install -m 644 -D bacula-sqlite/scripts/wxconsole.pamd %{buildroot}%{_sysconfdir}/pam.d/bwxconsole
-install -m 644 -D %{SOURCE14} %{buildroot}%{_sysconfdir}/security/console.apps/bwxconsole
-#bat.pamd is broken.
-install -m 644 -D bacula-sqlite/scripts/bgnome-console.pamd %{buildroot}%{_sysconfdir}/pam.d/bat
-install -m 644 -D bacula-sqlite/scripts/bat.console_apps %{buildroot}%{_sysconfdir}/security/console.apps/bat
-install -m 644 -D bacula-sqlite/src/tray-monitor/generic.xpm %{buildroot}%{_datadir}/pixmaps/bacula-tray-monitor.xpm
-install -m 644 -D bacula-sqlite/src/qt-console/images/bat_icon.png %{buildroot}%{_datadir}/pixmaps/bat_icon.png
-install -m 644 -D bacula-sqlite/scripts/bgnome-console.pamd %{buildroot}%{_sysconfdir}/pam.d/bacula-tray-monitor
-install -m 644 %{SOURCE13} %{buildroot}%{_sysconfdir}/security/console.apps/bacula-tray-monitor
-
-#ln -sf consolehelper %{buildroot}%{_bindir}/bgnome-console
-ln -sf consolehelper %{buildroot}%{_bindir}/bwxconsole
-ln -sf consolehelper %{buildroot}%{_bindir}/bat
-ln -sf consolehelper %{buildroot}%{_bindir}/bacula-tray-monitor
-install -m 755 bacula-sqlite/src/qt-console/bat %{buildroot}%{_sbindir}
-
-#desktop-file-install --vendor="fedora" --dir=%{buildroot}%{_datadir}/applications %{SOURCE3}
-desktop-file-install --vendor="fedora" --dir=%{buildroot}%{_datadir}/applications %{SOURCE4}
-desktop-file-install --vendor="fedora" --dir=%{buildroot}%{_datadir}/applications %{SOURCE5}
-desktop-file-install --vendor="fedora" --dir=%{buildroot}%{_datadir}/applications %{SOURCE12}
 
+# Bat
+%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
+install -m 755 -D src/qt-console/bat %{buildroot}%{_sbindir}
+install -m 644 -D src/qt-console/bat.conf %{buildroot}%{_sysconfdir}/bacula/bat.conf
+install -m 644 -D src/qt-console/images/bat_icon.png %{buildroot}%{_datadir}/pixmaps/bat_icon.png
+install -m 644 -D scripts/bat.pamd %{buildroot}%{_sysconfdir}/pam.d/bat
+install -m 644 -D scripts/bat.console_apps %{buildroot}%{_sysconfdir}/security/console.apps/bat
+ln -sf consolehelper %{buildroot}%{_bindir}/bat
+desktop-file-install --vendor="fedora" --dir=%{buildroot}%{_datadir}/applications %{SOURCE13}
+%else
+rm -f %{buildroot}%{_mandir}/man1/bat.1*
+%endif
 
 # logrotate
 mkdir -p %{buildroot}%{_localstatedir}/log/bacula
 install -m 644 -D %{SOURCE6} %{buildroot}%{_sysconfdir}/logrotate.d/bacula
 
-
 # And logwatch
-install -m 755 -D bacula-sqlite/scripts/logwatch/bacula %{buildroot}%{_sysconfdir}/logwatch/scripts/services/bacula
-install -m 755 -D bacula-sqlite/scripts/logwatch/applybaculadate %{buildroot}%{_sysconfdir}/logwatch/scripts/shared/applybaculadate
-install -m 644 -D bacula-sqlite/scripts/logwatch/logfile.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/logfiles/bacula.conf
-install -m 644 -D bacula-sqlite/scripts/logwatch/services.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/services/bacula.conf
+install -m 755 -D scripts/logwatch/bacula %{buildroot}%{_sysconfdir}/logwatch/scripts/services/bacula
+install -m 755 -D scripts/logwatch/applybaculadate %{buildroot}%{_sysconfdir}/logwatch/scripts/shared/applybaculadate
+install -m 644 -D scripts/logwatch/logfile.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/logfiles/bacula.conf
+install -m 644 -D scripts/logwatch/services.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/services/bacula.conf
 
+%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
 # Systemd unit files
 mkdir -p ${buildroot}%{_unitdir}
-install -m 755 -D %{SOURCE7}  %{buildroot}%{_unitdir}/bacula-fd.service
-install -m 755 -D %{SOURCE8}  %{buildroot}%{_unitdir}/bacula-dir.service
-install -m 755 -D %{SOURCE9}  %{buildroot}%{_unitdir}/bacula-sd.service
-install -m 755 -D %{SOURCE15} %{buildroot}%{_sbindir}/bacula-checkconf
+install -m 755 -D %{SOURCE10}  %{buildroot}%{_unitdir}/bacula-fd.service
+install -m 755 -D %{SOURCE11}  %{buildroot}%{_unitdir}/bacula-dir.service
+install -m 755 -D %{SOURCE12}  %{buildroot}%{_unitdir}/bacula-sd.service
+install -m 755 -D %{SOURCE18}  %{buildroot}%{_sbindir}/bacula-checkconf
+%else
+# Initscripts
+install -m 755 -D %{SOURCE7}  %{buildroot}%{_initrddir}/bacula-fd
+install -m 755 -D %{SOURCE8}  %{buildroot}%{_initrddir}/bacula-dir
+install -m 755 -D %{SOURCE9}  %{buildroot}%{_initrddir}/bacula-sd
+%endif
 
+# Sysconfig
+install -m 644 -D %{SOURCE15}  %{buildroot}%{_sysconfdir}/sysconfig/bacula-fd
+install -m 644 -D %{SOURCE16}  %{buildroot}%{_sysconfdir}/sysconfig/bacula-dir
+install -m 644 -D %{SOURCE17}  %{buildroot}%{_sysconfdir}/sysconfig/bacula-sd
 
 # Wipe backup files from the multiple make install calls
 rm -vf %{buildroot}%{_sysconfdir}/bacula/*.{new,old}
 rm -vf %{buildroot}%{_libexecdir}/bacula/*.{new,old}
 
-
 # Create the spooling
 mkdir -p %{buildroot}%{_localstatedir}/spool/bacula
 
-
 # Move some files around
-mv %{buildroot}%{_libexecdir}/bacula/query.sql %{buildroot}%{_sysconfdir}/bacula/query.sql
-
+#mv %{buildroot}%{_libexecdir}/bacula/query.sql %{buildroot}%{_sysconfdir}/bacula/query.sql
 
 # Nuke the scripts we do not need
 rm -vf %{buildroot}%{_libexecdir}/bacula/{bacula,bacula-ctl-*,startmysql,stopmysql} 
 
-# Install bat.conf
-install -m 644 bacula-sqlite/src/qt-console/bat.conf %{buildroot}%{_sysconfdir}/bacula/bat.conf
-
 # Fix up some perms so rpmlint does not complain too much
 chmod 755 %{buildroot}%{_sbindir}/*
+chmod 755 %{buildroot}%{_libdir}/bacula/*
 chmod 755 %{buildroot}%{_libexecdir}/bacula/*
 chmod 644 %{buildroot}%{_libexecdir}/bacula/btraceback.*
 
 # Remove extra docs
 rm -rf %{buildroot}%{_datadir}/doc/bacula/
 
+# Remove local archives
+rm -f %{buildroot}%{_libdir}/*.la
+
 %clean
 rm -rf %{buildroot}
 
 
 %post director-mysql
-/usr/sbin/alternatives --install /usr/sbin/bacula-dir bacula-dir /usr/sbin/bacula-dir.mysql 50 \
-	--slave /usr/sbin/dbcheck bacula-dbcheck /usr/sbin/dbcheck.mysql \
-	--slave /usr/libexec/bacula/create_bacula_database create_bacula_database /usr/libexec/bacula/create_bacula_database.mysql \
-	--slave /usr/libexec/bacula/drop_bacula_database drop_bacula_database /usr/libexec/bacula/drop_bacula_database.mysql \
-	--slave /usr/libexec/bacula/drop_bacula_tables drop_bacula_tables /usr/libexec/bacula/drop_bacula_tables.mysql \
-	--slave /usr/libexec/bacula/grant_bacula_privileges grant_bacula_privileges /usr/libexec/bacula/grant_bacula_privileges.mysql \
-	--slave /usr/libexec/bacula/make_bacula_tables make_bacula_tables /usr/libexec/bacula/make_bacula_tables.mysql \
-	--slave /usr/libexec/bacula/make_catalog_backup make_catalog_backup /usr/libexec/bacula/make_catalog_backup.mysql \
-	--slave /usr/libexec/bacula/update_bacula_tables update_bacula_tables /usr/libexec/bacula/update_bacula_tables.mysql
+/usr/sbin/alternatives --install %{_libdir}/libbaccats-%{version}.so libbaccats-%{version}.so %{_libdir}/libbaccats-mysql-%{version}.so 50
 
 
 %post director-sqlite
-/usr/sbin/alternatives --install /usr/sbin/bacula-dir bacula-dir /usr/sbin/bacula-dir.sqlite 40 \
-	--slave /usr/sbin/dbcheck bacula-dbcheck /usr/sbin/dbcheck.sqlite \
-	--slave /usr/libexec/bacula/create_bacula_database create_bacula_database /usr/libexec/bacula/create_bacula_database.sqlite \
-	--slave /usr/libexec/bacula/drop_bacula_database drop_bacula_database /usr/libexec/bacula/drop_bacula_database.sqlite \
-	--slave /usr/libexec/bacula/drop_bacula_tables drop_bacula_tables /usr/libexec/bacula/drop_bacula_tables.sqlite \
-	--slave /usr/libexec/bacula/grant_bacula_privileges grant_bacula_privileges /usr/libexec/bacula/grant_bacula_privileges.sqlite \
-	--slave /usr/libexec/bacula/make_bacula_tables make_bacula_tables /usr/libexec/bacula/make_bacula_tables.sqlite \
-	--slave /usr/libexec/bacula/make_catalog_backup make_catalog_backup /usr/libexec/bacula/make_catalog_backup.sqlite \
-	--slave /usr/libexec/bacula/update_bacula_tables update_bacula_tables /usr/libexec/bacula/update_bacula_tables.sqlite
+/usr/sbin/alternatives --install %{_libdir}/libbaccats-%{version}.so libbaccats-%{version}.so %{_libdir}/libbaccats-sqlite3-%{version}.so 40
 
 
 %post director-postgresql
-/usr/sbin/alternatives --install /usr/sbin/bacula-dir bacula-dir /usr/sbin/bacula-dir.postgresql 60 \
-	--slave /usr/sbin/dbcheck bacula-dbcheck /usr/sbin/dbcheck.postgresql \
-	--slave /usr/libexec/bacula/create_bacula_database create_bacula_database /usr/libexec/bacula/create_bacula_database.postgresql \
-	--slave /usr/libexec/bacula/drop_bacula_database drop_bacula_database /usr/libexec/bacula/drop_bacula_database.postgresql \
-	--slave /usr/libexec/bacula/drop_bacula_tables drop_bacula_tables /usr/libexec/bacula/drop_bacula_tables.postgresql \
-	--slave /usr/libexec/bacula/grant_bacula_privileges grant_bacula_privileges /usr/libexec/bacula/grant_bacula_privileges.postgresql \
-	--slave /usr/libexec/bacula/make_bacula_tables make_bacula_tables /usr/libexec/bacula/make_bacula_tables.postgresql \
-	--slave /usr/libexec/bacula/make_catalog_backup make_catalog_backup /usr/libexec/bacula/make_catalog_backup.postgresql \
-	--slave /usr/libexec/bacula/update_bacula_tables update_bacula_tables /usr/libexec/bacula/update_bacula_tables.postgresql
+/usr/sbin/alternatives --install %{_libdir}/libbaccats-%{version}.so libbaccats-%{version}.so %{_libdir}/libbaccats-postgresql-%{version}.so 60
+
 
 
 %preun director-mysql
 if [ "$1" = 0 ]; then
-	/usr/sbin/alternatives --remove bacula-dir /usr/sbin/bacula-dir.mysql
+	/usr/sbin/alternatives --remove libbaccats-%{version}.so %{_libdir}/libbaccats-mysql-%{version}.so
 fi
 
 
 %preun director-sqlite
 if [ "$1" = 0 ]; then
-	/usr/sbin/alternatives --remove bacula-dir /usr/sbin/bacula-dir.sqlite
+	/usr/sbin/alternatives --remove libbbaccats-%{version}.so %{_libdir}/libbaccats-sqlite3-%{version}.so
 fi
 
 
 %preun director-postgresql
 if [ "$1" = 0 ]; then
-	/usr/sbin/alternatives --remove bacula-dir /usr/sbin/bacula-dir.postgresql
+	/usr/sbin/alternatives --remove libbaccats-%{version}.so %{_libdir}/libbaccats-postgresql-%{version}.so
 fi
 
 %pre common
@@ -725,40 +529,11 @@ fi
 /usr/sbin/fedora-useradd  33 -r -s /sbin/nologin -d /var/spool/bacula -M \
 	-c 'Bacula Backup System' -g bacula bacula &>/dev/null || :
 
-
-%post storage-mysql
-/usr/sbin/alternatives --install /usr/sbin/bcopy bacula-sd /usr/sbin/bcopy.mysql 50 \
-	--slave /usr/sbin/bscan bacula-bscan /usr/sbin/bscan.mysql 
-
-
-%post storage-sqlite
-/usr/sbin/alternatives --install /usr/sbin/bcopy bacula-sd /usr/sbin/bcopy.sqlite 40 \
-	--slave /usr/sbin/bscan bacula-bscan /usr/sbin/bscan.sqlite
-
-
-%post storage-postgresql
-/usr/sbin/alternatives --install /usr/sbin/bcopy bacula-sd /usr/sbin/bcopy.postgresql 60 \
-	--slave /usr/sbin/bscan bacula-bscan /usr/sbin/bscan.postgresql
-
-
-%preun storage-mysql
-if [ "$1" = 0 ]; then
-	/usr/sbin/alternatives --remove bacula-sd /usr/sbin/bcopy.mysql
-fi
-
-%preun storage-sqlite
-if [ "$1" = 0 ]; then
-	/usr/sbin/alternatives --remove bacula-sd /usr/sbin/bcopy.sqlite
-fi
-
-%preun storage-postgresql
-if [ "$1" = 0 ]; then
-	/usr/sbin/alternatives --remove bacula-sd /usr/sbin/bcopy.postgresql
-fi
+%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
 
 %post client
-if [ $1 -eq 1 ] ; then 
-    # Initial installation 
+if [ $1 -eq 1 ] ; then
+    # Initial installation
     /bin/systemctl daemon-reload >/dev/null 2>&1 || :
 fi
 
@@ -786,10 +561,9 @@ fi
 /sbin/chkconfig --del bacula-fd >/dev/null 2>&1 || :
 /bin/systemctl try-restart bacula-fd.service >/dev/null 2>&1 || :
 
-
 %post director-common
-if [ $1 -eq 1 ] ; then 
-    # Initial installation 
+if [ $1 -eq 1 ] ; then
+    # Initial installation
     /bin/systemctl daemon-reload >/dev/null 2>&1 || :
 fi
 
@@ -819,8 +593,8 @@ fi
 
 
 %post storage-common
-if [ $1 -eq 1 ] ; then 
-    # Initial installation 
+if [ $1 -eq 1 ] ; then
+    # Initial installation
     /bin/systemctl daemon-reload >/dev/null 2>&1 || :
 fi
 
@@ -838,7 +612,7 @@ if [ $1 -ge 1 ] ; then
     /bin/systemctl try-restart bacula-sd.service >/dev/null 2>&1 || :
 fi
 
-%triggerun storage-common -- bacula-storage-common < 5.0.3-10 
+%triggerun storage-common -- bacula-storage-common < 5.0.3-10
 # Save the current service runlevel info
 # User must manually run systemd-sysv-convert --apply bacula-sd
 # to migrate them to systemd targets
@@ -848,232 +622,259 @@ fi
 /sbin/chkconfig --del bacula-sd >/dev/null 2>&1 || :
 /bin/systemctl try-restart bacula-sd.service >/dev/null 2>&1 || :
 
+%else
+
+%post client
+/sbin/chkconfig --add bacula-fd
+
+
+%preun client
+if [ "$1" = 0 ]; then
+	/sbin/service bacula-fd stop >/dev/null 2>&1 || :
+	/sbin/chkconfig --del bacula-fd
+fi
+
+
+%postun client
+if [ "$1" -ge "1" ]; then
+	/sbin/service bacula-fd condrestart >/dev/null 2>&1 || :
+fi
+
+
+%post director-common
+/sbin/chkconfig --add bacula-dir
+
+
+%preun director-common
+if [ "$1" = 0 ]; then
+	/sbin/service bacula-dir stop >/dev/null 2>&1 || :
+	/sbin/chkconfig --del bacula-dir
+fi
+
+
+%postun director-common
+if [ "$1" -ge "1" ]; then
+	/sbin/service bacula-dir condrestart >/dev/null 2>&1 || :
+fi
+
+
+%post storage-common
+/sbin/chkconfig --add bacula-sd
+
+
+%preun storage-common
+if [ "$1" = 0 ]; then
+	/sbin/service bacula-sd stop >/dev/null 2>&1 || :
+	/sbin/chkconfig --del bacula-sd
+fi
+
+
+%postun storage-common
+if [ "$1" -ge "1" ]; then
+	/sbin/service bacula-sd condrestart >/dev/null 2>&1 || :
+fi
+
+%endif
+
 
 %files common
 %defattr(-,root,root,-)
-%doc bacula-%{version}/AUTHORS bacula-%{version}/ChangeLog bacula-%{version}/COPYING bacula-%{version}/LICENSE
-%doc bacula-%{version}/README bacula-%{version}/SUPPORT bacula-%{version}/VERIFYING
-%doc bacula-%{version}/examples/
+%doc AUTHORS ChangeLog COPYING LICENSE README SUPPORT VERIFYING examples/
 %config(noreplace) %{_sysconfdir}/logrotate.d/bacula
-%dir %{_sysconfdir}/bacula
-%dir %{_libexecdir}/bacula
+%dir %{_sysconfdir}/%{name}
+%dir %{_libexecdir}/%{name}
 %{_sbindir}/bsmtp
 %{_sbindir}/btraceback
-%{_libexecdir}/bacula/btraceback.dbx
-%{_libexecdir}/bacula/btraceback.gdb
-%{_mandir}/man1/bsmtp.1*
-%{_mandir}/man8/bacula.8*
-%{_mandir}/man8/btraceback.8*
+%{_sbindir}/bacula
+%{_libexecdir}/%{name}/mtx-changer.conf
+%{_libexecdir}/%{name}/btraceback.dbx
+%{_libexecdir}/%{name}/btraceback.gdb
+%{_libexecdir}/%{name}/bacula_config
+%{_libexecdir}/%{name}/btraceback.mdb
+%{_libdir}/libbac-%{version}.so
+%{_libdir}/libbac.so
+%{_libdir}/libbaccats.so
+%{_libdir}/libbaccfg-%{version}.so
+%{_libdir}/libbaccfg.so
+%{_libdir}/libbacfind-%{version}.so
+%{_libdir}/libbacfind.so
+%{_libdir}/libbacpy-%{version}.so
+%{_libdir}/libbacpy.so
+%{_libdir}/libbacsql-%{version}.so
+%{_libdir}/libbacsql.so
+%{_mandir}/man1/bsmtp.1.gz
+%{_mandir}/man8/bacula.8.gz
+%{_mandir}/man8/btraceback.8.gz
 %dir %attr(750, bacula, bacula) %{_localstatedir}/log/bacula
 %dir %attr(750, bacula, bacula) %{_localstatedir}/spool/bacula
-%{_sbindir}/bacula
-#%{_libdir}/bpipe-fd.so
-/usr/libexec/bacula/mtx-changer.conf
-%{_libexecdir}/bacula/bacula_config
-%{_libexecdir}/bacula/btraceback.mdb
+%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
 %{_sbindir}/bacula-checkconf
+%endif
 
 %files client
 %defattr(-,root,root,-)
 %{_sbindir}/bacula-fd
+%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
 %{_unitdir}/bacula-fd.service
+%else
+%{_initrddir}/bacula-fd
+%endif
 %config(noreplace) %{_sysconfdir}/bacula/bacula-fd.conf
-%{_mandir}/man8/bacula-fd.8*
-
+%config(noreplace) %{_sysconfdir}/sysconfig/bacula-fd
+%{_mandir}/man8/bacula-fd.8.gz
+%{_libdir}/bacula/bpipe-fd.so
 
 %files console
 %defattr(-,root,root,-)
 %{_sbindir}/bconsole
 %attr(640,root,bacula) %config(noreplace) %{_sysconfdir}/bacula/bconsole.conf
-%{_mandir}/man8/bconsole.8*
-
-
-#%files console-gnome
-#%defattr(-,root,root,-)
-#%config %{_sysconfdir}/security/console.apps/bgnome-console
-#%config %{_sysconfdir}/pam.d/bgnome-console
-#%attr(640,root,bacula) %config(noreplace) %{_sysconfdir}/bacula/bgnome-console.conf
-#%{_bindir}/bgnome-console
-#%{_sbindir}/bgnome-console
-#%{_mandir}/man1/bacula-bgnome-console.1.gz
-##%{_mandir}/man1/bacula-bconsole-gnome.1*
-#%{_datadir}/applications/fedora-bacula-gconsole.desktop
-#%{_datadir}/pixmaps/bacula.png
+%{_mandir}/man8/bconsole.8.gz
 
+%if 0%{?fedora} >= 11 || 0%{?rhel} >= 6
 %files console-bat
 %defattr(-,root,root,-)
-%config %{_sysconfdir}/security/console.apps/bat
-%config %{_sysconfdir}/pam.d/bat
+%config(noreplace) %{_sysconfdir}/security/console.apps/bat
+%config(noreplace) %{_sysconfdir}/pam.d/bat
 %attr(640,root,bacula) %config(noreplace) %{_sysconfdir}/bacula/bat.conf
 %{_bindir}/bat
 %{_sbindir}/bat
 %{_mandir}/man1/bat.1.gz
 %{_datadir}/applications/fedora-bacula-bat.desktop
 %{_datadir}/pixmaps/bat_icon.png
-%{_datadir}/pixmaps/bacula.png
-
-
-%files console-wxwidgets
-%defattr(-,root,root,-)
-%config %{_sysconfdir}/security/console.apps/bwxconsole
-%config %{_sysconfdir}/pam.d/bwxconsole
-%attr(640,root,bacula) %config(noreplace) %{_sysconfdir}/bacula/bwxconsole.conf
-%{_bindir}/bwxconsole
-%{_sbindir}/bwxconsole
-%{_mandir}/man1/bacula-bwxconsole.1*
-%{_datadir}/applications/fedora-bacula-wxconsole.desktop
-%{_datadir}/pixmaps/wxwin16x16.xpm
-
+%endif
 
 %files director-common
 %defattr(-,root,root,-)
-%doc bacula-%{version}/updatedb/
+%doc updatedb
 %attr(640,root,bacula) %config(noreplace) %{_sysconfdir}/bacula/bacula-dir.conf
-%config(noreplace) %{_sysconfdir}/bacula/query.sql
-%config %{_sysconfdir}/logwatch/conf/logfiles/bacula.conf
-%config %{_sysconfdir}/logwatch/conf/services/bacula.conf
+#%config(noreplace) %{_sysconfdir}/bacula/query.sql
+%config(noreplace) %{_sysconfdir}/logwatch/conf/logfiles/bacula.conf
+%config(noreplace) %{_sysconfdir}/logwatch/conf/services/bacula.conf
+%config(noreplace) %{_sysconfdir}/sysconfig/bacula-dir
 %{_sysconfdir}/logwatch/scripts/services/bacula
 %{_sysconfdir}/logwatch/scripts/shared/applybaculadate
+%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
 %{_unitdir}/bacula-dir.service
+%else
+%{_initrddir}/bacula-dir
+%endif
+%{_sbindir}/bacula-dir
 %{_sbindir}/bregex
 %{_sbindir}/bwild
-%{_mandir}/man8/dbcheck.8*
-%{_mandir}/man8/bacula-dir.8*
-%{_libexecdir}/bacula/delete_catalog_backup
-%{_libexecdir}/bacula/make_catalog_backup.pl
+%{_sbindir}/dbcheck
+%{_mandir}/man8/dbcheck.8.gz
+%{_mandir}/man8/bacula-dir.8.gz
+%{_mandir}/man8/bregex.8.gz
+%{_mandir}/man8/bwild.8.gz
+%{_libexecdir}/%{name}/create_bacula_database
+%{_libexecdir}/%{name}/delete_catalog_backup
+%{_libexecdir}/%{name}/disk-changer
+%{_libexecdir}/%{name}/drop_bacula_database
+%{_libexecdir}/%{name}/drop_bacula_tables
+%{_libexecdir}/%{name}/dvd-handler
+%{_libexecdir}/%{name}/grant_bacula_privileges
+%{_libexecdir}/%{name}/make_bacula_tables
+%{_libexecdir}/%{name}/make_catalog_backup
+%{_libexecdir}/%{name}/make_catalog_backup.pl
+%{_libexecdir}/%{name}/mtx-changer
+%{_libexecdir}/%{name}/mtx-changer.conf
+%{_libexecdir}/%{name}/update_bacula_tables
 
 %files director-mysql
 %defattr(-,root,root,-)
-%{_sbindir}/bacula-dir.mysql
-%{_sbindir}/dbcheck.mysql
-%{_libexecdir}/bacula/create_mysql_database
-%{_libexecdir}/bacula/drop_mysql_database
-%{_libexecdir}/bacula/drop_mysql_tables
-%{_libexecdir}/bacula/grant_mysql_privileges
-%{_libexecdir}/bacula/make_mysql_tables
-%{_libexecdir}/bacula/update_mysql_tables
-%{_libexecdir}/bacula/create_bacula_database.mysql
-%{_libexecdir}/bacula/drop_bacula_database.mysql
-%{_libexecdir}/bacula/drop_bacula_tables.mysql
-%{_libexecdir}/bacula/grant_bacula_privileges.mysql
-%{_libexecdir}/bacula/make_bacula_tables.mysql
-%{_libexecdir}/bacula/make_catalog_backup.mysql
-%{_libexecdir}/bacula/update_bacula_tables.mysql
-
-
+%{_libdir}/libbaccats-mysql-%{version}.so
+%{_libdir}/libbaccats-mysql.so
+%{_libexecdir}/%{name}/create_mysql_database
+%{_libexecdir}/%{name}/drop_mysql_database
+%{_libexecdir}/%{name}/drop_mysql_tables
+%{_libexecdir}/%{name}/grant_mysql_privileges
+%{_libexecdir}/%{name}/make_mysql_tables
+%{_libexecdir}/%{name}/update_mysql_tables
 
 %files director-sqlite
 %defattr(-,root,root,-)
-%{_sbindir}/bacula-dir.sqlite
-%{_sbindir}/dbcheck.sqlite
-# DANGER Will Robinson. Bacula has versioned sqlite filenames
-%{_libexecdir}/bacula/create_sqlite%{?sqlite_suffix}_database
-%{_libexecdir}/bacula/drop_sqlite%{?sqlite_suffix}_database
-%{_libexecdir}/bacula/drop_sqlite%{?sqlite_suffix}_tables
-%{_libexecdir}/bacula/grant_sqlite%{?sqlite_suffix}_privileges
-%{_libexecdir}/bacula/make_sqlite%{?sqlite_suffix}_tables
-%{_libexecdir}/bacula/update_sqlite%{?sqlite_suffix}_tables
-%{_libexecdir}/bacula/create_bacula_database.sqlite
-%{_libexecdir}/bacula/drop_bacula_database.sqlite
-%{_libexecdir}/bacula/drop_bacula_tables.sqlite
-%{_libexecdir}/bacula/grant_bacula_privileges.sqlite
-%{_libexecdir}/bacula/make_bacula_tables.sqlite
-%{_libexecdir}/bacula/make_catalog_backup.sqlite
-%{_libexecdir}/bacula/update_bacula_tables.sqlite
-
+%{_libdir}/libbaccats-sqlite3-%{version}.so
+%{_libdir}/libbaccats-sqlite3.so
+%{_libexecdir}/%{name}/create_sqlite3_database
+%{_libexecdir}/%{name}/drop_sqlite3_database
+%{_libexecdir}/%{name}/drop_sqlite3_tables
+%{_libexecdir}/%{name}/grant_sqlite3_privileges
+%{_libexecdir}/%{name}/make_sqlite3_tables
+%{_libexecdir}/%{name}/update_sqlite3_tables
 
 %files director-postgresql
 %defattr(-,root,root,-)
-%{_sbindir}/bacula-dir.postgresql
-%{_sbindir}/dbcheck.postgresql
-%{_libexecdir}/bacula/create_postgresql_database
-%{_libexecdir}/bacula/drop_postgresql_database
-%{_libexecdir}/bacula/drop_postgresql_tables
-%{_libexecdir}/bacula/grant_postgresql_privileges
-%{_libexecdir}/bacula/make_postgresql_tables
-%{_libexecdir}/bacula/update_postgresql_tables
-%{_libexecdir}/bacula/create_bacula_database.postgresql
-%{_libexecdir}/bacula/drop_bacula_database.postgresql
-%{_libexecdir}/bacula/drop_bacula_tables.postgresql
-%{_libexecdir}/bacula/grant_bacula_privileges.postgresql
-%{_libexecdir}/bacula/make_bacula_tables.postgresql
-%{_libexecdir}/bacula/make_catalog_backup.postgresql
-%{_libexecdir}/bacula/update_bacula_tables.postgresql
-
+%{_libdir}/libbaccats-postgresql-%{version}.so
+%{_libdir}/libbaccats-postgresql.so
+%{_libexecdir}/%{name}/create_postgresql_database
+%{_libexecdir}/%{name}/drop_postgresql_database
+%{_libexecdir}/%{name}/drop_postgresql_tables
+%{_libexecdir}/%{name}/grant_postgresql_privileges
+%{_libexecdir}/%{name}/make_postgresql_tables
+%{_libexecdir}/%{name}/update_postgresql_tables
 
 %files storage-common
 %defattr(-,root,root,-)
 %{_sbindir}/bacula-sd
+%{_sbindir}/bcopy
 %{_sbindir}/bextract
 %{_sbindir}/bls
+%{_sbindir}/bscan
 %{_sbindir}/btape
 %config(noreplace) %{_sysconfdir}/bacula/bacula-sd.conf
+%config(noreplace) %{_sysconfdir}/sysconfig/bacula-sd
+%if 0%{?fedora} >= 15 || 0%{?rhel} > 6
 %{_unitdir}/bacula-sd.service
+%else
+%{_initrddir}/bacula-sd
+%endif
 %{_libexecdir}/bacula/disk-changer
 %{_libexecdir}/bacula/dvd-handler
 %{_libexecdir}/bacula/mtx-changer
-%{_mandir}/man8/bcopy.8*
-%{_mandir}/man8/bextract.8*
-%{_mandir}/man8/bls.8*
-%{_mandir}/man8/bscan.8*
-%{_mandir}/man8/btape.8*
-%{_mandir}/man8/bacula-sd.8*
-
-
-%files storage-mysql
-%defattr(-,root,root,-)
-%{_sbindir}/bcopy.mysql
-%{_sbindir}/bscan.mysql
-
-
-%files storage-sqlite
-%defattr(-,root,root,-)
-%{_sbindir}/bcopy.sqlite
-%{_sbindir}/bscan.sqlite
-
-
-%files storage-postgresql
-%defattr(-,root,root,-)
-%{_sbindir}/bcopy.postgresql
-%{_sbindir}/bscan.postgresql
-
-
-%files traymonitor
-%defattr(-,root,root,-)
-%{_bindir}/bacula-tray-monitor
-%{_sbindir}/bacula-tray-monitor
-%attr(640,root,bacula) %config(noreplace) %{_sysconfdir}/bacula/tray-monitor.conf
-%config %{_sysconfdir}/security/console.apps/bacula-tray-monitor
-%config %{_sysconfdir}/pam.d/bacula-tray-monitor
-%{_mandir}/man1/bacula-tray-monitor.1*
-%{_datadir}/applications/fedora-bacula-traymonitor.desktop
-%{_datadir}/pixmaps/bacula-tray-monitor.xpm
-
+%{_mandir}/man8/bacula-sd.8.gz
+%{_mandir}/man8/bcopy.8.gz
+%{_mandir}/man8/bextract.8.gz
+%{_mandir}/man8/bls.8.gz
+%{_mandir}/man8/bscan.8.gz
+%{_mandir}/man8/btape.8.gz
 
 %files docs
 %defattr(-,root,root,-)
-#%doc bacula-docs-%{docs_version}/manuals/en/old/install/install.pdf
-%doc bacula-docs-%{docs_version}/manuals/en/problems/problems.pdf
-%doc bacula-docs-%{docs_version}/manuals/en/console/console.pdf
-%doc bacula-docs-%{docs_version}/manuals/en/utility/utility.pdf
-#%doc bacula-docs-%{docs_version}/manuals/en/old/concepts/concepts.pdf
-#%doc bacula-docs-%{docs_version}/manuals/en/old/catalog/catalog.pdf
-%doc bacula-docs-%{docs_version}/manuals/en/developers/developers.pdf
-%doc bacula-docs-%{docs_version}/manuals/en/main/main.pdf
-%doc bacula-docs-%{docs_version}/manuals/en/misc/misc.pdf
-
-
-#%files web
-#%defattr(-,root,root,-)
-#%doc bacula-gui-%{gui_version}/bacula-web/CONTACT bacula-gui-%{gui_version}/bacula-web/COPYING
-#%doc bacula-gui-%{gui_version}/bacula-web/README bacula-gui-%{gui_version}/bacula-web/TODO
-#%{_datadir}/bacula-web/
-#%config(noreplace) %{_sysconfdir}/bacula/bacula-web.conf
-#%config(noreplace) %{_sysconfdir}/httpd/conf.d/bacula-web.conf
-#%dir %attr(755, apache, apache) %{_localstatedir}/cache/bacula-web
+%doc bacula-docs-%{version}/manuals/en/problems/problems.pdf
+%doc bacula-docs-%{version}/manuals/en/console/console.pdf
+%doc bacula-docs-%{version}/manuals/en/utility/utility.pdf
+%doc bacula-docs-%{version}/manuals/en/developers/developers.pdf
+%doc bacula-docs-%{version}/manuals/en/main/main.pdf
+%doc bacula-docs-%{version}/manuals/en/misc/misc.pdf
+
+%files -n nagios-plugins-bacula
+%defattr(-,root,root)
+%{_libdir}/nagios/plugins/check_bacula
 
 
 %changelog
+* Tue Nov 29 2011 Tom Callaway <spot at fedoraproject.org> - 5.2.2-1
+- Update to 5.2.2
+- minor spec cleanups, conditionalized support for systemd
+
+* Fri Nov 04 2011 Simone Caronni <negativo17 at gmail.com> - 5.2.1-1
+- Updated to 5.2.1.
+- Reworked and removed some patches for 5.2.1 codebase.
+- Reworked bat installation.
+- Removed sqlite2 support.
+- Removed all the fancy database backend rebuilding.
+- Disabled libtool for bpipe-fd.so.
+- Passed plugins dir as libdir/bacula.
+- Added sql libs to alternatives.
+- Disabled traymonitor.
+- Minor fixes to spec file, rpmlint fixes.
+- Nagios patch for Enterprise FDs.
+- Removed all gui/web stuff.
+- Removed a lot of comments.
+- Conditional on Fedora 11 / RHEL 6 for bat build.
+- Obsolete bacula-sysconfdir.
+- Removed bwxconsole.
+
 * Thu Nov 3 2011 Lukáš Nykrýn <lnykryn at redhat.com> - 5.0.3-13
 - fixed creating of bacula MySQL tables and bump
 
diff --git a/sources b/sources
index f7a51e8..6b5a83d 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-9de254ae39cab0587fdb2f5d8d90b03b  bacula-5.0.3.tar.gz
-7a00557dcf0dfa40de9e74176fefd1ae  bacula-docs-5.0.3.tar.bz2
+227b88f56ae085da8f48823b220d4c87  bacula-5.2.2.tar.gz
+478273c0229f24d6690fdbedbeb50fa4  bacula-docs-5.2.2.tar.bz2


More information about the scm-commits mailing list