diff options
author | Jason Zaman <perfinion@gentoo.org> | 2015-12-18 12:38:27 +0800 |
---|---|---|
committer | Jason Zaman <perfinion@gentoo.org> | 2015-12-18 12:53:39 +0800 |
commit | 5231e417bf80278d39198663c2aef041a88c98a4 (patch) | |
tree | 001194993ba1efab9d1461d72b84ad682a33823c /sec-policy/selinux-base | |
parent | net-wireless/aircrack-ng: head uses CXX now so add override like CC et al (diff) | |
download | gentoo-5231e417bf80278d39198663c2aef041a88c98a4.tar.gz gentoo-5231e417bf80278d39198663c2aef041a88c98a4.tar.bz2 gentoo-5231e417bf80278d39198663c2aef041a88c98a4.zip |
sec-policy: Release of SELinux policies 2.20151208-r1
Diffstat (limited to 'sec-policy/selinux-base')
-rw-r--r-- | sec-policy/selinux-base/Manifest | 2 | ||||
-rw-r--r-- | sec-policy/selinux-base/selinux-base-2.20151208-r1.ebuild | 169 |
2 files changed, 171 insertions, 0 deletions
diff --git a/sec-policy/selinux-base/Manifest b/sec-policy/selinux-base/Manifest index 1fbc2d979117..4fe3ce038442 100644 --- a/sec-policy/selinux-base/Manifest +++ b/sec-policy/selinux-base/Manifest @@ -8,4 +8,6 @@ DIST patchbundle-selinux-base-policy-2.20141203-r6.tar.bz2 293231 SHA256 b686dcc DIST patchbundle-selinux-base-policy-2.20141203-r7.tar.bz2 295833 SHA256 ba2219b3efc747be65f94c4d8ac3cd6ee530c82c848fa41935a114184678622a SHA512 8e32d9dbfb2f0f3f50200543aadb51ed9834ccd5cdf30bf8e4d9e6d0b645ce44ffaf80f7aa9385e9c9095d9a383b3a348a92356cb5386c06544ab082a9a468c7 WHIRLPOOL 1648ee1be71e45fcf5a264816ce7edc7bab19bd28a68703923eb2d6068f1f0469ae593855231d31f88baecbf29e7cece2d6beeed20b7c04231a6c90e90d35910 DIST patchbundle-selinux-base-policy-2.20141203-r8.tar.bz2 297919 SHA256 77539eb3d78105f8789cd8205d2698bd27e2abf100163bdd162cda860fd15120 SHA512 2f8a19e1e4bb65f32b480275f49099aed3ae9df543c7de862b3bbd93e81b89cd96dadac3d091e28673d09a6885db8c5656b3a77d0080775c110b04f2753de7a6 WHIRLPOOL 79cb7e620eb8e838192dc557c7a9ce7e713227d783cc8b63792825559b2145cad70d0af6f99948c1527557bc363feffd846c73893682b4a14fc7d08b9e20c649 DIST patchbundle-selinux-base-policy-2.20141203-r9.tar.bz2 299602 SHA256 e8518004942a6c57170a609683e22b1410c93a2a195829c41dc8fbc703d941b5 SHA512 ce6484fbca1d2d074e50d1a3953392bd3ce0a4617df98fbac37747b469b4f160a9331586dfe1c3ddccb1ccbee24876a2f05ab49e37c8492a48baf83c2d01d140 WHIRLPOOL 1fd7b956e98e95a64c3a713a944d4531259bd156a7feabf6a89c4b5f33ac846377730eede97889e85183be086f282ebd18e860214f6ca3f01b40f2323470ee04 +DIST patchbundle-selinux-base-policy-2.20151208-r1.tar.bz2 281828 SHA256 08884d11088f7c9120692c27477b2b43a25a6ad013a87d663697c17209ee9418 SHA512 a2c51b41c1ac909a31e89f52ee7661a22af1ae7950383cd63c7f7bcd1cabac062221a5bac27d12d1ea63a0c30f834ea13c0c75df4bc8b08d8eb31b89a8cc7f02 WHIRLPOOL 87807f84ce7d2207434b2f7f1216f769a50d72960d3999e11f877795c46dcd7ba66e750a8365f5efa3616816aa81585bb921862bb61d9b75b34d4cb744d8748d DIST refpolicy-2.20141203.tar.bz2 680243 SHA256 f438209c430d8a2d4ddcbe4bdd3edb46f6af7dc4913637af0b73c635e40c1522 SHA512 682e4280c5799e4c12ec7594afc1389f67be35055748d2e0dbdc3419159a16c96d4946ca6178daee8370515951f8653b2e452efe8c962b8d7f9bc192f0b15a0c WHIRLPOOL 74bca232534e7af9051bb1ab9f77c1ff6c425781cf4561f781d6e9a40cc5ca0d9add540249ea5493e8782a9372aea296ead6c165c6c440ae1509eb319d151ee5 +DIST refpolicy-2.20151208.tar.bz2 698182 SHA256 2dd2f45a7132137afe8302805c3b7839739759b9ab73dd1815c01afe34ac99de SHA512 cbefe117f143adea834065949e24e9fe86336c049e9e0518026597d5b0a18c482a9717422bd39b7fb0012d19df00365c969d87e1f13a7bb9dcb9996313ed6cf8 WHIRLPOOL cb843a602dde4234a62e6f92001bff689a457796215b015bcccce79e7aa73bfe875a82bdbdbf59236f218eb41aaf665fcc5753c42d86eb3ed1caa1b69ddc2efa diff --git a/sec-policy/selinux-base/selinux-base-2.20151208-r1.ebuild b/sec-policy/selinux-base/selinux-base-2.20151208-r1.ebuild new file mode 100644 index 000000000000..d86db33d977a --- /dev/null +++ b/sec-policy/selinux-base/selinux-base-2.20151208-r1.ebuild @@ -0,0 +1,169 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ +EAPI="5" + +inherit eutils + +if [[ ${PV} == 9999* ]]; then + EGIT_REPO_URI="${SELINUX_GIT_REPO:-git://anongit.gentoo.org/proj/hardened-refpolicy.git https://anongit.gentoo.org/git/proj/hardened-refpolicy.git}" + EGIT_BRANCH="${SELINUX_GIT_BRANCH:-master}" + EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy" + + inherit git-r3 + + KEYWORDS="" +else + SRC_URI="https://raw.githubusercontent.com/wiki/TresysTechnology/refpolicy/files/refpolicy-${PV}.tar.bz2 + https://dev.gentoo.org/~swift/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2" + + KEYWORDS="~amd64 ~x86" +fi + +IUSE="doc +open_perms +peer_perms systemd +ubac +unconfined" + +DESCRIPTION="Gentoo base policy for SELinux" +HOMEPAGE="https://www.gentoo.org/proj/en/hardened/selinux/" +LICENSE="GPL-2" +SLOT="0" + +RDEPEND=">=sys-apps/policycoreutils-2.3 + virtual/udev + !<=sec-policy/selinux-base-policy-2.20120725" +DEPEND="${RDEPEND} + sys-devel/m4 + >=sys-apps/checkpolicy-2.3" + +S=${WORKDIR}/ + +src_prepare() { + if [[ ${PV} != 9999* ]]; then + # Apply the gentoo patches to the policy. These patches are only necessary + # for base policies, or for interface changes on modules. + EPATCH_MULTI_MSG="Applying SELinux policy updates ... " \ + EPATCH_SUFFIX="patch" \ + EPATCH_SOURCE="${WORKDIR}" \ + EPATCH_FORCE="yes" \ + epatch + fi + + cd "${S}/refpolicy" + make bare + + epatch_user +} + +src_configure() { + [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" + + # Update the SELinux refpolicy capabilities based on the users' USE flags. + + if ! use peer_perms; then + sed -i -e '/network_peer_controls/d' \ + "${S}/refpolicy/policy/policy_capabilities" || die + fi + + if ! use open_perms; then + sed -i -e '/open_perms/d' \ + "${S}/refpolicy/policy/policy_capabilities" || die + fi + + if ! use ubac; then + sed -i -e '/^UBAC/s/y/n/' "${S}/refpolicy/build.conf" \ + || die "Failed to disable User Based Access Control" + fi + + if use systemd; then + sed -i -e '/^SYSTEMD/s/n/y/' "${S}/refpolicy/build.conf" \ + || die "Failed to enable SystemD" + fi + + echo "DISTRO = gentoo" >> "${S}/refpolicy/build.conf" || die + + # Prepare initial configuration + cd "${S}/refpolicy" || die + make conf || die "Make conf failed" + + # Setup the policies based on the types delivered by the end user. + # These types can be "targeted", "strict", "mcs" and "mls". + for i in ${POLICY_TYPES}; do + cp -a "${S}/refpolicy" "${S}/${i}" || die + cd "${S}/${i}" || die + + #cp "${FILESDIR}/modules-2.20120215.conf" "${S}/${i}/policy/modules.conf" + sed -i -e "/= module/d" "${S}/${i}/policy/modules.conf" || die + + sed -i -e '/^QUIET/s/n/y/' -e "/^NAME/s/refpolicy/$i/" \ + "${S}/${i}/build.conf" || die "build.conf setup failed." + + if [[ "${i}" == "mls" ]] || [[ "${i}" == "mcs" ]]; + then + # MCS/MLS require additional settings + sed -i -e "/^TYPE/s/standard/${i}/" "${S}/${i}/build.conf" \ + || die "failed to set type to mls" + fi + + if [ "${i}" == "targeted" ]; then + sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \ + "${S}/${i}/config/appconfig-standard/seusers" \ + || die "targeted seusers setup failed." + fi + + if [ "${i}" != "targeted" ] && [ "${i}" != "strict" ] && use unconfined; then + sed -i -e '/root/d' -e 's/user_u/unconfined_u/' \ + "${S}/${i}/config/appconfig-${i}/seusers" \ + || die "policy seusers setup failed." + fi + done +} + +src_compile() { + [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" + + for i in ${POLICY_TYPES}; do + cd "${S}/${i}" || die + emake base + if use doc; then + emake html + fi + done +} + +src_install() { + [ -z "${POLICY_TYPES}" ] && local POLICY_TYPES="targeted strict mls mcs" + + for i in ${POLICY_TYPES}; do + cd "${S}/${i}" || die + + make DESTDIR="${D}" install \ + || die "${i} install failed." + + make DESTDIR="${D}" install-headers \ + || die "${i} headers install failed." + + echo "run_init_t" > "${D}/etc/selinux/${i}/contexts/run_init_type" || die + + echo "textrel_shlib_t" >> "${D}/etc/selinux/${i}/contexts/customizable_types" || die + + # libsemanage won't make this on its own + keepdir "/etc/selinux/${i}/policy" + + if use doc; then + dohtml doc/html/*; + fi + + insinto /usr/share/selinux/devel; + doins doc/policy.xml; + + done + + dodoc doc/Makefile.example doc/example.{te,fc,if} + + doman man/man8/*.8; + + insinto /etc/selinux + doins "${FILESDIR}/config" + + insinto /usr/share/portage/config/sets + doins "${FILESDIR}/selinux.conf" +} |