]>
Commit | Line | Data |
---|---|---|
97184a12 ER |
1 | # TODO |
2 | # - lighttpd support | |
3 | %define php_min_version 5.3.4 | |
eba56fc5 ER |
4 | Summary: Open source monitoring and reporting tool for Bacula |
5 | Name: bacula-web | |
5e3bbf5d | 6 | Version: 6.0.0 |
f5b51469 | 7 | Release: 2 |
eba56fc5 ER |
8 | License: GPL v2 |
9 | Group: Applications/WWW | |
5e3bbf5d JK |
10 | Source0: http://www.bacula-web.org/download/articles/bacula-web-600.html?file=files/bacula-web.org/downloads/%{name}-%{version}.tgz |
11 | # Source0-md5: 3e99f9626cf4329ce43947f11a9d8f49 | |
eba56fc5 | 12 | Source1: apache.conf |
138953e5 | 13 | Patch0: sys-libs.patch |
19277062 | 14 | URL: http://www.bacula-web.org/ |
eba56fc5 | 15 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
97184a12 | 16 | BuildRequires: rpmbuild(macros) >= 1.654 |
eba56fc5 | 17 | BuildRequires: sed >= 4.0 |
138953e5 ER |
18 | Requires: Smarty |
19 | Requires: Smarty-plugin-gettext | |
1f4ccae5 | 20 | Requires: php(core) >= %{php_min_version} |
f3e8be0b ER |
21 | Requires: php(gd) |
22 | Requires: php(gettext) | |
23 | Requires: php(pdo) | |
97184a12 | 24 | Requires: php(session) |
eba56fc5 | 25 | Requires: phplot |
eba56fc5 | 26 | Requires: webserver(php) |
97184a12 ER |
27 | # Any of the db drivers needed depending where you hold your Bacula DB |
28 | Suggests: php-pdo-mysql | |
29 | Suggests: php-pdo-pgsql | |
30 | Suggests: php-pdo-sqlite | |
405cdc14 | 31 | BuildArch: noarch |
4041abae AM |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
33 | ||
af7a763b | 34 | %define _webapps /etc/webapps |
eba56fc5 | 35 | %define _webapp %{name} |
af7a763b ER |
36 | %define _sysconfdir %{_webapps}/%{_webapp} |
37 | %define _appdir %{_datadir}/%{_webapp} | |
138953e5 | 38 | %define cachedir /var/cache/%{name} |
af7a763b | 39 | %define _smartyplugindir %{php_data_dir}/Smarty/plugins |
4041abae | 40 | |
eba56fc5 ER |
41 | # bad depsolver |
42 | %define _noautopear pear | |
43 | # put it together for rpmbuild | |
44 | %define _noautoreq %{?_noautophp} %{?_noautopear} | |
4041abae | 45 | |
eba56fc5 ER |
46 | %description |
47 | Bacula-Web is a web based tool written in PHP that provide you a | |
48 | summarized view of your bacula's backup infrastructure. It obtain his | |
49 | information from your bacula catalog's database. | |
b3b9ed9e | 50 | |
4041abae | 51 | %prep |
5e3bbf5d | 52 | %setup -q |
138953e5 | 53 | %patch0 -p1 |
4041abae | 54 | |
97184a12 | 55 | mv application/config . |
eba56fc5 | 56 | mv config/config.php{.sample,} |
97184a12 ER |
57 | %{__rm} application/locale/*/LC_MESSAGES/*.po |
58 | %{__rm} -r application/view/cache | |
138953e5 | 59 | mv core/external . |
5e3bbf5d | 60 | mv DOCS/* . |
4041abae | 61 | |
97184a12 ER |
62 | # you'll need this if you cp -a complete dir in source |
63 | # cleanup backups after patching | |
64 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
8eb594c5 | 65 | |
4041abae AM |
66 | %install |
67 | rm -rf $RPM_BUILD_ROOT | |
138953e5 | 68 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir},%{cachedir}} |
97184a12 | 69 | cp -a *.php application core $RPM_BUILD_ROOT%{_appdir} |
eba56fc5 | 70 | cp -a config/* $RPM_BUILD_ROOT%{_sysconfdir} |
138953e5 | 71 | |
eba56fc5 | 72 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf |
2f6c9c51 | 73 | cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf |
4041abae | 74 | |
eba56fc5 ER |
75 | %clean |
76 | rm -rf $RPM_BUILD_ROOT | |
4041abae | 77 | |
138953e5 ER |
78 | %post |
79 | # cleanup cache from previous rpm | |
80 | echo %{cachedir}/* | xargs rm -f | |
81 | ||
82 | %preun | |
83 | if [ "$1" = 0 ]; then | |
84 | echo %{cachedir}/* | xargs rm -f | |
85 | fi | |
86 | ||
eba56fc5 | 87 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
af7a763b | 88 | %webapp_register apache %{_webapp} |
4041abae | 89 | |
eba56fc5 | 90 | %triggerun -- apache1 < 1.3.37-3, apache1-base |
af7a763b ER |
91 | %webapp_unregister apache %{_webapp} |
92 | ||
2f6c9c51 | 93 | %triggerin -- apache < 2.2.0, apache-base |
af7a763b ER |
94 | %webapp_register httpd %{_webapp} |
95 | ||
2f6c9c51 | 96 | %triggerun -- apache < 2.2.0, apache-base |
af7a763b | 97 | %webapp_unregister httpd %{_webapp} |
4041abae | 98 | |
eba56fc5 | 99 | %files |
4041abae | 100 | %defattr(644,root,root,755) |
97184a12 | 101 | %doc INSTALL README Changelog |
af7a763b ER |
102 | %dir %attr(750,root,http) %{_sysconfdir} |
103 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
104 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
eba56fc5 | 105 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php |
eba56fc5 ER |
106 | |
107 | %dir %{_appdir} | |
108 | %{_appdir}/backupjob-report.php | |
109 | %{_appdir}/client-report.php | |
110 | %{_appdir}/index.php | |
97184a12 | 111 | %{_appdir}/joblogs.php |
eba56fc5 ER |
112 | %{_appdir}/jobs.php |
113 | %{_appdir}/pools.php | |
114 | %{_appdir}/test.php | |
eba56fc5 ER |
115 | |
116 | %dir %{_appdir}/core | |
5e3bbf5d JK |
117 | %{_appdir}/core/bweb.class.php |
118 | %{_appdir}/core/const.inc.php | |
97184a12 | 119 | %{_appdir}/core/global.inc.php |
eba56fc5 | 120 | %{_appdir}/core/app |
eba56fc5 ER |
121 | %{_appdir}/core/db |
122 | %{_appdir}/core/graph | |
123 | %{_appdir}/core/i18n | |
124 | %{_appdir}/core/utils | |
125 | ||
97184a12 ER |
126 | %dir %{_appdir}/application |
127 | %{_appdir}/application/libs | |
128 | %{_appdir}/application/models | |
129 | %{_appdir}/application/view | |
130 | ||
131 | %dir %{_appdir}/application/locale | |
132 | %lang(de) %{_appdir}/application/locale/de_DE | |
133 | %lang(en) %{_appdir}/application/locale/en_EN | |
134 | %lang(es) %{_appdir}/application/locale/es_ES | |
135 | %lang(fr) %{_appdir}/application/locale/fr_FR | |
136 | %lang(it) %{_appdir}/application/locale/it_IT | |
5e3bbf5d | 137 | %lang(nl) %{_appdir}/application/locale/nl_NL |
97184a12 ER |
138 | %lang(pt_BR) %{_appdir}/application/locale/pt_BR |
139 | %lang(sv) %{_appdir}/application/locale/sv_SV | |
eba56fc5 | 140 | |
138953e5 | 141 | %dir %attr(775,root,http) %{cachedir} |