From d1d3770b71aa976b929143018aa46a0dbf48b7aa59545b3af321da557d9a9205 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 4 Nov 2008 16:41:12 +0000 Subject: [PATCH] uaa OBS-URL: https://build.opensuse.org/package/show/security:SELinux/selinux-policy?expand=0&rev=9 --- selinux-policy-build_conf.patch | 74 ++++++++++++++++++++++++++++++++ selinux-policy.spec | 75 ++++++++++++++++++++++++++++----- 2 files changed, 139 insertions(+), 10 deletions(-) create mode 100644 selinux-policy-build_conf.patch diff --git a/selinux-policy-build_conf.patch b/selinux-policy-build_conf.patch new file mode 100644 index 0000000..33bd986 --- /dev/null +++ b/selinux-policy-build_conf.patch @@ -0,0 +1,74 @@ +--- refpolicy-mcs/build.conf ++++ refpolicy-mcs/build.conf +@@ -12,13 +12,13 @@ + + # Policy Type + # standard, mls, mcs +-TYPE = standard ++TYPE = mcs + + # Policy Name + # If set, this will be used as the policy + # name. Otherwise the policy type will be + # used for the name. +-NAME = refpolicy ++NAME = refpolicy-mcs + + # Distribution + # Some distributions have portions of policy +@@ -27,7 +27,7 @@ + # for the distribution. + # redhat, gentoo, debian, suse, and rhel4 are current options. + # Fedora users should enable redhat. +-#DISTRO = redhat ++DISTRO = suse + + # Unknown Permissions Handling + # The behavior for handling permissions defined in the +--- refpolicy-mls/build.conf ++++ refpolicy-mls/build.conf +@@ -12,13 +12,13 @@ + + # Policy Type + # standard, mls, mcs +-TYPE = standard ++TYPE = mls + + # Policy Name + # If set, this will be used as the policy + # name. Otherwise the policy type will be + # used for the name. +-NAME = refpolicy ++NAME = refpolicy-mls + + # Distribution + # Some distributions have portions of policy +@@ -27,7 +27,7 @@ + # for the distribution. + # redhat, gentoo, debian, suse, and rhel4 are current options. + # Fedora users should enable redhat. +-#DISTRO = redhat ++DISTRO = suse + + # Unknown Permissions Handling + # The behavior for handling permissions defined in the +--- refpolicy-standard/build.conf ++++ refpolicy-standard/build.conf +@@ -18,7 +18,7 @@ + # If set, this will be used as the policy + # name. Otherwise the policy type will be + # used for the name. +-NAME = refpolicy ++NAME = refpolicy-standard + + # Distribution + # Some distributions have portions of policy +@@ -27,7 +27,7 @@ + # for the distribution. + # redhat, gentoo, debian, suse, and rhel4 are current options. + # Fedora users should enable redhat. +-#DISTRO = redhat ++DISTRO = suse + + # Unknown Permissions Handling + # The behavior for handling permissions defined in the diff --git a/selinux-policy.spec b/selinux-policy.spec index e4e3205..cee602a 100644 --- a/selinux-policy.spec +++ b/selinux-policy.spec @@ -17,34 +17,89 @@ Release: 1 Url: http://oss.tresys.com/projects/refpolicy/ License: GPL v2 Group: System/Base -Summary: SELinux policy +Summary: SELinux policies Source: refpolicy-%{version}.tar.bz2 +Patch0: %{name}-build_conf.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: checkpolicy policycoreutils libsepol-devel python python-xml m4 +BuildArch: noarch %description -SELinux policy - based on reference policy from Tresys +SELinux policies + +%package refpolicy-standard +Group: System/Base +Summary: SELinux policy - Tresys Standard Refpolicy +Provides: selinux-policy + +%description refpolicy-standard + +SELinux policy - based on reference policy from Tresys - standard + +%package refpolicy-mcs +Group: System/Base +Summary: SELinux policy - Tresys MCS Refpolicy +Provides: selinux-policy + +%description refpolicy-mcs + +SELinux policy - based on reference policy from Tresys - mcs + +%package refpolicy-mls +Group: System/Base +Summary: SELinux policy - Tresys MLS Refpolicy +Provides: selinux-policy + +%description refpolicy-mls + +SELinux policy - based on reference policy from Tresys - mls %prep -%setup -q -n refpolicy +%setup -q -c -n selinux-policy -T +tar xfj %{SOURCE0} && mv refpolicy refpolicy-standard +tar xfj %{SOURCE0} && mv refpolicy refpolicy-mcs +tar xfj %{SOURCE0} && mv refpolicy refpolicy-mls +%patch0 %build -make conf -make policy +for i in standard mcs mls; do + cd refpolicy-$i + make conf + make policy + cd .. +done %install -make DESTDIR=$RPM_BUILD_ROOT install -sed -i "s:^# edit $RPM_BUILD_ROOT:# edit :" $RPM_BUILD_ROOT%{_sysconfdir}/selinux/refpolicy/contexts/files/file_contexts.homedirs +for i in standard mcs mls; do + cd refpolicy-$i + make DESTDIR=$RPM_BUILD_ROOT install + sed -i "s:^# edit $RPM_BUILD_ROOT:# edit :" $RPM_BUILD_ROOT%{_sysconfdir}/selinux/refpolicy-$i/contexts/files/file_contexts.homedirs + cd .. +done %clean rm -rf $RPM_BUILD_ROOT -%files +%files refpolicy-standard %defattr(-,root,root) %doc COPYING Changelog README %dir %{_sysconfdir}/selinux -%dir %{_sysconfdir}/selinux/refpolicy -%{_sysconfdir}/selinux/refpolicy/* +%dir %{_sysconfdir}/selinux/refpolicy-standard +%{_sysconfdir}/selinux/refpolicy-standard/* + +%files refpolicy-mcs +%defattr(-,root,root) +%doc COPYING Changelog README +%dir %{_sysconfdir}/selinux +%dir %{_sysconfdir}/selinux/refpolicy-mcs +%{_sysconfdir}/selinux/refpolicy-mcs/* + +%files refpolicy-mls +%defattr(-,root,root) +%doc COPYING Changelog README +%dir %{_sysconfdir}/selinux +%dir %{_sysconfdir}/selinux/refpolicy-mls +%{_sysconfdir}/selinux/refpolicy-mls/* %changelog