# HG changeset patch # User Michael Schloh von Bennewitz # Date 1346171795 -7200 # Node ID 6b18bb69901eff77c98afe61eddaf52a0e10fd91 # Parent ac1eb2cd38a8b8e5560cf7170852864d30a01075 Correct the paths of patched scripts, refine password generation, mitigate fdatasync(2) detection problems, correct dependencies, remove outdated autoconf components, correct conf file paths and attributes, complete and correct log file rotation handing, and note warnings useful for diagnosing builds. diff -r ac1eb2cd38a8 -r 6b18bb69901e bacula/bacula.patch --- a/bacula/bacula.patch Tue Aug 28 18:36:30 2012 +0200 +++ b/bacula/bacula.patch Tue Aug 28 18:36:35 2012 +0200 @@ -1,4 +1,5 @@ Index: manpages/Makefile.in +diff -Nau manpages/Makefile.in.orig manpages/Makefile.in --- manpages/Makefile.in.orig 2010-08-05 16:29:51.000000000 +0200 +++ manpages/Makefile.in 2010-12-19 19:30:06.000000000 +0100 @@ -21,23 +21,21 @@ @@ -32,25 +33,35 @@ clean: Index: scripts/bacula.in +diff -Nau scripts/bacula.in.orig scripts/bacula.in --- scripts/bacula.in.orig 2010-08-05 16:29:51.000000000 +0200 +++ scripts/bacula.in 2010-12-19 19:30:06.000000000 +0100 -@@ -20,30 +20,36 @@ +@@ -13,37 +13,43 @@ + # easier to "steal" this code for the development + # environment where they are different. + # +-SCRIPTDIR=@scriptdir@ ++SCRIPTDIR=@libexecdir@ + # + # Disable Glibc malloc checks, it doesn't help and it keeps from getting + # good dumps MALLOC_CHECK_=0 export MALLOC_CHECK_ +-case "$1" in +action=$1 +debug=$2 +[ -n "$3" ] && enable_dir=$3 || enable_dir=yes +[ -n "$4" ] && enable_sd=$4 || enable_sd=yes +[ -n "$5" ] && enable_fd=$5 || enable_fd=yes -+ - case "$1" in ++ ++case "$action" in start) - [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2 - [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2 - [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir $1 $2 -+ [ "$enable_sd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2 -+ [ "$enable_fd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2 ++ [ "$enable_sd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2 ++ [ "$enable_fd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2 + [ "$enable_dir" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir $1 $2 ;; @@ -59,14 +70,14 @@ - [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2 - [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2 - [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir $1 $2 -+ [ "$enable_fd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2 -+ [ "$enable_sd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2 ++ [ "$enable_sd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd $1 $2 ++ [ "$enable_fd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd $1 $2 + [ "$enable_dir" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir $1 $2 ;; restart) - $0 stop -+ $0 stop $debug $enable_dir $enable_sd $enable_fd ++ $0 stop $debug $enable_dir $enable_sd $enable_fd sleep 2 - $0 start + $0 start $debug $enable_dir $enable_sd $enable_fd @@ -76,16 +87,16 @@ - [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd status - [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd status - [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir status -+ [ "$enable_sd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd status -+ [ "$enable_fd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd status ++ [ "$enable_sd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-sd ] && ${SCRIPTDIR}/bacula-ctl-sd status ++ [ "$enable_fd" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-fd ] && ${SCRIPTDIR}/bacula-ctl-fd status + [ "$enable_dir" = "yes" ] && [ -x ${SCRIPTDIR}/bacula-ctl-dir ] && ${SCRIPTDIR}/bacula-ctl-dir status ;; *) Index: src/dird/bacula-dir.conf.in +diff -Nau src/dird/bacula-dir.conf.in.orig src/dird/bacula-dir.conf.in --- src/dird/bacula-dir.conf.in.orig 2010-08-05 16:29:51.000000000 +0200 +++ src/dird/bacula-dir.conf.in 2010-12-19 19:30:06.000000000 +0100 -@@ -29,7 +29,8 @@ Level = Incremental Client = @basename@-fd FileSet = "Full Set" @@ -95,6 +106,15 @@ Storage = File Messages = Standard Pool = File +@@ -106,7 +107,7 @@ + # directory to give a reasonable FileSet to backup to + # disk storage during initial testing. + # +- File = @sbindir@ ++ File = @scriptdir@ + } + + # @@ -123,6 +124,11 @@ } } diff -r ac1eb2cd38a8 -r 6b18bb69901e bacula/bacula.spec --- a/bacula/bacula.spec Tue Aug 28 18:36:30 2012 +0200 +++ b/bacula/bacula.spec Tue Aug 28 18:36:35 2012 +0200 @@ -21,6 +21,15 @@ ## SUCH DAMAGE. ## +# MSvB: +# MSvB: Note, see http://www.bacula.org/en/?page=news +# MSvB: for information on new configuration options. +# MSvB: Warning! -L /pfx/lib is placed before locally +# MSvB: built libraries (bacula-/src/cats...) +# MSvB: which causes the old version of bacula to +# MSvB: supply logic to the new version build! +# MSvB: + # package information Name: bacula Summary: Network Backup Tool @@ -32,7 +41,7 @@ Group: System License: GPL Version: 5.2.10 -Release: 20120629 +Release: 20120800 # package options %option with_server yes @@ -60,11 +69,11 @@ # build information BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, gcc::with_cxx = yes PreReq: OpenPKG, openpkg >= 20100101 -BuildPreReq: readline, zlib -PreReq: readline, zlib +BuildPreReq: ncurses, readline, zlib +PreReq: ncurses, readline, zlib %if "%{with_ssl}" == "yes" -BuildPreReq: openssl >= 0.9.8 -PreReq: openssl >= 0.9.8 +BuildPreReq: openssl >= 0.9.8, openssl::with_threads = yes +PreReq: openssl >= 0.9.8, openssl::with_threads = yes %endif %if "%{with_wrap}" == "yes" BuildPreReq: tcpwrappers @@ -118,13 +127,20 @@ %build # generate a random director password - password="`openssl rand -base64 33`" + #password=`tr -dc A-Za-z0-9 /dev/null || true + strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true ( cd $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula && for unwanted in bconsole startmysql stopmysql; do rm -f $unwanted @@ -224,19 +240,19 @@ %{l_shtool} install -c -m 754 %{l_value -s -a} \ %{SOURCE bexec.sh} $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula/bexec - # wrap binaries to avoid to specify "-c" for each run - ( cd $RPM_BUILD_ROOT%{l_prefix}/sbin - for bin in bacula-dir bacula-fd bacula-sd \ - bconsole bcopy bextract bls bscan dbcheck \ - tray-monitor wx-console; do - if [ -x $bin ]; then - mv $bin $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula - ln $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula/bexec ./$bin - fi - done - ) || exit $? + ## wrap binaries to avoid specifying '-c' on each run + #( cd $RPM_BUILD_ROOT%{l_prefix}/sbin + # for bin in bacula-dir bacula-fd bacula-sd \ + # bconsole bcopy bextract bls bscan dbcheck \ + # tray-monitor wx-console; do + # if [ -x $bin ]; then + # mv $bin $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula + # ln $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula/bexec ./$bin + # fi + # done + #) || exit $? - # install run-command script + # install runcommand script %{l_shtool} install -c -m 755 %{l_value -s -a} \ -e 's,@with_server@,%{with_server},g' \ %{SOURCE rc.bacula} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ @@ -252,15 +268,13 @@ %if "%{with_server}" == "yes" '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/make_catalog_backup' \ '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/delete_catalog_backup'\ - '%config(noreplace) %{l_prefix}/etc/bacula/bacula-dir.conf' \ - '%config(noreplace) %{l_prefix}/etc/bacula/bacula-sd.conf' \ + '%attr(-,%{l_musr},%{l_rgrp}) %config(noreplace) %{l_prefix}/etc/bacula/bacula-dir.conf' \ + '%attr(-,%{l_musr},%{l_rgrp}) %config(noreplace) %{l_prefix}/etc/bacula/bacula-sd.conf' \ %endif - '%config(noreplace) %{l_prefix}/etc/bacula/bacula-fd.conf' \ -%if "%{with_server}" == "yes" - '%attr(640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/bacula/bacula-dir.conf' \ - '%attr(640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/bacula/bacula-sd.conf' \ -%endif - '%attr(640,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/bacula/bacula-fd.conf' + '%attr(-,%{l_musr},%{l_rgrp}) %config(noreplace) %{l_prefix}/etc/bacula/bacula-fd.conf' \ + '%attr(-,%{l_musr},%{l_rgrp}) %config(noreplace) %{l_prefix}/etc/bacula/bconsole.conf' \ + '%attr(750,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/bacula/clients' \ + '%attr(750,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/bacula/scripts' %files -f files @@ -268,11 +282,13 @@ %post # create initial database +%if "%{with_server}" == "yes" if [ ! -f $RPM_INSTALL_PREFIX/var/bacula/bacula.db ]; then $RPM_INSTALL_PREFIX/libexec/bacula/make_bacula_tables chmod 600 $RPM_INSTALL_PREFIX/var/bacula/bacula.db chown %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/var/bacula/bacula.db fi +%endif # after upgrade, restart service [ $1 -eq 2 ] || exit 0