selinux-refpolicy/refpolicy/support/selinux-policy-refpolicy.spec

433 lines
14 KiB
RPMSpec
Raw Normal View History

2005-10-24 15:14:43 +00:00
%define distro redhat
%define direct_initrc y
%define monolithic n
2005-10-24 15:15:25 +00:00
%define polname1 targeted
%define type1 targeted-mcs
%define polname2 strict
%define type2 strict-mcs
Summary: SELinux policy configuration
Name: selinux-policy
2005-10-24 15:14:43 +00:00
Version: 20051019
Release: 1
License: GPL
Group: System Environment/Base
Source: refpolicy-%{version}.tar.bz2
Url: http://serefpolicy.sourceforge.net
2005-10-24 15:15:25 +00:00
BuildRoot: %{_tmppath}/refpolicy-buildroot
2005-10-24 15:14:43 +00:00
BuildArch: noarch
# FIXME Need to ensure these have correct versions
BuildRequires: checkpolicy m4 policycoreutils python make gcc
PreReq: kernel >= 2.6.4-1.300 policycoreutils >= %{POLICYCOREUTILSVER}
Obsoletes: policy
%description
SELinux Reference Policy - modular.
%prep
%setup -q
2005-10-24 15:15:25 +00:00
make conf
2005-10-24 15:14:43 +00:00
%build
%install
2005-10-24 15:15:25 +00:00
%{__rm} -fR $RPM_BUILD_ROOT
make NAME=%{polname1} TYPE=%{type1} DISTRO=%{distro} DIRECT_INITRC=%{direct_initrc} MONOLITHIC=%{monolithic} base.pp
make NAME=%{polname1} TYPE=%{type1} DISTRO=%{distro} DIRECT_INITRC=%{direct_initrc} MONOLITHIC=%{monolithic} modules
%{__mkdir} -p $RPM_BUILD_ROOT/%{_usr}/share/selinux/%{polname1}/%{type1}
%{__cp} *.pp $RPM_BUILD_ROOT/%{_usr}/share/selinux/%{polname1}/%{type1}
%{__mkdir} -p $RPM_BUILD_ROOT/%{_sysconfdir}/selinux/%{polname1}/policy
%{__mkdir} -p $RPM_BUILD_ROOT/%{_sysconfdir}/selinux/%{polname1}/contexts/files
make NAME=%{polname1} TYPE=%{type1} DISTRO=%{distro} DIRECT_INITRC=%{direct_initrc} MONOLITHIC=y DESTDIR=$RPM_BUILD_ROOT install-appconfig
make NAME=%{polname1} TYPE=%{type1} DISTRO=%{distro} DIRECT_INITRC=%{direct_initrc} MONOLITHIC=%{monolithic} DESTDIR=$RPM_BUILD_ROOT $RPM_BUILD_ROOT%{_sysconfdir}/selinux/%{polname1}/users/local.users
make NAME=%{polname1} TYPE=%{type1} DISTRO=%{distro} DIRECT_INITRC=%{direct_initrc} MONOLITHIC=%{monolithic} DESTDIR=$RPM_BUILD_ROOT $RPM_BUILD_ROOT%{_sysconfdir}/selinux/%{polname1}/users/system.users
make NAME=%{polname2} TYPE=%{type2} DISTRO=%{distro} DIRECT_INITRC=%{direct_initrc} MONOLITHIC=%{monolithic} base.pp
make NAME=%{polname2} TYPE=%{type2} DISTRO=%{distro} DIRECT_INITRC=%{direct_initrc} MONOLITHIC=%{monolithic} modules
%{__mkdir} -p $RPM_BUILD_ROOT/%{_usr}/share/selinux/%{polname2}/%{type2}
%{__cp} *.pp $RPM_BUILD_ROOT/%{_usr}/share/selinux/%{polname2}/%{type2}
%{__mkdir} -p $RPM_BUILD_ROOT/%{_sysconfdir}/selinux/%{polname2}/policy
%{__mkdir} -p $RPM_BUILD_ROOT/%{_sysconfdir}/selinux/%{polname2}/contexts/files
make NAME=%{polname2} TYPE=%{type2} DISTRO=%{distro} DIRECT_INITRC=%{direct_initrc} MONOLITHIC=y DESTDIR=$RPM_BUILD_ROOT install-appconfig
make NAME=%{polname2} TYPE=%{type2} DISTRO=%{distro} DIRECT_INITRC=%{direct_initrc} MONOLITHIC=%{monolithic} DESTDIR=$RPM_BUILD_ROOT $RPM_BUILD_ROOT%{_sysconfdir}/selinux/%{polname2}/users/local.users
make NAME=%{polname2} TYPE=%{type2} DISTRO=%{distro} DIRECT_INITRC=%{direct_initrc} MONOLITHIC=%{monolithic} DESTDIR=$RPM_BUILD_ROOT $RPM_BUILD_ROOT%{_sysconfdir}/selinux/%{polname2}/users/system.users
2005-10-24 15:14:43 +00:00
%clean
2005-10-24 15:15:25 +00:00
%{__rm} -fR $RPM_BUILD_ROOT
2005-10-24 15:14:43 +00:00
%files
%defattr(-,root,root)
%dir %{_usr}/share/selinux
2005-10-24 15:15:25 +00:00
%dir %{_sysconfdir}/selinux
%dir %{_usr}/share/selinux/*
%dir %{_usr}/share/selinux/*/*
%config %{_usr}/share/selinux/*/*/*.pp
#%ghost %config(noreplace) %{_sysconfdir}/selinux/config
%dir %{_sysconfdir}/selinux/*
%ghost %config %{_sysconfdir}/selinux/*/booleans
%dir %{_sysconfdir}/selinux/*/policy
#%ghost %config %{_sysconfdir}/selinux/*/policy/policy.*
%dir %{_sysconfdir}/selinux/*/contexts
%config(noreplace) %{_sysconfdir}/selinux/*/contexts/customizable_types
%config(noreplace) %{_sysconfdir}/selinux/*/contexts/dbus_contexts
%config(noreplace) %{_sysconfdir}/selinux/*/contexts/default_contexts
%config(noreplace) %{_sysconfdir}/selinux/*/contexts/default_type
%config(noreplace) %{_sysconfdir}/selinux/*/contexts/failsafe_context
%config(noreplace) %{_sysconfdir}/selinux/*/contexts/initrc_context
%config(noreplace) %{_sysconfdir}/selinux/*/contexts/removable_context
%config(noreplace) %{_sysconfdir}/selinux/*/contexts/userhelper_context
%dir %{_sysconfdir}/selinux/*/contexts/files
#%ghost %config %{_sysconfdir}/selinux/*/contexts/files/file_contexts
#%ghost %config %{_sysconfdir}/selinux/*/contexts/files/homedir_template
#%ghost %config %{_sysconfdir}/selinux/*/contexts/files/file_contexts.homedirs
%config %{_sysconfdir}/selinux/*/contexts/files/media
%dir %{_sysconfdir}/selinux/*/users
%config %{_sysconfdir}/selinux/*/users/system.users
%config %{_sysconfdir}/selinux/*/users/local.users
#%ghost %dir %{_sysconfdir}/selinux/*/modules
2005-10-24 15:14:43 +00:00
%pre
%post
2005-10-24 15:15:25 +00:00
%package base-targeted
Summary: SELinux %{polname1} base policy
2005-10-24 15:14:43 +00:00
Group: System Environment/Base
2005-10-24 15:15:25 +00:00
Provides: selinux-policy-base
2005-10-24 15:14:43 +00:00
2005-10-24 15:15:25 +00:00
%description base-targeted
SELinux Reference policy targeted base module.
2005-10-24 15:14:43 +00:00
2005-10-24 15:15:25 +00:00
%files base-targeted
2005-10-24 15:14:43 +00:00
%defattr(-,root,root)
%dir %{_usr}/share/selinux
2005-10-24 15:15:25 +00:00
%dir %{_usr}/share/selinux/%{polname1}
%dir %{_usr}/share/selinux/%{polname1}/%{type1}
%config %{_usr}/share/selinux/%{polname1}/%{type1}/base.pp
%dir %{_sysconfdir}/selinux
#%ghost %config(noreplace) %{_sysconfdir}/selinux/config
%dir %{_sysconfdir}/selinux/%{polname1}
%ghost %config %{_sysconfdir}/selinux/%{polname1}/booleans
%dir %{_sysconfdir}/selinux/%{polname1}/policy
#%ghost %config %{_sysconfdir}/selinux/%{polname1}/policy/policy.*
%dir %{_sysconfdir}/selinux/%{polname1}/contexts
%config(noreplace) %{_sysconfdir}/selinux/%{polname1}/contexts/customizable_types
%config(noreplace) %{_sysconfdir}/selinux/%{polname1}/contexts/dbus_contexts
%config(noreplace) %{_sysconfdir}/selinux/%{polname1}/contexts/default_contexts
%config(noreplace) %{_sysconfdir}/selinux/%{polname1}/contexts/default_type
%config(noreplace) %{_sysconfdir}/selinux/%{polname1}/contexts/failsafe_context
%config(noreplace) %{_sysconfdir}/selinux/%{polname1}/contexts/initrc_context
%config(noreplace) %{_sysconfdir}/selinux/%{polname1}/contexts/removable_context
%config(noreplace) %{_sysconfdir}/selinux/%{polname1}/contexts/userhelper_context
%dir %{_sysconfdir}/selinux/%{polname1}/contexts/files
#%ghost %config %{_sysconfdir}/selinux/%{polname1}/contexts/files/file_contexts
#%ghost %config %{_sysconfdir}/selinux/%{polname1}/contexts/files/homedir_template
#%ghost %config %{_sysconfdir}/selinux/%{polname1}/contexts/files/file_contexts.homedirs
%config %{_sysconfdir}/selinux/%{polname1}/contexts/files/media
%dir %{_sysconfdir}/selinux/%{polname1}/users
%config %{_sysconfdir}/selinux/%{polname1}/users/system.users
%config %{_sysconfdir}/selinux/%{polname1}/users/local.users
#%ghost %dir %{_sysconfdir}/selinux/%{polname1}/modules
%post base-targeted
semodule -b /usr/share/selinux/%{polname1}/%{type1}/base.pp -s %{_sysconfdir}/selinux/%{polname1}
for file in $(ls /usr/share/selinux/%{polname1}/%{type1} | grep -v base.pp)
do semodule -i /usr/share/selinux/%{polname1}/%{type1}/$file -s %{_sysconfdir}/selinux/%{polname1}
done
%package base-strict
Summary: SELinux %{polname2} base policy
Group: System Environment/Base
Provides: selinux-policy-base
2005-10-24 15:14:43 +00:00
2005-10-24 15:15:25 +00:00
%description base-strict
SELinux Reference policy strict base module.
2005-10-24 15:14:43 +00:00
2005-10-24 15:15:25 +00:00
%files base-strict
%defattr(-,root,root)
%dir %{_usr}/share/selinux
%dir %{_usr}/share/selinux/%{polname2}
%dir %{_usr}/share/selinux/%{polname2}/%{type2}
%config %{_usr}/share/selinux/%{polname2}/%{type2}/base.pp
%dir %{_sysconfdir}/selinux
#%ghost %config(noreplace) %{_sysconfdir}/selinux/config
%dir %{_sysconfdir}/selinux/%{polname2}
%ghost %config %{_sysconfdir}/selinux/%{polname2}/booleans
%dir %{_sysconfdir}/selinux/%{polname2}/policy
#%ghost %config %{_sysconfdir}/selinux/%{polname2}/policy/policy.*
%dir %{_sysconfdir}/selinux/%{polname2}/contexts
%config(noreplace) %{_sysconfdir}/selinux/%{polname2}/contexts/customizable_types
%config(noreplace) %{_sysconfdir}/selinux/%{polname2}/contexts/dbus_contexts
%config(noreplace) %{_sysconfdir}/selinux/%{polname2}/contexts/default_contexts
%config(noreplace) %{_sysconfdir}/selinux/%{polname2}/contexts/default_type
%config(noreplace) %{_sysconfdir}/selinux/%{polname2}/contexts/failsafe_context
%config(noreplace) %{_sysconfdir}/selinux/%{polname2}/contexts/initrc_context
%config(noreplace) %{_sysconfdir}/selinux/%{polname2}/contexts/removable_context
%config(noreplace) %{_sysconfdir}/selinux/%{polname2}/contexts/userhelper_context
%dir %{_sysconfdir}/selinux/%{polname2}/contexts/files
#%ghost %config %{_sysconfdir}/selinux/%{polname2}/contexts/files/file_contexts
#%ghost %config %{_sysconfdir}/selinux/%{polname2}/contexts/files/homedir_template
#%ghost %config %{_sysconfdir}/selinux/%{polname2}/contexts/files/file_contexts.homedirs
%config %{_sysconfdir}/selinux/%{polname2}/contexts/files/media
%dir %{_sysconfdir}/selinux/%{polname2}/users
%config %{_sysconfdir}/selinux/%{polname2}/users/system.users
%config %{_sysconfdir}/selinux/%{polname2}/users/local.users
#%ghost %dir %{_sysconfdir}/selinux/%{polname2}/modules
%post base-strict
semodule -b /usr/share/selinux/%{polname2}/%{type2}/base.pp -s %{_sysconfdir}/selinux/%{polname2}
for file in $(ls /usr/share/selinux/%{polname2}/%{type2} | grep -v base.pp)
do semodule -i /usr/share/selinux/%{polname2}/%{type2}/$file -s %{_sysconfdir}/selinux/%{polname2}
done
2005-10-24 15:14:43 +00:00
%package apache
2005-10-24 15:15:25 +00:00
Summary: SELinux apache policy
2005-10-24 15:14:43 +00:00
Group: System Environment/Base
2005-10-24 15:15:25 +00:00
Requires: selinux-policy-base
2005-10-24 15:14:43 +00:00
%description apache
SELinux Reference policy apache module.
%files apache
%defattr(-,root,root)
%dir %{_usr}/share/selinux
2005-10-24 15:15:25 +00:00
%dir %{_usr}/share/selinux/*
%dir %{_usr}/share/selinux/*/*
%config %{_usr}/share/selinux/*/*/apache.pp
2005-10-24 15:14:43 +00:00
%post apache
2005-10-24 15:15:25 +00:00
if [ -d %{_sysconfdir}/selinux/%{polname1}/modules ] ; then
semodule -n -i %{_usr}/share/selinux/%{polname1}/%{type1}/apache.pp -s %{_sysconfdir}/selinux/%{polname1}
fi
if [ -d %{_sysconfdir}/selinux/%{polname2}/modules ] ; then
semodule -i %{_usr}/share/selinux/%{polname2}/%{type2}/apache.pp -s %{_sysconfdir}/selinux/%{polname2}
fi
%preun apache
if [ -d %{_sysconfdir}/selinux/%{polname1}/modules ]
then semodule -n -r apache -s %{_sysconfdir}/selinux/%{polname1}
fi
if [ -d %{_sysconfdir}/selinux/%{polname2}/modules ]
then semodule -n -r apache -s %{_sysconfdir}/selinux/%{polname2}
fi
2005-10-24 15:14:43 +00:00
%package bind
2005-10-24 15:15:25 +00:00
Summary: SELinux bind policy
2005-10-24 15:14:43 +00:00
Group: System Environment/Base
%description bind
SELinux Reference policy bind module.
%files bind
%defattr(-,root,root)
%dir %{_usr}/share/selinux
2005-10-24 15:15:25 +00:00
%dir %{_usr}/share/selinux/*
%dir %{_usr}/share/selinux/*/*
%config %{_usr}/share/selinux/*/*/bind.pp
2005-10-24 15:14:43 +00:00
%post bind
2005-10-24 15:15:25 +00:00
semodule -i %{_usr}/share/selinux/targeted/targeted-mcs/bind.pp
2005-10-24 15:14:43 +00:00
2005-10-24 15:15:25 +00:00
%preun bind
2005-10-24 15:14:43 +00:00
semodule -r bind
%package dhcp
2005-10-24 15:15:25 +00:00
Summary: SELinux dhcp policy
2005-10-24 15:14:43 +00:00
Group: System Environment/Base
%description dhcp
SELinux Reference policy dhcp module.
%files dhcp
%defattr(-,root,root)
%dir %{_usr}/share/selinux
2005-10-24 15:15:25 +00:00
%dir %{_usr}/share/selinux/*
%dir %{_usr}/share/selinux/*/*
%config %{_usr}/share/selinux/*/*/dhcp.pp
2005-10-24 15:14:43 +00:00
%post dhcp
2005-10-24 15:15:25 +00:00
semodule -i %{_usr}/share/selinux/targeted/targeted-mcs/dhcp.pp
2005-10-24 15:14:43 +00:00
2005-10-24 15:15:25 +00:00
%preun dhcp
2005-10-24 15:14:43 +00:00
semodule -r dhcp
%package ldap
2005-10-24 15:15:25 +00:00
Summary: SELinux ldap policy
2005-10-24 15:14:43 +00:00
Group: System Environment/Base
%description ldap
SELinux Reference policy ldap module.
%files ldap
%defattr(-,root,root)
%dir %{_usr}/share/selinux
2005-10-24 15:15:25 +00:00
%dir %{_usr}/share/selinux/*
%dir %{_usr}/share/selinux/*/*
%config %{_usr}/share/selinux/*/*/ldap.pp
2005-10-24 15:14:43 +00:00
%post ldap
2005-10-24 15:15:25 +00:00
semodule -i %{_usr}/share/selinux/targeted/targeted-mcs/ldap.pp
2005-10-24 15:14:43 +00:00
2005-10-24 15:15:25 +00:00
%preun ldap
2005-10-24 15:14:43 +00:00
semodule -r ldap
%package mailman
2005-10-24 15:15:25 +00:00
Summary: SELinux mailman policy
2005-10-24 15:14:43 +00:00
Group: System Environment/Base
%description mailman
SELinux Reference policy mailman module.
%files mailman
%defattr(-,root,root)
%dir %{_usr}/share/selinux
2005-10-24 15:15:25 +00:00
%dir %{_usr}/share/selinux/*
%dir %{_usr}/share/selinux/*/*
%config %{_usr}/share/selinux/*/*/mailman.pp
2005-10-24 15:14:43 +00:00
%post mailman
2005-10-24 15:15:25 +00:00
semodule -i %{_usr}/share/selinux/targeted/targeted-mcs/mailman.pp
2005-10-24 15:14:43 +00:00
2005-10-24 15:15:25 +00:00
%preun mailman
2005-10-24 15:14:43 +00:00
semodule -r mailman
%package mysql
2005-10-24 15:15:25 +00:00
Summary: SELinux mysql policy
2005-10-24 15:14:43 +00:00
Group: System Environment/Base
%description mysql
SELinux Reference policy mysql module.
%files mysql
%defattr(-,root,root)
%dir %{_usr}/share/selinux
2005-10-24 15:15:25 +00:00
%dir %{_usr}/share/selinux/*
%dir %{_usr}/share/selinux/*/*
%config %{_usr}/share/selinux/*/*/mysql.pp
2005-10-24 15:14:43 +00:00
%post mysql
2005-10-24 15:15:25 +00:00
semodule -i %{_usr}/share/selinux/targeted/targeted-mcsmysql.pp
2005-10-24 15:14:43 +00:00
2005-10-24 15:15:25 +00:00
%preun mysql
2005-10-24 15:14:43 +00:00
semodule -r mysql
%package portmap
2005-10-24 15:15:25 +00:00
Summary: SELinux portmap policy
2005-10-24 15:14:43 +00:00
Group: System Environment/Base
%description portmap
SELinux Reference policy portmap module.
%files portmap
%defattr(-,root,root)
%dir %{_usr}/share/selinux
2005-10-24 15:15:25 +00:00
%dir %{_usr}/share/selinux/*
%dir %{_usr}/share/selinux/*/*
%config %{_usr}/share/selinux/*/*/portmap.pp
2005-10-24 15:14:43 +00:00
%post portmap
2005-10-24 15:15:25 +00:00
semodule -i %{_usr}/share/selinux/targeted/targeted-mcs/portmap.pp
2005-10-24 15:14:43 +00:00
2005-10-24 15:15:25 +00:00
%preun portmap
2005-10-24 15:14:43 +00:00
semodule -r portmap
%package postgresql
2005-10-24 15:15:25 +00:00
Summary: SELinux postgresql policy
2005-10-24 15:14:43 +00:00
Group: System Environment/Base
%description postgresql
SELinux Reference policy postgresql module.
%files postgresql
%defattr(-,root,root)
%dir %{_usr}/share/selinux
2005-10-24 15:15:25 +00:00
%dir %{_usr}/share/selinux/*
%dir %{_usr}/share/selinux/*/*
%config %{_usr}/share/selinux/*/*/postgresql.pp
2005-10-24 15:14:43 +00:00
%post postgresql
2005-10-24 15:15:25 +00:00
semodule -i %{_usr}/share/selinux/targeted/targeted-mcs/postgresql.pp
2005-10-24 15:14:43 +00:00
2005-10-24 15:15:25 +00:00
%preun postgresql
2005-10-24 15:14:43 +00:00
semodule -r postgresql
%package samba
2005-10-24 15:15:25 +00:00
Summary: SELinux samba policy
2005-10-24 15:14:43 +00:00
Group: System Environment/Base
%description samba
SELinux Reference policy samba module.
%files samba
%defattr(-,root,root)
%dir %{_usr}/share/selinux
2005-10-24 15:15:25 +00:00
%dir %{_usr}/share/selinux/*
%dir %{_usr}/share/selinux/*/*
%config %{_usr}/share/selinux/*/*/samba.pp
2005-10-24 15:14:43 +00:00
%post samba
2005-10-24 15:15:25 +00:00
semodule -i %{_usr}/share/selinux/targeted/targeted-mcs/samba.pp
2005-10-24 15:14:43 +00:00
2005-10-24 15:15:25 +00:00
%preun samba
2005-10-24 15:14:43 +00:00
semodule -r samba
%package snmp
2005-10-24 15:15:25 +00:00
Summary: SELinux snmp policy
2005-10-24 15:14:43 +00:00
Group: System Environment/Base
%description snmp
SELinux Reference policy snmp module.
%files snmp
%defattr(-,root,root)
%dir %{_usr}/share/selinux
2005-10-24 15:15:25 +00:00
%dir %{_usr}/share/selinux/*
%dir %{_usr}/share/selinux/*/*
%config %{_usr}/share/selinux/*/*/snmp.pp
2005-10-24 15:14:43 +00:00
%post snmp
2005-10-24 15:15:25 +00:00
semodule -i %{_usr}/share/selinux/targeted/targeted-mcs/snmp.pp
2005-10-24 15:14:43 +00:00
2005-10-24 15:15:25 +00:00
%preun snmp
2005-10-24 15:14:43 +00:00
semodule -r snmp
%package squid
2005-10-24 15:15:25 +00:00
Summary: SELinux squid policy
2005-10-24 15:14:43 +00:00
Group: System Environment/Base
%description squid
SELinux Reference policy squid module.
%files squid
%defattr(-,root,root)
%dir %{_usr}/share/selinux
2005-10-24 15:15:25 +00:00
%dir %{_usr}/share/selinux/*
%dir %{_usr}/share/selinux/*/*
%config %{_usr}/share/selinux/*/*/squid.pp
2005-10-24 15:14:43 +00:00
%post squid
2005-10-24 15:15:25 +00:00
semodule -i %{_usr}/share/selinux/targeted/targeted-mcs/squid.pp
2005-10-24 15:14:43 +00:00
2005-10-24 15:15:25 +00:00
%preun squid
2005-10-24 15:14:43 +00:00
semodule -r squid
%package webalizer
2005-10-24 15:15:25 +00:00
Summary: SELinux webalizer policy
2005-10-24 15:14:43 +00:00
Group: System Environment/Base
%description webalizer
SELinux Reference policy webalizer module.
%files webalizer
%defattr(-,root,root)
%dir %{_usr}/share/selinux
2005-10-24 15:15:25 +00:00
%dir %{_usr}/share/selinux/*
%dir %{_usr}/share/selinux/*/*
%config %{_usr}/share/selinux/*/*/webalizer.pp
2005-10-24 15:14:43 +00:00
%post webalizer
2005-10-24 15:15:25 +00:00
semodule -i %{_usr}/share/selinux/targeted/targeted-mcs/webalizer.pp
2005-10-24 15:14:43 +00:00
2005-10-24 15:15:25 +00:00
%preun webalizer
2005-10-24 15:14:43 +00:00
semodule -r webalizer
%changelog