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