Moved selinux subpackage into base package.

This commit is contained in:
Nathan Kinder 2010-04-07 22:34:08 +00:00
parent 748afdef07
commit 75dd970820

View File

@ -17,6 +17,7 @@ Group: System Environment/Daemons
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Provides: fedora-ds-base = %{version}-%{release} Provides: fedora-ds-base = %{version}-%{release}
Obsoletes: fedora-ds-base < 1.2.1-1 Obsoletes: fedora-ds-base < 1.2.1-1
Obsoletes: %{name}-selinux
BuildRequires: nspr-devel BuildRequires: nspr-devel
BuildRequires: nss-devel BuildRequires: nss-devel
@ -43,12 +44,15 @@ BuildRequires: /usr/share/selinux/devel/Makefile
# the following is for the pam passthru auth plug-in # the following is for the pam passthru auth plug-in
BuildRequires: pam-devel BuildRequires: pam-devel
# require our selinux subpackage
Requires: %{name}-selinux = %{version}-%{release}
# this is needed for using semanage from our setup scripts # this is needed for using semanage from our setup scripts
Requires: policycoreutils-python Requires: policycoreutils-python
# these are needed for selinux
Requires: selinux-policy
Requires(post): policycoreutils
Requires(preun): policycoreutils
Requires(postun): policycoreutils
# the following are needed for some of our scripts # the following are needed for some of our scripts
Requires: mozldap-tools Requires: mozldap-tools
Requires: perl-Mozilla-LDAP Requires: perl-Mozilla-LDAP
@ -96,21 +100,6 @@ Obsoletes: fedora-ds-base-devel < 1.2.1-1
%description devel %description devel
Development Libraries and headers for the 389 Directory Server base package. Development Libraries and headers for the 389 Directory Server base package.
%package selinux
Summary: SELinux policy for 389 Directory Server
Group: System Environment/Daemons
Requires: selinux-policy
# this is needed to load and unload the policy module
Requires(post): policycoreutils
Requires(post): /sbin/service
Requires(preun): policycoreutils
Requires(preun): /sbin/service
Requires(postun): policycoreutils
%description selinux
SELinux policy for the 389 Directory Server base package.
%package selinux-devel %package selinux-devel
Summary: Development interface for 389 Directory Server base SELinux policy Summary: Development interface for 389 Directory Server base SELinux policy
Group: Development/Libraries Group: Development/Libraries
@ -234,17 +223,35 @@ else
-- print("in %{pkgname} post - installing") -- print("in %{pkgname} post - installing")
%{pkgname}_upgrading = false %{pkgname}_upgrading = false
end end
-- load the selinux policy module
variants = "%{selinux_variants}"
for selinuxvariant in string.gfind(variants, "%a+") do
os.execute('semodule -s '..selinuxvariant..' -i %{_datadir}/selinux/'..selinuxvariant..'/%{pkgname}.pp > /dev/null 2>&1')
end
-- label the files installed by this package
os.execute('fixfiles -R %{name} restore > /dev/null 2>&1')
%preun %preun
if [ $1 = 0 ]; then if [ $1 = 0 ]; then # Final removal
/sbin/service %{pkgname} stop >/dev/null 2>&1 || : /sbin/service %{pkgname} stop >/dev/null 2>&1 || :
/sbin/chkconfig --del %{pkgname} /sbin/chkconfig --del %{pkgname}
/sbin/service %{pkgname}-snmp stop >/dev/null 2>&1 || : /sbin/service %{pkgname}-snmp stop >/dev/null 2>&1 || :
/sbin/chkconfig --del %{pkgname}-snmp /sbin/chkconfig --del %{pkgname}-snmp
for selinuxvariant in %{selinux_variants}
do
semodule -s ${selinuxvariant} -r %{pkgname} 2>/dev/null || :
done
fi fi
%postun -p /sbin/ldconfig %postun
/sbin/ldconfig
if [ "$1" -ge "1" ]; then # Upgrade
for selinuxvariant in %{selinux_variants}
do
semodule -s ${selinuxvariant} -i %{_datadir}/selinux/${selinuxvariant}/%{pkgname}.pp 2>/dev/null || :
done
fi
%posttrans -p <lua> %posttrans -p <lua>
-- if we saved the run level configuration in %pre, restore it now -- if we saved the run level configuration in %pre, restore it now
@ -286,6 +293,8 @@ if %{pkgname}_upgrading then
-- print("restarting instance "..inst) -- print("restarting instance "..inst)
os.execute('/sbin/service %{pkgname} start '..inst..' >/dev/null 2>&1') os.execute('/sbin/service %{pkgname} start '..inst..' >/dev/null 2>&1')
end end
-- restart the snmp subagent if needed
os.execute('/sbin/service %{pkgname}-snmp condrestart > /dev/null 2>&1')
end end
-- if we upgraded from fedora to 389, the upgrade will shutdown -- if we upgraded from fedora to 389, the upgrade will shutdown
-- all old running instances, so we have to start them here -- all old running instances, so we have to start them here
@ -294,36 +303,6 @@ if %{pkgname}_exists then
os.execute('/sbin/service %{pkgname} start >/dev/null 2>&1') os.execute('/sbin/service %{pkgname} start >/dev/null 2>&1')
end end
%post selinux
if [ "$1" -le "1" ] ; then # First install
for selinuxvariant in %{selinux_variants}
do
semodule -s ${selinuxvariant} -i %{_datadir}/selinux/${selinuxvariant}/%{pkgname}.pp 2>/dev/null || :
done
fixfiles -R %{name} restore || :
/sbin/service %{pkgname} condrestart > /dev/null 2>&1 || :
/sbin/service %{pkgname}-snmp condrestart > /dev/null 2>&1 || :
fi
%preun selinux
if [ "$1" -lt "1" ]; then # Final removal
for selinuxvariant in %{selinux_variants}
do
semodule -s ${selinuxvariant} -r %{pkgname} 2>/dev/null || :
done
fixfiles -R %{name} restore || :
/sbin/service %{pkgname} condrestart > /dev/null 2>&1 || :
/sbin/service %{pkgname}-snmp condrestart > /dev/null 2>&1 || :
fi
%postun selinux
if [ "$1" -ge "1" ]; then # Upgrade
for selinuxvariant in %{selinux_variants}
do
semodule -s ${selinuxvariant} -i %{_datadir}/selinux/${selinuxvariant}/%{pkgname}.pp 2>/dev/null || :
done
fi
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
@ -338,6 +317,7 @@ fi
%config(noreplace)%{_sysconfdir}/%{pkgname}/config/template-initconfig %config(noreplace)%{_sysconfdir}/%{pkgname}/config/template-initconfig
%config(noreplace)%{_sysconfdir}/sysconfig/%{pkgname} %config(noreplace)%{_sysconfdir}/sysconfig/%{pkgname}
%{_datadir}/%{pkgname} %{_datadir}/%{pkgname}
%{_datadir}/selinux/*/%{pkgname}.pp
%{_sysconfdir}/rc.d/init.d/%{pkgname} %{_sysconfdir}/rc.d/init.d/%{pkgname}
%{_sysconfdir}/rc.d/init.d/%{pkgname}-snmp %{_sysconfdir}/rc.d/init.d/%{pkgname}-snmp
%{_bindir}/* %{_bindir}/*
@ -359,19 +339,16 @@ fi
%{_includedir}/%{pkgname} %{_includedir}/%{pkgname}
%{_libdir}/%{pkgname}/*.so %{_libdir}/%{pkgname}/*.so
%files selinux
%defattr(-,root,root,-)
%{_datadir}/selinux/*/%{pkgname}.pp
%files selinux-devel %files selinux-devel
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{_datadir}/%{pkgname}-selinux %{_datadir}/%{pkgname}-selinux
%changelog %changelog
* Tue Apr 6 2010 Nathan Kinder <nkinder@redhat.com> - 1.2.6-0.3.a3 * Tue Apr 7 2010 Nathan Kinder <nkinder@redhat.com> - 1.2.6-0.3.a3
- 1.2.6.a3 release - 1.2.6.a3 release
- add managed entries plug-in - add managed entries plug-in
- many bug fixes - many bug fixes
- moved selinux subpackage into base package
* Mon Mar 2 2010 Rich Megginson <rmeggins@redhat.com> - 1.2.6-0.2.a2 * Mon Mar 2 2010 Rich Megginson <rmeggins@redhat.com> - 1.2.6-0.2.a2
- 1.2.6.a2 release - 1.2.6.a2 release