From d58a85389bd2dd360ab0d4d4e0efd33f40b41b06 Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Dec 23 2011 15:22:41 +0000 Subject: Add Nagios & bpipe plugin, initscripts, remove dsolink patches, enable libtool --- diff --git a/bacula-5.0.1-dsolink.patch b/bacula-5.0.1-dsolink.patch deleted file mode 100644 index 51ec8b4..0000000 --- a/bacula-5.0.1-dsolink.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- bacula-5.0.1/bacula-5.0.1/src/qt-console/bat.pro.in~ 2010-02-24 09:33:48.000000000 -0600 -+++ bacula-5.0.1/bacula-5.0.1/src/qt-console/bat.pro.in 2010-03-11 17:12:44.645296544 -0600 -@@ -20,7 +20,7 @@ - TARGET = bat - DEPENDPATH += . - INCLUDEPATH += .. . ./console ./restore ./select --LIBS += -L../lib -lbaccfg -lbac @OPENSSL_LIBS@ -+LIBS += -L../lib -lbaccfg -lbac -ldl @OPENSSL_LIBS@ - LIBTOOL_LINK = @QMAKE_LIBTOOL@ --silent --tag=CXX --mode=link - LIBTOOL_INSTALL = @QMAKE_LIBTOOL@ --silent --mode=install - QMAKE_LINK = $${LIBTOOL_LINK} $(CXX) diff --git a/bacula-5.0.3-dsolink.patch b/bacula-5.0.3-dsolink.patch deleted file mode 100644 index e6a5f16..0000000 --- a/bacula-5.0.3-dsolink.patch +++ /dev/null @@ -1,165 +0,0 @@ ---- bacula-5.0.3/bacula-5.0.3/src/qt-console/bat.pro.in~ 2010-08-10 11:27:17.000000000 -0500 -+++ bacula-5.0.3/bacula-5.0.3/src/qt-console/bat.pro.in 2010-08-10 12:32:00.312182153 -0500 -@@ -20,7 +20,7 @@ - TARGET = bat - DEPENDPATH += . - INCLUDEPATH += .. . ./console ./restore ./select --LIBS += -L../lib -lbaccfg -lbac -ldl @OPENSSL_LIBS@ -+LIBS += -L../lib -lbaccfg -lbac -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) ---- bacula-5.0.3/bacula-5.0.3/src/tools/Makefile.in~ 2010-08-05 09:29:51.000000000 -0500 -+++ bacula-5.0.3/bacula-5.0.3/src/tools/Makefile.in 2010-08-11 12:54:02.028450916 -0500 -@@ -57,7 +57,7 @@ - @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) ---- bacula-5.0.3/bacula-5.0.3/src/tools/Makefile.in~ 2010-08-11 12:57:29.000000000 -0500 -+++ bacula-5.0.3/bacula-5.0.3/src/tools/Makefile.in 2010-08-11 14:10:52.998447849 -0500 -@@ -64,7 +64,7 @@ - - dbcheck: Makefile dbcheck.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) $(DIRCONFOBJS) - $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -L../cats -o $@ dbcheck.o $(DIRCONFOBJS) \ -- -lbacsql -lbaccfg -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) -+ -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 \ ---- bacula-5.0.3/bacula-5.0.3/src/tools/Makefile.in~ 2010-08-11 14:13:51.000000000 -0500 -+++ bacula-5.0.3/bacula-5.0.3/src/tools/Makefile.in 2010-08-11 15:11:00.309447155 -0500 -@@ -97,7 +97,7 @@ - - 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) bbatch.o - $(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L../cats -L. -L../lib -o $@ bbatch.o \ ---- bacula-5.0.3/bacula-5.0.3/src/tools/Makefile.in~ 2010-08-12 06:57:25.000000000 -0500 -+++ bacula-5.0.3/bacula-5.0.3/src/tools/Makefile.in 2010-08-12 07:58:13.545781384 -0500 -@@ -93,7 +93,7 @@ - - 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 \ ---- bacula-5.0.3/bacula-5.0.3/src/stored/Makefile.in~ 2010-08-05 09:29:51.000000000 -0500 -+++ bacula-5.0.3/bacula-5.0.3/src/stored/Makefile.in 2010-08-12 08:56:11.053777811 -0500 -@@ -91,7 +91,7 @@ - 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) $(FDLIBS) \ -- -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) ---- bacula-5.0.3/bacula-5.0.3/src/stored/Makefile.in~ 2010-08-12 08:59:17.000000000 -0500 -+++ bacula-5.0.3/bacula-5.0.3/src/stored/Makefile.in 2010-08-12 10:24:42.478529732 -0500 -@@ -117,7 +117,7 @@ - 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 $<" ---- bacula-5.0.3/bacula-5.0.3/src/stored/Makefile.in~ 2010-08-12 10:27:36.000000000 -0500 -+++ bacula-5.0.3/bacula-5.0.3/src/stored/Makefile.in 2010-08-12 11:45:39.904529074 -0500 -@@ -127,7 +127,7 @@ - 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) $(FDLIBS) \ -- -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 $<" ---- bacula-5.0.3/bacula-5.0.3/src/stored/Makefile.in~ 2010-08-12 11:48:22.000000000 -0500 -+++ bacula-5.0.3/bacula-5.0.3/src/stored/Makefile.in 2010-08-12 13:21:02.246528324 -0500 -@@ -136,7 +136,7 @@ - - bscan: Makefile $(SCNOBJS) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) - $(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SCNOBJS) \ -- -lbacsql $(DB_LIBS) $(FDLIBS) -lbacfind -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) -+ -lbacsql $(DB_LIBS) $(FDLIBS) -lbacfind -lbaccfg -lbac -lm -lz $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) - - bcopy.o: bcopy.c - @echo "Compiling $<" ---- bacula-5.0.3/bacula-5.0.3/src/stored/Makefile.in~ 2010-08-12 13:23:58.000000000 -0500 -+++ bacula-5.0.3/bacula-5.0.3/src/stored/Makefile.in 2010-08-12 14:31:11.204777284 -0500 -@@ -107,7 +107,7 @@ - - btape: Makefile $(TAPEOBJS) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) - $(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../cats -o $@ $(TAPEOBJS) \ -- -lbacsql -lbaccfg -lbac $(DLIB) -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) -+ -lbacsql -lbaccfg -lbac $(DLIB) -lm -lz $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) - - bls.o: bls.c - @echo "Compiling $<" ---- bacula-5.0.3/bacula-5.0.3/src/stored/Makefile.in~ 2010-08-13 07:02:47.000000000 -0500 -+++ bacula-5.0.3/bacula-5.0.3/src/stored/Makefile.in 2010-08-13 08:25:50.830920608 -0500 -@@ -145,7 +145,7 @@ - - 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) \ ---- bacula-5.0.3/bacula-5.0.3/src/dird/Makefile.in~ 2010-08-05 09:29:51.000000000 -0500 -+++ bacula-5.0.3/bacula-5.0.3/src/dird/Makefile.in 2010-08-13 09:25:38.855168511 -0500 -@@ -64,7 +64,7 @@ - bacula-dir: Makefile $(SVROBJS) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(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 -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(DLIB) $(DB_LIBS) $(LIBS) \ -+ -lbacfind -lbacsql -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) ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ---- bacula-5.0.3/bacula-5.0.3/src/console/Makefile.in~ 2010-08-05 09:29:51.000000000 -0500 -+++ bacula-5.0.3/bacula-5.0.3/src/console/Makefile.in 2010-08-13 10:26:18.001169569 -0500 -@@ -48,7 +48,7 @@ - - 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) ---- bacula-5.0.3/bacula-5.0.3/src/wx-console/Makefile.in~ 2010-08-05 09:29:51.000000000 -0500 -+++ bacula-5.0.3/bacula-5.0.3/src/wx-console/Makefile.in 2010-08-13 11:28:43.829917394 -0500 -@@ -83,7 +83,7 @@ - - bwx-console: Makefile $(CONSOBJS) @WIN32@ ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) - $(LIBTOOL_LINK) $(CXX) $(CONSOBJS) $(WIN32RES) -o $@ -L../lib $(CONS_LDFLAGS) \ -- -lbaccfg -lbac $(LIBS) $(OPENSSL_LIBS) -+ -lbaccfg -lbac -lz $(LIBS) $(OPENSSL_LIBS) - - win32: bwx-console_private.res - ---- bacula-5.0.3/bacula-5.0.3/src/tray-monitor/Makefile.in~ 2010-08-05 09:29:51.000000000 -0500 -+++ bacula-5.0.3/bacula-5.0.3/src/tray-monitor/Makefile.in 2010-08-13 12:34:18.573918720 -0500 -@@ -45,7 +45,7 @@ - - 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.0.3-nagios-ent-fd.patch b/bacula-5.0.3-nagios-ent-fd.patch new file mode 100644 index 0000000..b3ad2af --- /dev/null +++ b/bacula-5.0.3-nagios-ent-fd.patch @@ -0,0 +1,36 @@ +diff -Naur bacula-5.0.3.old/examples/nagios/check_bacula/authenticate.c bacula-5.0.3/examples/nagios/check_bacula/authenticate.c +--- bacula-5.0.3.old/examples/nagios/check_bacula/authenticate.c 2011-12-23 14:16:46.510066504 +0100 ++++ bacula-5.0.3/examples/nagios/check_bacula/authenticate.c 2011-12-23 14:17:16.562632437 +0100 +@@ -57,9 +57,7 @@ + /* Response from SD */ + static char SDOKhello[] = "3000 OK Hello\n"; + /* Response from FD */ +-static char FDOKhello[] = "2000 OK Hello\n"; +-static char FD3OKhello[] = "2000 OK Hello 1\n"; +-static char FD31OKhello[] = "2000 OK Hello 2\n"; ++static char FDOKhello[] = "2000 OK Hello"; + + /* Forward referenced functions */ + +@@ -171,9 +169,7 @@ + } + Dmsg1(110, "msg); + stop_bsock_timer(tid); +- if ((strncmp(fd->msg, FDOKhello, sizeof(FDOKhello)) != 0) && +- (strncmp(fd->msg, FD3OKhello, sizeof(FD3OKhello)) != 0) && +- (strncmp(fd->msg, FD31OKhello, sizeof(FD31OKhello)) != 0) ) { ++ if ((strncmp(fd->msg, FDOKhello, strlen(FDOKhello)) != 0)) { + return 0; + } + return 1; +diff -Naur bacula-5.0.3.old/examples/nagios/check_bacula/check_bacula.c bacula-5.0.3/examples/nagios/check_bacula/check_bacula.c +--- bacula-5.0.3.old/examples/nagios/check_bacula/check_bacula.c 2011-12-23 14:16:46.510066504 +0100 ++++ bacula-5.0.3/examples/nagios/check_bacula/check_bacula.c 2011-12-23 14:17:23.122755977 +0100 +@@ -268,7 +268,7 @@ + + int stat; + char num; +- char *dname; ++ const char *dname; + + dname = ""; diff --git a/bacula.spec b/bacula.spec index 0ec3a77..a76b5c6 100644 --- a/bacula.spec +++ b/bacula.spec @@ -1,6 +1,8 @@ +%bcond_without fedora + Name: bacula Version: 5.0.3 -Release: 15%{?dist} +Release: 16%{?dist} Summary: Cross platform network backup for Linux, Unix, Mac and Windows # See LICENSE for details License: GPLv2 with exceptions @@ -28,17 +30,16 @@ Source16: bacula-dir.sysconfig Source17: bacula-sd.sysconfig Patch1: bacula-5.0.3-config.patch +Patch2: bacula-5.0.3-nagios-ent-fd.patch Patch3: bacula-5.0.3-pamd.patch -Patch14: bacula-5.0.1-dsolink.patch -Patch15: bacula-5.0.2-openssl.patch -Patch16: bacula-5.0.3-queryfile.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 +Patch4: bacula-5.0.2-openssl.patch +Patch5: bacula-5.0.3-queryfile.patch +Patch6: bacula-5.0.2-python27.patch +Patch7: bacula-5.0.3-log-path.patch +Patch8: bacula-5.0.3-sqlite-priv.patch +Patch9: bacula-5.0.3-tray-dir.patch +Patch10: bacula-5.0.3-mysql55.patch +Patch11: bacula-5.0.3-maxvalue.patch BuildRequires: openssl-devel, ncurses-devel, perl, glibc-devel BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel @@ -141,10 +142,17 @@ Requires: bacula-common = %{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, @@ -162,10 +170,17 @@ bacula-director-sqlite or bacula-director-postgresql. Summary: Bacula backup client Group: System Environment/Daemons Requires: bacula-common = %{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, @@ -181,10 +196,17 @@ Summary: Common Bacula storage daemon files Group: System Environment/Daemons Requires: bacula-storage = %{version}-%{release} Requires: bacula-common = %{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, @@ -272,7 +294,7 @@ different computers. It is based on a client/server architecture. This package contains the command-line management console for the bacula backup system. - +%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 %package console-bat Summary: Bacula bat console Group: System Environment/Daemons @@ -285,7 +307,7 @@ 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 - +%endif %package console-wxwidgets Summary: Bacula console using the wx widgets toolkit @@ -328,23 +350,30 @@ different computers. It is based on a client/server architecture. This package contains the documentation for most of the bacula-packages. +%package -n nagios-plugins-bacula +Summary: Nagios Plugin - check_bacula +Group: Applications/System + +%description -n nagios-plugins-bacula +Provides check_bacula support for Nagios. + + %prep %setup -q -c -n bacula-%{version} %setup -q -a 1 -D -T pushd bacula-%{version} %patch1 -p1 -b .config +%patch2 -p1 -b .nagios-ent-fd %patch3 -p1 -b .pamd -%patch14 -p2 -b .dsolink -%patch15 -p2 -b .openssl -%patch16 -p1 -b .queryfile -%patch17 -p0 -b .python27 -%patch18 -p2 -b .dsolink -%patch19 -p2 -b .log-path -%patch20 -p0 -b .priv -%patch21 -p2 -b .tray-dir -%patch22 -p0 -b .mysql55 -%patch23 -p1 -b .maxvalue +%patch4 -p2 -b .openssl +%patch5 -p1 -b .queryfile +%patch6 -p0 -b .python27 +%patch7 -p2 -b .log-path +%patch8 -p0 -b .priv +%patch9 -p2 -b .tray-dir +%patch10 -p0 -b .mysql55 +%patch11 -p1 -b .maxvalue # Remove execution permissions from files we're packaging as docs later on @@ -390,6 +419,7 @@ export CPPFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/ncurses" --with-smtp-host=localhost \ --with-subsys-dir=%{_localstatedir}/lock/subsys \ --with-pid-dir=%{_localstatedir}/run \ + --with-plugindir=%{_libdir}/bacula \ --disable-conio \ --enable-readline \ --enable-largefile \ @@ -398,7 +428,6 @@ export CPPFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/ncurses" --with-python \ --enable-smartalloc \ --with-x \ - --disable-libtool \ $* if test $? != 0; then @@ -407,23 +436,36 @@ if test $? != 0; then exit 1 fi +# 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 + %{__make} %{?_smp_mflags} NO_ECHO= } # Regen bat QT project file and build tools pushd bacula-base + %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 export QMAKE=/usr/bin/qmake-qt4 build \ --enable-bat \ --enable-bwx-console \ --enable-tray-monitor \ --enable-client-only - pushd src - pushd qt-console - /usr/bin/qmake-qt4 - make - popd + pushd src/qt-console + /usr/bin/qmake-qt4 + make + popd + %else + build \ + --disable-bat \ + --enable-bwx-console \ + --enable-tray-monitor \ + --enable-client-only + %endif + pushd examples/nagios/check_bacula + CFLAGS="%{optflags}" %{__make} LIBS="-lpthread -ldl -lssl -lcrypto -lz" popd popd @@ -471,28 +513,38 @@ rm -rf %{buildroot} pushd bacula-base make install DESTDIR=%{buildroot} - # Desktop Integration for the console apps and the traymonitor + + # install the nagios plugin + %{__mkdir_p} %{buildroot}%{_libdir}/nagios/plugins + %{__install} -m0755 examples/nagios/check_bacula/.libs/check_bacula %{buildroot}%{_libdir}/nagios/plugins/ + + # Desktop Integration mkdir -p %{buildroot}%{_bindir} install -m 644 -D scripts/bacula.png %{buildroot}%{_datadir}/pixmaps/bacula.png + + # bwxconsole install -m 644 -D src/wx-console/wxwin16x16.xpm %{buildroot}%{_datadir}/pixmaps/wxwin16x16.xpm install -m 644 -D scripts/wxconsole.pamd %{buildroot}%{_sysconfdir}/pam.d/bwxconsole install -m 644 -D %{SOURCE14} %{buildroot}%{_sysconfdir}/security/console.apps/bwxconsole - install -m 644 -D scripts/bgnome-console.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}/bwxconsole + desktop-file-install --vendor="fedora" --dir=%{buildroot}%{_datadir}/applications %{SOURCE10} + install -m 644 -D src/tray-monitor/generic.xpm %{buildroot}%{_datadir}/pixmaps/bacula-tray-monitor.xpm - install -m 644 -D src/qt-console/images/bat_icon.png %{buildroot}%{_datadir}/pixmaps/bat_icon.png install -m 644 -D scripts/bgnome-console.pamd %{buildroot}%{_sysconfdir}/pam.d/bacula-tray-monitor install -m 644 -D %{SOURCE13} %{buildroot}%{_sysconfdir}/security/console.apps/bacula-tray-monitor - install -m 644 -D src/qt-console/bat.conf %{buildroot}%{_sysconfdir}/bacula/bat.conf - - ln -sf consolehelper %{buildroot}%{_bindir}/bwxconsole - ln -sf consolehelper %{buildroot}%{_bindir}/bat ln -sf consolehelper %{buildroot}%{_bindir}/bacula-tray-monitor - install -m 755 src/qt-console/bat %{buildroot}%{_sbindir} - - desktop-file-install --vendor="fedora" --dir=%{buildroot}%{_datadir}/applications %{SOURCE10} desktop-file-install --vendor="fedora" --dir=%{buildroot}%{_datadir}/applications %{SOURCE11} + + %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 + install -m 644 -D src/qt-console/images/bat_icon.png %{buildroot}%{_datadir}/pixmaps/bat_icon.png + install -m 644 -D scripts/bgnome-console.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 %{SOURCE12} + + install -m 755 -D src/qt-console/.libs/bat %{buildroot}%{_sbindir} + install -m 644 -D src/qt-console/bat.conf %{buildroot}%{_sysconfdir}/bacula/bat.conf + %endif popd pushd bacula-sqlite @@ -558,12 +610,19 @@ install -m 755 -D bacula-base/scripts/logwatch/applybaculadate %{buildroot}%{_sy install -m 644 -D bacula-base/scripts/logwatch/logfile.bacula.conf %{buildroot}%{_sysconfdir}/logwatch/conf/logfiles/bacula.conf install -m 644 -D bacula-base/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 %{SOURCE3} %{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 @@ -594,6 +653,10 @@ find %{_builddir}/%{name}-%{version}/%{name}-docs-%{version}/manuals/en -name "* find %{_builddir}/%{name}-%{version}/%{name}-docs-%{version}/manuals/en -name "*.pl" -exec rm -f {} \; find %{_builddir}/%{name}-%{version}/%{name}-docs-%{version}/manuals/en -name "*.tex" -exec rm -f {} \; +# Remove local archives +rm -f %{buildroot}%{_libdir}/*.la + + %clean rm -rf %{buildroot} @@ -678,6 +741,8 @@ 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 @@ -768,48 +833,117 @@ 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}/README bacula-%{version}/SUPPORT bacula-%{version}/VERIFYING bacula-%{version}/ReleaseNotes %doc bacula-%{version}/examples/ %config(noreplace) %{_sysconfdir}/logrotate.d/bacula %dir %{_sysconfdir}/bacula %dir %{_libexecdir}/bacula +%{_libdir}/libbac-%{version}.so +%{_libdir}/libbac.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 +%{_sbindir}/bacula-checkconf %{_sbindir}/bsmtp %{_sbindir}/btraceback +%{_sbindir}/bacula +%{_libexecdir}/bacula/bacula_config %{_libexecdir}/bacula/btraceback.dbx %{_libexecdir}/bacula/btraceback.gdb +%{_libexecdir}/bacula/btraceback.mdb +%{_libexecdir}/bacula/mtx-changer.conf %{_mandir}/man1/bsmtp.1* %{_mandir}/man8/bacula.8* %{_mandir}/man8/btraceback.8* %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 -%{_sbindir}/bacula-checkconf %files client %defattr(-,root,root,-) -%{_sbindir}/bacula-fd -%{_unitdir}/bacula-fd.service %config(noreplace) %{_sysconfdir}/bacula/bacula-fd.conf %config(noreplace) %{_sysconfdir}/sysconfig/bacula-fd +%{_sbindir}/bacula-fd +%{_libdir}/bacula/bpipe-fd.so +%if 0%{?fedora} >= 15 || 0%{?rhel} > 6 +%{_unitdir}/bacula-fd.service +%else +%{_initrddir}/bacula-fd +%endif %{_mandir}/man8/bacula-fd.8* %files console %defattr(-,root,root,-) -%{_sbindir}/bconsole %attr(640,root,bacula) %config(noreplace) %{_sysconfdir}/bacula/bconsole.conf +%{_sbindir}/bconsole %{_mandir}/man8/bconsole.8* +%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 %files console-bat %defattr(-,root,root,-) %config %{_sysconfdir}/security/console.apps/bat @@ -821,6 +955,7 @@ fi %{_datadir}/applications/fedora-bacula-bat.desktop %{_datadir}/pixmaps/bat_icon.png %{_datadir}/pixmaps/bacula.png +%endif %files console-wxwidgets @@ -845,7 +980,11 @@ fi %config %{_sysconfdir}/logwatch/conf/services/bacula.conf %{_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}/bregex %{_sbindir}/bwild %{_mandir}/man8/dbcheck.8* @@ -913,13 +1052,17 @@ fi %files storage-common %defattr(-,root,root,-) +%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 %{_sbindir}/bacula-sd %{_sbindir}/bextract %{_sbindir}/bls %{_sbindir}/btape -%config(noreplace) %{_sysconfdir}/bacula/bacula-sd.conf -%config(noreplace) %{_sysconfdir}/sysconfig/bacula-sd -%{_unitdir}/bacula-sd.service %{_libexecdir}/bacula/disk-changer %{_libexecdir}/bacula/dvd-handler %{_libexecdir}/bacula/mtx-changer @@ -951,11 +1094,11 @@ fi %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 +%{_bindir}/bacula-tray-monitor +%{_sbindir}/bacula-tray-monitor %{_mandir}/man1/bacula-tray-monitor.1* %{_datadir}/applications/fedora-bacula-traymonitor.desktop %{_datadir}/pixmaps/bacula-tray-monitor.xpm @@ -977,7 +1120,17 @@ fi %doc bacula-docs-%{version}/manuals/en/misc/misc +%files -n nagios-plugins-bacula +%defattr(-,root,root) +%{_libdir}/nagios/plugins/check_bacula + + %changelog +* Fri Dec 23 2011 Simone Caronni - 5.0.3-16 +- Add Nagios plugin. +- Add conditionals for RHEL building (initscripts, bat). +- Enable libtool, bpipe-fd.so plugin and remove dsolink patches. + * Fri Dec 23 2011 Simone Caronni - 5.0.3-15 - Spec file cleanup. - Fix Buildrequires for RHEL.