|
|
@@ -25,8 +25,8 @@
|
|
|
# FIXME: rse: "odoc" support still not in final shape
|
|
|
|
|
|
# package component versions
|
|
|
-%define V_bacula 1.37.30
|
|
|
-%define V_doc 20050717
|
|
|
+%define V_bacula 1.37.36
|
|
|
+%define V_doc 20050823
|
|
|
|
|
|
# package information
|
|
|
Name: bacula
|
|
|
@@ -39,23 +39,26 @@ Class: EVAL
|
|
|
Group: System
|
|
|
License: GPL
|
|
|
Version: %{V_bacula}
|
|
|
-Release: 20050721
|
|
|
+Release: 20050824
|
|
|
|
|
|
# package options
|
|
|
-%option with_server yes
|
|
|
-%option with_user %{l_musr}
|
|
|
-%option with_group %{l_mgrp}
|
|
|
-%option with_ssl yes
|
|
|
-%option with_db sqlite
|
|
|
-%option with_dvd no
|
|
|
-%option with_mtx no
|
|
|
-%option with_x11 no
|
|
|
+%option with_server yes
|
|
|
+%option with_user %{l_rusr}
|
|
|
+%option with_group %{l_rgrp}
|
|
|
+%option with_ssl yes
|
|
|
+%option with_wrap no
|
|
|
+%option with_db sqlite
|
|
|
+%option with_dvd no
|
|
|
+%option with_mtx no
|
|
|
+%option with_python no
|
|
|
+%option with_wxconsole no
|
|
|
+%option with_traymonitor no
|
|
|
|
|
|
# list of sources
|
|
|
Source0: http://prdownloads.sourceforge.net/bacula/bacula-%{version}.tar.gz
|
|
|
-Source1: ftp://ftp.openpkg.org/sources/CPY/VERSIONED/bacula-doc-%{V_doc}.tar.gz
|
|
|
+Source1: ftp://ftp.openpkg.org/sources/CPY/VERSIONED/bacula/bacula-doc-%{V_doc}.tar.gz
|
|
|
Source2: rc.bacula
|
|
|
-Source3: bconsole.sh
|
|
|
+Source3: bexec.sh
|
|
|
Patch0: bacula.patch
|
|
|
|
|
|
# build information
|
|
|
@@ -69,6 +72,10 @@ PreReq: readline, zlib
|
|
|
BuildPreReq: openssl >= 0.9.8
|
|
|
PreReq: openssl >= 0.9.8
|
|
|
%endif
|
|
|
+%if "%{with_wrap}" == "yes"
|
|
|
+BuildPreReq: tcpwrappers
|
|
|
+PreReq: tcpwrappers
|
|
|
+%endif
|
|
|
%if "%{with_db}" == "sqlite"
|
|
|
BuildPreReq: sqlite
|
|
|
PreReq: sqlite
|
|
|
@@ -82,11 +89,25 @@ BuildPreReq: postgresql
|
|
|
PreReq: postgresql
|
|
|
%endif
|
|
|
%if "%{with_dvd}" == "yes"
|
|
|
+BuildPreReq: dvdrw-tools
|
|
|
PreReq: dvdrw-tools
|
|
|
%endif
|
|
|
%if "%{with_mtx}" == "yes"
|
|
|
+BuildPreReq: mtx
|
|
|
PreReq: mtx
|
|
|
%endif
|
|
|
+%if "%{with_python}" == "yes" || "%{with_dvd}" == "yes"
|
|
|
+BuildPreReq: python
|
|
|
+PreReq: python
|
|
|
+%endif
|
|
|
+%if "%{with_wxconsole}" == "yes"
|
|
|
+BuildPreReq: wx
|
|
|
+PreReq: wx
|
|
|
+%endif
|
|
|
+%if "%{with_traymonitor}" == "yes"
|
|
|
+BuildPreReq: gtk2
|
|
|
+PreReq: gtk2
|
|
|
+%endif
|
|
|
AutoReq: no
|
|
|
AutoReqProv: no
|
|
|
|
|
|
@@ -110,8 +131,19 @@ AutoReqProv: no
|
|
|
%setup -q
|
|
|
%setup -q -D -T -b 1
|
|
|
%patch -p0
|
|
|
+ rm src/lib/tcpd.h
|
|
|
|
|
|
%build
|
|
|
+ # delay generation of default passwords until installation, else
|
|
|
+ # the config files change on every install leading _always_ to
|
|
|
+ # the generation of .rpmnew files which prevent rc start/stop/restart
|
|
|
+ for pwd in dir_password fd_password sd_password \
|
|
|
+ mon_dir_password mon_fd_password mon_sd_password; do
|
|
|
+ %{l_shtool} subst \
|
|
|
+ -e "s;^s,@$pwd@,;s,@-$pwd-@,;" \
|
|
|
+ configure
|
|
|
+ done
|
|
|
+
|
|
|
# configure
|
|
|
case "%{with_db}" in
|
|
|
sqlite ) cfg_db="--with-sqlite=%{l_prefix}" ;;
|
|
|
@@ -139,17 +171,24 @@ AutoReqProv: no
|
|
|
%endif
|
|
|
%if "%{with_ssl}" == "yes"
|
|
|
--with-openssl=%{l_prefix} \
|
|
|
+%endif
|
|
|
+%if "%{with_wrap}" == "yes"
|
|
|
+ --with-tcp-wrappers=yes \
|
|
|
%endif
|
|
|
$cfg_db \
|
|
|
-%if "%{with_x11}" == "yes"
|
|
|
- --with-x \
|
|
|
+%if "%{with_python}" == "yes" || "%{with_dvd}" == "yes"
|
|
|
+ --with-python=%{l_prefix} \
|
|
|
+%endif
|
|
|
+%if "%{with_wxconsole}" == "yes"
|
|
|
+ --enable-wx-console=yes \
|
|
|
%endif
|
|
|
--sysconfdir=%{l_prefix}/etc/bacula \
|
|
|
--mandir=%{l_prefix}/man \
|
|
|
--with-scriptdir=%{l_prefix}/libexec/bacula \
|
|
|
--with-working-dir=%{l_prefix}/var/bacula \
|
|
|
--with-pid-dir=%{l_prefix}/var/bacula/run \
|
|
|
- --with-subsys-dir=%{l_prefix}/var/bacula/run/subsys
|
|
|
+ --with-subsys-dir=%{l_prefix}/var/bacula/run/subsys \
|
|
|
+ --disable-nls
|
|
|
|
|
|
# build
|
|
|
%{l_make} %{l_mflags -O}
|
|
|
@@ -163,6 +202,7 @@ AutoReqProv: no
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/sbin \
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/libexec/bacula \
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/etc/bacula \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/etc/bacula/clients \
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/var/bacula \
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/var/bacula/run \
|
|
|
@@ -177,7 +217,8 @@ AutoReqProv: no
|
|
|
%{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
|
|
|
|
|
|
# strip down installation
|
|
|
- strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true
|
|
|
+ # do not strip binaries, to make it easier to diagnose problems
|
|
|
+ # 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
|
|
|
@@ -186,20 +227,30 @@ AutoReqProv: no
|
|
|
rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/bacula.8.gz
|
|
|
|
|
|
# install additional files
|
|
|
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
|
|
|
- %{SOURCE bconsole.sh} $RPM_BUILD_ROOT%{l_prefix}/bin/bconsole
|
|
|
+ %{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 $?
|
|
|
|
|
|
# install run-command script
|
|
|
%{l_shtool} install -c -m 644 %{l_value -s -a} \
|
|
|
-e 's,@with_server@,%{with_server},g' \
|
|
|
%{SOURCE rc.bacula} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
|
|
|
|
|
|
- # documentation/examples
|
|
|
+ # install documentation/examples
|
|
|
%{l_shtool} install -c -m 644 \
|
|
|
-e 's,/usr/share/doc/bacula-<version>,%{l_prefix}/doc/bacula,' \
|
|
|
scripts/bacula.man $RPM_BUILD_ROOT%{l_prefix}/man/man8/bacula.8
|
|
|
-
|
|
|
- # install documentation
|
|
|
if %{l_odoc} -F; then
|
|
|
echo "WARNING: will not package auxiliary documentation" 1>&2
|
|
|
else
|
|
|
@@ -213,10 +264,21 @@ AutoReqProv: no
|
|
|
'%attr(750,%{with_user},%{with_group}) %{l_prefix}/var/bacula' \
|
|
|
'%attr(750,%{with_user},%{with_group}) %{l_prefix}/var/bacula/run' \
|
|
|
'%attr(750,%{with_user},%{with_group}) %{l_prefix}/var/bacula/run/subsys' \
|
|
|
- '%config %{l_prefix}/etc/bacula/bconsole.conf' \
|
|
|
- '%config %{l_prefix}/etc/bacula/bacula-sd.conf' \
|
|
|
- '%config %{l_prefix}/etc/bacula/bacula-fd.conf' \
|
|
|
- '%config %{l_prefix}/etc/bacula/bacula-dir.conf'
|
|
|
+ '%attr(-,-,%{with_group}) %{l_prefix}/libexec/bacula/dvd-freespace' \
|
|
|
+ '%attr(-,-,%{with_group}) %{l_prefix}/libexec/bacula/dvd-writepart' \
|
|
|
+ '%attr(-,-,%{with_group}) %{l_prefix}/libexec/bacula/mtx-changer' \
|
|
|
+ '%attr(-,-,%{with_group}) %{l_prefix}/libexec/bacula/make_catalog_backup' \
|
|
|
+ '%attr(-,-,%{with_group}) %{l_prefix}/libexec/bacula/delete_catalog_backup'\
|
|
|
+ '%config(noreplace) %{l_prefix}/etc/bacula/bacula-sd.conf' \
|
|
|
+ '%config(noreplace) %{l_prefix}/etc/bacula/bacula-fd.conf' \
|
|
|
+ '%config(noreplace) %{l_prefix}/etc/bacula/bacula-dir.conf' \
|
|
|
+%if "%{with_wxconsole}" == "yes"
|
|
|
+ '%config(noreplace) %{l_prefix}/etc/bacula/wx-console.conf' \
|
|
|
+%endif
|
|
|
+%if "%{with_traymonitor}" == "yes"
|
|
|
+ '%config(noreplace) %{l_prefix}/etc/bacula/tray-monitor.conf' \
|
|
|
+%endif
|
|
|
+ '%config(noreplace) %{l_prefix}/etc/bacula/bconsole.conf'
|
|
|
|
|
|
%files -f files
|
|
|
%docdir %{l_docdir}
|
|
|
@@ -232,6 +294,15 @@ AutoReqProv: no
|
|
|
chown %{with_user}:%{with_group} $RPM_INSTALL_PREFIX/var/bacula/bacula.db
|
|
|
fi
|
|
|
|
|
|
+ # generate default passwords
|
|
|
+ for pwd in dir_password fd_password sd_password \
|
|
|
+ mon_dir_password mon_fd_password mon_sd_password; do
|
|
|
+ %{l_shtool} subst \
|
|
|
+ -e "s;@$pwd@;`openssl rand -base64 33`;" \
|
|
|
+ $RPM_INSTALL_PREFIX/etc/bacula/*.conf \
|
|
|
+ $RPM_INSTALL_PREFIX/etc/bacula/*.conf.rpmnew 2>/dev/null
|
|
|
+ done
|
|
|
+
|
|
|
# after upgrade, restart service
|
|
|
[ $1 -eq 2 ] || exit 0
|
|
|
eval `%{l_rc} bacula status 2>/dev/null`
|