%bcond_without pgsql # use PostgreSQL
%bcond_without sqlite3 # use SQLite3
%bcond_without python
-%bcond_with nagios # build nagios plugin
+%bcond_without nagios # build nagios plugin
%bcond_with rescue
%bcond_with sqlite3_sync_off # makes SQLite3 backend much faster, but less reliable
Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
Name: bacula
Version: 5.0.3
-Release: 1
+Release: 6
License: extended GPL v2
Group: Networking/Utilities
Source0: http://downloads.sourceforge.net/bacula/%{name}-%{version}.tar.gz
Patch7: %{name}-dbi_fixes.patch
Patch8: %{name}-dbi_dbcheck.patch
Patch9: %{name}-openssl1.patch
+Patch10: %{name}-dvd_rewind.patch
URL: http://www.bacula.org/
BuildRequires: acl-devel
BuildRequires: autoconf
BuildRequires: zlib-devel
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define _sysconfdir /etc/%{name}
+%define _sysconfdir /etc/%{name}
%define _localstatedir /var/lib/%{name}
-%define nagiosplugindir %{_prefix}/lib/nagios/plugins
+%define nagiosplugindir %{_libdir}/nagios/plugins
# from 'the worst' to 'the best'
%define databases %{?with_dbi:dbi} %{?with_sqlite3:sqlite3} %{?with_mysql:mysql} %{?with_pgsql:postgresql}
%setup -q -a 1
%patch0 -p1
%patch1 -p0
-#%patch2 -p1
+%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
+%patch10 -p1
tar -xf %{SOURCE2} && ln -s bacula-rescue-* rescue
%install
rm -rf $RPM_BUILD_ROOT
-
install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,logrotate.d,pam.d,sysconfig}
install -d $RPM_BUILD_ROOT%{_sysconfdir}/rescue
install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_mandir},%{_bindir},/var/log/bacula}
file_prefix=${orig_name%%-*.so}
file_suffix=${orig_name#*-}
file_name=$file_prefix-$database-$file_suffix
- install -p $libfile $RPM_BUILD_ROOT/%{_libdir}/$file_name
- touch $RPM_BUILD_ROOT/%{_libdir}/$orig_name
+ install -p $libfile $RPM_BUILD_ROOT%{_libdir}/$file_name
+ touch $RPM_BUILD_ROOT%{_libdir}/$orig_name
done
done
+# replace with empty file, replaced by ldconfig from each db-* package on intsall
+rm -f $RPM_BUILD_ROOT%{_libdir}/libbacsql-%{version}.so
+touch $RPM_BUILD_ROOT%{_libdir}/libbacsql-%{version}.so
+
install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-dir
install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-fd
install -p %{SOURCE12} $RPM_BUILD_ROOT/etc/rc.d/init.d/bacula-sd
%endif
%if %{with bat}
-# TODO: libtool install
-#libtool --silent --mode=install install src/qt-console/bat $RPM_BUILD_ROOT%{_bindir}
-install src/qt-console/.libs/bat $RPM_BUILD_ROOT%{_bindir}
+mv $RPM_BUILD_ROOT{%{_sbindir},%{_bindir}}/bat
cp -a scripts/bat.desktop $RPM_BUILD_ROOT%{_desktopdir}
%endif
touch $RPM_BUILD_ROOT/var/log/bacula/log
-# install the updatedb scripts
-install -p updatedb/update_sqlite* $RPM_BUILD_ROOT%{_libexecdir}/%{name}
+# install the updatedb scripts for older versions that last full release
+# 2.0 -> 3.0 : 10_to_11
+install -p updatedb/update_*_tables_10_to_11 $RPM_BUILD_ROOT%{_libexecdir}/%{name}
# place for site passwords
touch $RPM_BUILD_ROOT%{_sysconfdir}/{dir-password,fd-password,sd-password}
rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/bacula-ctl-*
# unsupported
-#rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/*_bdb_*
+rm $RPM_BUILD_ROOT%{_libexecdir}/%{name}/btraceback.mdb
# rename to avoid possible conflicts
mv $RPM_BUILD_ROOT%{_sbindir}/{,bacula-}dbcheck
for f in create_bacula_database drop_bacula_database drop_bacula_tables \
grant_bacula_privileges make_bacula_tables update_bacula_tables ; do
- ln -sf /dev/null $RPM_BUILD_ROOT%{_libexecdir}/%{name}/$f
+ touch $RPM_BUILD_ROOT%{_libexecdir}/%{name}/$f
done
%if %{with nagios}
+install -d $RPM_BUILD_ROOT%{nagiosplugindir}
%{__make} -C examples/nagios/check_bacula install \
sbindir=%{nagiosplugindir} \
+ INSTALL_PROGRAM="libtool --mode=install install -p" \
DESTDIR=$RPM_BUILD_ROOT
%endif
%groupadd -P %{name}-common -g 136 -r -f bacula
%useradd -P %{name}-common -u 136 -r -d /var/lib/bacula -s /bin/false -c "Bacula User" -g bacula bacula
-
%define update_configs \
-echo "Updating bacula passwords and names..." | %banner \
+echo "Updating bacula passwords and names..." | %banner -a %{name} \
cd /etc/bacula \
-for f in *-password ; do \
- if [ ! -s $f ] ; then \
+for f in *-password; do \
+ if [ ! -s $f ]; then \
openssl rand -base64 33 > $f \
fi \
- p=`cat $f` \
- for cf in *.conf *.conf.rpmnew ; do \
+ p=$(cat $f) \
+ for cf in *.conf *.conf.rpmnew; do \
[ -f $cf ] && sed -i -e"s:#FAKE-$f#:$p:" "$cf" || : \
done \
done \
-for cf in *.conf *.conf.rpmnew ; do \
+for cf in *.conf *.conf.rpmnew; do \
[ -f $cf ] && sed -i -e"s:--hostname--:`hostname`:" "$cf" || : \
done
%attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
%attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
%attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
-%attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite_*
%attr(755,root,root) %{_libdir}/libbacsql-sqlite3-5*.so
%ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so
%attr(755,root,root) %{_libexecdir}/%{name}/grant_sqlite3_privileges
%attr(755,root,root) %{_libexecdir}/%{name}/make_sqlite3_tables
%attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite3_*
-%attr(755,root,root) %{_libexecdir}/%{name}/update_sqlite_*
%attr(755,root,root) %{_libdir}/libbacsql-dbi-5*.so
%ghost %attr(755,root,root) %{_libdir}/libbacsql-5*.so