type sysctl_net_t;
type httpd_t;
type proc_net_t;
+ type home_root_t;
+ type lib_t;
class sock_file write;
class tcp_socket listen;
class dir { search create rmdir };
allow passenger_t sysfs_t:dir search;
allow passenger_t sysfs_t:file { read open };
allow passenger_t user_tmp_t:file { read getattr open };
+
+# passenger + occi server
+allow passenger_t home_root_t:dir search;
+allow passenger_t lib_t:file execute_no_trans;
Source2: rubygem-passenger.tmpfiles
Source10: apache-passenger.conf.in
Source11: locations.ini
+Source12: passenger.te
# Include sys/types.h for GCC 4.7
Patch2: rubygem-passenger-4.0.18-gcc47-include-sys_types.patch
%else
Requires: ruby(abi) = 1.8
%endif
+Requires(post): policycoreutils-python
+Requires(preun): policycoreutils-python
+Requires(postun): policycoreutils-python
%if 0%{?rhel} >= 6 || 0%{?fedora} >= 15
BuildRequires: libcurl-devel
BuildRequires: graphviz
BuildRequires: httpd-devel
BuildRequires: libev-devel
+BuildRequires: policycoreutils-python
BuildRequires: ruby
BuildRequires: ruby-devel
BuildRequires: rubygems
rake apache2
#rake nginx
+checkmodule -M -m -o passenger.mod %{SOURCE12}
+semodule_package -o passenger.pp -m passenger.mod
+
+
%install
export USE_VENDORED_LIBEV=false
%{__cp} -p doc/Users?guide?Apache.txt %{buildroot}%{_docdir}/mod_passenger-%{version}
%endif
+%{__mkdir_p} %{buildroot}%{_datadir}/selinux/packages/%{name}
+install -m 0644 passenger.pp %{buildroot}%{_datadir}/selinux/packages/%{name}
+
+
%check
export USE_VENDORED_LIBEV=false
# Run the tests, capture the output, but don't fail the build if the tests fail
rake test --trace ||:
+
+%post
+if [ "$1" -le "1" ] ; then # First install
+ semodule -i %{_datadir}/selinux/packages/%{name}/passenger.pp 2>/dev/null || :
+fi
+
+
+%preun
+if [ "$1" -lt "1" ] ; then # Final removal
+ semodule -r passenger 2>/dev/null || :
+fi
+
+
+%postun
+if [ "$1" -ge "1" ] ; then # Upgrade
+ semodule -i %{_datadir}/selinux/packages/%{name}/passenger.pp 2>/dev/null || :
+fi
+
+
%files
%doc %{gem_instdir}/README.md
%doc %{gem_instdir}/CHANGELOG
%exclude %{gem_instdir}/configure
%exclude %{gem_instdir}/debian.template/
%exclude %{gem_cache}
+%dir %{_datadir}/selinux/packages/%{name}
+%{_datadir}/selinux/packages/%{name}/passenger.pp
%files doc
%doc %{gem_docdir}