rpms/glpi/F-9 glpi.spec,1.13,1.14

Remi Collet (remi) fedora-extras-commits at redhat.com
Fri Apr 25 18:54:30 UTC 2008


Author: remi

Update of /cvs/extras/rpms/glpi/F-9
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv7421

Modified Files:
	glpi.spec 
Log Message:
replace semodule by semanage (fix #442706)


Index: glpi.spec
===================================================================
RCS file: /cvs/extras/rpms/glpi/F-9/glpi.spec,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- glpi.spec	28 Jan 2008 18:08:43 -0000	1.13
+++ glpi.spec	25 Apr 2008 18:53:55 -0000	1.14
@@ -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 @@
 BuildRequires:  dos2unix
 %if %{useselinux}
 Requires:       policycoreutils
-BuildRequires:  selinux-policy-devel, checkpolicy
 %endif
 
 %description
@@ -66,35 +65,9 @@
 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 <<EOF
-policy_module(%{name},0.70)
-require {
-  type httpd_sys_content_t;
-  type httpd_log_t;
-  type httpd_var_lib_t;
-}
-EOF
-
-cat >%{name}.fc <<EOF
-%{_sysconfdir}/%{name}(/.*)?          root:object_r:httpd_sys_content_t:s0
-%{_localstatedir}/log/%{name}(/.*)?   system_u:object_r:httpd_sys_content_t:s0
-%{_localstatedir}/lib/%{name}(/.*)?   system_u:object_r:httpd_sys_content_t:s0
-EOF
-popd
-%endif
-
 
 %build
-%if %{useselinux}
-# SElinux 
-pushd selinux
-make -f %{_datadir}/selinux/devel/Makefile
-popd
-%endif
+# empty build
 
 
 %install
@@ -144,11 +117,6 @@
 rm -f %{buildroot}%{_datadir}/%{name}/config/.htaccess
 rm -f %{buildroot}%{_datadir}/%{name}/scripts/.htaccess
 
-%if %{useselinux}
-# SElinux 
-mkdir -p %{buildroot}%{_datadir}/selinux/packages/%{name}
-install -m644 selinux/%{name}.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/%{name}.pp
-%endif
 
 # Lang
 for i in %{buildroot}%{_datadir}/%{name}/locales/*
@@ -164,26 +132,34 @@
 
 %post
 %if %{useselinux}
-# Install/update Selinux policy
-semodule -i %{_datadir}/selinux/packages/%{name}/%{name}.pp
-# files owned by RPM
-fixfiles -R %{name} restore
+# Remove Selinux policy (from previous packaging)
+(
+semodule -s targeted -r %{name} &>/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 @@
 %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 <Fedora at FamilleCollet.com> - 0.70.2-3
+- remplace module policy by simple semanage (#442706)
+
 * Mon Jan 28 2008 Remi Collet <Fedora at FamilleCollet.com> - 0.70.2-2
 - rebuild (fix sources tarball)
 




More information about the fedora-extras-commits mailing list