diff --git a/glpi.spec b/glpi.spec index 6fda90f..65ded24 100644 --- a/glpi.spec +++ b/glpi.spec @@ -1,4 +1,4 @@ -%if %{?fedora}%{?rhel} >= 6 +%if %{?fedora}%{?rhel} >= 5 %define useselinux 1 %else %define useselinux 0 @@ -6,7 +6,7 @@ Name: glpi Version: 0.70.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Free IT asset management software Summary(fr): Gestion Libre de Parc Informatique @@ -34,7 +34,6 @@ Requires(post): /sbin/service BuildRequires: dos2unix %if %{useselinux} Requires: policycoreutils -BuildRequires: selinux-policy-devel, checkpolicy %endif %description @@ -66,35 +65,9 @@ dos2unix -o LICENSE.phpmailer LICENSE.tiny_mce iconv -f ISO-8859-15 -t UTF-8 LISEZMOI.txt >a && mv a LISEZMOI.txt iconv -f ISO-8859-15 -t UTF-8 README.txt >a && mv a README.txt -%if %{useselinux} -mkdir selinux -pushd selinux - -cat >%{name}.te <%{name}.fc </dev/null +# New File context +semanage fcontext -a -s system_u -t httpd_sys_script_rw_t -r s0 "%{_sysconfdir}/glpi(/.*)?" +semanage fcontext -a -s system_u -t httpd_sys_script_rw_t -r s0 "%{_localstatedir}/log/glpi(/.*)?" +semanage fcontext -a -s system_u -t httpd_sys_script_rw_t -r s0 "%{_localstatedir}/lib/glpi(/.*)?" # files created by app restorecon -R %{_sysconfdir}/%{name} restorecon -R %{_localstatedir}/lib/%{name} restorecon -R %{_localstatedir}/log/%{name} +) &>/dev/null %endif /sbin/service httpd condrestart > /dev/null 2>&1 || : %postun -/sbin/service httpd condrestart > /dev/null 2>&1 || : %if %{useselinux} if [ "$1" -eq "0" ]; then - # Remove the SElinux policy. - semodule -r %{name} || : + # Remove the File Context + ( + semanage fcontext -d "%{_sysconfdir}/glpi(/.*)?" + semanage fcontext -d "%{_localstatedir}/log/glpi(/.*)?" + semanage fcontext -d "%{_localstatedir}/lib/glpi(/.*)?" + ) &>/dev/null fi %endif +/sbin/service httpd condrestart > /dev/null 2>&1 || : %files -f %{name}.lang @@ -215,11 +191,11 @@ fi %attr(750,apache,root) %dir %{_localstatedir}/log/%{name} %dir %{_datadir}/%{name}/locales -%if %{useselinux} -%{_datadir}/selinux/packages/%{name}/%{name}.pp -%endif %changelog +* Fri Apr 25 2008 Remi Collet - 0.70.2-3 +- remplace module policy by simple semanage (#442706) + * Mon Jan 28 2008 Remi Collet - 0.70.2-2 - rebuild (fix sources tarball)