1 Summary: WebGUI tool for Bacula Community program
6 Group: Applications/Internet
7 URL: http://bacula.org/
8 Source0: http://bacula.org/downloads/baculum/baculum-7.0.6b.tar.gz
10 Source2: baculum-apache.conf
11 Source3: baculum-lighttpd.conf
12 Source4: baculum-lighttpd.service
13 BuildRequires: systemd-units
14 BuildRequires: selinux-policy
15 BuildRequires: selinux-policy-devel
16 BuildRequires: checkpolicy
17 Requires: bacula-console
18 # Lower version of PHP ( < 5.3.4) does not provide php-mysqlnd db driver
19 # and from this reason the lowest is 5.3.4
20 Requires: php >= 5.3.4
23 Requires: php-mbstring
31 The Baculum program allows the user to administer and manage Bacula jobs.
32 By using Baculum it is possible to execute backup/restore operations, monitor
33 current Bacula jobs, media management and others. Baculum has integrated web
34 console that communicates with Bacula bconsole program.
37 Summary: SELinux module for Baculum WebGUI tool
38 Requires: %name = %version-%release
39 Group: Applications/Internet
40 Requires(post): policycoreutils-python
41 Requires(preun): policycoreutils-python
44 This package provides an SELinux module for Baculum WebGUI tool.
45 You should install this package if you are using SELinux, that Baculum
46 can be run in enforcing mode.
49 Summary: Apache configuration for Baculum WebGUI tool
50 Requires: %name = %version-%release
51 Group: Applications/Internet
53 # This conflict field is required because Lighttpd and Apache
54 # cannot listen on the same port at the same time. Even using diffeernt
55 # ports cause problems like shared framework cache and
56 # web server specific directories permissions (for lighttpd and apache
58 Conflicts: %{name}-lighttpd
61 This package provides the Apache configuration for Baculum WebGUI tool.
62 By using this module it is possible to run Baculum in Apache environment.
65 Summary: Lighttpd configuration for Baculum WebGUI tool
66 Requires: %name = %version-%release
67 Group: Applications/Internet
69 Requires: lighttpd-fastcgi
70 # This conflict field is required because Lighttpd and Apache
71 # cannot listen on the same port at the same time. Even using diffeernt
72 # ports cause problems like shared framework cache and
73 # web server specific directories permissions (for lighttpd and apache
75 Conflicts: %{name}-httpd
78 This package provides the Lighttpd configuration for Baculum WebGUI tool.
79 By using this module it is possible to run Baculum in Lighttpd environment.
85 # Execute files preparation in build directory by Makefile
87 # Compilation SELinuxu policies before loading them
88 make -C examples/selinux/ -f %{_datadir}/selinux/devel/Makefile %{name}.pp
91 mkdir -p %{buildroot}%{_datadir}/%{name}/htdocs/protected
92 mkdir -p %{buildroot}%{_sysconfdir}/%{name}
93 mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d
94 mkdir -p %{buildroot}%{_unitdir}
95 mkdir -p %{buildroot}%{_localstatedir}/cache/%{name}
96 mkdir -p %{buildroot}%{_var}/log/%{name}
97 mkdir -p %{buildroot}%{_datadir}/selinux/packages/%{name}
99 cp -ra build/. %{buildroot}%{_datadir}/%{name}/htdocs
100 install -m 640 %{SOURCE2} %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf
101 install -m 640 %{SOURCE3} %{buildroot}%{_sysconfdir}/%{name}/
102 install -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/
103 install -m 600 %{SOURCE1} %{buildroot}%{_datadir}/%{name}/htdocs/protected/Data/%{name}.users
104 install -m 644 examples/selinux/%{name}.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/%{name}.pp
105 # these symbolic links indicates to Baculum's cache directory
106 ln -s %{_localstatedir}/cache/%{name} %{buildroot}%{_datadir}/%{name}/htdocs/assets
107 ln -s %{_localstatedir}/cache/%{name} %{buildroot}%{_datadir}/%{name}/htdocs/protected/runtime
110 %systemd_post baculum.service
113 if [ $1 -le 1 ] ; then
114 # Write access is possible for web servers user only to two directories
115 # - Data/ directory stores settings and web server HTTP Basic credentials
116 # - /var/cache/baculum - cache used by framework in specific locations (assets/ and protected/runtime/)
117 # by symbolic links to cache directory
118 semanage fcontext -a -t httpd_sys_rw_content_t '%{_datadir}/%{name}/htdocs/protected/Data(/.*)?' 2>/dev/null || :
119 restorecon -i -R '%{_datadir}/%{name}/htdocs/protected/Data' || :
120 semanage fcontext -a -t httpd_cache_t '%{_localstatedir}/cache/%{name}(/.*)?' 2>/dev/null || :
121 restorecon -i -R %{_localstatedir}/cache/%{name} || :
122 semodule -i %{_datadir}/selinux/packages/%{name}/%{name}.pp 2>/dev/null || :
126 if [ $1 -lt 1 ] ; then
127 # remove settings and logs if exist
128 [ ! -e %{_datadir}/%{name}/htdocs/protected/Data/settings.conf ] ||
129 rm %{_datadir}/%{name}/htdocs/protected/Data/settings.conf
130 [ ! -e %{_datadir}/%{name}/htdocs/protected/Data/baculum.log ] ||
131 rm %{_datadir}/%{name}/htdocs/protected/Data/baculum*.log
135 %systemd_preun baculum-lighttpd.service
138 %systemd_postun_with_restart baculum-lighttpd.service
141 if [ $1 -eq 0 ] ; then
142 semanage fcontext -d -t httpd_sys_rw_content_t '%{_datadir}/%{name}/htdocs/protected/Data(/.*)?' 2>/dev/null || :
143 semanage fcontext -d -t httpd_cache_t '%{_localstatedir}/cache/%{name}(/.*)?' 2>/dev/null || :
144 semodule -r %{name} 2>/dev/null || :
148 %defattr(-,root,root)
149 # directory excluded here, because it needs to be provided
150 # with selected web server privileges (lighttpd or apache)
151 %exclude %{_datadir}/%{name}/htdocs/protected/Data/
154 %doc AUTHORS INSTALL README
157 %defattr(-,root,root)
158 %{_datadir}/selinux/packages/%{name}/%{name}.pp
161 %defattr(644,root,root)
162 # Apache logs are stored in /var/log/httpd/
163 %config %{_sysconfdir}/httpd/conf.d/%{name}.conf
164 %attr(700,apache,apache) %{_localstatedir}/cache/%{name}/
165 %attr(700,apache,apache) %{_datadir}/%{name}/htdocs/protected/Data/
168 %defattr(-,root,root)
169 # Lighttpd logs are stored in /var/log/baculum
170 %attr(750,lighttpd,lighttpd) %{_var}/log/%{name}/
171 %attr(700,lighttpd,lighttpd) %{_localstatedir}/cache/%{name}/
172 %attr(700,lighttpd,lighttpd) %{_datadir}/%{name}/htdocs/protected/Data/
173 %{_unitdir}/%{name}-lighttpd.service
174 %config %{_sysconfdir}/%{name}/%{name}-lighttpd.conf
177 * Tue Jul 14 2015 Marcin Haba <marcin.haba@bacula.pl> - 7.0.6-0.3.b
178 - Separate to subpackage Lighttpd support
179 - Add Apache subpackage
180 - Use upstream Makefile to prepare build files
181 - Cache symlbolic links only in install section
182 - Add comments to Spec
183 - Compile SELinux policies instead of install pre-compiled
184 - Add source files: baculum.users, baculum-apache.conf
185 baculum-lighttpd.conf and baculum-lighttpd.service
186 * Mon Jul 13 2015 Marcin Haba <marcin.haba@bacula.pl> - 7.0.6-0.2.b
187 - Remove chkconfig and service dependencies from Spec
188 - Change Spec sections order
189 - Correct package description typos and errors
190 * Mon Jul 06 2015 Marcin Haba <marcin.haba@bacula.pl> - 7.0.6-0.1.b