Source2: %{semodule_name}.fc
Source3: %{name}.logrotate
Source4: README.Fedora
-Source5: %{name}.target
# kill bundler
# (not intended for upstream)
Patch0: rocci-server-unbundle.diff
-# missing requires in code (needed when bundler is not used)
-# https://github.com/EGI-FCTF/rOCCI-server/pull/55
-Patch1: rocci-server-requires.diff
BuildArch: noarch
BuildRequires: policycoreutils-python
BuildRequires: ruby(release) >= 1.9.3
BuildRequires: rubygems-devel
BuildRequires: rubygem(rdoc)
-BuildRequires: systemd
# tests (plus all runtimes)
#BuildRequires: rubygem(rspec)
#BuildRequires: rubygem(rspec-rails)
Requires(pre): shadow-utils
Requires(post): policycoreutils
-Requires(post): systemd
Requires(preun): policycoreutils
-Requires(preun): systemd
Requires(postun): policycoreutils
-Requires(postun): systemd
Requires: logrotate
Requires: memcached
Requires: mod_passenger
# kill bundler
%patch0 -p1
-%patch1 -p1
mv Gemfile Gemfile.unused
mv Gemfile.lock Gemfile.lock.unused
echo "Listen 11443" >> %{buildroot}%{_sysconfdir}/httpd/conf.d/occi-listen.conf
install -p -m 0644 examples/etc/apache2/conf.d/security %{buildroot}%{_sysconfdir}/httpd/conf.d/occi-security.conf
-mkdir -p %{buildroot}%{_unitdir}
-install -p -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}
-
# Upstream testsuite fails:
#254 examples, 29 failures, 13 pending
#%%check
getent passwd rocci >/dev/null || useradd -r -g rocci -d %{app_root} -c "rOCCI user" rocci
%post
-%systemd_post %{name}.target
if [ "$1" -le "1" ] ; then # First install
semodule -i %{_datadir}/selinux/packages/%{name}/%{semodule_name}.pp 2>/dev/null || :
restorecon -R %{app_root} %{_localstatedir}/log/rocci-server 2>/dev/null || :
semanage port -a -t http_port_t -p tcp 11443 2>/dev/null || :
- # reload and start everything in case httpd is already running
- systemctl reload httpd.service >/dev/null 2>&1 && systemctl start %{name}.target >/dev/null 2>&1
fi
%preun
-%systemd_preun %{name}.target
if [ "$1" -lt "1" ] ; then # Final removal
semodule -r %{semodule_name} 2>/dev/null || :
semanage port -d -t http_port_t -p tcp 11443 2>/dev/null || :
semodule -i %{_datadir}/selinux/packages/%{name}/%{semodule_name}.pp 2>/dev/null || :
restorecon -R %{app_root} %{_localstatedir}/log/rocci-server 2>/dev/null || :
fi
-if [ "$1" -lt "1" ] ; then # Final removal
- # reload httpd needed
- systemctl reload httpd.service >/dev/null 2>&1
-fi
-%systemd_postun
%files
%{app_root}/config.ru
%attr(-,rocci,rocci) %{_localstatedir}/log/rocci-server/
%{_datadir}/selinux/packages/%{name}/%{semodule_name}.pp
-%{_unitdir}/%{name}.target
%exclude %{app_root}/bin/
%exclude %{app_root}/.bundle/
%exclude %{app_root}/.rspec
%changelog
-* Sun Sep 14 2014 František Dvořák <valtri@civ.zcu.cz> - 1.0.5-1.20140915git9ec6ad2
+* Wed Sep 17 2014 František Dvořák <valtri@civ.zcu.cz> - 1.0.5-1.20140915git9ec6ad2
- Initial package