diff --git a/bacula-7.2.0-git.patch b/bacula-7.2.0-git.patch deleted file mode 100644 index d63a9a7..0000000 --- a/bacula-7.2.0-git.patch +++ /dev/null @@ -1,1871 +0,0 @@ -diff --git a/bacula/autoconf/config.guess b/bacula/autoconf/config.guess -index b79252d..981c376 100755 ---- a/bacula/autoconf/config.guess -+++ b/bacula/autoconf/config.guess -@@ -1001,6 +1001,9 @@ EOF - ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} - exit ;; -+ ppc64el:Linux:*:*) -+ echo powerpc64le-unknown-linux-${LIBC} -+ exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; -diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in -index db86e4d..0843981 100644 ---- a/bacula/autoconf/configure.in -+++ b/bacula/autoconf/configure.in -@@ -2479,7 +2479,7 @@ if test x$support_lzo = xyes; then - AC_CHECK_HEADER(${with_lzo}/lzo/lzoconf.h, - [ - AC_DEFINE(HAVE_LZO, 1, [Define to 1 if you have LZO compression]) -- LZO_LIBS="${LZO_LDFLAGS} -lzo2" -+ LZO_LIBS="${LZO_LDFLAGS} -llzo2" - have_lzo="yes" - ], [ - echo " " -@@ -3294,6 +3294,8 @@ AC_OUTPUT([autoconf/Make.common \ - src/qt-console/bat.pro.mingw32 \ - src/qt-console/bat.pro.mingw64 \ - src/qt-console/install_conf_file \ -+ src/qt-console/tray-monitor/tray-monitor.conf \ -+ src/qt-console/tray-monitor/tray-monitor.pro \ - src/qt-console/tray-monitor/tray-monitor.pro.mingw32 \ - src/qt-console/tray-monitor/tray-monitor.pro.mingw64 \ - src/dird/Makefile \ -diff --git a/bacula/configure b/bacula/configure -index ba59ba1..e476645 100755 ---- a/bacula/configure -+++ b/bacula/configure -@@ -1,6 +1,6 @@ - #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. --# Generated by GNU Autoconf 2.69 for bacula 7.1.0. -+# Generated by GNU Autoconf 2.69 for bacula 7.2.0. - # - # - # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@@ -587,8 +587,8 @@ MAKEFLAGS= - # Identity of this package. - PACKAGE_NAME='bacula' - PACKAGE_TARNAME='bacula' --PACKAGE_VERSION='7.1.0' --PACKAGE_STRING='bacula 7.1.0' -+PACKAGE_VERSION='7.2.0' -+PACKAGE_STRING='bacula 7.2.0' - PACKAGE_BUGREPORT='' - PACKAGE_URL='' - -@@ -1562,7 +1562,7 @@ if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF --\`configure' configures bacula 7.1.0 to adapt to many kinds of systems. -+\`configure' configures bacula 7.2.0 to adapt to many kinds of systems. - - Usage: $0 [OPTION]... [VAR=VALUE]... - -@@ -1631,7 +1631,7 @@ fi - - if test -n "$ac_init_help"; then - case $ac_init_help in -- short | recursive ) echo "Configuration of bacula 7.1.0:";; -+ short | recursive ) echo "Configuration of bacula 7.2.0:";; - esac - cat <<\_ACEOF - -@@ -1826,7 +1826,7 @@ fi - test -n "$ac_init_help" && exit $ac_status - if $ac_init_version; then - cat <<\_ACEOF --bacula configure 7.1.0 -+bacula configure 7.2.0 - generated by GNU Autoconf 2.69 - - Copyright (C) 2012 Free Software Foundation, Inc. -@@ -2761,7 +2761,7 @@ cat >config.log <<_ACEOF - This file contains any messages produced by compilers while - running configure, to aid debugging if configure makes a mistake. - --It was created by bacula $as_me 7.1.0, which was -+It was created by bacula $as_me 7.2.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ -@@ -29417,7 +29417,7 @@ if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - - $as_echo "#define HAVE_LZO 1" >>confdefs.h - -- LZO_LIBS="${LZO_LDFLAGS} -lzo2" -+ LZO_LIBS="${LZO_LDFLAGS} -llzo2" - have_lzo="yes" - - else -@@ -30881,7 +30881,7 @@ if test "x${subsysdir}" = "x${sbindir}" ; then - fi - - --ac_config_files="$ac_config_files autoconf/Make.common Makefile manpages/Makefile scripts/btraceback scripts/bconsole scripts/bacula scripts/bacula-ctl-dir scripts/bacula-ctl-fd scripts/bacula-ctl-sd scripts/devel_bacula scripts/Makefile scripts/logrotate scripts/mtx-changer scripts/disk-changer scripts/dvd-handler scripts/dvd-simulator scripts/logwatch/Makefile scripts/logwatch/logfile.bacula.conf scripts/bat.desktop scripts/bat.desktop.xsu scripts/bat.desktop.consolehelper scripts/bat.console_apps src/Makefile src/host.h src/console/Makefile src/console/bconsole.conf src/qt-console/bat.conf src/qt-console/bat.pro src/qt-console/bat.pro.mingw32 src/qt-console/bat.pro.mingw64 src/qt-console/install_conf_file src/qt-console/tray-monitor/tray-monitor.pro.mingw32 src/qt-console/tray-monitor/tray-monitor.pro.mingw64 src/dird/Makefile src/dird/bacula-dir.conf src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile src/filed/bacula-fd.conf src/cats/Makefile src/cats/make_catalog_backup.pl src/cats/make_catalog_backup src/cats/delete_catalog_backup src/cats/create_postgresql_database src/cats/update_postgresql_tables src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges src/cats/drop_postgresql_tables src/cats/drop_postgresql_database src/cats/create_mysql_database src/cats/update_mysql_tables src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables src/cats/drop_mysql_database src/cats/create_sqlite3_database src/cats/update_sqlite3_tables src/cats/make_sqlite3_tables src/cats/grant_sqlite3_privileges src/cats/drop_sqlite3_tables src/cats/drop_sqlite3_database src/cats/sqlite src/cats/mysql src/cats/create_bacula_database src/cats/update_bacula_tables src/cats/grant_bacula_privileges src/cats/make_bacula_tables src/cats/drop_bacula_tables src/cats/drop_bacula_database src/cats/install-default-backend src/findlib/Makefile src/tools/Makefile src/plugins/fd/Makefile src/plugins/sd/Makefile src/plugins/dir/Makefile po/Makefile.in updatedb/update_mysql_tables updatedb/update_sqlite3_tables updatedb/update_postgresql_tables updatedb/update_mysql_tables_9_to_10 updatedb/update_sqlite3_tables_9_to_10 updatedb/update_postgresql_tables_9_to_10 updatedb/update_mysql_tables_10_to_11 updatedb/update_sqlite3_tables_10_to_11 updatedb/update_postgresql_tables_10_to_11 updatedb/update_mysql_tables_11_to_12 updatedb/update_sqlite3_tables_11_to_12 updatedb/update_postgresql_tables_11_to_12 updatedb/update_mysql_tables_12_to_13 updatedb/update_postgresql_tables_12_to_13 updatedb/update_mysql_tables_13_to_14 updatedb/update_postgresql_tables_13_to_14 examples/nagios/check_bacula/Makefile platforms/rpms/redhat/bacula.spec platforms/rpms/redhat/bacula-bat.spec platforms/rpms/redhat/bacula-docs.spec platforms/rpms/redhat/bacula-mtx.spec platforms/rpms/suse/bacula.spec platforms/rpms/suse/bacula-bat.spec platforms/rpms/suse/bacula-docs.spec platforms/rpms/suse/bacula-mtx.spec $PFILES" -+ac_config_files="$ac_config_files autoconf/Make.common Makefile manpages/Makefile scripts/btraceback scripts/bconsole scripts/bacula scripts/bacula-ctl-dir scripts/bacula-ctl-fd scripts/bacula-ctl-sd scripts/devel_bacula scripts/Makefile scripts/logrotate scripts/mtx-changer scripts/disk-changer scripts/dvd-handler scripts/dvd-simulator scripts/logwatch/Makefile scripts/logwatch/logfile.bacula.conf scripts/bat.desktop scripts/bat.desktop.xsu scripts/bat.desktop.consolehelper scripts/bat.console_apps src/Makefile src/host.h src/console/Makefile src/console/bconsole.conf src/qt-console/bat.conf src/qt-console/bat.pro src/qt-console/bat.pro.mingw32 src/qt-console/bat.pro.mingw64 src/qt-console/install_conf_file src/qt-console/tray-monitor/tray-monitor.conf src/qt-console/tray-monitor/tray-monitor.pro src/qt-console/tray-monitor/tray-monitor.pro.mingw32 src/qt-console/tray-monitor/tray-monitor.pro.mingw64 src/dird/Makefile src/dird/bacula-dir.conf src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile src/filed/bacula-fd.conf src/cats/Makefile src/cats/make_catalog_backup.pl src/cats/make_catalog_backup src/cats/delete_catalog_backup src/cats/create_postgresql_database src/cats/update_postgresql_tables src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges src/cats/drop_postgresql_tables src/cats/drop_postgresql_database src/cats/create_mysql_database src/cats/update_mysql_tables src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables src/cats/drop_mysql_database src/cats/create_sqlite3_database src/cats/update_sqlite3_tables src/cats/make_sqlite3_tables src/cats/grant_sqlite3_privileges src/cats/drop_sqlite3_tables src/cats/drop_sqlite3_database src/cats/sqlite src/cats/mysql src/cats/create_bacula_database src/cats/update_bacula_tables src/cats/grant_bacula_privileges src/cats/make_bacula_tables src/cats/drop_bacula_tables src/cats/drop_bacula_database src/cats/install-default-backend src/findlib/Makefile src/tools/Makefile src/plugins/fd/Makefile src/plugins/sd/Makefile src/plugins/dir/Makefile po/Makefile.in updatedb/update_mysql_tables updatedb/update_sqlite3_tables updatedb/update_postgresql_tables updatedb/update_mysql_tables_9_to_10 updatedb/update_sqlite3_tables_9_to_10 updatedb/update_postgresql_tables_9_to_10 updatedb/update_mysql_tables_10_to_11 updatedb/update_sqlite3_tables_10_to_11 updatedb/update_postgresql_tables_10_to_11 updatedb/update_mysql_tables_11_to_12 updatedb/update_sqlite3_tables_11_to_12 updatedb/update_postgresql_tables_11_to_12 updatedb/update_mysql_tables_12_to_13 updatedb/update_postgresql_tables_12_to_13 updatedb/update_mysql_tables_13_to_14 updatedb/update_postgresql_tables_13_to_14 examples/nagios/check_bacula/Makefile platforms/rpms/redhat/bacula.spec platforms/rpms/redhat/bacula-bat.spec platforms/rpms/redhat/bacula-docs.spec platforms/rpms/redhat/bacula-mtx.spec platforms/rpms/suse/bacula.spec platforms/rpms/suse/bacula-bat.spec platforms/rpms/suse/bacula-docs.spec platforms/rpms/suse/bacula-mtx.spec $PFILES" - - ac_config_commands="$ac_config_commands default" - -@@ -31392,7 +31392,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - # report actual input values of CONFIG_FILES etc. instead of their - # values after options handling. - ac_log=" --This file was extended by bacula $as_me 7.1.0, which was -+This file was extended by bacula $as_me 7.2.0, which was - generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES -@@ -31458,7 +31458,7 @@ _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" - ac_cs_version="\\ --bacula config.status 7.1.0 -+bacula config.status 7.2.0 - configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -@@ -32001,6 +32001,8 @@ do - "src/qt-console/bat.pro.mingw32") CONFIG_FILES="$CONFIG_FILES src/qt-console/bat.pro.mingw32" ;; - "src/qt-console/bat.pro.mingw64") CONFIG_FILES="$CONFIG_FILES src/qt-console/bat.pro.mingw64" ;; - "src/qt-console/install_conf_file") CONFIG_FILES="$CONFIG_FILES src/qt-console/install_conf_file" ;; -+ "src/qt-console/tray-monitor/tray-monitor.conf") CONFIG_FILES="$CONFIG_FILES src/qt-console/tray-monitor/tray-monitor.conf" ;; -+ "src/qt-console/tray-monitor/tray-monitor.pro") CONFIG_FILES="$CONFIG_FILES src/qt-console/tray-monitor/tray-monitor.pro" ;; - "src/qt-console/tray-monitor/tray-monitor.pro.mingw32") CONFIG_FILES="$CONFIG_FILES src/qt-console/tray-monitor/tray-monitor.pro.mingw32" ;; - "src/qt-console/tray-monitor/tray-monitor.pro.mingw64") CONFIG_FILES="$CONFIG_FILES src/qt-console/tray-monitor/tray-monitor.pro.mingw64" ;; - "src/dird/Makefile") CONFIG_FILES="$CONFIG_FILES src/dird/Makefile" ;; -diff --git a/bacula/examples/devices/DVD.conf b/bacula/examples/devices/DVD.conf -deleted file mode 100644 -index 8c6552a..0000000 ---- a/bacula/examples/devices/DVD.conf -+++ /dev/null -@@ -1,22 +0,0 @@ --# --# A DVD device --# --Device { -- Name = "DVD Writer" -- Media Type = DVD -- Device Type = DVD -- Archive Device = /dev/hdc -- LabelMedia = yes; # lets Bacula label unlabeled media -- Random Access = Yes; -- AutomaticMount = yes; # when device opened, read it -- RemovableMedia = yes; -- AlwaysOpen = no; -- MaximumPartSize = 800M; -- RequiresMount = yes; -- MountPoint = /mnt/cdrom; -- MountCommand = "/bin/mount -t iso9660 -o ro %a %m"; -- UnmountCommand = "/bin/umount %m"; -- SpoolDirectory = /tmp/backup; -- WritePartCommand = "@scriptdir@/dvd-handler %a write %e %v" -- FreeSpaceCommand = "@scriptdir@/dvd-handler %a free" --} -diff --git a/bacula/manpages/Makefile.in b/bacula/manpages/Makefile.in -index e4d107a..db38f64 100644 ---- a/bacula/manpages/Makefile.in -+++ b/bacula/manpages/Makefile.in -@@ -8,7 +8,7 @@ - - MAN8 = bacula.8 bacula-dir.8 bacula-fd.8 bacula-sd.8 \ - bconsole.8 bcopy.8 bextract.8 bls.8 bscan.8 btape.8 \ -- btraceback.8 dbcheck.8 bwild.8 bregex.8 bpluginfo.8 -+ btraceback.8 dbcheck.8 bwild.8 bregex.8 - - MAN1 = bsmtp.1 bat.1 - -diff --git a/bacula/manpages/bconsole.8 b/bacula/manpages/bconsole.8 -index 7bce096..478f02c 100644 ---- a/bacula/manpages/bconsole.8 -+++ b/bacula/manpages/bconsole.8 -@@ -39,7 +39,7 @@ No conio (for scripting). - .B \-s - No signals (for debugging). - .TP --.b \-u\ nn -+.B \-u\ nn - Set command execution timeout to \fInn\fP seconds. - .TP - .B \-t -diff --git a/bacula/platforms/rpms/redhat/bacula.spec.in b/bacula/platforms/rpms/redhat/bacula.spec.in -index 8f59a8f..5d3c231 100644 ---- a/bacula/platforms/rpms/redhat/bacula.spec.in -+++ b/bacula/platforms/rpms/redhat/bacula.spec.in -@@ -65,6 +65,8 @@ - %define log_dir %_libdir/bacula/log - %endif - -+%define systemd_dir /lib/systemd/system -+ - # Daemon user:group Don't change them unless you know what you are doing - %define director_daemon_user bacula - %define storage_daemon_user bacula -@@ -75,7 +77,7 @@ - - %define depkgs ../depkgs - --# probems with mandriva build: -+# problems with mandriva build: - # nothing provides libbonobo2_0-devel, nothing provides libbonoboui2_0-devel - - #-------------------------------------------------------------------------- -@@ -142,6 +144,8 @@ Source2: Release_Notes-%{version}-%{release}.tar.gz - %{?build_fc17:%define fc17 1} - %define fc18 0 - %{?build_fc18:%define fc18 1} -+%define fc22 0 -+%{?build_fc22:%define fc22 1} - # Whitebox Enterprise build - %define wb3 0 - %{?build_wb3:%define wb3 1} -@@ -162,6 +166,9 @@ Source2: Release_Notes-%{version}-%{release}.tar.gz - %define rhel6 0 - %{?build_rhel6:%define rhel6 1} - %{?build_el6:%define rhel6 1} -+%define rhel7 0 -+%{?build_rhel7:%define rhel7 1} -+%{?build_el7:%define rhel7 1} - # CentOS build - %define centos3 0 - %{?build_centos3:%define centos3 1} -@@ -199,6 +206,8 @@ Source2: Release_Notes-%{version}-%{release}.tar.gz - %{?build_su111:%define su111 1} - %define su112 0 - %{?build_su112:%define su112 1} -+%define su113 0 -+%{?build_su113:%define su113 1} - %define su120 0 - %{?build_su120:%define su120 1} - %define su131 0 -@@ -214,13 +223,29 @@ Source2: Release_Notes-%{version}-%{release}.tar.gz - %define client_only 0 - %{?build_client_only:%define client_only 1} - -+# if the platform is using systemd -+%define usesystemd 0 -+ -+%if %{rhel7} || %{fc22} -+%define usesystemd 1 -+%endif -+ -+# depending if we use systemd or not, we use chkconfig or systemctl -+%if %{usesystemd} -+%define service_enable systemctl enable -+%define service_disable systemctl disable -+%else -+%define service_enable /sbin/chkconfig --add -+%define service_disable /sbin/chkconfig --del -+%endif -+ - # Setup some short cuts - %define rhat 0 - %if %{rh7} || %{rh8} || %{rh9} - %define rhat 1 - %endif - %define fed 0 --%if %{fc16} || %{fc17} || %{fc18} -+%if %{fc16} || %{fc17} || %{fc18} || %{fc22} - %define fed 1 - %endif - %define suse 0 -@@ -228,7 +253,7 @@ Source2: Release_Notes-%{version}-%{release}.tar.gz - %define suse 1 - %endif - %define rhel 0 --%if %{rhel3} || %{rhel4} || %{rhel5} || %{rhel6} || %{centos3} || %{centos4} || %{centos5} || %{centos6} -+%if %{rhel3} || %{rhel4} || %{rhel5} || %{rhel6} || %{rhel7} || %{centos3} || %{centos4} || %{centos5} || %{centos6} - %define rhel 1 - %endif - %define scil 0 -@@ -283,7 +308,7 @@ exit 1 - %{?build_x86_64:%define x86_64 1} - - # check what distribution we are --%if %{fc16} || %{fc17} || %{fc18} -+%if %{fc16} || %{fc17} || %{fc18} || %{fc22} - %define _dist %(grep Fedora /etc/redhat-release) - %endif - %if %{centos5} || %{centos4} || %{centos3} -@@ -361,6 +386,7 @@ BuildRequires: libstdc++-devel, zlib-devel - BuildRequires: openssl-devel - BuildRequires: libacl-devel - BuildRequires: pkgconfig -+BuildRequires: bzip2-devel - %if ! %{rh7} - BuildRequires: libxml2-devel - %endif -@@ -486,7 +512,7 @@ Provides: %{product} - Provides: %{product}-libs - %endif - --Requires: libstdc++, zlib, openssl -+Requires: libstdc++, zlib, openssl, bzip2-libs - Requires: glibc, readline, %{name}-libs - - %if %{python} -@@ -656,6 +682,9 @@ export BACULA="Bacula" - %if %{rh7} || %{rh8} || %{rh9} - --disable-batch-insert \ - %endif -+%if %{usesystemd} -+ --with-systemd=%{systemd_dir} \ -+%endif - --with-tcp-wrappers \ - --with-dir-user=%{director_daemon_user} \ - --with-dir-group=%{daemon_group} \ -@@ -696,10 +725,22 @@ mkdir -p $RPM_BUILD_ROOT%{sqlite_bindir} - - make DESTDIR=$RPM_BUILD_ROOT install - -+# bsnapshot -+make DESTDIR=$RPM_BUILD_ROOT -C ../bacula-%{_version}/src/tools/ install-bsnapshot -+ -+%if %{usesystemd} -+make DESTDIR=$RPM_BUILD_ROOT -C platforms/systemd install-dir install-service -+%endif -+ - # Remove docs for programs that are depreciated - rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext} - rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext} -+rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext} - rm -f $RPM_BUILD_ROOT%{script_dir}/gconsole -+ -+# Remove docs for programs only included in bee -+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bpluginfo.8.%{manpage_ext} -+ - # Storage-ctl packaged in shstore rpm - rm -f $RPM_BUILD_ROOT%{script_dir}/storage-ctl - rm -f $RPM_BUILD_ROOT%{script_dir}/storage-ctl.conf -@@ -718,25 +759,32 @@ rm -f $RPM_BUILD_ROOT%{script_dir}/stopmysql - %endif - - # install the init scripts -+%if !%{usesystemd} - %if %{suse} - cp -p platforms/suse/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir - cp -p platforms/suse/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd - cp -p platforms/suse/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd --%endif -+%endif # suse - %if %{mdk} - cp -p platforms/mandrake/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir - cp -p platforms/mandrake/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd - cp -p platforms/mandrake/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd --%endif -+%endif # mdk - %if ! %{suse} && ! %{mdk} - cp -p platforms/redhat/bacula-dir $RPM_BUILD_ROOT/etc/init.d/bacula-dir - cp -p platforms/redhat/bacula-fd $RPM_BUILD_ROOT/etc/init.d/bacula-fd - cp -p platforms/redhat/bacula-sd $RPM_BUILD_ROOT/etc/init.d/bacula-sd --%endif -+%endif # !suse && !mdk - chmod 0754 $RPM_BUILD_ROOT/etc/init.d/* -+%endif # ! usesystemd -+ - %if %{client_only} - rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-dir - rm -f $RPM_BUILD_ROOT/etc/init.d/bacula-sd -+rm -f $RPM_BUILD_ROOT%{script_dir}/breload -+rm -f $RPM_BUILD_ROOT%{script_dir}/manual_prune.pl -+rm -f $RPM_BUILD_ROOT%{systemd_dir}/bacula-dir.service -+rm -f $RPM_BUILD_ROOT%{systemd_dir}/bacula-sd.service - %endif - - # install sqlite -@@ -756,6 +804,8 @@ cp -p updatedb/* $RPM_BUILD_ROOT%{script_dir}/updatedb/ - # install specific scripts - - # install special upgrade script, except for sqlite3 -+%if ! %{sqlite} -+%endif - - %if ! %{client_only} - # install the sample-query.sql file -@@ -789,7 +839,6 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.%{manpage_ext} - rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bregex.8.%{manpage_ext} - rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bwild.8.%{manpage_ext} - rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bsmtp.1.%{manpage_ext} --rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bpluginfo.8.gz - rm -f $RPM_BUILD_ROOT%{script_dir}/bacula - rm -f $RPM_BUILD_ROOT%{script_dir}/bacula_config - rm -f $RPM_BUILD_ROOT%{script_dir}/bacula-ctl-dir -@@ -803,7 +852,6 @@ rm -rf $RPM_BUILD_ROOT%{script_dir}/updatedb - rm -f $RPM_BUILD_ROOT%{script_dir}/bconsole - rm -f $RPM_BUILD_ROOT%{script_dir}/mtx-changer.conf - rm -f $RPM_BUILD_ROOT%{_sbindir}/bacula --rm -f $RPM_BUILD_ROOT%{_sbindir}/bpluginfo - - %endif - -@@ -887,15 +935,24 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt - %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd - %attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-sd - %attr(-, root, %{daemon_group}) %{plugin_dir}/bpipe-fd.so --%attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir --%attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd -+#%attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir -+#%attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd - %attr(-, root, %{daemon_group}) %{_sbindir}/dbcheck --%attr(-, root, %{daemon_group}) %{_sbindir}/bpluginfo - %attr(-, root, %{storage_daemon_group}) %{script_dir}/dvd-handler --%attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd -+#%attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd - %attr(-, root, %{storage_daemon_group}) %{script_dir}/mtx-changer - %attr(-, root, %{storage_daemon_group}) %config(noreplace) %{script_dir}/mtx-changer.conf - -+%if %{usesystemd} -+%attr(-, root, %{daemon_group}) %{systemd_dir}/bacula-dir.service -+%attr(-, root, %{daemon_group}) %{systemd_dir}/bacula-fd.service -+%attr(-, root, %{daemon_group}) %{systemd_dir}/bacula-sd.service -+%else -+%attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir -+%attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd -+%attr(-, root, %{storage_daemon_group}) /etc/init.d/bacula-sd -+%endif -+ - /etc/logrotate.d/bacula - %{logwatch_dir}/scripts/services/bacula - %{logwatch_dir}/scripts/shared/applybaculadate -@@ -917,6 +974,8 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt - %attr(-, root, %{daemon_group}) %{_sbindir}/bscan - %attr(-, root, %{daemon_group}) %{_sbindir}/btape - -+%attr(755, root, root) %{_sbindir}/bsnapshot -+ - %{_sbindir}/bacula-fd - %{_sbindir}/bacula - %{_sbindir}/bcopy -@@ -940,7 +999,6 @@ rm -f $RPM_BUILD_DIR/Release_Notes-%{version}-%{release}.txt - %{_mandir}/man8/bwild.8.%{manpage_ext} - %{_mandir}/man1/bsmtp.1.%{manpage_ext} - %{_mandir}/man1/bat.1.%{manpage_ext} --%{_mandir}/man8/bpluginfo.8.gz - - %_prefix/share/doc/* - -@@ -1079,14 +1137,14 @@ fi - # add our links - if [ "$1" -ge 1 ] ; then - %if %{suse} && %{mysql} -- /sbin/chkconfig --add mysql -+ %{service_enable} mysql - %endif - %if %{suse} && %{postgresql} -- /sbin/chkconfig --add postgresql -+ %{service_enable} postgresql - %endif -- /sbin/chkconfig --add bacula-dir -- /sbin/chkconfig --add bacula-fd -- /sbin/chkconfig --add bacula-sd -+ %{service_enable} bacula-dir -+ %{service_enable} bacula-fd -+ %{service_enable} bacula-sd - fi - %endif - -@@ -1103,6 +1161,9 @@ if [ -d %{sysconf_dir} ]; then - done - fi - host=`hostname -s` -+ if [ "$host" = "" ]; then -+ host=localhost -+ fi - for file in *.conf; do - sed -f .rpm.sed $file > $file.new - sed "s@XXX_HOSTNAME_XXX@${host}@g" $file.new > $file -@@ -1212,6 +1273,9 @@ if [ -d %{sysconf_dir} ]; then - done - fi - host=`hostname -s` -+ if [ "$host" = "" ]; then -+ host=localhost -+ fi - for file in *.conf; do - sed -f .rpm.sed $file > $file.new - sed "s@XXX_HOSTNAME_XXX@${host}@g" $file.new > $file -@@ -1234,9 +1298,9 @@ fi - %if ! %{client_only} - # delete our links - if [ $1 = 0 ]; then -- /sbin/chkconfig --del bacula-dir -- /sbin/chkconfig --del bacula-fd -- /sbin/chkconfig --del bacula-sd -+ %{service_disable} bacula-dir -+ %{service_disable} bacula-fd -+ %{service_disable} bacula-sd - fi - %endif - -@@ -1246,8 +1310,17 @@ fi - %attr(-, root, %{daemon_group}) %dir %{plugin_dir} - #%attr(-, root, %{daemon_group}) %dir %{log_dir} - %attr(-, root, %{daemon_group}) %dir %{sysconf_dir} -+ -+# SD/DIR might write here -+%attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{log_dir} -+#%attr(-, root, %{daemon_group}) %{script_dir}/bacula-ctl-fd -+ -+%if %{usesystemd} -+%attr(-, root, %{daemon_group}) %{systemd_dir}/bacula-fd.service -+%else - %{script_dir}/bacula-ctl-fd - /etc/init.d/bacula-fd -+%endif - - /etc/logrotate.d/bacula - -@@ -1295,7 +1368,7 @@ fi - %post client - # add our link - if [ "$1" -ge 1 ] ; then -- /sbin/chkconfig --add bacula-fd -+ %{service_enable} bacula-fd - fi - - if [ -d %{sysconf_dir} ]; then -@@ -1311,6 +1384,9 @@ if [ -d %{sysconf_dir} ]; then - done - fi - host=`hostname -s` -+ if [ "$host" = "" ]; then -+ host=localhost -+ fi - for file in *.conf; do - sed -f .rpm.sed $file > $file.new - sed "s@XXX_HOSTNAME_XXX@${host}@g" $file.new > $file -@@ -1321,7 +1397,7 @@ fi - %preun client - # delete our link - if [ $1 = 0 ]; then -- /sbin/chkconfig --del bacula-fd -+ %{service_disable} bacula-fd - fi - - %files libs -diff --git a/bacula/platforms/systemd/Makefile.in b/bacula/platforms/systemd/Makefile.in -index 37c257d..2c3ddba 100644 ---- a/bacula/platforms/systemd/Makefile.in -+++ b/bacula/platforms/systemd/Makefile.in -@@ -21,55 +21,55 @@ nothing: - install: install-dir install-conf install-autostart - - install-dir: -- mkdir -p $(DESTDIR)/$(SYSTEMD_UNITDIR) $(DESTDIR)/$(SYSTEMD_TMPFILES) -+ mkdir -p $(DESTDIR)/$(SYSTEMD_UNITDIR) $(DESTDIR)/$(SYSTEMD_TMPFILES) - - install-conf: -- @$(INSTALL_PROGRAM) -m 644 bacula.conf $(DESTDIR)/$(SYSTEMD_TMPFILES)/bacula.conf -+ @$(INSTALL_PROGRAM) -m 644 bacula.conf $(DESTDIR)/$(SYSTEMD_TMPFILES)/bacula.conf - - install-autostart: install-autostart-fd install-autostart-sd install-autostart-dir - - install-service: -- @$(INSTALL_PROGRAM) -m 644 bacula-fd.service $(DESTDIR)/$(SYSTEMD_UNITDIR) -- @$(INSTALL_PROGRAM) -m 644 bacula-dir.service $(DESTDIR)/$(SYSTEMD_UNITDIR) -- @$(INSTALL_PROGRAM) -m 644 bacula-sd.service $(DESTDIR)/$(SYSTEMD_UNITDIR) -+ @$(INSTALL_PROGRAM) -m 644 bacula-fd.service $(DESTDIR)/$(SYSTEMD_UNITDIR) -+ @$(INSTALL_PROGRAM) -m 644 bacula-dir.service $(DESTDIR)/$(SYSTEMD_UNITDIR) -+ @$(INSTALL_PROGRAM) -m 644 bacula-sd.service $(DESTDIR)/$(SYSTEMD_UNITDIR) - - install-autostart-fd: -- @if test x$(DESTDIR) = x -a -f $(SYSTEMD_UNITDIR)/bacula-fd.service; then \ -- /bin/systemctl stop bacula-fd.service; \ -- /bin/systemctl disable bacula-fd.service; \ -- fi -- @$(INSTALL_PROGRAM) -m 644 bacula-fd.service $(DESTDIR)/$(SYSTEMD_UNITDIR)/bacula-fd.service -- # set symlinks for script at startup and shutdown -- @if test x$(DESTDIR) = x ; then \ -- /bin/systemctl enable bacula-fd.service; \ -- /bin/systemctl start bacula-fd.service; \ -- fi -+ @if test x$(DESTDIR) = x -a -f $(SYSTEMD_UNITDIR)/bacula-fd.service; then \ -+ /bin/systemctl stop bacula-fd.service; \ -+ /bin/systemctl disable bacula-fd.service; \ -+ fi -+ @$(INSTALL_PROGRAM) -m 644 bacula-fd.service $(DESTDIR)/$(SYSTEMD_UNITDIR)/bacula-fd.service -+ # set symlinks for script at startup and shutdown -+ @if test x$(DESTDIR) = x ; then \ -+ /bin/systemctl enable bacula-fd.service; \ -+ /bin/systemctl start bacula-fd.service; \ -+ fi - - - install-autostart-sd: -- @if test x$(DESTDIR) = x -a -f $(SYSTEMD_UNITDIR)/bacula-sd.service; then \ -- /bin/systemctl stop bacula-sd.service; \ -- /bin/systemctl disable bacula-sd.service; \ -- fi -- @$(INSTALL_PROGRAM) -m 644 bacula-sd.service $(DESTDIR)/$(SYSTEMD_UNITDIR)/bacula-sd.service -- # set symlinks for script at startup and shutdown -- @if test x$(DESTDIR) = x ; then \ -- /bin/systemctl enable bacula-sd.service; \ -- /bin/systemctl start bacula-sd.service; \ -- fi -+ @if test x$(DESTDIR) = x -a -f $(SYSTEMD_UNITDIR)/bacula-sd.service; then \ -+ /bin/systemctl stop bacula-sd.service; \ -+ /bin/systemctl disable bacula-sd.service; \ -+ fi -+ @$(INSTALL_PROGRAM) -m 644 bacula-sd.service $(DESTDIR)/$(SYSTEMD_UNITDIR)/bacula-sd.service -+ # set symlinks for script at startup and shutdown -+ @if test x$(DESTDIR) = x ; then \ -+ /bin/systemctl enable bacula-sd.service; \ -+ /bin/systemctl start bacula-sd.service; \ -+ fi - - - install-autostart-dir: -- @if test x$(DESTDIR) = x -a -f $(SYSTEMD_UNITDIR)/bacula-dir.service; then \ -- /bin/systemctl stop bacula-dir.service; \ -- /bin/systemctl disable bacula-dir.service; \ -- fi -- @$(INSTALL_PROGRAM) -m 644 bacula-dir.service $(DESTDIR)/$(SYSTEMD_UNITDIR)/bacula-dir.service -- # set symlinks for script at startup and shutdown -- @if test x$(DESTDIR) = x ; then \ -- /bin/systemctl enable bacula-dir.service; \ -- /bin/systemctl start bacula-dir.service; \ -- fi -+ @if test x$(DESTDIR) = x -a -f $(SYSTEMD_UNITDIR)/bacula-dir.service; then \ -+ /bin/systemctl stop bacula-dir.service; \ -+ /bin/systemctl disable bacula-dir.service; \ -+ fi -+ @$(INSTALL_PROGRAM) -m 644 bacula-dir.service $(DESTDIR)/$(SYSTEMD_UNITDIR)/bacula-dir.service -+ # set symlinks for script at startup and shutdown -+ @if test x$(DESTDIR) = x ; then \ -+ /bin/systemctl enable bacula-dir.service; \ -+ /bin/systemctl start bacula-dir.service; \ -+ fi - - - uninstall: uninstall-autostart uninstall-conf -@@ -77,37 +77,37 @@ uninstall: uninstall-autostart uninstall-conf - uninstall-autostart: uninstall-autostart-fd uninstall-autostart-sd uninstall-autostart-dir - - uninstall-autostart-fd: -- @if test x$(DESTDIR) = x -a -f $(SYSTEMD_UNITDIR)/bacula-fd.service; then \ -- /bin/systemctl stop bacula-fd.service; \ -- /bin/systemctl disable bacula-fd.service; \ -- fi -- @rm -f $(DESTDIR)$(SYSTEMD_UNITDIR)/bacula-fd.service -+ @if test x$(DESTDIR) = x -a -f $(SYSTEMD_UNITDIR)/bacula-fd.service; then \ -+ /bin/systemctl stop bacula-fd.service; \ -+ /bin/systemctl disable bacula-fd.service; \ -+ fi -+ @rm -f $(DESTDIR)$(SYSTEMD_UNITDIR)/bacula-fd.service - - - uninstall-autostart-sd: -- @if test x$(DESTDIR) = x -a -f $(SYSTEMD_UNITDIR)/bacula-sd.service; then \ -- /bin/systemctl stop bacula-fd.service; \ -- /bin/systemctl disable bacula-fd.service; \ -- fi -- @rm -f $(DESTDIR)$(SYSTEMD_UNITDIR)/bacula-sd.service -+ @if test x$(DESTDIR) = x -a -f $(SYSTEMD_UNITDIR)/bacula-sd.service; then \ -+ /bin/systemctl stop bacula-fd.service; \ -+ /bin/systemctl disable bacula-fd.service; \ -+ fi -+ @rm -f $(DESTDIR)$(SYSTEMD_UNITDIR)/bacula-sd.service - - uninstall-autostart-dir: -- @if test x$(DESTDIR) = x -a -f $(SYSTEMD)/bacula-dir.service; then \ -- /bin/systemctl stop bacula-dir.service; \ -- /bin/systemctl disable bacula-dir.service; \ -- fi -- @rm -f $(DESTDIR)$(SYSTEMD_UNITDIR)/bacula-dir.service -+ @if test x$(DESTDIR) = x -a -f $(SYSTEMD)/bacula-dir.service; then \ -+ /bin/systemctl stop bacula-dir.service; \ -+ /bin/systemctl disable bacula-dir.service; \ -+ fi -+ @rm -f $(DESTDIR)$(SYSTEMD_UNITDIR)/bacula-dir.service - - uninstall-conf: -- @rm -f $(DESTDIR)/$(SYSTEMD_TMPFILES)/bacula.conf -+ @rm -f $(DESTDIR)/$(SYSTEMD_TMPFILES)/bacula.conf - - clean: -- @rm -f 1 2 3 -+ @rm -f 1 2 3 - - distclean: clean -- @rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec -- @rm -f bacula.conf bacula-sd.service bacula-fd.service bacula-dir.service -+ @rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec -+ @rm -f bacula.conf bacula-sd.service bacula-fd.service bacula-dir.service - - devclean: clean -- @rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec -- @rm -f bacula.conf bacula-sd.service bacula-fd.service bacula-dir.service -+ @rm -f Makefile bacula-*.spec bacula.*.spec bacula.spec -+ @rm -f bacula.conf bacula-sd.service bacula-fd.service bacula-dir.service -diff --git a/bacula/src/cats/bvfs.c b/bacula/src/cats/bvfs.c -index d73a49b..1d4619d 100644 ---- a/bacula/src/cats/bvfs.c -+++ b/bacula/src/cats/bvfs.c -@@ -472,6 +472,7 @@ static int update_path_hierarchy_cache(JCR *jcr, - free(result); - } - -+ - if (mdb->bdb_get_type_index() == SQL_TYPE_SQLITE3) { - Mmsg(mdb->cmd, - "INSERT INTO PathVisibility (PathId, JobId) " -@@ -481,7 +482,19 @@ static int update_path_hierarchy_cache(JCR *jcr, - "AND h.PPathId NOT IN (SELECT PathId FROM PathVisibility WHERE JobId=%s)", - jobid, jobid, jobid ); - -- } else { -+ } else if (mdb->bdb_get_type_index() == SQL_TYPE_MYSQL) { -+ Mmsg(mdb->cmd, -+ "INSERT INTO PathVisibility (PathId, JobId) " -+ "SELECT a.PathId,%s " -+ "FROM ( " -+ "SELECT DISTINCT h.PPathId AS PathId " -+ "FROM PathHierarchy AS h " -+ "JOIN PathVisibility AS p ON (h.PathId=p.PathId) " -+ "WHERE p.JobId=%s) AS a " -+ "LEFT JOIN PathVisibility AS b ON (b.JobId=%s and a.PathId = b.PathId) " -+ "WHERE b.PathId IS NULL", jobid, jobid, jobid); -+ -+ } else { /* TODO: Test the MYSQL Query with PostgreSQL */ - Mmsg(mdb->cmd, - "INSERT INTO PathVisibility (PathId, JobId) " - "SELECT a.PathId,%s " -diff --git a/bacula/src/filed/acl.c b/bacula/src/filed/acl.c -index 8a63b6b..f8c3dd8 100644 ---- a/bacula/src/filed/acl.c -+++ b/bacula/src/filed/acl.c -@@ -927,7 +927,7 @@ static bacl_rtn_code generic_set_acl_on_os(JCR *jcr, - * Define the supported ACL streams for this OS - */ - static int os_access_acl_streams[1] = { -- STREAM_ACL_DARWIN_ACCESS_ACL -+ STREAM_ACL_DARWIN_ACCESS - }; - static int os_default_acl_streams[1] = { - -1 -@@ -956,7 +956,7 @@ static bacl_rtn_code darwin_backup_acl_streams(JCR *jcr, FF_PKT *ff_pkt) - #endif - - if (jcr->acl_ctx->content_length > 0) { -- return send_acl_stream(jcr, STREAM_ACL_DARWIN_ACCESS_ACL); -+ return send_acl_stream(jcr, STREAM_ACL_DARWIN_ACCESS); - } - return bacl_rtn_ok; - } -@@ -988,11 +988,11 @@ static bacl_rtn_code (*os_restore_acl_streams) - * Define the supported ACL streams for these OSes - */ - static int os_access_acl_streams[2] = { -- STREAM_ACL_FREEBSD_ACCESS_ACL, -- STREAM_ACL_FREEBSD_NFS4_ACL -+ STREAM_ACL_FREEBSD_ACCESS, -+ STREAM_ACL_FREEBSD_NFS4 - }; - static int os_default_acl_streams[1] = { -- STREAM_ACL_FREEBSD_DEFAULT_ACL -+ STREAM_ACL_FREEBSD_DEFAULT - }; - - static bacl_rtn_code freebsd_backup_acl_streams(JCR *jcr, FF_PKT *ff_pkt) -@@ -1065,7 +1065,7 @@ static bacl_rtn_code freebsd_backup_acl_streams(JCR *jcr, FF_PKT *ff_pkt) - return bacl_rtn_fatal; - - if (jcr->acl_ctx->content_length > 0) { -- if (send_acl_stream(jcr, STREAM_ACL_FREEBSD_NFS4_ACL) == bacl_rtn_fatal) -+ if (send_acl_stream(jcr, STREAM_ACL_FREEBSD_NFS4) == bacl_rtn_fatal) - return bacl_rtn_fatal; - } - break; -@@ -1077,7 +1077,7 @@ static bacl_rtn_code freebsd_backup_acl_streams(JCR *jcr, FF_PKT *ff_pkt) - return bacl_rtn_fatal; - - if (jcr->acl_ctx->content_length > 0) { -- if (send_acl_stream(jcr, STREAM_ACL_FREEBSD_ACCESS_ACL) == bacl_rtn_fatal) -+ if (send_acl_stream(jcr, STREAM_ACL_FREEBSD_ACCESS) == bacl_rtn_fatal) - return bacl_rtn_fatal; - } - -@@ -1088,7 +1088,7 @@ static bacl_rtn_code freebsd_backup_acl_streams(JCR *jcr, FF_PKT *ff_pkt) - if (generic_get_acl_from_os(jcr, BACL_TYPE_DEFAULT) == bacl_rtn_fatal) - return bacl_rtn_fatal; - if (jcr->acl_ctx->content_length > 0) { -- if (send_acl_stream(jcr, STREAM_ACL_FREEBSD_DEFAULT_ACL) == bacl_rtn_fatal) -+ if (send_acl_stream(jcr, STREAM_ACL_FREEBSD_DEFAULT) == bacl_rtn_fatal) - return bacl_rtn_fatal; - } - } -@@ -1113,13 +1113,13 @@ static bacl_rtn_code freebsd_restore_acl_streams(JCR *jcr, - */ - switch (stream) { - case STREAM_UNIX_ACCESS_ACL: -- case STREAM_ACL_FREEBSD_ACCESS_ACL: -+ case STREAM_ACL_FREEBSD_ACCESS: - case STREAM_UNIX_DEFAULT_ACL: -- case STREAM_ACL_FREEBSD_DEFAULT_ACL: -+ case STREAM_ACL_FREEBSD_DEFAULT: - acl_enabled = pathconf(jcr->last_fname, _PC_ACL_EXTENDED); - acl_type_name = "POSIX"; - break; -- case STREAM_ACL_FREEBSD_NFS4_ACL: -+ case STREAM_ACL_FREEBSD_NFS4: - #if defined(_PC_ACL_NFS4) - acl_enabled = pathconf(jcr->last_fname, _PC_ACL_NFS4); - #endif -@@ -1159,12 +1159,12 @@ static bacl_rtn_code freebsd_restore_acl_streams(JCR *jcr, - */ - switch (stream) { - case STREAM_UNIX_ACCESS_ACL: -- case STREAM_ACL_FREEBSD_ACCESS_ACL: -+ case STREAM_ACL_FREEBSD_ACCESS: - return generic_set_acl_on_os(jcr, BACL_TYPE_ACCESS, content, content_length); - case STREAM_UNIX_DEFAULT_ACL: -- case STREAM_ACL_FREEBSD_DEFAULT_ACL: -+ case STREAM_ACL_FREEBSD_DEFAULT: - return generic_set_acl_on_os(jcr, BACL_TYPE_DEFAULT, content, content_length); -- case STREAM_ACL_FREEBSD_NFS4_ACL: -+ case STREAM_ACL_FREEBSD_NFS4: - return generic_set_acl_on_os(jcr, BACL_TYPE_NFS4, content, content_length); - default: - break; -@@ -1273,11 +1273,11 @@ static bacl_rtn_code (*os_restore_acl_streams) - * Define the supported ACL streams for this OS - */ - static int os_access_acl_streams[1] = { -- STREAM_ACL_TRU64_ACCESS_ACL -+ STREAM_ACL_TRU64_ACCESS - }; - static int os_default_acl_streams[2] = { -- STREAM_ACL_TRU64_DEFAULT_ACL, -- STREAM_ACL_TRU64_DEFAULT_DIR_ACL -+ STREAM_ACL_TRU64_DEFAULT, -+ STREAM_ACL_TRU64_DEFAULT_DIR - }; - - static bacl_rtn_code tru64_backup_acl_streams(JCR *jcr, FF_PKT *ff_pkt) -@@ -1564,8 +1564,8 @@ char *acl_strerror(int); - * Define the supported ACL streams for this OS - */ - static int os_access_acl_streams[2] = { -- STREAM_ACL_SOLARIS_ACLENT, -- STREAM_ACL_SOLARIS_ACE -+ STREAM_ACL_SOLARIS_POSIX, -+ STREAM_ACL_SOLARIS_NFS4 - }; - static int os_default_acl_streams[1] = { - -1 -@@ -1653,10 +1653,10 @@ static bacl_rtn_code solaris_backup_acl_streams(JCR *jcr, FF_PKT *ff_pkt) - - switch (acl_type(aclp)) { - case ACLENT_T: -- stream_status = send_acl_stream(jcr, STREAM_ACL_SOLARIS_ACLENT); -+ stream_status = send_acl_stream(jcr, STREAM_ACL_SOLARIS_POSIX); - break; - case ACE_T: -- stream_status = send_acl_stream(jcr, STREAM_ACL_SOLARIS_ACE); -+ stream_status = send_acl_stream(jcr, STREAM_ACL_SOLARIS_NFS4); - break; - default: - break; -@@ -1673,8 +1673,8 @@ static bacl_rtn_code solaris_restore_acl_streams(JCR *jcr, int stream, char *con - acl_t *aclp; - int acl_enabled, error; - -- if (stream != STREAM_UNIX_ACCESS_ACL || stream != STREAM_ACL_SOLARIS_ACLENT || -- stream != STREAM_ACL_SOLARIS_ACE) { -+ if (stream != STREAM_UNIX_ACCESS_ACL || stream != STREAM_ACL_SOLARIS_POSIX || -+ stream != STREAM_ACL_SOLARIS_NFS4) { - return bacl_rtn_error; - } - -@@ -1709,7 +1709,7 @@ static bacl_rtn_code solaris_restore_acl_streams(JCR *jcr, int stream, char *con - * On a filesystem with ACL support make sure this particular ACL type can be restored. - */ - switch (stream) { -- case STREAM_ACL_SOLARIS_ACLENT: -+ case STREAM_ACL_SOLARIS_POSIX: - /* - * An aclent can be restored on filesystems with _ACL_ACLENT_ENABLED or _ACL_ACE_ENABLED support. - */ -@@ -1720,7 +1720,7 @@ static bacl_rtn_code solaris_restore_acl_streams(JCR *jcr, int stream, char *con - return bacl_rtn_error; - } - break; -- case STREAM_ACL_SOLARIS_ACE: -+ case STREAM_ACL_SOLARIS_NFS4: - /* - * An ace can only be restored on a filesystem with _ACL_ACE_ENABLED support. - */ -@@ -1750,7 +1750,7 @@ static bacl_rtn_code solaris_restore_acl_streams(JCR *jcr, int stream, char *con - * Validate that the conversion gave us the correct acl type. - */ - switch (stream) { -- case STREAM_ACL_SOLARIS_ACLENT: -+ case STREAM_ACL_SOLARIS_POSIX: - if (acl_type(aclp) != ACLENT_T) { - Mmsg1(jcr->errmsg, - _("wrong encoding of acl type in acl stream on file \"%s\"\n"), -@@ -1758,7 +1758,7 @@ static bacl_rtn_code solaris_restore_acl_streams(JCR *jcr, int stream, char *con - return bacl_rtn_error; - } - break; -- case STREAM_ACL_SOLARIS_ACE: -+ case STREAM_ACL_SOLARIS_NFS4: - if (acl_type(aclp) != ACE_T) { - Mmsg1(jcr->errmsg, - _("wrong encoding of acl type in acl stream on file \"%s\"\n"), -@@ -1802,7 +1802,7 @@ static bacl_rtn_code solaris_restore_acl_streams(JCR *jcr, int stream, char *con - * Define the supported ACL streams for this OS - */ - static int os_access_acl_streams[1] = { -- STREAM_ACL_SOLARIS_ACLENT -+ STREAM_ACL_SOLARIS_POSIX - }; - static int os_default_acl_streams[1] = { - -1 -@@ -1861,7 +1861,7 @@ static bacl_rtn_code solaris_backup_acl_streams(JCR *jcr, FF_PKT *ff_pkt) - pm_strcpy(jcr->acl_ctx->content, acl_text); - actuallyfree(acl_text); - free(acls); -- return send_acl_stream(jcr, STREAM_ACL_SOLARIS_ACLENT); -+ return send_acl_stream(jcr, STREAM_ACL_SOLARIS_POSIX); - } - - berrno be; -@@ -2027,7 +2027,7 @@ bool backup_acl_streams(JCR *jcr, FF_PKT *ff_pkt) - * AFS is a non OS specific filesystem so see if this path is on an AFS filesystem - * Set the BACL_FLAG_SAVE_AFS flag if it is. If not set the BACL_FLAG_SAVE_NATIVE flag. - */ -- if (fstype_equals(jcr->last_fname, "afs")) { -+ if (fstype_cmp(ff_pkt, "afs")) { - jcr->acl_ctx->flags |= BACL_FLAG_SAVE_AFS; - } else { - jcr->acl_ctx->flags |= BACL_FLAG_SAVE_NATIVE; -@@ -2128,7 +2128,7 @@ bacl_rtn_code restore_acl_streams(JCR *jcr, int stream, - * AFS is a non OS specific filesystem so see if this path is on an AFS filesystem - * Set the BACL_FLAG_RESTORE_AFS flag if it is. If not set the BACL_FLAG_RETORE_NATIVE flag. - */ -- if (fstype_equals(jcr->last_fname, "afs")) { -+ if (fstype_cmp(ff_pkt, "afs")) { - jcr->acl_ctx->flags |= BACL_FLAG_RESTORE_AFS; - } else { - jcr->acl_ctx->flags |= BACL_FLAG_RESTORE_NATIVE; -diff --git a/bacula/src/filed/backup.h b/bacula/src/filed/backup.h -index 4ce8c1c..2cf0223 100644 ---- a/bacula/src/filed/backup.h -+++ b/bacula/src/filed/backup.h -@@ -50,10 +50,12 @@ struct bctx_t { - - /* Compression variables */ - #if defined(HAVE_LIBZ) || defined(HAVE_LZO) -- uLong compress_len; - uLong max_compress_len; -+ uLong compress_len; - Bytef *cbuf; - Bytef *cbuf2; -+#else -+ uint64_t max_compress_len; - #endif - #ifdef HAVE_LZO - comp_stream_header ch; -diff --git a/bacula/src/findlib/bfile.c b/bacula/src/findlib/bfile.c -index 92d6286..99b3a5f 100644 ---- a/bacula/src/findlib/bfile.c -+++ b/bacula/src/findlib/bfile.c -@@ -537,9 +537,10 @@ int bopen(BFILE *bfd, const char *fname, uint64_t flags, mode_t mode) - bfd->win32DecompContext.liNextHeader = 0; - - #if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_WILLNEED) -- if (bfd->fid != -1 && flags & O_RDONLY) { -+ /* If not RDWR or WRONLY must be Read Only */ -+ if (bfd->fid != -1 && !(flags & (O_RDWR|O_WRONLY))) { - int stat = posix_fadvise(bfd->fid, 0, 0, POSIX_FADV_WILLNEED); -- Dmsg2(400, "Did posix_fadvise on %s stat=%d\n", fname, stat); -+ Dmsg3(400, "Did posix_fadvise WILLNEED on %s fid=%d stat=%d\n", fname, bfd->fid, stat); - } - #endif - -@@ -585,10 +586,12 @@ int bclose(BFILE *bfd) - } - - #if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_DONTNEED) -- if (bfd->m_flags & O_RDONLY) { -+ /* If not RDWR or WRONLY must be Read Only */ -+ if (!(bfd->m_flags & (O_RDWR|O_WRONLY))) { - fdatasync(bfd->fid); /* sync the file */ - /* Tell OS we don't need it any more */ - posix_fadvise(bfd->fid, 0, 0, POSIX_FADV_DONTNEED); -+ Dmsg1(400, "Did posix_fadvise DONTNEED on fid=%d\n", bfd->fid); - } - #endif - -@@ -653,4 +656,3 @@ boffset_t blseek(BFILE *bfd, boffset_t offset, int whence) - bfd->berrno = errno; - return pos; - } -- -diff --git a/bacula/src/findlib/fstype.c b/bacula/src/findlib/fstype.c -index 3ed575d..c2bc83d 100644 ---- a/bacula/src/findlib/fstype.c -+++ b/bacula/src/findlib/fstype.c -@@ -31,7 +31,9 @@ - #include "find.h" - #include - #include -- -+#ifdef HAVE_SUN_OS -+ #include -+#endif - #else /* Set up for testing a stand alone program */ - - #include -@@ -84,6 +86,15 @@ void add_mtab_item(void *user_ctx, struct stat *st, const char *fstype, - } - } - -+/* Compare directly the FS from a fname with a string */ -+bool fstype_cmp(FF_PKT *ff_pkt, const char *fsname) -+{ -+ char buf[256]; -+ if (fstype(ff_pkt, buf, sizeof(buf))) { -+ return (strcmp(buf, fsname) == 0); -+ } -+ return false; -+} - - /* - * These functions should be implemented for each OS -@@ -373,7 +384,7 @@ bool read_mtab(mtab_handler_t *mtab_handler, void *user_ctx) - mtab_handler(user_ctx, &st, mnt.mnt_fstype, mnt.mnt_mountp, - mnt.mnt_mntopts, mnt.mnt_special); - } -- fclose(fp); -+ fclose(mntfp); - V(mutex); - #endif - -diff --git a/bacula/src/findlib/protos.h b/bacula/src/findlib/protos.h -index 7291ee8..12514ad 100644 ---- a/bacula/src/findlib/protos.h -+++ b/bacula/src/findlib/protos.h -@@ -81,7 +81,7 @@ bool path_list_add(JCR *jcr, uint32_t len, char *fname); - - /* from fstype.c */ - bool fstype(FF_PKT *ff_pkt, char *fs, int fslen); --bool fstype_equals(const char *fname, const char *fstype_name); -+bool fstype_cmp(FF_PKT *ff_pkt, const char *fstype_name); - - /* from drivetype.c */ - bool drivetype(const char *fname, char *fs, int fslen); -diff --git a/bacula/src/lib/address_conf.c b/bacula/src/lib/address_conf.c -index 59dbd0f..66a49d2 100644 ---- a/bacula/src/lib/address_conf.c -+++ b/bacula/src/lib/address_conf.c -@@ -613,10 +613,19 @@ char *sockaddr_to_ascii(const struct sockaddr *sa, int socklen, char *buf, int b - /* This is the more modern way of doing it */ - char clienthost[NI_MAXHOST]; - char clientservice[NI_MAXSERV]; -- int status; -- status = getnameinfo(sa, socklen, clienthost, sizeof(clienthost), -- clientservice, sizeof(clientservice), -- NI_NUMERICHOST | NI_NUMERICSERV); -+ int status = 1; -+ if (sa->sa_family == AF_INET) { -+ status = getnameinfo(sa, socklen, clienthost, sizeof(clienthost), -+ clientservice, sizeof(clientservice), -+ NI_NUMERICHOST | NI_NUMERICSERV); -+ } -+#ifdef HAVE_IPV6 -+ else { -+ status = getnameinfo(sa, sizeof(sockaddr_in6), clienthost, sizeof(clienthost), -+ clientservice, sizeof(clientservice), -+ NI_NUMERICHOST | NI_NUMERICSERV); -+ } -+#endif - if (status == 0) { - /* Enclose IPv6 in [] */ - if (strchr(clienthost, ':') != NULL) { -diff --git a/bacula/src/qt-console/tray-monitor/authenticate.cpp b/bacula/src/qt-console/tray-monitor/authenticate.cpp -index 16f78dd..dde4682 100644 ---- a/bacula/src/qt-console/tray-monitor/authenticate.cpp -+++ b/bacula/src/qt-console/tray-monitor/authenticate.cpp -@@ -30,7 +30,7 @@ - * - */ - --#include "winhdrs.h" -+//#include "winhdrs.h" - #include "tray-monitor.h" - - void senditf(const char *fmt, ...); -diff --git a/bacula/src/qt-console/tray-monitor/tray-ui.h b/bacula/src/qt-console/tray-monitor/tray-ui.h -index e4e5dfc..ce2b22f 100644 ---- a/bacula/src/qt-console/tray-monitor/tray-ui.h -+++ b/bacula/src/qt-console/tray-monitor/tray-ui.h -@@ -27,7 +27,7 @@ - # endif - #endif - --#include "winhdrs.h" -+//#include "winhdrs.h" - #include - #include - #include -diff --git a/bacula/src/stored/block.h b/bacula/src/stored/block.h -index ff8f085..a8552b0 100644 ---- a/bacula/src/stored/block.h -+++ b/bacula/src/stored/block.h -@@ -127,7 +127,6 @@ struct DEV_BLOCK { - int32_t rechdr_items; /* number of items in rechdr queue */ - char *bufp; /* pointer into buffer */ - char ser_buf[BLKHDR2_LENGTH]; /* Serial buffer for data */ -- POOLMEM *rechdr_queue; /* record header queue */ - POOLMEM *buf; /* actual data buffer */ - }; - -diff --git a/bacula/src/stored/block_util.c b/bacula/src/stored/block_util.c -index 7fc45d2..86e097d 100644 ---- a/bacula/src/stored/block_util.c -+++ b/bacula/src/stored/block_util.c -@@ -135,7 +135,6 @@ DEV_BLOCK *new_block(DEVICE *dev) - */ - block->buf_len = len; - block->buf = get_memory(block->buf_len); -- block->rechdr_queue = get_memory(block->buf_len); - block->rechdr_items = 0; - empty_block(block); - block->BlockVer = BLOCK_VER; /* default write version */ -@@ -187,7 +186,6 @@ void free_block(DEV_BLOCK *block) - if (block) { - Dmsg1(999, "free_block buffer %x\n", block->buf); - free_memory(block->buf); -- free_memory(block->rechdr_queue); - Dmsg1(999, "free_block block %x\n", block); - free_memory((POOLMEM *)block); - } -diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c -index 0aae19a..a93e0e7 100644 ---- a/bacula/src/stored/mount.c -+++ b/bacula/src/stored/mount.c -@@ -620,7 +620,7 @@ void DCR::do_swapping(bool is_writing) - if (dev->vol) { - dev->vol->clear_swapping(); - Dmsg1(100, "=== set in_use vol=%s\n", dev->vol->vol_name); -- dev->vol->set_in_use(); -+ dev->vol->clear_in_use(); - dev->VolHdr.VolumeName[0] = 0; /* don't yet have right Volume */ - } else { - Dmsg1(100, "No vol on dev=%s\n", dev->print_name()); -diff --git a/bacula/src/tools/bpluginfo.c b/bacula/src/tools/bpluginfo.c -new file mode 100644 -index 0000000..1655bd5 ---- /dev/null -+++ b/bacula/src/tools/bpluginfo.c -@@ -0,0 +1,625 @@ -+/* -+ * Contributed in 2012 by Inteos sp. z o.o. -+ * -+ * Utility tool display various information about Bacula plugin, -+ * including but not limited to: -+ * - Name and Author of the plugin -+ * - Plugin License -+ * - Description -+ * - API version -+ * - Enabled functions, etc. -+ */ -+/* -+ Bacula® - The Network Backup Solution -+ -+ Copyright (C) 2006-2014 Free Software Foundation Europe e.V. -+ -+ The main author of Bacula is Kern Sibbald, with contributions from many -+ others, a complete list can be found in the file AUTHORS. -+ -+ You may use this file and others of this release according to the -+ license defined in the LICENSE file, which includes the Affero General -+ Public License, v3.0 ("AGPLv3") and some additional permissions and -+ terms pursuant to its AGPLv3 Section 7. -+ -+ Bacula® is a registered trademark of Kern Sibbald. -+*/ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#ifndef __WIN32__ -+#include -+#endif -+#include "bacula.h" -+#include "../filed/fd_plugins.h" -+#include "../dird/dir_plugins.h" -+// I can't include sd_plugins.h here ... -+#include "../stored/stored.h" -+#include "assert_macro.h" -+ -+extern "C" { -+ typedef int (*loadPlugin) (void *binfo, void *bfuncs, void **pinfo, -+ void **pfuncs); -+ typedef int (*unloadPlugin) (void); -+} -+#define DEFAULT_API_VERSION 1 -+enum plugintype { -+ DIRPLUGIN, -+ FDPLUGIN, -+ SDPLUGIN, -+ ERRORPLUGIN, -+}; -+ -+/* -+ * pDirInfo -+ * pInfo -+ * psdInfo -+ */ -+typedef union _pluginfo pluginfo; -+union _pluginfo { -+ pDirInfo pdirinfo; -+ pInfo pfdinfo; -+ psdInfo psdinfo; -+}; -+ -+/* -+ * pDirFuncs -+ * pFuncs -+ * psdFuncs -+ */ -+typedef union _plugfuncs plugfuncs; -+union _plugfuncs { -+ pDirFuncs pdirfuncs; -+ pFuncs pfdfuncs; -+ psdFuncs psdfuncs; -+}; -+ -+/* -+ * bDirFuncs -+ * bFuncs -+ * bsdFuncs -+ */ -+/* -+ * TODO: change to union -+ * -+typedef union _baculafuncs baculafuncs; -+union _baculafuncs { -+ bDirFuncs bdirfuncs; -+ bFuncs bfdfuncs; -+ bsdFuncs bsdfuncs; -+}; -+*/ -+typedef struct _baculafuncs baculafuncs; -+struct _baculafuncs { -+ uint32_t size; -+ uint32_t version; -+ int (*registerBaculaEvents) (void *ctx, ...); -+ int (*getBaculaValue) (void *ctx, int var, void *value); -+ int (*setBaculaValue) (void *ctx, int var, void *value); -+ int (*JobMessage) (void *ctx, const char *file, int line, int type, int64_t mtime, -+ const char *fmt, ...); -+ int (*DebugMessage) (void *ctx, const char *file, int line, int level, -+ const char *fmt, ...); -+ void *(*baculaMalloc) (void *ctx, const char *file, int line, size_t size); -+ void (*baculaFree) (void *ctx, const char *file, int line, void *mem); -+}; -+ -+/* -+ * bDirInfo -+ * bInfo -+ * bsdInfo -+ */ -+typedef union _baculainfos baculainfos; -+union _baculainfos { -+ bDirInfo bdirinfo; -+ bInfo bfdinfo; -+ bsdInfo bsdinfo; -+}; -+ -+/* -+typedef struct _baculainfos baculainfos; -+struct _baculainfos { -+ uint32_t size; -+ uint32_t version; -+}; -+*/ -+ -+typedef struct _progdata progdata; -+struct _progdata { -+ int verbose; -+ int listinfo; -+ int listfunc; -+ char *pluginfile; -+ void *pluginhandle; -+ int bapiversion; -+ int bplugtype; -+ pluginfo *pinfo; -+ plugfuncs *pfuncs; -+}; -+ -+/* memory allocation/deallocation */ -+#define MALLOC(size) \ -+ (char *) bmalloc ( size ); -+ -+#define ASSERT_MEMORY(m) \ -+ if ( m == NULL ){ \ -+ printf ( "Error: memory allocation error!\n" ); \ -+ exit (10); \ -+ } -+ -+#define FREE(ptr) \ -+ if ( ptr != NULL ){ \ -+ bfree ( ptr ); \ -+ ptr = NULL; \ -+ } -+ -+int registerBaculaEvents(void *ctx, ...) -+{ -+ return 0; -+}; -+ -+int getBaculaValue(void *ctx, int var, void *value) -+{ -+ return 0; -+}; -+ -+int setBaculaValue(void *ctx, int var, void *value) -+{ -+ return 0; -+}; -+ -+int DebugMessage(void *ctx, const char *file, int line, int level, const char *fmt, ...) -+{ -+#ifdef DEBUGMSG -+ printf("DG: %s:%d %s\n", file, line, fmt); -+#endif -+ return 0; -+}; -+ -+int JobMessage(void *ctx, const char *file, int line, int type, int64_t mtime, -+ const char *fmt, ...) -+{ -+#ifdef DEBUGMSG -+ printf("JM: %s:%d <%d> %s\n", file, line, type, fmt); -+#endif -+ return 0; -+}; -+ -+void *baculaMalloc(void *ctx, const char *file, int line, size_t size) -+{ -+ return MALLOC(size); -+}; -+ -+void baculaFree(void *ctx, const char *file, int line, void *mem) -+{ -+ FREE(mem); -+}; -+ -+/* -+ * displays a short help -+ */ -+void print_help(int argc, char *argv[]) -+{ -+ -+ printf("\n" -+ "Usage: bpluginfo [options] \n" -+ " -v verbose\n" -+ " -i list plugin header information only (default)\n" -+ " -f list plugin functions information only\n" -+ " -a bacula api version (default %d)\n" -+ " -h help screen\n" "\n", DEFAULT_API_VERSION); -+} -+ -+/* allocates and resets a main program data variable */ -+progdata *allocpdata(void) -+{ -+ -+ progdata *pdata; -+ -+ pdata = (progdata *) bmalloc(sizeof(progdata)); -+ ASSERT_MEMORY(pdata); -+ memset(pdata, 0, sizeof(progdata)); -+ -+ return pdata; -+} -+ -+/* releases all allocated program data resources */ -+void freepdata(progdata * pdata) -+{ -+ -+ if (pdata->pluginfile) { -+ FREE(pdata->pluginfile); -+ } -+ FREE(pdata); -+} -+ -+/* -+ * parse execution arguments and fills required pdata structure fields -+ * -+ * input: -+ * pdata - pointer to program data structure -+ * argc, argv - execution envinroment variables -+ * output: -+ * pdata - required structure fields -+ * -+ * supported options: -+ * -v verbose flag -+ * -i list plugin header info only (default) -+ * -f list implemented functions only -+ * -a bacula api version (default 1) -+ * -h help screen -+ */ -+void parse_args(progdata * pdata, int argc, char *argv[]) -+{ -+ -+ int i; -+ char *dirtmp; -+ char *progdir; -+ int api; -+ int s; -+ -+ if (argc < 2) { -+ /* TODO - add a real help screen */ -+ printf("\nNot enough parameters!\n"); -+ print_help(argc, argv); -+ exit(1); -+ } -+ -+ if (argc > 5) { -+ /* TODO - add a real help screen */ -+ printf("\nToo many parameters!\n"); -+ print_help(argc, argv); -+ exit(1); -+ } -+ -+ for (i = 1; i < argc; i++) { -+ if (strcmp(argv[i], "-h") == 0) { -+ /* help screen */ -+ print_help(argc, argv); -+ exit(0); -+ } -+ if (strcmp(argv[i], "-v") == 0) { -+ /* verbose option */ -+ pdata->verbose = 1; -+ continue; -+ } -+ if (strcmp(argv[i], "-f") == 0) { -+ /* functions list */ -+ pdata->listfunc = 1; -+ continue; -+ } -+ if (strcmp(argv[i], "-i") == 0) { -+ /* header list */ -+ pdata->listinfo = 1; -+ continue; -+ } -+ if (strcmp(argv[i], "-a") == 0) { -+ /* bacula api version */ -+ if (i < argc - 1) { -+ s = sscanf(argv[i + 1], "%d", &api); -+ if (s == 1) { -+ pdata->bapiversion = api; -+ i++; -+ continue; -+ } -+ } -+ printf("\nAPI version number required!\n"); -+ print_help(argc, argv); -+ exit(1); -+ } -+ if (!pdata->pluginfile) { -+ if (argv[i][0] != '/') { -+ dirtmp = MALLOC(PATH_MAX); -+ ASSERT_MEMORY(dirtmp); -+ progdir = MALLOC(PATH_MAX); -+ ASSERT_MEMORY(progdir); -+ dirtmp = getcwd(dirtmp, PATH_MAX); -+ -+ strcat(dirtmp, "/"); -+ strcat(dirtmp, argv[i]); -+ -+ if (realpath(dirtmp, progdir) == NULL) { -+ /* error in resolving path */ -+ FREE(progdir); -+ progdir = bstrdup(argv[i]); -+ } -+ pdata->pluginfile = bstrdup(progdir); -+ FREE(dirtmp); -+ FREE(progdir); -+ } else { -+ pdata->pluginfile = bstrdup(argv[i]); -+ } -+ continue; -+ } -+ } -+} -+ -+/* -+ * checks a plugin type based on a plugin magic string -+ * -+ * input: -+ * pdata - program data with plugin info structure -+ * output: -+ * int - enum plugintype -+ */ -+int getplugintype(progdata * pdata) -+{ -+ -+ ASSERT_NVAL_RET_V(pdata, ERRORPLUGIN); -+ -+ pluginfo *pinfo = pdata->pinfo; -+ -+ ASSERT_NVAL_RET_V(pinfo, ERRORPLUGIN); -+ -+ if (pinfo->pdirinfo.plugin_magic && -+ strcmp(pinfo->pdirinfo.plugin_magic, DIR_PLUGIN_MAGIC) == 0) { -+ return DIRPLUGIN; -+ } else -+ if (pinfo->pfdinfo.plugin_magic && -+ strcmp(pinfo->pfdinfo.plugin_magic, FD_PLUGIN_MAGIC) == 0) { -+ return FDPLUGIN; -+ } else -+ if (pinfo->psdinfo.plugin_magic && -+ strcmp(pinfo->psdinfo.plugin_magic, SD_PLUGIN_MAGIC) == 0) { -+ return SDPLUGIN; -+ } else { -+ return ERRORPLUGIN; -+ } -+} -+ -+/* -+ * prints any available information about a plugin -+ * -+ * input: -+ * pdata - program data with plugin info structure -+ * output: -+ * printed info -+ */ -+void dump_pluginfo(progdata * pdata) -+{ -+ -+ ASSERT_NVAL_RET(pdata); -+ -+ pluginfo *pinfo = pdata->pinfo; -+ -+ ASSERT_NVAL_RET(pinfo); -+ -+ plugfuncs *pfuncs = pdata->pfuncs; -+ -+ ASSERT_NVAL_RET(pfuncs); -+ -+ switch (pdata->bplugtype) { -+ case DIRPLUGIN: -+ printf("\nPlugin type:\t\tBacula Director plugin\n"); -+ if (pdata->verbose) { -+ printf("Plugin magic:\t\t%s\n", NPRT(pinfo->pdirinfo.plugin_magic)); -+ } -+ printf("Plugin version:\t\t%s\n", pinfo->pdirinfo.plugin_version); -+ printf("Plugin release date:\t%s\n", NPRT(pinfo->pdirinfo.plugin_date)); -+ printf("Plugin author:\t\t%s\n", NPRT(pinfo->pdirinfo.plugin_author)); -+ printf("Plugin licence:\t\t%s\n", NPRT(pinfo->pdirinfo.plugin_license)); -+ printf("Plugin description:\t%s\n", NPRT(pinfo->pdirinfo.plugin_description)); -+ printf("Plugin API version:\t%d\n", pinfo->pdirinfo.version); -+ break; -+ case FDPLUGIN: -+ printf("\nPlugin type:\t\tFile Daemon plugin\n"); -+ if (pdata->verbose) { -+ printf("Plugin magic:\t\t%s\n", NPRT(pinfo->pfdinfo.plugin_magic)); -+ } -+ printf("Plugin version:\t\t%s\n", pinfo->pfdinfo.plugin_version); -+ printf("Plugin release date:\t%s\n", NPRT(pinfo->pfdinfo.plugin_date)); -+ printf("Plugin author:\t\t%s\n", NPRT(pinfo->pfdinfo.plugin_author)); -+ printf("Plugin licence:\t\t%s\n", NPRT(pinfo->pfdinfo.plugin_license)); -+ printf("Plugin description:\t%s\n", NPRT(pinfo->pfdinfo.plugin_description)); -+ printf("Plugin API version:\t%d\n", pinfo->pfdinfo.version); -+ break; -+ case SDPLUGIN: -+ printf("\nPlugin type:\t\tBacula Storage plugin\n"); -+ if (pdata->verbose) { -+ printf("Plugin magic:\t\t%s\n", NPRT(pinfo->psdinfo.plugin_magic)); -+ } -+ printf("Plugin version:\t\t%s\n", pinfo->psdinfo.plugin_version); -+ printf("Plugin release date:\t%s\n", NPRT(pinfo->psdinfo.plugin_date)); -+ printf("Plugin author:\t\t%s\n", NPRT(pinfo->psdinfo.plugin_author)); -+ printf("Plugin licence:\t\t%s\n", NPRT(pinfo->psdinfo.plugin_license)); -+ printf("Plugin description:\t%s\n", NPRT(pinfo->psdinfo.plugin_description)); -+ printf("Plugin API version:\t%d\n", pinfo->psdinfo.version); -+ break; -+ default: -+ printf("\nUnknown plugin type or other Error\n\n"); -+ } -+} -+ -+/* -+ * prints any available information about plugin' functions -+ * -+ * input: -+ * pdata - program data with plugin info structure -+ * output: -+ * printed info -+ */ -+void dump_plugfuncs(progdata * pdata) -+{ -+ -+ ASSERT_NVAL_RET(pdata); -+ -+ plugfuncs *pfuncs = pdata->pfuncs; -+ -+ ASSERT_NVAL_RET(pfuncs); -+ -+ printf("\nPlugin functions:\n"); -+ -+ switch (pdata->bplugtype) { -+ case DIRPLUGIN: -+ if (pdata->verbose) { -+ if (pfuncs->pdirfuncs.newPlugin) { -+ printf(" newPlugin()\n"); -+ } -+ if (pfuncs->pdirfuncs.freePlugin) { -+ printf(" freePlugin()\n"); -+ } -+ } -+ if (pfuncs->pdirfuncs.getPluginValue) { -+ printf(" getPluginValue()\n"); -+ } -+ if (pfuncs->pdirfuncs.setPluginValue) { -+ printf(" setPluginValue()\n"); -+ } -+ if (pfuncs->pdirfuncs.handlePluginEvent) { -+ printf(" handlePluginEvent()\n"); -+ } -+ break; -+ case FDPLUGIN: -+ if (pdata->verbose) { -+ if (pfuncs->pfdfuncs.newPlugin) { -+ printf(" newPlugin()\n"); -+ } -+ if (pfuncs->pfdfuncs.freePlugin) { -+ printf(" freePlugin()\n"); -+ } -+ } -+ if (pfuncs->pfdfuncs.getPluginValue) { -+ printf(" getPluginValue()\n"); -+ } -+ if (pfuncs->pfdfuncs.setPluginValue) { -+ printf(" setPluginValue()\n"); -+ } -+ if (pfuncs->pfdfuncs.handlePluginEvent) { -+ printf(" handlePluginEvent()\n"); -+ } -+ if (pfuncs->pfdfuncs.startBackupFile) { -+ printf(" startBackupFile()\n"); -+ } -+ if (pfuncs->pfdfuncs.endBackupFile) { -+ printf(" endBackupFile()\n"); -+ } -+ if (pfuncs->pfdfuncs.startRestoreFile) { -+ printf(" startRestoreFile()\n"); -+ } -+ if (pfuncs->pfdfuncs.endRestoreFile) { -+ printf(" endRestoreFile()\n"); -+ } -+ if (pfuncs->pfdfuncs.pluginIO) { -+ printf(" pluginIO()\n"); -+ } -+ if (pfuncs->pfdfuncs.createFile) { -+ printf(" createFile()\n"); -+ } -+ if (pfuncs->pfdfuncs.setFileAttributes) { -+ printf(" setFileAttributes()\n"); -+ } -+ if (pfuncs->pfdfuncs.checkFile) { -+ printf(" checkFile()\n"); -+ } -+ break; -+ case SDPLUGIN: -+ if (pdata->verbose) { -+ if (pfuncs->psdfuncs.newPlugin) { -+ printf(" newPlugin()\n"); -+ } -+ if (pfuncs->psdfuncs.freePlugin) { -+ printf(" freePlugin()\n"); -+ } -+ } -+ if (pfuncs->psdfuncs.getPluginValue) { -+ printf(" getPluginValue()\n"); -+ } -+ if (pfuncs->psdfuncs.setPluginValue) { -+ printf(" setPluginValue()\n"); -+ } -+ if (pfuncs->psdfuncs.handlePluginEvent) { -+ printf(" handlePluginEvent()\n"); -+ } -+ break; -+ default: -+ printf("\nUnknown plugin type or other Error\n\n"); -+ } -+} -+ -+/* -+ * input parameters: -+ * argv[0] [options] -+ * -+ * exit codes: -+ * 0 - success -+ * 1 - cannot load a plugin -+ * 2 - cannot find a loadPlugin function -+ * 3 - cannot find an unloadPlugin function -+ * 10 - not enough memory -+ */ -+int main(int argc, char *argv[]) -+{ -+ -+ progdata *pdata; -+ loadPlugin loadplugfunc; -+ unloadPlugin unloadplugfunc; -+ baculafuncs bfuncs = { -+ sizeof(bfuncs), -+ 1, -+ registerBaculaEvents, -+ getBaculaValue, -+ setBaculaValue, -+ JobMessage, -+ DebugMessage, -+ baculaMalloc, -+ baculaFree, -+ }; -+ baculainfos binfos; -+ -+ pdata = allocpdata(); -+ parse_args(pdata, argc, argv); -+ -+ binfos.bfdinfo.size = sizeof(binfos); -+ binfos.bfdinfo.version = DEFAULT_API_VERSION; -+ -+ pdata->pluginhandle = dlopen(pdata->pluginfile, RTLD_LAZY); -+ if (pdata->pluginhandle == NULL) { -+ printf("\nCannot load a plugin: %s\n\n", dlerror()); -+ freepdata(pdata); -+ exit(1); -+ } -+ -+ loadplugfunc = (loadPlugin) dlsym(pdata->pluginhandle, "loadPlugin"); -+ if (loadplugfunc == NULL) { -+ printf("\nCannot find loadPlugin function: %s\n", dlerror()); -+ printf("\nWhether the file is a really Bacula plugin?\n\n"); -+ freepdata(pdata); -+ exit(2); -+ } -+ -+ unloadplugfunc = (unloadPlugin) dlsym(pdata->pluginhandle, "unloadPlugin"); -+ if (unloadplugfunc == NULL) { -+ printf("\nCannot find unloadPlugin function: %s\n", dlerror()); -+ printf("\nWhether the file is a really Bacula plugin?\n\n"); -+ freepdata(pdata); -+ exit(3); -+ } -+ -+ if (pdata->bapiversion > 0) { -+ binfos.bdirinfo.version = pdata->bapiversion; -+ } -+ -+ loadplugfunc(&binfos, &bfuncs, (void **)&pdata->pinfo, (void **)&pdata->pfuncs); -+ -+ pdata->bplugtype = getplugintype(pdata); -+ -+ if (!pdata->listfunc) { -+ dump_pluginfo(pdata); -+ } -+ if ((!pdata->listinfo && pdata->listfunc) || pdata->verbose) { -+ dump_plugfuncs(pdata); -+ } -+ printf("\n"); -+ -+ unloadplugfunc(); -+ -+ dlclose(pdata->pluginhandle); -+ -+ freepdata(pdata); -+ -+ return 0; -+} -diff --git a/bacula/src/version.h b/bacula/src/version.h -index 48265be..677a81f 100644 ---- a/bacula/src/version.h -+++ b/bacula/src/version.h -@@ -6,8 +6,8 @@ - - /* Note: there can be only *one* VERSION in this file */ - #define VERSION "7.2.0" --#define BDATE "14 August 2015" --#define LSMDATE "14Aug15" -+#define BDATE "17 November 2015" -+#define LSMDATE "17Nov15" - - #define RELEASE 1 /* Use ONLY in rpms */ - -@@ -15,6 +15,12 @@ - #define BYEAR "2015" /* year for copyright messages in progs */ - - /* -+ * Versions of packages needed to build Bacula components -+ */ -+#define DEPKGS_QT_VERSION "01Jan13" -+#define DEPKGS_VERSION "26Jun14" -+ -+/* - Bacula(R) - The Network Backup Solution - - Copyright (C) 2000-2015 Kern Sibbald -diff --git a/bacula/updatedb/update_mysql_tables.in b/bacula/updatedb/update_mysql_tables.in -index a800011..4ae0513 100644 ---- a/bacula/updatedb/update_mysql_tables.in -+++ b/bacula/updatedb/update_mysql_tables.in -@@ -9,8 +9,8 @@ - echo " " - echo "This script will update a Bacula MySQL database from version 12-14 to 15" - echo " " --echo "Depending on the current version of your catalog, you may have to run this script" --echo " multiple times" -+echo "Depending on the current version of your catalog," -+echo "you may have to run this script multiple times." - echo " " - - bindir=@MYSQL_BINDIR@ -@@ -116,10 +116,10 @@ CREATE TABLE Snapshot ( - SnapshotId INTEGER UNSIGNED AUTO_INCREMENT, - Name TINYBLOB NOT NULL, - JobId INTEGER UNSIGNED DEFAULT 0, -- FileSetId INTEGER UNSIGNED DEFAULT 0; -+ FileSetId INTEGER UNSIGNED DEFAULT 0, - CreateTDate BIGINT NOT NULL, - CreateDate DATETIME NOT NULL, -- ClientId INTEGER DEFAULT 0, -+ ClientId INTEGER UNSIGNED DEFAULT 0, - Volume TINYBLOB NOT NULL, - Device TINYBLOB NOT NULL, - Type TINYBLOB NOT NULL, -diff --git a/bacula/updatedb/update_postgresql_tables.in b/bacula/updatedb/update_postgresql_tables.in -index 6681046..c3db92a 100644 ---- a/bacula/updatedb/update_postgresql_tables.in -+++ b/bacula/updatedb/update_postgresql_tables.in -@@ -3,14 +3,14 @@ - # Copyright (C) 2000-2015 Kern Sibbald - # License: BSD 2-Clause; see file LICENSE-FOSS - # --# Shell script to update MySQL tables from Bacula Community version -+# Shell script to update PostgreSQL tables from Bacula Community version - # 5.0.x, 5.2.x, 7.0.x - # - echo " " --echo "This script will update a Bacula MySQL database from version 12-14 to 15" -+echo "This script will update a Bacula PostgreSQL database from version 12-14 to 15" - echo " " --echo "Depending on the current version of your catalog, you may have to run this script" --echo " multiple times" -+echo "Depending on the current version of your catalog," -+echo "you may have to run this script multiple times." - echo " " - - bindir=@POSTGRESQL_BINDIR@ diff --git a/bacula-sd.sysconfig.el5 b/bacula-sd.sysconfig.el5 deleted file mode 100644 index 97e9a47..0000000 --- a/bacula-sd.sysconfig.el5 +++ /dev/null @@ -1,9 +0,0 @@ -# Users for bacula storage -# If no user is set bacula will run as root - -SD_USER=bacula -SD_GROUP=disk - -# Useful for debugging -# -# OPTS="-d 200" diff --git a/bacula.spec b/bacula.spec index 3d4caef..0f25de0 100644 --- a/bacula.spec +++ b/bacula.spec @@ -3,13 +3,11 @@ Name: bacula Version: 7.4.7 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Cross platform network backup for Linux, Unix, Mac and Windows # See LICENSE for details License: AGPLv3 with exceptions -Group: System Environment/Daemons URL: http://www.bacula.org -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz @@ -29,7 +27,6 @@ Source14: %{name}-traymonitor.desktop Source15: %{name}-fd.sysconfig Source16: %{name}-dir.sysconfig Source17: %{name}-sd.sysconfig -Source18: %{name}-sd.sysconfig.el5 # Image taken from http://www.bacula.org/git/cgit.cgi/bacula/plain/bacula/src/tray-monitor/generic.xpm Source19: generic.xpm @@ -56,6 +53,7 @@ BuildRequires: sed BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: glibc-devel +BuildRequires: ImageMagick BuildRequires: libacl-devel BuildRequires: libstdc++-devel BuildRequires: libxml2-devel @@ -64,8 +62,10 @@ BuildRequires: lzo-devel BuildRequires: mysql-devel BuildRequires: ncurses-devel BuildRequires: postgresql-devel +BuildRequires: qt4-devel >= 4.6.2 BuildRequires: readline-devel BuildRequires: sqlite-devel +BuildRequires: tcp_wrappers-devel BuildRequires: zlib-devel %if 0%{?fedora} >= 26 || 0%{?rhel} >= 8 @@ -74,14 +74,6 @@ BuildRequires: compat-openssl10-devel BuildRequires: openssl-devel %endif -%if 0%{?fedora} || 0%{?rhel} >= 6 -BuildRequires: qt4-devel >= 4.6.2 -BuildRequires: tcp_wrappers-devel -BuildRequires: ImageMagick -%else -BuildRequires: tcp_wrappers -%endif - %if 0%{?fedora} || 0%{?rhel} >= 7 BuildRequires: systemd %endif @@ -95,7 +87,6 @@ to find and recover lost or damaged files. %package libs Summary: Bacula libraries -Group: System Environment/Daemons Obsoletes: bacula-sysconfdir <= 2.4 %description libs @@ -108,7 +99,6 @@ Bacula programs. %package libs-sql Summary: Bacula SQL libraries -Group: System Environment/Daemons Obsoletes: bacula-libs-mysql <= 5.0.3 Obsoletes: bacula-libs-sqlite <= 5.0.3 Obsoletes: bacula-libs-postgresql <= 5.0.3 @@ -127,7 +117,6 @@ alternatives system. %package common Summary: Common Bacula files -Group: System Environment/Daemons Obsoletes: bacula-sysconfdir <= 2.4 Provides: group(%username) = %uid Provides: user(%username) = %uid @@ -144,7 +133,6 @@ This package contains files common to all Bacula daemons. %package director Summary: Bacula Director files -Group: System Environment/Daemons Requires: bacula-common%{?_isa} = %{version}-%{release} Requires: bacula-libs%{?_isa} = %{version}-%{release} Requires: bacula-libs-sql%{?_isa} = %{version}-%{release} @@ -164,7 +152,7 @@ Requires(preun): systemd Requires(postun): systemd %endif -%if 0%{?rhel} == 5 || 0%{?rhel} == 6 +%if 0%{?rhel} == 6 Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig Requires(preun): /sbin/service @@ -180,11 +168,7 @@ This package contains the director files. %package logwatch Summary: Bacula Director logwatch scripts -Group: System Environment/Daemons -# RHEL 5 does not support noarch subpackages -%if 0%{?fedora} || 0%{?rhel} >= 6 BuildArch: noarch -%endif Requires: bacula-director = %{version}-%{release} Requires: logwatch @@ -197,7 +181,6 @@ This package contains logwatch scripts for Bacula Director. %package storage Summary: Bacula storage daemon files -Group: System Environment/Daemons Requires: bacula-common%{?_isa} = %{version}-%{release} Requires: bacula-libs%{?_isa} = %{version}-%{release} Requires: bacula-libs-sql%{?_isa} = %{version}-%{release} @@ -218,7 +201,7 @@ Requires(preun): systemd Requires(postun): systemd %endif -%if 0%{?rhel} == 5 || 0%{?rhel} == 6 +%if 0%{?rhel} == 6 Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig Requires(preun): /sbin/service @@ -236,7 +219,6 @@ devices. %package client Summary: Bacula backup client -Group: System Environment/Daemons Requires: bacula-common%{?_isa} = %{version}-%{release} Requires: bacula-libs%{?_isa} = %{version}-%{release} @@ -246,7 +228,7 @@ Requires(preun): systemd Requires(postun): systemd %endif -%if 0%{?rhel} == 5 || 0%{?rhel} == 6 +%if 0%{?rhel} == 6 Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig Requires(preun): /sbin/service @@ -263,7 +245,6 @@ backed up. %package console Summary: Bacula management console -Group: System Environment/Daemons Obsoletes: bacula-console-gnome <= 2.4 Obsoletes: bacula-console-wxwidgets <= 5.0.3 Requires: bacula-libs%{?_isa} = %{version}-%{release} @@ -276,10 +257,8 @@ based on a client/server architecture. This package contains the command-line management console for the bacula backup system. -%if 0%{?fedora} || 0%{?rhel} >= 6 %package console-bat Summary: Bacula bat console -Group: System Environment/Daemons Requires: bacula-libs%{?_isa} = %{version}-%{release} Requires: dejavu-lgc-sans-fonts @@ -292,7 +271,6 @@ This package contains the bat version of the bacula management console. %package traymonitor Summary: Bacula system tray monitor -Group: System Environment/Daemons Requires: bacula-libs%{?_isa} = %{version}-%{release} Requires: dejavu-lgc-sans-fonts @@ -303,11 +281,9 @@ based on a client/server architecture. This package contains the Gnome and KDE compatible tray monitor to monitor your bacula server. -%endif %package devel Summary: Bacula development files -Group: Development/Libraries Requires: bacula-libs%{?_isa} = %{version}-%{release} Requires: bacula-libs-sql%{?_isa} = %{version}-%{release} @@ -320,7 +296,6 @@ This development package contains static libraries and header files. %package -n nagios-plugins-bacula Summary: Nagios Plugin - check_bacula -Group: Applications/System Requires: bacula-libs%{?_isa} = %{version}-%{release} Requires: nagios-common%{?_isa} @@ -343,7 +318,6 @@ cp %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} . find updatedb -type f | xargs chmod -x %build -build() { export CFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/ncurses" export CPPFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/ncurses" export PATH="$PATH:%{_qt4_bindir}" @@ -351,6 +325,7 @@ export PATH="$PATH:%{_qt4_bindir}" --disable-conio \ --disable-rpath \ --docdir=%{_datadir}/bacula \ + --enable-bat \ --enable-batch-insert \ --enable-build-dird \ --enable-build-stored \ @@ -380,15 +355,7 @@ export PATH="$PATH:%{_qt4_bindir}" --with-subsys-dir=%{_localstatedir}/lock/subsys \ --with-tcp-wrappers \ --with-working-dir=%{_localstatedir}/spool/bacula \ - --with-x \ - $* -} - -%if 0%{?fedora} || 0%{?rhel} >= 6 -build --enable-bat -%else -build --disable-bat -%endif + --with-x # Remove RPATH sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool @@ -397,7 +364,6 @@ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool make %{?_smp_mflags} make -C examples/nagios/check_bacula -%if 0%{?fedora} || 0%{?rhel} >= 6 pushd src/qt-console/tray-monitor %{?qmake_qt4}%{!?qmake_qt4:qmake-qt4} tray-monitor.pro make %{?_smp_mflags} @@ -405,11 +371,9 @@ pushd src/qt-console/tray-monitor popd # Convert image to png for tray monitor icon convert %{SOURCE19} bacula-tray-monitor.png -%endif %install -rm -rf %{buildroot} -make install DESTDIR=%{buildroot} +%make_install # Nagios plugin install -p -m 755 -D examples/nagios/check_bacula/.libs/check_bacula %{buildroot}%{_libdir}/nagios/plugins/check_bacula @@ -418,7 +382,6 @@ install -p -m 755 -D examples/nagios/check_bacula/.libs/check_bacula %{buildroot rm -f %{buildroot}%{_libdir}/libbaccats.so rm -f %{buildroot}%{_libdir}/libbaccats-%{version}.so -%if 0%{?fedora} || 0%{?rhel} >= 6 # Bat install -p -m 644 -D src/qt-console/images/bat_icon.png %{buildroot}%{_datadir}/pixmaps/bat.png desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE13} @@ -430,10 +393,6 @@ install -p -m 644 -D manpages/bacula-tray-monitor.1 %{buildroot}%{_mandir}/man1/ install -p -m 644 -D bacula-tray-monitor.png %{buildroot}%{_datadir}/pixmaps/bacula-tray-monitor.png desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE14} -%else -rm -f %{buildroot}%{_mandir}/man1/bat.1* -%endif - # Logrotate mkdir -p %{buildroot}%{_localstatedir}/log/bacula install -p -m 644 -D %{SOURCE6} %{buildroot}%{_sysconfdir}/logrotate.d/bacula @@ -460,11 +419,7 @@ install -p -m 755 -D %{SOURCE9} %{buildroot}%{_initrddir}/bacula-sd # Sysconfig install -p -m 644 -D %{SOURCE15} %{buildroot}%{_sysconfdir}/sysconfig/bacula-fd install -p -m 644 -D %{SOURCE16} %{buildroot}%{_sysconfdir}/sysconfig/bacula-dir -%if 0%{?fedora} || 0%{?rhel} >= 6 install -p -m 644 -D %{SOURCE17} %{buildroot}%{_sysconfdir}/sysconfig/bacula-sd -%else -install -p -m 644 -D %{SOURCE18} %{buildroot}%{_sysconfdir}/sysconfig/bacula-sd -%endif # Spool directory mkdir -p %{buildroot}%{_localstatedir}/spool/bacula @@ -474,11 +429,7 @@ rm -f %{buildroot}%{_libexecdir}/bacula/{bacula,bacula-ctl-*,startmysql,stopmysq rm -f %{buildroot}%{_sbindir}/bacula rm -f %{buildroot}%{_mandir}/man8/bacula.8.gz rm -f %{buildroot}%{_libdir}/*.la -%if 0%{?fedora} || 0%{?rhel} >= 6 rm -f %{buildroot}%{_datadir}/bacula/{ChangeLog,INSTALL,LICENSE*,README,ReleaseNotes,VERIFYING,technotes} -%else -rm -rf %{buildroot}%{_datadir}/bacula -%endif # Fix up some perms so rpmlint does not complain too much chmod 755 %{buildroot}%{_sbindir}/* @@ -486,9 +437,6 @@ chmod 755 %{buildroot}%{_libdir}/bacula/* chmod 755 %{buildroot}%{_libexecdir}/bacula/* chmod 644 %{buildroot}%{_libexecdir}/bacula/btraceback.* -%clean -rm -rf %{buildroot} - %post libs /sbin/ldconfig @@ -563,7 +511,7 @@ exit 0 %endif -%if 0%{?rhel} == 5 || 0%{?rhel} == 6 +%if 0%{?rhel} == 6 %post client /sbin/chkconfig --add bacula-fd @@ -610,16 +558,13 @@ fi %endif %files libs -%{!?_licensedir:%global license %%doc} %license LICENSE %doc AUTHORS ChangeLog SUPPORT ReleaseNotes LICENSE-FAQ LICENSE-FOSS -%defattr(-,root,root,-) %{_libdir}/libbac-%{version}.so %{_libdir}/libbaccfg-%{version}.so %{_libdir}/libbacfind-%{version}.so %files libs-sql -%defattr(-,root,root,-) %{_libdir}/libbaccats-mysql-%{version}.so %{_libdir}/libbaccats-mysql.so %{_libdir}/libbaccats-postgresql-%{version}.so @@ -629,7 +574,6 @@ fi %{_libdir}/libbacsql-%{version}.so %files common -%defattr(-,root,root,-) %doc README.Redhat quickstart_* %config(noreplace) %{_sysconfdir}/logrotate.d/bacula %dir %{_localstatedir}/log/bacula %attr(750, bacula, bacula) @@ -644,7 +588,6 @@ fi %{_sbindir}/btraceback %files director -%defattr(-,root,root,-) %doc updatedb examples/sample-query.sql %config(noreplace) %{_sysconfdir}/bacula/bacula-dir.conf %attr(640,root,bacula) %config(noreplace) %{_sysconfdir}/bacula/query.sql %attr(640,root,bacula) @@ -692,14 +635,12 @@ fi %endif %files logwatch -%defattr(-,root,root,-) %config(noreplace) %{_sysconfdir}/logwatch/conf/logfiles/bacula.conf %config(noreplace) %{_sysconfdir}/logwatch/conf/services/bacula.conf %{_sysconfdir}/logwatch/scripts/services/bacula %{_sysconfdir}/logwatch/scripts/shared/applybaculadate %files storage -%defattr(-,root,root,-) %config(noreplace) %{_sysconfdir}/bacula/bacula-sd.conf %attr(640,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/bacula-sd %{_libexecdir}/%{name}/disk-changer @@ -726,7 +667,6 @@ fi %files client -%defattr(-,root,root,-) %config(noreplace) %{_sysconfdir}/bacula/bacula-fd.conf %attr(640,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/bacula-fd %{_mandir}/man8/bacula-fd.8* @@ -739,14 +679,11 @@ fi %endif %files console -%defattr(-,root,root,-) %config(noreplace) %{_sysconfdir}/bacula/bconsole.conf %attr(640,root,root) %{_mandir}/man8/bconsole.8* %{_sbindir}/bconsole -%if 0%{?fedora} || 0%{?rhel} >= 6 %files console-bat -%defattr(-,root,root,-) %config(noreplace) %{_sysconfdir}/bacula/bat.conf %attr(640,root,root) %{_datadir}/applications/bacula-bat.desktop %{_datadir}/bacula/*.html @@ -756,16 +693,13 @@ fi %{_sbindir}/bat %files traymonitor -%defattr(-,root,root,-) %config(noreplace) %{_sysconfdir}/bacula/tray-monitor.conf %attr(640,root,root) %{_datadir}/applications/bacula-traymonitor.desktop %{_datadir}/pixmaps/bacula-tray-monitor.png %{_mandir}/man1/bacula-tray-monitor.1* %{_sbindir}/bacula-tray-monitor -%endif %files devel -%defattr(-,root,root,-) %{_includedir}/bacula %{_libdir}/libbac.so %{_libdir}/libbaccfg.so @@ -773,10 +707,12 @@ fi %{_libdir}/libbacsql.so %files -n nagios-plugins-bacula -%defattr(-,root,root) %{_libdir}/nagios/plugins/check_bacula %changelog +* Wed Apr 05 2017 Simone Caronni - 7.4.7-2 +- Remove all RHEL/CentOS 5 compatibility. + * Thu Mar 16 2017 Jon Ciesla - 7.4.7-1 - Update to 7.4.7.