%define wxconsole 0
%{?build_wxconsole:%define wxconsole 1}
+# Should we build bat
+# requires QT4
+%define bat 0
+%{?build_bat:%define bat 1}
+
# should we turn on python support
%define python 0
%{?build_python:%define python 1}
%if %{gconsole}
BuildRequires: pkgconfig, pango-devel, atk-devel
%endif
+%if %{bat}
+BuildRequires: qt-devel >= 4
+%endif
%if %{rh7}
BuildRequires: libtermcap-devel
BuildRequires: glibc-devel >= 2.2
server packages.
%endif
+%if %{bat}
+%package bat
+Summary: Bacula - The Network Backup Solution
+Group: System Environment/Daemons
+%endif
+
+%if %{bat} && %{su102}
+Requires: openssl
+Requires: glibc >= 2.5
+Requires: fontconfig
+Requires: freetype2
+Requires: libgcc
+Requires: libpng
+Requires: qt >= 4
+Requires: libstdc++
+Requires: zlib
+%endif
+
+%if %{bat} && %{fc6}
+Requires: openssl
+Requires: glibc >= 2.5
+Requires: fontconfig
+Requires: freetype
+Requires: libgcc
+Requires: libpng
+Requires: qt >= 4
+Requires: libstdc++
+Requires: zlib
+%endif
+
+%if %{bat}
+%description bat
+%{blurb}
+
+%{blurb2}
+%{blurb3}
+%{blurb4}
+%{blurb5}
+%{blurb6}
+%{blurb7}
+%{blurb8}
+
+This is the Bacula Administration Tool package. It is an add-on to
+the client or server packages.
+%endif
+
%prep
%setup
--with-postgresql \
%endif
%if %{wxconsole}
- --enable-wx-console \
+ --enable-bwx-console \
+%endif
+%if %{bat}
+ --enable-bat \
%endif
%if %{python}
--with-python \
mkdir -p $RPM_BUILD_ROOT/etc/log.d/scripts/services
mkdir -p $RPM_BUILD_ROOT%{script_dir}/updatedb
-%if %{gconsole} || %{wxconsole}
+%if %{gconsole} || %{wxconsole} || %{bat}
mkdir -p $RPM_BUILD_ROOT/usr/share/applications
mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
%endif
-%if %{gconsole} || %{wxconsole}
+%if %{gconsole} || %{wxconsole} || %{bat}
%define usermode_iftrick 1
%else
%define usermode_iftrick 0
# make install in manpages installs _everything_ shotgun style
# so now delete what we will not be packaging
%if ! %{wxconsole}
-rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-wxconsole.1.gz
+rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext}
+%endif
+%if ! %{bat}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bat.1.%{manpage_ext}
%endif
%if ! %{gconsole}
-rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-console-gnome.1.gz
-rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-tray-monitor.1.gz
+rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bacula-tray-monitor.1.%{manpage_ext}
%endif
%if %{client_only}
-rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bsmtp.1.gz
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-dir.8.gz
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-sd.8.gz
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bcopy.8.gz
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bextract.8.gz
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bls.8.gz
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bscan.8.gz
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/btape.8.gz
-rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.gz
+rm -f $RPM_BUILD_ROOT%{_mandir}/man1/bsmtp.1.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-dir.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bacula-sd.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bcopy.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bextract.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bls.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/bscan.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/btape.8.%{manpage_ext}
+rm -f $RPM_BUILD_ROOT%{_mandir}/man8/dbcheck.8.%{manpage_ext}
%endif
# fixme - make installs the mysql scripts for sqlite build
cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
cp -p scripts/wxconsole.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
%endif
+%if %{bat} && %{su102}
+cp -p src/qt-console/images/bat_icon.png $RPM_BUILD_ROOT/usr/share/pixmaps/bat_icon.png
+cp -p scripts/bat.desktop.xsu $RPM_BUILD_ROOT/usr/share/applications/bat.desktop
+%endif
%if %{rh8} || %{rh9} || %{wb3} || %{fc1} || %{fc3} || %{fc4} || %{fc5} || %{mdk}
%define iftrick 1
%else
%if %{gconsole} && %{iftrick}
cp -p scripts/bacula.png $RPM_BUILD_ROOT/usr/share/pixmaps/bacula.png
cp -p scripts/bacula.desktop.gnome2.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bacula.desktop
-cp -p scripts/gnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/gnome-console
-cp -p scripts/gnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/gnome-console
-ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/gnome-console
+cp -p scripts/bgnome-console.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/bgnome-console
+cp -p scripts/bgnome-console.pamd $RPM_BUILD_ROOT/etc/pam.d/bgnome-console
+ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/bgnome-console
%endif
%if %{gconsole} && ! %{rh8}
cp -p src/tray-monitor/generic.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/bacula-tray-monitor.xpm
%if %{wxconsole} && %{iftrick}
cp -p src/wx-console/wxwin16x16.xpm $RPM_BUILD_ROOT/usr/share/pixmaps/wxwin16x16.xpm
cp -p scripts/wxconsole.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/wxconsole.desktop
-cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/wxconsole
-cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/wxconsole
-ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/wxconsole
+cp -p scripts/wxconsole.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/bwx-console
+cp -p scripts/wxconsole.pamd $RPM_BUILD_ROOT/etc/pam.d/bwx-console
+ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/bwx-console
+%endif
+%if %{bat} && %{iftrick}
+cp -p src/qt-console/images/bat_icon.png $RPM_BUILD_ROOT/usr/share/pixmaps/bat_icon.png
+cp -p scripts/bat.desktop.consolehelper $RPM_BUILD_ROOT/usr/share/applications/bat.desktop
+cp -p scripts/bat.console_apps $RPM_BUILD_ROOT/etc/security/console.apps/bat
+cp -p scripts/bat.pamd $RPM_BUILD_ROOT/etc/pam.d/bat
+ln -sf consolehelper $RPM_BUILD_ROOT/usr/bin/bat
%endif
# install sqlite
cp -p src/filed/static-bacula-fd $RPM_BUILD_ROOT%{sysconf_dir}/rescue/linux/cdrom/bacula/bin/bacula-fd
rm -f src/filed/static-bacula-fd
-%if %{wxconsole}
-mv $RPM_BUILD_ROOT/usr/sbin/wx-console $RPM_BUILD_ROOT/usr/sbin/wxconsole
-mv $RPM_BUILD_ROOT%{sysconf_dir}/wx-console.conf $RPM_BUILD_ROOT%{sysconf_dir}/wxconsole.conf
+# install bat since make doesn't at the moment
+%if %{bat}
+cp -p src/qt-console/bat $RPM_BUILD_ROOT/usr/sbin/bat
+cp -p src/qt-console/bat.conf $RPM_BUILD_ROOT%{sysconf_dir}/bat.conf
%endif
# now clean up permissions that are left broken by the install
%if %{gconsole}
%files gconsole
%defattr(-,root,root)
-/usr/sbin/gnome-console
+/usr/sbin/bgnome-console
%attr(-, root, %{daemon_group}) %dir %{script_dir}
%attr(-, root, %{daemon_group}) %{script_dir}/gconsole
-%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/gnome-console.conf
+%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bgnome-console.conf
/usr/share/pixmaps/bacula.png
/usr/share/applications/bacula.desktop
-%{_mandir}/man1/bacula-console-gnome.1.%{manpage_ext}
+%{_mandir}/man1/bacula-bgnome-console.1.%{manpage_ext}
%endif
%if %{gconsole} && ! %{rh8}
%if %{gconsole} && ! %{su9} && ! %{su10} && ! %{su102}
# add the console helper files
-%config(noreplace,missingok) /etc/pam.d/gnome-console
-%config(noreplace,missingok) /etc/security/console.apps/gnome-console
-/usr/bin/gnome-console
+%config(noreplace,missingok) /etc/pam.d/bgnome-console
+%config(noreplace,missingok) /etc/security/console.apps/bgnome-console
+/usr/bin/bgnome-console
%endif
%if %{gconsole}
%if %{wxconsole}
%files wxconsole
%defattr(-,root,root)
-/usr/sbin/wxconsole
+/usr/sbin/bwx-console
%attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
-%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/wxconsole.conf
+%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bwx-console.conf
/usr/share/pixmaps/wxwin16x16.xpm
/usr/share/applications/wxconsole.desktop
-%{_mandir}/man1/bacula-wxconsole.1.%{manpage_ext}
+%{_mandir}/man1/bacula-bwxconsole.1.%{manpage_ext}
%endif
%if %{wxconsole} && ! %{su9} && ! %{su10} && ! %{su102}
# add the console helper files
-%config(noreplace,missingok) /etc/pam.d/wxconsole
-%config(noreplace,missingok) /etc/security/console.apps/wxconsole
-/usr/bin/wxconsole
+%config(noreplace,missingok) /etc/pam.d/bwx-console
+%config(noreplace,missingok) /etc/security/console.apps/bwx-console
+/usr/bin/bwx-console
%endif
%if %{wxconsole}
fi
%endif
+%if %{bat}
+%files bat
+%defattr(-,root,root)
+/usr/sbin/bat
+%attr(-, root, %{daemon_group}) %dir %{sysconf_dir}
+%attr(-, root, %{daemon_group}) %config(noreplace) %{sysconf_dir}/bat.conf
+/usr/share/pixmaps/bat_icon.png
+/usr/share/applications/bat.desktop
+%{_mandir}/man1/bat.1.%{manpage_ext}
+%endif
+
+%if %{bat} && ! %{su9} && ! %{su10} && ! %{su102}
+# add the console helper files
+%config(noreplace,missingok) /etc/pam.d/bat
+%config(noreplace,missingok) /etc/security/console.apps/bat
+/usr/bin/bat
+%endif
+
+%if %{bat}
+%pre bat
+# create the daemon group
+HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null`
+if [ -z "$HAVE_BACULA" ]; then
+ %{groupadd} -r %{daemon_group} > /dev/null 2>&1
+ echo "The group %{daemon_group} has been added to %{group_file}."
+ echo "See the manual chapter \"Running Bacula\" for details."
+fi
+
+%post bat
+# generate passwords if needed
+if [ -d %{sysconf_dir} ]; then
+ cd %{sysconf_dir}
+ for file in *.conf; do
+ for string in XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_PASSWORD_XXX XXX_REPLACE_WITH_DIRECTOR_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_CLIENT_MONITOR_PASSWORD_XXX XXX_REPLACE_WITH_STORAGE_MONITOR_PASSWORD_XXX; do
+ need_password=`grep $string $file 2>/dev/null`
+ if [ -n "$need_password" ]; then
+ pass=`openssl rand -base64 33`
+ sed "s-$string-$pass-g" $file > $file.new
+ cp -f $file.new $file; rm -f $file.new
+ fi
+ done
+ done
+fi
+%endif
+
%changelog
+* Sun Apr 29 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
+- 2.1.8
+- gnome-console now bgnome-console
+- wxconsole now bwx-console
+- add build option for bat
* Sat Apr 08 2007 D. Scott Barninger <barninger@fairfieldcomputers.com>
- merge Otto Mueller's patch but keep script dir set to /etc/bacula
- add build tag for Scientific Linux per Jon Peatfield <J.S.Peatfield@damtp.cam.ac.uk>