3 %global metaname baculum
5 Summary: API layer to Baculum WebGUI tool for Bacula Community program
10 Group: Applications/Internet
11 URL: http://bacula.org/
12 Source0: bacula-gui-7.9.0.tar.gz
13 BuildRequires: systemd-units
14 BuildRequires: checkpolicy
15 Requires: bacula-console
16 # Lower version of PHP ( < 5.3.4) does not provide php-mysqlnd db driver
17 # and from this reason the lowest is 5.3.4
18 Requires: php >= 5.3.4
21 Requires: php-mbstring
29 The Baculum program allows the user to administer and manage Bacula jobs.
30 By using Baculum it is possible to execute backup/restore operations, monitor
31 current Bacula jobs, configure Bacula, media management and others. Baculum has
32 integrated web console that communicates with Bacula bconsole program.
35 Summary: Common libraries for Baculum
36 Group: Applications/Internet
39 This package provides the common libraries for Baculum.
40 This module is a part of Baculum.
43 Summary: Baculum API files
44 Requires: %name-common = %version-%release
45 Group: Applications/Internet
46 Requires: bacula-console
47 # Lower version of PHP ( < 5.3.4) does not provide php-mysqlnd db driver
48 # and from this reason the lowest is 5.3.4
49 Requires: php >= 5.3.4
58 This package provides the API files for Baculum.
59 This module is a part of Baculum.
62 Summary: Baculum API files
63 Requires: %name-common = %version-%release
64 Group: Applications/Internet
65 # Lower version of PHP ( < 5.3.4) does not provide php-mysqlnd db driver
66 # and from this reason the lowest is 5.3.4
67 Requires: php >= 5.3.4
69 Requires: php-mbstring
73 This package provides the Web files for Baculum.
74 This module is a part of Baculum.
77 Summary: Apache configuration for Baculum API
78 Requires: %name-api = %version-%release
79 Group: Applications/Internet
81 # This conflict field is required because Lighttpd and Apache
82 # cannot listen on the same port at the same time. Even using diffeernt
83 # ports cause problems like shared framework cache and
84 # web server specific directories permissions (for lighttpd and apache
86 Conflicts: %{name}-api-lighttpd, %{name}-web-lighttpd
88 %description api-httpd
89 This package provides the Apache configuration for Baculum API.
90 By using this module it is possible to run Baculum API in Apache environment.
93 Summary: Lighttpd configuration for Baculum API
94 Requires: %name-api = %version-%release
95 Group: Applications/Internet
97 Requires: lighttpd-fastcgi
98 # This conflict field is required because Lighttpd and Apache
99 # cannot listen on the same port at the same time. Even using diffeernt
100 # ports cause problems like shared framework cache and
101 # web server specific directories permissions (for lighttpd and apache
103 Conflicts: %{name}-api-httpd, %{name}-web-httpd
105 %description api-lighttpd
106 This package provides the Lighttpd configuration for Baculum API.
107 By using this module it is possible to run Baculum API in Lighttpd environment.
110 Summary: Apache configuration for Baculum WebGUI
111 Requires: %name-web = %version-%release
112 Group: Applications/Internet
114 # This conflict field is required because Lighttpd and Apache
115 # cannot listen on the same port at the same time. Even using diffeernt
116 # ports cause problems like shared framework cache and
117 # web server specific directories permissions (for lighttpd and apache
119 Conflicts: %{name}-web-lighttpd, %{name}-api-lighttpd
121 %description web-httpd
122 This package provides the Apache configuration for Baculum WebGUI.
123 By using this module it is possible to run Baculum WebGUI in Apache environment.
125 %package web-lighttpd
126 Summary: Lighttpd configuration for Baculum WebGUI
127 Requires: %name-web = %version-%release
128 Group: Applications/Internet
130 Requires: lighttpd-fastcgi
131 # This conflict field is required because Lighttpd and Apache
132 # cannot listen on the same port at the same time. Even using diffeernt
133 # ports cause problems like shared framework cache and
134 # web server specific directories permissions (for lighttpd and apache
136 Conflicts: %{name}-web-httpd, %{name}-api-httpd
138 %description web-lighttpd
139 This package provides the Lighttpd configuration for Baculum WebGUI.
140 By using this module it is possible to run Baculum WebGUI in Lighttpd environment.
143 %setup -n bacula-gui-%version/baculum
146 # Execute files preparation in build directory by Makefile
147 make build DESTDIR=%{destdir}
148 # Remove these cache directories, because here will be symbolic links
149 rmdir %{destdir}/%{_datadir}/%{metaname}/htdocs/assets
150 rmdir %{destdir}/%{_datadir}/%{metaname}/htdocs/protected/runtime
151 for lang in %{langs}; do
152 rm %{destdir}/%{_datadir}/%{metaname}/htdocs/protected/API/Lang/${lang}/messages.mo
153 rm %{destdir}/%{_datadir}/%{metaname}/htdocs/protected/Web/Lang/${lang}/messages.mo
157 cp -ra build/. %{buildroot}
158 %find_lang %{metaname} --all-name
161 # these symbolic links indicates to Baculum's cache directory
162 ln -s %{_localstatedir}/cache/%{metaname} %{_datadir}/%{metaname}/htdocs/assets
163 ln -s %{_localstatedir}/cache/%{metaname} %{_datadir}/%{metaname}/htdocs/protected/runtime
166 # because framework does not use system locale dir, here are linked
167 # locale files to framework location
168 for lang in %{langs}; do
169 ln -s %{_datadir}/locale/${lang}/LC_MESSAGES/%{metaname}-api.mo \
170 %{_datadir}/%{metaname}/htdocs/protected/API/Lang/${lang}/messages.mo
174 # because framework does not use system locale dir, here are linked
175 # locale files to framework location
176 for lang in %{langs}; do
177 ln -s %{_datadir}/locale/${lang}/LC_MESSAGES/%{metaname}-web.mo \
178 %{_datadir}/%{metaname}/htdocs/protected/Web/Lang/${lang}/messages.mo
182 %systemd_post httpd.service
183 ln -s %{_sysconfdir}/%{metaname}/Config-api-apache %{_datadir}/%{metaname}/htdocs/protected/API/Config
186 %systemd_post baculum-api-lighttpd.service
187 ln -s %{_sysconfdir}/%{metaname}/Config-api-lighttpd %{_datadir}/%{metaname}/htdocs/protected/API/Config
190 %systemd_post httpd.service
191 ln -s %{_sysconfdir}/%{metaname}/Config-web-apache %{_datadir}/%{metaname}/htdocs/protected/Web/Config
194 %systemd_post baculum-web-lighttpd.service
195 ln -s %{_sysconfdir}/%{metaname}/Config-web-lighttpd %{_datadir}/%{metaname}/htdocs/protected/Web/Config
198 rm %{_datadir}/%{metaname}/htdocs/assets
199 rm %{_datadir}/%{metaname}/htdocs/protected/runtime
202 for lang in %{langs}; do
203 rm %{_datadir}/%{metaname}/htdocs/protected/API/Lang/${lang}/messages.mo
207 for lang in %{langs}; do
208 rm %{_datadir}/%{metaname}/htdocs/protected/Web/Lang/${lang}/messages.mo
212 %systemd_preun httpd.service
213 if [ $1 -lt 1 ] ; then
214 # Rename settings if exist.
215 # Note, 'config' macro cannot be used because this file is created after successful
216 # installation via wizard. Also using 'config' macro to /usr location strictly forbidden
217 # by Packaging Guidelines.
218 [ ! -e %{_datadir}/%{metaname}/htdocs/protected/API/Config/api.conf ] ||
219 mv %{_datadir}/%{metaname}/htdocs/protected/API/Config/api.conf \
220 %{_datadir}/%{metaname}/htdocs/protected/API/Config/api.conf.apache
221 # remove debug files if any
222 [ ! -e %{_datadir}/%{metaname}/htdocs/protected/API/Logs/baculum-api.log ] ||
223 rm %{_datadir}/%{metaname}/htdocs/protected/API/Logs/baculum-api*.log
224 rm %{_datadir}/%{metaname}/htdocs/protected/API/Config
228 %systemd_preun httpd.service
229 if [ $1 -lt 1 ] ; then
230 # Rename settings if exist.
231 # Note, 'config' macro cannot be used because this file is created after successful
232 # installation via wizard. Also using 'config' macro to /usr location strictly forbidden
233 # by Packaging Guidelines.
234 [ ! -e %{_datadir}/%{metaname}/htdocs/protected/Web/Config/settings.conf ] ||
235 mv %{_datadir}/%{metaname}/htdocs/protected/Web/Config/settings.conf \
236 %{_datadir}/%{metaname}/htdocs/protected/Web/Config/settings.conf.apache
237 [ ! -e %{_datadir}/%{metaname}/htdocs/protected/Web/Config/hosts.conf ] ||
238 mv %{_datadir}/%{metaname}/htdocs/protected/Web/Config/hosts.conf \
239 %{_datadir}/%{metaname}/htdocs/protected/Web/Config/hosts.conf.apache
240 # remove debug files if any
241 [ ! -e %{_datadir}/%{metaname}/htdocs/protected/Web/Logs/baculum-web.log ] ||
242 rm %{_datadir}/%{metaname}/htdocs/protected/Web/Logs/baculum-web*.log
243 rm %{_datadir}/%{metaname}/htdocs/protected/Web/Config
247 %systemd_preun baculum-api-lighttpd.service
248 if [ $1 -lt 1 ] ; then
250 /sbin/service baculum-api-lighttpd stop &>/dev/null || :
251 # Rename settings if exist.
252 # Note, 'config' macro cannot be used because this file is created after successful
253 # installation via wizard. Also using 'config' macro to /usr location strictly forbidden
254 # by Packaging Guidelines.
255 [ ! -e %{_datadir}/%{metaname}/htdocs/protected/API/Config/api.conf ] ||
256 mv %{_datadir}/%{metaname}/htdocs/protected/API/Config/api.conf \
257 %{_datadir}/%{metaname}/htdocs/protected/API/Config/api.conf.lighttpd
258 # remove debug files if any
259 [ ! -e %{_datadir}/%{metaname}/htdocs/protected/API/Logs/baculum-api.log ] ||
260 rm %{_datadir}/%{metaname}/htdocs/protected/API/Logs/baculum-api*.log
261 rm %{_datadir}/%{metaname}/htdocs/protected/API/Config
265 %systemd_preun baculum-web-lighttpd.service
266 if [ $1 -lt 1 ] ; then
268 /sbin/service baculum-web-lighttpd stop &>/dev/null || :
269 # Rename settings if exist.
270 # Note, 'config' macro cannot be used because this file is created after successful
271 # installation via wizard. Also using 'config' macro to /usr location strictly forbidden
272 # by Packaging Guidelines.
273 [ ! -e %{_datadir}/%{metaname}/htdocs/protected/Web/Config/settings.conf ] ||
274 mv %{_datadir}/%{metaname}/htdocs/protected/Web/Config/settings.conf \
275 %{_datadir}/%{metaname}/htdocs/protected/Web/Config/settings.conf.lighttpd
276 [ ! -e %{_datadir}/%{metaname}/htdocs/protected/Web/Config/hosts.conf ] ||
277 mv %{_datadir}/%{metaname}/htdocs/protected/Web/Config/hosts.conf \
278 %{_datadir}/%{metaname}/htdocs/protected/Web/Config/hosts.conf.lighttpd
279 # remove debug files if any
280 [ ! -e %{_datadir}/%{metaname}/htdocs/protected/Web/Logs/baculum-web.log ] ||
281 rm %{_datadir}/%{metaname}/htdocs/protected/Web/Logs/baculum-web*.log
282 rm %{_datadir}/%{metaname}/htdocs/protected/Web/Config
286 %systemd_postun_with_restart httpd.service
289 %systemd_postun_with_restart httpd.service
292 %systemd_postun_with_restart baculum-api-lighttpd.service
295 %systemd_postun_with_restart baculum-web-lighttpd.service
297 %files -f %{metaname}.lang common
298 %defattr(-,root,root)
299 %{_datadir}/%{metaname}/htdocs/protected/Common
300 %{_datadir}/%{metaname}/htdocs/protected/application.xml
301 %{_datadir}/%{metaname}/htdocs/framework
302 %{_datadir}/%{metaname}/htdocs/themes
303 %{_datadir}/%{metaname}/htdocs/LICENSE
304 %{_datadir}/%{metaname}/htdocs/AUTHORS
305 %{_datadir}/%{metaname}/htdocs/README
306 %{_datadir}/%{metaname}/htdocs/INSTALL
307 %{_datadir}/%{metaname}/htdocs/index.php
313 %defattr(-,root,root)
314 # directory excluded here, because it needs to be provided
315 # with selected web server privileges (lighttpd or apache)
316 %exclude %{_datadir}/%{metaname}/htdocs/protected/API/Config
317 %exclude %{_datadir}/%{metaname}/htdocs/protected/API/Logs
318 %{_datadir}/%{metaname}/htdocs/protected/API
321 %defattr(-,root,root)
322 # directory excluded here, because it needs to be provided
323 # with selected web server privileges (lighttpd or apache)
324 %exclude %{_datadir}/%{metaname}/htdocs/protected/Web/Config
325 %exclude %{_datadir}/%{metaname}/htdocs/protected/Web/Logs
326 %{_datadir}/%{metaname}/htdocs/protected/Web
330 %defattr(644,root,root)
331 # directory excluded here, because it needs to be provided
332 # with selected web server privileges (lighttpd or apache)
333 %exclude %{_datadir}/%{metaname}/htdocs/protected/API/Config
334 # Apache logs are stored in /var/log/httpd/
335 %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{metaname}-api.conf
336 %attr(755,apache,apache) %{_localstatedir}/cache/%{metaname}/
337 %attr(700,apache,apache) %{_sysconfdir}/%{metaname}/Config-api-apache/
338 %attr(600,apache,apache) %{_sysconfdir}/%{metaname}/Config-api-apache/%{metaname}.users
339 %attr(755,apache,apache) %{_datadir}/%{metaname}/htdocs/protected/API/Logs
342 %defattr(644,root,root)
343 # directory excluded here, because it needs to be provided
344 # with selected web server privileges (lighttpd or apache)
345 %exclude %{_datadir}/%{metaname}/htdocs/protected/Web/Config
346 # Apache logs are stored in /var/log/httpd/
347 %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{metaname}-web.conf
348 %attr(755,apache,apache) %{_localstatedir}/cache/%{metaname}/
349 %attr(700,apache,apache) %{_sysconfdir}/%{metaname}/Config-web-apache/
350 %attr(600,apache,apache) %{_sysconfdir}/%{metaname}/Config-web-apache/%{metaname}.users
351 %attr(755,apache,apache) %{_datadir}/%{metaname}/htdocs/protected/Web/Logs
354 %defattr(644,root,root)
355 # Lighttpd logs are stored in /var/log/lighttpd
356 %attr(755,lighttpd,lighttpd) %{_localstatedir}/cache/%{metaname}/
357 %attr(700,lighttpd,lighttpd) %{_sysconfdir}/%{metaname}/Config-api-lighttpd/
358 %attr(600,lighttpd,lighttpd) %{_sysconfdir}/%{metaname}/Config-api-lighttpd/%{metaname}.users
359 %attr(755,lighttpd,lighttpd) %{_datadir}/%{metaname}/htdocs/protected/API/Logs
360 %{_unitdir}/%{metaname}-api-lighttpd.service
361 %config(noreplace) %{_sysconfdir}/%{metaname}/%{metaname}-api-lighttpd.conf
364 %defattr(644,root,root)
365 # Lighttpd logs are stored in /var/log/lighttpd
366 %attr(755,lighttpd,lighttpd) %{_localstatedir}/cache/%{metaname}/
367 %attr(700,lighttpd,lighttpd) %{_sysconfdir}/%{metaname}/Config-web-lighttpd/
368 %attr(600,lighttpd,lighttpd) %{_sysconfdir}/%{metaname}/Config-web-lighttpd/%{metaname}.users
369 %attr(755,lighttpd,lighttpd) %{_datadir}/%{metaname}/htdocs/protected/Web/Logs
370 %{_unitdir}/%{metaname}-web-lighttpd.service
371 %config(noreplace) %{_sysconfdir}/%{metaname}/%{metaname}-web-lighttpd.conf
374 * Sat Dec 10 2016 Marcin Haba <marcin.haba@bacula.pl> - 7.5.0-0.1