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