--- 389-ds-base-1.2.11.15.ebuild.orig 2012-12-03 11:02:32.556594083 +0100 +++ 389-ds-base-1.2.11.15.ebuild.orig 2012-12-03 11:09:27.409002486 +0100 @@ -55,11 +55,12 @@ } src_prepare() { - epatch "${FILESDIR}/selinux.patch" # Fix compilation against mozldap epatch "${FILESDIR}/389-ds-base-1.2.11-fix-mozldap.patch" # Upstream patch, will be in 1.2.11.16, fixes CVE-2012-4450 epatch "${FILESDIR}/389-ds-base-1.2.11.16-cve-2012-4450.patch" + # Fix SELinux build as per bug #445484 + epatch "${FILESDIR}/389-ds-base-1.2.11.15-fix-selinux-build.patch" # as per 389 documentation, when 64bit, export USE_64 use amd64 && export USE_64=1 @@ -163,20 +164,9 @@ pkg_postinst() { if use selinux; then - if has "loadpolicy" $FEATURES; then - einfo "Inserting the following modules into the module store" - cd /usr/share/selinux/targeted # struct policy not supported - semodule -s dirsrv -i dirsrv.pp - else - elog - elog "Policy has not been loaded. It is strongly suggested" - elog "that the policy be loaded before continuing!!" - elog - elog "Automatic policy loading can be enabled by adding" - elog "\"loadpolicy\" to the FEATURES in make.conf." - elog - ebeep 4 - fi + local SELINUXTYPE=$(grep ^SELINUXTYPE /etc/selinux/config | cut -d '=' -f 2); + cd /usr/share/selinux/${SELINUXTYPE}; + semodule -i dirsrv.pp; fi elog