-Summary: Bacula - The Network Backup Solution
-Summary(pl.UTF-8): Bacula - rozwiązanie do wykonywania kopii zapasowych po sieci
-Name: bacula-gui
-Version: 2.2.8
-Release: 0.1
-License: extended GPL v2
-Group: Networking/Utilities
-Source0: http://dl.sourceforge.net/bacula/%{name}-%{version}.tar.gz
-# Source0-md5: 7858cfddf87fe101eea3959ed18d1836
-URL: http://www.bacula.org/
+# TODO
+# - lighttpd support
+%define php_min_version 5.3.4
+%include /usr/lib/rpm/macros.php
+Summary: Open source monitoring and reporting tool for Bacula
+Name: bacula-web
+Version: 6.0.0
+Release: 4
+License: GPL v2
+Group: Applications/WWW
+Source0: http://www.bacula-web.org/download/articles/bacula-web-600.html?file=files/bacula-web.org/downloads/%{name}-%{version}.tgz
+# Source0-md5: 3e99f9626cf4329ce43947f11a9d8f49
+Source1: apache.conf
+Patch0: sys-libs.patch
+URL: http://www.bacula-web.org/
+BuildRequires: rpm-php-pearprov >= 4.4.2-11
+BuildRequires: rpmbuild(macros) >= 1.654
+BuildRequires: sed >= 4.0
+Requires: Smarty
+Requires: Smarty-plugin-gettext
+Requires: php(core) >= %{php_min_version}
+Requires: php(gd)
+Requires: php(gettext)
+Requires: php(pdo)
+Requires: php(session)
+Requires: phplot
+Requires: webserver(php)
+# Any of the db drivers needed depending where you hold your Bacula DB
+Suggests: php-pdo-mysql
+Suggests: php-pdo-pgsql
+Suggests: php-pdo-sqlite
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define _sysconfdir /etc/bacula
-%define _localstatedir /var/lib/bacula
+%define _webapps /etc/webapps
+%define _webapp %{name}
+%define _sysconfdir %{_webapps}/%{_webapp}
+%define _appdir %{_datadir}/%{_webapp}
+%define cachedir /var/cache/%{name}
+%define _smartyplugindir %{php_data_dir}/Smarty/plugins
+
+# bad depsolver
+%define _noautopear pear
+# put it together for rpmbuild
+%define _noautoreq %{?_noautophp} %{?_noautopear}
%description
-Bacula - It comes by night and sucks the vital essence from your
-computers.
-
-Sets of various Bacula GUIs.
-
-%description -l pl.UTF-8
-Bacula przychodzi nocą i wysysa żywotny ekstrakt z komputerów.
-
-Zbiór różnych graficzych interfejsów do Baculi.
-
-%package bimagemgr
-Summary: A utility to monitor and burn file backups to CDR
-Summary(pl.UTF-8): Narzędzie do monitorowania i wypalania kopii zapasowych na CDR
-Group: Networking/Utilities
-Requires(post): sed >= 4.0
-Requires(post,preun): /sbin/chkconfig
-Requires(postun): /usr/sbin/groupdel
-Requires(postun): /usr/sbin/userdel
-Requires(pre): /usr/sbin/groupadd
-Requires(pre): /usr/sbin/useradd
-Requires: bacula-server
-Requires: cdrecord
-Requires: mkisofs
-Requires: perl-DBI
-
-%description bimagemgr
-A utility to monitor and burn file backups to CDR.
-
-%description bimagemgr -l pl.UTF-8
-Narzędzie do monitorowania i wypalania kopii zapasowych na CDR.
-
-%package web
-Summary: Bacula web base structure
-Summary(pl.UTF-8): Struktura bazowa WWW dla Baculi
-Group: Networking/Utilities
-Requires(post): sed >= 4.0
-Requires: %{name}-common = %{version}-%{release}
-Obsoletes: bacula-updatedb
-
-%description web
-Base structure for Bacula web apps.
-
-%description web -l pl.UTF-8
-Struktura bazowa WWW dla Baculi.
-
-%package libweb
-Summary: Bacula web library
-Summary(pl.UTF-8): Biblioteka WWW Baculi
-Group: Networking/Utilities
-Requires(post): sed >= 4.0
-Requires: %{name}-common = %{version}-%{release}
-
-%description libweb
-Bacula web library.
-
-%description libweb -l pl.UTF-8
-Biblioteka WWW Baculi.
-
-%package brestore
-Summary: A restoration GUI in Perl/GTK+
-Summary(pl.UTF-8): GUI do odzyskiwania danych w Perlu/GTK+
-Group: Networking/Utilities
-Requires(post): sed >= 4.0
-Requires: %{name}-common = %{version}-%{release}
-
-%description brestore
-A restoration GUI for Bacula developed using Perl/GTK+.
-
-It has the following features:
- - Direct SQL access to the database for good performance
- - Fast Time Navigation (switch almost instantaneously between the
- different versions of a directory, by changing the date from a list)
- - Possibility to choose a selected file, then browse all its available
- versions, and see directly if these versions are online in a library
- or not
- - Simple restoration by the generation of a BSR file
- - Works with either PostgreSQL or MySQL
-
-%description brestore -l pl.UTF-8
-GUI do odzyskiwania danych dla Baculi stworzone z użyciem Perla/GTK+.
-
-Ma następujące możliwości:
- - bezpośredni dostęp SQL do bazy danych dla uzyskania dobrej
- wydajności
- - szybką nawigację w czasie (prawie natychmiastowe przełączanie
- między różnymi wersjami katalogu poprzez zmianę daty z listy)
- - możliwość wyboru zaznaczonego pliku, a następnie przeglądanie
- dostępnych wersji i oglądanie bezpośrednio, czy wersje są w
- bibliotece
- - proste odzyskiwanie poprzez generowanie pliku BSR
- - działa z PostgreSQL-em lub MySQL-em
-
-%package bweb
-Summary: A Bacula web interface
-Summary(pl.UTF-8): Interfejs WWW do Baculi
-Group: Networking/Utilities
-Requires(post): sed >= 4.0
-Requires: %{name}-common = %{version}-%{release}
-
-%description bweb
-A Bacula web interface.
-
-%description bweb -l pl.UTF-8
-Interfejs WWW do Baculi.
+Bacula-Web is a web based tool written in PHP that provide you a
+summarized view of your bacula's backup infrastructure. It obtain his
+information from your bacula catalog's database.
%prep
%setup -q
+%patch0 -p1
+
+mv application/config .
+mv config/config.php{.sample,}
+%{__rm} application/locale/*/LC_MESSAGES/*.po
+%{__rm} -r application/view/cache
+mv core/external .
+mv DOCS/* .
-%build
-# no building; yes there is configure file there but it's useless
+# you'll need this if you cp -a complete dir in source
+# cleanup backups after patching
+find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
%install
rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir},%{cachedir}}
+cp -a *.php application core $RPM_BUILD_ROOT%{_appdir}
+cp -a config/* $RPM_BUILD_ROOT%{_sysconfdir}
+
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
%clean
rm -rf $RPM_BUILD_ROOT
-%files bimagemgr
-%defattr(644,root,root,755)
+%post
+# cleanup cache from previous rpm
+echo %{cachedir}/* | xargs rm -f
-%files web
-%defattr(644,root,root,755)
+%preun
+if [ "$1" = 0 ]; then
+ echo %{cachedir}/* | xargs rm -f
+fi
-%files libweb
-%defattr(644,root,root,755)
+%triggerin -- apache1 < 1.3.37-3, apache1-base
+%webapp_register apache %{_webapp}
-%files brestore
-%defattr(644,root,root,755)
+%triggerun -- apache1 < 1.3.37-3, apache1-base
+%webapp_unregister apache %{_webapp}
+
+%triggerin -- apache < 2.2.0, apache-base
+%webapp_register httpd %{_webapp}
+
+%triggerun -- apache < 2.2.0, apache-base
+%webapp_unregister httpd %{_webapp}
-%files bweb
+%files
%defattr(644,root,root,755)
+%doc INSTALL README Changelog
+%dir %attr(750,root,http) %{_sysconfdir}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
+
+%dir %{_appdir}
+%{_appdir}/backupjob-report.php
+%{_appdir}/client-report.php
+%{_appdir}/index.php
+%{_appdir}/joblogs.php
+%{_appdir}/jobs.php
+%{_appdir}/pools.php
+%{_appdir}/test.php
+
+%dir %{_appdir}/core
+%{_appdir}/core/bweb.class.php
+%{_appdir}/core/const.inc.php
+%{_appdir}/core/global.inc.php
+%{_appdir}/core/app
+%{_appdir}/core/db
+%{_appdir}/core/graph
+%{_appdir}/core/i18n
+%{_appdir}/core/utils
+
+%dir %{_appdir}/application
+%{_appdir}/application/libs
+%{_appdir}/application/models
+%{_appdir}/application/view
+
+%dir %{_appdir}/application/locale
+%lang(de) %{_appdir}/application/locale/de_DE
+%lang(en) %{_appdir}/application/locale/en_EN
+%lang(es) %{_appdir}/application/locale/es_ES
+%lang(fr) %{_appdir}/application/locale/fr_FR
+%lang(it) %{_appdir}/application/locale/it_IT
+%lang(nl) %{_appdir}/application/locale/nl_NL
+%lang(pt_BR) %{_appdir}/application/locale/pt_BR
+%lang(sv) %{_appdir}/application/locale/sv_SV
+
+%dir %attr(775,root,http) %{cachedir}