1.1 --- a/bacula/bacula.spec Tue Aug 28 18:36:30 2012 +0200 1.2 +++ b/bacula/bacula.spec Tue Aug 28 18:36:35 2012 +0200 1.3 @@ -21,6 +21,15 @@ 1.4 ## SUCH DAMAGE. 1.5 ## 1.6 1.7 +# MSvB: 1.8 +# MSvB: Note, see http://www.bacula.org/en/?page=news 1.9 +# MSvB: for information on new configuration options. 1.10 +# MSvB: Warning! -L /pfx/lib is placed before locally 1.11 +# MSvB: built libraries (bacula-<ver>/src/cats...) 1.12 +# MSvB: which causes the old version of bacula to 1.13 +# MSvB: supply logic to the new version build! 1.14 +# MSvB: 1.15 + 1.16 # package information 1.17 Name: bacula 1.18 Summary: Network Backup Tool 1.19 @@ -32,7 +41,7 @@ 1.20 Group: System 1.21 License: GPL 1.22 Version: 5.2.10 1.23 -Release: 20120629 1.24 +Release: 20120800 1.25 1.26 # package options 1.27 %option with_server yes 1.28 @@ -60,11 +69,11 @@ 1.29 # build information 1.30 BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, gcc::with_cxx = yes 1.31 PreReq: OpenPKG, openpkg >= 20100101 1.32 -BuildPreReq: readline, zlib 1.33 -PreReq: readline, zlib 1.34 +BuildPreReq: ncurses, readline, zlib 1.35 +PreReq: ncurses, readline, zlib 1.36 %if "%{with_ssl}" == "yes" 1.37 -BuildPreReq: openssl >= 0.9.8 1.38 -PreReq: openssl >= 0.9.8 1.39 +BuildPreReq: openssl >= 0.9.8, openssl::with_threads = yes 1.40 +PreReq: openssl >= 0.9.8, openssl::with_threads = yes 1.41 %endif 1.42 %if "%{with_wrap}" == "yes" 1.43 BuildPreReq: tcpwrappers 1.44 @@ -118,13 +127,20 @@ 1.45 1.46 %build 1.47 # generate a random director password 1.48 - password="`openssl rand -base64 33`" 1.49 + #password=`tr -dc A-Za-z0-9 </dev/urandom | head -c 33` 1.50 + password=`%{l_openssl} rand -base64 33` 1.51 1.52 # for the same reason remove version informations from config files 1.53 %{l_shtool} subst \ 1.54 -e "s;For Bacula release @VERSION@ .*;;" \ 1.55 `find . -name "*.conf.in"` 1.56 1.57 + # help specific platforms find fdatasync(3) 1.58 + libs="" 1.59 + case "%{l_platform -t}" in 1.60 + *-sunos* ) libs="-lrt" ;; 1.61 + esac 1.62 + 1.63 # use localhost as default host 1.64 %{l_shtool} subst \ 1.65 -e 's;hostname=.*;hostname=localhost;g' \ 1.66 @@ -133,11 +149,11 @@ 1.67 # configure 1.68 LIBS= 1.69 case "%{l_platform -t}" in 1.70 - *-linux*) LIBS="-L/usr/lib/termcap";; 1.71 + *-sunos*) LIBS="-ldl" ;; 1.72 esac 1.73 CC="%{l_cc}" \ 1.74 CFLAGS="%{l_cflags -O}" \ 1.75 - CPPFLAGS="%{l_cppflags}" \ 1.76 + CPPFLAGS="%{l_cppflags ncurses}" \ 1.77 LDFLAGS="%{l_ldflags} $LIBS" \ 1.78 ./configure \ 1.79 --prefix=%{l_prefix} \ 1.80 @@ -177,20 +193,21 @@ 1.81 %if "%{with_python}" == "yes" || "%{with_dvd}" == "yes" 1.82 --with-python=%{l_prefix} \ 1.83 %endif 1.84 - --enable-wx-console=no \ 1.85 --sysconfdir=%{l_prefix}/etc/bacula \ 1.86 --mandir=%{l_prefix}/man \ 1.87 --with-scriptdir=%{l_prefix}/libexec/bacula \ 1.88 --with-working-dir=%{l_prefix}/var/bacula \ 1.89 --with-pid-dir=%{l_prefix}/var/bacula/run \ 1.90 --with-subsys-dir=%{l_prefix}/var/bacula/run/subsys \ 1.91 + --with-archivedir=/tmp \ 1.92 + --with-sbin-perm=0755 \ 1.93 + --disable-shared \ 1.94 --disable-nls 1.95 1.96 # build 1.97 %{l_make} %{l_mflags -O} 1.98 1.99 %install 1.100 - 1.101 # create installation hierarchy 1.102 %{l_shtool} mkdir -f -p -m 755 \ 1.103 $RPM_BUILD_ROOT%{l_prefix}/bin \ 1.104 @@ -212,8 +229,7 @@ 1.105 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT 1.106 1.107 # strip down installation 1.108 - # do not strip binaries, to make it easier to diagnose problems 1.109 - # strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true 1.110 + strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true 1.111 ( cd $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula && 1.112 for unwanted in bconsole startmysql stopmysql; do 1.113 rm -f $unwanted 1.114 @@ -224,19 +240,19 @@ 1.115 %{l_shtool} install -c -m 754 %{l_value -s -a} \ 1.116 %{SOURCE bexec.sh} $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula/bexec 1.117 1.118 - # wrap binaries to avoid to specify "-c" for each run 1.119 - ( cd $RPM_BUILD_ROOT%{l_prefix}/sbin 1.120 - for bin in bacula-dir bacula-fd bacula-sd \ 1.121 - bconsole bcopy bextract bls bscan dbcheck \ 1.122 - tray-monitor wx-console; do 1.123 - if [ -x $bin ]; then 1.124 - mv $bin $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula 1.125 - ln $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula/bexec ./$bin 1.126 - fi 1.127 - done 1.128 - ) || exit $? 1.129 + ## wrap binaries to avoid specifying '-c' on each run 1.130 + #( cd $RPM_BUILD_ROOT%{l_prefix}/sbin 1.131 + # for bin in bacula-dir bacula-fd bacula-sd \ 1.132 + # bconsole bcopy bextract bls bscan dbcheck \ 1.133 + # tray-monitor wx-console; do 1.134 + # if [ -x $bin ]; then 1.135 + # mv $bin $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula 1.136 + # ln $RPM_BUILD_ROOT%{l_prefix}/libexec/bacula/bexec ./$bin 1.137 + # fi 1.138 + # done 1.139 + #) || exit $? 1.140 1.141 - # install run-command script 1.142 + # install runcommand script 1.143 %{l_shtool} install -c -m 755 %{l_value -s -a} \ 1.144 -e 's,@with_server@,%{with_server},g' \ 1.145 %{SOURCE rc.bacula} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ 1.146 @@ -252,15 +268,13 @@ 1.147 %if "%{with_server}" == "yes" 1.148 '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/make_catalog_backup' \ 1.149 '%attr(-,%{l_musr},%{l_rgrp}) %{l_prefix}/libexec/bacula/delete_catalog_backup'\ 1.150 - '%config(noreplace) %{l_prefix}/etc/bacula/bacula-dir.conf' \ 1.151 - '%config(noreplace) %{l_prefix}/etc/bacula/bacula-sd.conf' \ 1.152 + '%attr(-,%{l_musr},%{l_rgrp}) %config(noreplace) %{l_prefix}/etc/bacula/bacula-dir.conf' \ 1.153 + '%attr(-,%{l_musr},%{l_rgrp}) %config(noreplace) %{l_prefix}/etc/bacula/bacula-sd.conf' \ 1.154 %endif 1.155 - '%config(noreplace) %{l_prefix}/etc/bacula/bacula-fd.conf' \ 1.156 -%if "%{with_server}" == "yes" 1.157 - '%attr(640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/bacula/bacula-dir.conf' \ 1.158 - '%attr(640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/bacula/bacula-sd.conf' \ 1.159 -%endif 1.160 - '%attr(640,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/bacula/bacula-fd.conf' 1.161 + '%attr(-,%{l_musr},%{l_rgrp}) %config(noreplace) %{l_prefix}/etc/bacula/bacula-fd.conf' \ 1.162 + '%attr(-,%{l_musr},%{l_rgrp}) %config(noreplace) %{l_prefix}/etc/bacula/bconsole.conf' \ 1.163 + '%attr(750,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/bacula/clients' \ 1.164 + '%attr(750,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/bacula/scripts' 1.165 1.166 %files -f files 1.167 1.168 @@ -268,11 +282,13 @@ 1.169 1.170 %post 1.171 # create initial database 1.172 +%if "%{with_server}" == "yes" 1.173 if [ ! -f $RPM_INSTALL_PREFIX/var/bacula/bacula.db ]; then 1.174 $RPM_INSTALL_PREFIX/libexec/bacula/make_bacula_tables 1.175 chmod 600 $RPM_INSTALL_PREFIX/var/bacula/bacula.db 1.176 chown %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/var/bacula/bacula.db 1.177 fi 1.178 +%endif 1.179 1.180 # after upgrade, restart service 1.181 [ $1 -eq 2 ] || exit 0