From 0c100b7dd2b30e75b799d806df4ef899fd98e1ea Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 16 Apr 2022 13:07:24 +0100 Subject: gentoo resync : 16.04.2022 --- sec-policy/selinux-base/Manifest | 15 +- .../selinux-base/selinux-base-2.20200818-r2.ebuild | 153 -------------------- .../selinux-base/selinux-base-2.20210203-r1.ebuild | 158 --------------------- .../selinux-base/selinux-base-2.20210908-r1.ebuild | 158 --------------------- .../selinux-base/selinux-base-2.20220106-r1.ebuild | 2 +- .../selinux-base/selinux-base-2.20220106-r2.ebuild | 2 +- .../selinux-base/selinux-base-2.20220106-r3.ebuild | 158 +++++++++++++++++++++ 7 files changed, 164 insertions(+), 482 deletions(-) delete mode 100644 sec-policy/selinux-base/selinux-base-2.20200818-r2.ebuild delete mode 100644 sec-policy/selinux-base/selinux-base-2.20210203-r1.ebuild delete mode 100644 sec-policy/selinux-base/selinux-base-2.20210908-r1.ebuild create mode 100644 sec-policy/selinux-base/selinux-base-2.20220106-r3.ebuild (limited to 'sec-policy/selinux-base') diff --git a/sec-policy/selinux-base/Manifest b/sec-policy/selinux-base/Manifest index ebf3819bd2b1..49e169cc0b3b 100644 --- a/sec-policy/selinux-base/Manifest +++ b/sec-policy/selinux-base/Manifest @@ -1,18 +1,11 @@ AUX config 631 BLAKE2B 7c7c5ad7e2349cf8dd6877bba7947f256b6bdee492ef76a44ac378eafb9203c0d7ad6f188a762c61b80672a56dca65767567cd68c998aa67d58a9579e5c0cae6 SHA512 f3c4fece54e5786de94fc97c8e7678f9901c6963828d28b020c423458ac258480191f216522fed7658e7ad1c94fd25557efc524a4b75ec8837116c6a14c2328a AUX selinux.conf 119 BLAKE2B c877aec601cfc066b42493a3b45e179834d30b7f0eb34b625f3758795c2fd2e58744cf539fdb5b06c002365fb264bdf6e953c1f6e30c7b2d310e22206ea5a37f SHA512 a057f84388b2b494b5e7623b076450c1856687c50a4ccb5aa22215748461786a0c71fdd9f76e9ed8639bcd3040006fb010aa5497192d6c0cab432a1b9c028b3b -DIST patchbundle-selinux-base-policy-2.20200818-r2.tar.bz2 433623 BLAKE2B f0655c45c50347faf1217e5861298dce822e4b726c0b4489d4c70c4815842f7c17ac1b0a302ae5482a3ad25d1d5b6c4c3b6395194e79005f31560d103ad0fce6 SHA512 9fd22683ecd602a429b2d489f7b8c2936409fa060046255b72a4b95c9fdefa2455ba7655945278dc972c22f3ade6617898ed169e22001aaaaded4b47ca51b0c3 -DIST patchbundle-selinux-base-policy-2.20210203-r1.tar.bz2 298116 BLAKE2B 50c5523a8b758652af6aa59d548e9499b899898b58f52f74f1667a0c552f2b2d0ed5a44352e59245c7f0ebd199e2391400168d6ab27b4160d726fccded0c56f2 SHA512 ddb877ec3e2883f57e54e7380dd449d4d89a0769a1fb87141786e5de741ac21b2ead60362fd17c25888eb1334c68f71da561f4f29f406f0d4b5d13d378f6baff -DIST patchbundle-selinux-base-policy-2.20210908-r1.tar.bz2 295091 BLAKE2B 649d9a1d9190aac4a42d460b0609175bb7e1a32624d7504ebfa294741ed5fc2eec286471af1b9128f4cdb9845240b37353a8e641e111b9e53250607c34257baf SHA512 5c9cbd97ece391a2ba0f3586bf19811a2425b9c94c9beafa781dd7b175d7572a46e31a46e8f8671a4b7e122186574f5098a247fee62e1be8afc89233d71effb9 DIST patchbundle-selinux-base-policy-2.20220106-r1.tar.bz2 299683 BLAKE2B 9e48733878e2f809b8634a1e96a4b1bb2fc3e866e562a6ac9449da8d4af591cbe7de380384fabec50c7a7c67733253f82024ce62dee51fc73e35e0653626ff6c SHA512 314c639e08b15a94656e467e81857241b242020884c0e40272cfb422cccc35f2d4a5f067dc6ebdf8926335a65d737c233d1df75f69b356509e07fd60b46b07bf DIST patchbundle-selinux-base-policy-2.20220106-r2.tar.bz2 436316 BLAKE2B 07d6ba7a5fa8e8213e922bfd4c698b73c1cdf598ceaa5efe98be095b51aafa446af8ea7217dcc2bc001bfadaa250bfcc8b8dea3d9aa630384f8cdf139512170d SHA512 68a71d098ae09b034cb57f8e38c06b23a6584f5538b94a44fb1e48e48c718f2b37eb5e38931e55e8769481ebf0ed8c8642cfa85a45ac23a71be31cc35380fbad -DIST refpolicy-2.20200818.tar.bz2 570896 BLAKE2B 502c00fec39e1b81e42de3f7f942623f8b3fbdeac19f9f01126722a368b7d4f70427d6e4a574754c4f2fa551e4bc75c912dbc515c004f0dcd5eb28ab416498f6 SHA512 e4b527bb7a87b9359fc42eb111d5008103f57c37128998ea0e21ec7b0b8607ffe3f67697450e4c51a0db172ece69083335b279bacef4b1bd0b7748b58caa99a7 -DIST refpolicy-2.20210203.tar.bz2 564099 BLAKE2B a94a11ebb78890ba2c98714be2fe9054fdb8ccaf5154f47b881a9575a4a6865e8df475805550d7bba8039b4230c6a0c9f5c6130bf8c35a26bc7c473d550fb40d SHA512 a6ffe718626dd6121023b4cbc424c933d44ca8b662bd708baad307cf6284be0d80fef40cdc8b37f6f17ecb3636fd8d6c1d5d4072c17d835b7f500e17a3acd9fc -DIST refpolicy-2.20210908.tar.bz2 556375 BLAKE2B 12791eeed54204ef075b2d95a738c7d5007d48630d2a60d7e698bcb909dda0abcc15233811a91f4646415ab3daabe2cac46fbfbd04e61f71782e729c0209f99d SHA512 7b84330ca5dd631629302f342a11bf6211cf0711ff3f3273d63ddb072e84c8fe8bef48d511b264affc82090ee51036a09421f81878e10b0c047f572d7720de96 +DIST patchbundle-selinux-base-policy-2.20220106-r3.tar.bz2 309416 BLAKE2B 89852cce079300edcb00da41cfe42ea5041507f7d0a2a9897a4bd14f3ac68edfcc40ef49320e5ab826b1abb7fe7fc7ca4268042bbc019b3c76a58b9e112601c3 SHA512 4e23ad5e83df6c3501f0ac0a7201786d9f00809bedef248ae3a4b6af994e0006aaf70151c29ca21bb1c9c8887cc5bfeb18389d4f8e3bd3861c61d2d95d3a4e75 DIST refpolicy-2.20220106.tar.bz2 560342 BLAKE2B bc0e65466333e02acb48adbb28b8176d3c8e508b2ff97d4f8a876d7c0a65534a62d86c9816ac59f6eed583f4b5c51cf432643edd2dad24dd51eb3cf22e2b75ac SHA512 794327d2dd07196b5f36771f9a961cdf294cf68f690735418d6bdd859499b7007c518cc022ccca9c245a5266b85bdb7cacdcaeefee14e4800937c9101476b373 -EBUILD selinux-base-2.20200818-r2.ebuild 4080 BLAKE2B c948789e28d2be05711bed82023f38de8132aa772fd91c0b737d9a7af11c88141b5d621722954db7a2e70a5723be20b92149faa0127d6cddad49c6a19cf7b9d7 SHA512 6f6bacfe68190de235c3c73c27f5eb496fc9fe2cec6f7d590373b1db6a4db4c5f529bd96c4d6bc691f4f1ea28bb76e18d2ffd237ea4d82d6ef8595773e6e465c -EBUILD selinux-base-2.20210203-r1.ebuild 4175 BLAKE2B b6563e5a560c210fa0fd64e22aca74a196da14dce351a00d6b717df4f64d404e66efe16abefe8d115ce6cefac2753f3a83b2ebae1e56a367a19ee026a3b0d57d SHA512 f168b6284e490325e6ce8f4a35bee900ce4af5b328fe644e2c91192e2912c8b228d046e215c3293032ce5aaf782c322df87a001fa44ad04fd20061b55a67c7a7 -EBUILD selinux-base-2.20210908-r1.ebuild 4175 BLAKE2B b6563e5a560c210fa0fd64e22aca74a196da14dce351a00d6b717df4f64d404e66efe16abefe8d115ce6cefac2753f3a83b2ebae1e56a367a19ee026a3b0d57d SHA512 f168b6284e490325e6ce8f4a35bee900ce4af5b328fe644e2c91192e2912c8b228d046e215c3293032ce5aaf782c322df87a001fa44ad04fd20061b55a67c7a7 -EBUILD selinux-base-2.20220106-r1.ebuild 4177 BLAKE2B 8977045de111c35f0e24ce366b112dcbb7b61f589018c8f3ac6dc90dd2fd14b86355330865675b56b8a06c17c4ec4f7e5575b98e4d617ade3bab2a69bdc3493e SHA512 8e2ac1ef563170533b76f9f6851da7546bb8a5a85a2c1e0161b3f0baceffae3650b1a0435df80b5d61bc5feb67d45ee33d8007a88237939a616b9c8281afcdf5 -EBUILD selinux-base-2.20220106-r2.ebuild 4179 BLAKE2B bc1c425cea121d1daa7767b0395984abaebc039b6eba516c41cd9f4865886c889ca933f5b56eb1b99a778df7914337fb1d6e17052a06c17c283d7de2d86904e7 SHA512 b3929519b18a9ef91f82187b9362ff079db3efe7238b5af737dadfda1d7800081205e6a1122eac477e9b49ee6fceb7dac918d40c7c5e08dac1c4866b70a15486 +EBUILD selinux-base-2.20220106-r1.ebuild 4175 BLAKE2B 78fd238b813e3506b23c3855aa61e54eda98b24a93a771fe5abbc1b2342d4860069db1b381398b0e892b799cd1b1663129f134f1e9789b8cefd79c18aa789ba6 SHA512 d3943e65f3e52332b621b1d29023b42c47230d219558397c4f4b9102a5790f046218f11bdfde4ef568d7948c9bc5a6aa83615d1d3cd2614b1dcd8cfc20c81b8d +EBUILD selinux-base-2.20220106-r2.ebuild 4175 BLAKE2B 78fd238b813e3506b23c3855aa61e54eda98b24a93a771fe5abbc1b2342d4860069db1b381398b0e892b799cd1b1663129f134f1e9789b8cefd79c18aa789ba6 SHA512 d3943e65f3e52332b621b1d29023b42c47230d219558397c4f4b9102a5790f046218f11bdfde4ef568d7948c9bc5a6aa83615d1d3cd2614b1dcd8cfc20c81b8d +EBUILD selinux-base-2.20220106-r3.ebuild 4175 BLAKE2B 78fd238b813e3506b23c3855aa61e54eda98b24a93a771fe5abbc1b2342d4860069db1b381398b0e892b799cd1b1663129f134f1e9789b8cefd79c18aa789ba6 SHA512 d3943e65f3e52332b621b1d29023b42c47230d219558397c4f4b9102a5790f046218f11bdfde4ef568d7948c9bc5a6aa83615d1d3cd2614b1dcd8cfc20c81b8d EBUILD selinux-base-9999.ebuild 4179 BLAKE2B f34f34c4723b1fb40998ff1f9e84948fd9e478d13fab867892b07d17cb01ddfeae613f62b449d4173caefce607683601fa4517384d1e89a71b595967e7a7a345 SHA512 f9959a6aaa90914a6c0d705a2e318a21858b967980e694a3fda0a03393d107a0ac26cf1e0c3ef891f5276ad54c27f787445e732af70fd279a2eb925e459d0ab5 MISC metadata.xml 745 BLAKE2B 7079a3d2e3455a9261439f607e4590fa2199ec642805127ab8f8b4876a1f642022f1ce636e6304db686baed0e05fc209007f2043e121618b31f1d0a4d23a3349 SHA512 9e17f2409d9ca252b2f2871e6a1028d1ec862c7ea27e0d0a10f07807061b4171f65d4b3673bc79451c0cd167944bcf78fcb37a7db43f66b2f21ff7f765aa8421 diff --git a/sec-policy/selinux-base/selinux-base-2.20200818-r2.ebuild b/sec-policy/selinux-base/selinux-base-2.20200818-r2.ebuild deleted file mode 100644 index a0491b496df9..000000000000 --- a/sec-policy/selinux-base/selinux-base-2.20200818-r2.ebuild +++ /dev/null @@ -1,153 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -if [[ ${PV} == 9999* ]]; then - EGIT_REPO_URI="${SELINUX_GIT_REPO:-https://anongit.gentoo.org/git/proj/hardened-refpolicy.git}" - EGIT_BRANCH="${SELINUX_GIT_BRANCH:-master}" - EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy" - - inherit git-r3 -else - SRC_URI="https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_${PV/./_}/refpolicy-${PV}.tar.bz2 - https://dev.gentoo.org/~perfinion/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2" - - KEYWORDS="amd64 arm arm64 ~mips x86" -fi - -IUSE="doc +unknown-perms systemd +ubac +unconfined" - -DESCRIPTION="Gentoo base policy for SELinux" -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux" -LICENSE="GPL-2" -SLOT="0" - -RDEPEND=">=sys-apps/policycoreutils-2.8" -DEPEND="${RDEPEND}" -BDEPEND=" - >=sys-apps/checkpolicy-2.8 - sys-devel/m4" - -S=${WORKDIR}/ - -src_prepare() { - if [[ ${PV} != 9999* ]]; then - einfo "Applying SELinux policy updates ... " - eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch" - fi - - eapply_user - - cd "${S}/refpolicy" || die - emake bare -} - -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 unknown-perms; then - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/build.conf" \ - || die "Failed to allow Unknown Permissions Handling" - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/Makefile" \ - || die "Failed to allow Unknown Permissions Handling" - 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 - emake conf - - # 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 - - 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 - - emake DESTDIR="${D}" install - emake DESTDIR="${D}" install-headers - - 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 - docinto ${i}/html - dodoc -r doc/html/*; - fi - - insinto /usr/share/selinux/devel; - doins doc/policy.xml; - - done - - docinto / - 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" -} diff --git a/sec-policy/selinux-base/selinux-base-2.20210203-r1.ebuild b/sec-policy/selinux-base/selinux-base-2.20210203-r1.ebuild deleted file mode 100644 index 501b401f0312..000000000000 --- a/sec-policy/selinux-base/selinux-base-2.20210203-r1.ebuild +++ /dev/null @@ -1,158 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -PYTHON_COMPAT=( python3_{8,9,10} ) -PYTHON_REQ_USE="xml" -inherit python-any-r1 - -if [[ ${PV} == 9999* ]]; then - EGIT_REPO_URI="${SELINUX_GIT_REPO:-https://anongit.gentoo.org/git/proj/hardened-refpolicy.git}" - EGIT_BRANCH="${SELINUX_GIT_BRANCH:-master}" - EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy" - - inherit git-r3 -else - SRC_URI="https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_${PV/./_}/refpolicy-${PV}.tar.bz2 - https://dev.gentoo.org/~perfinion/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2" - - KEYWORDS="amd64 arm arm64 ~mips x86" -fi - -IUSE="doc +unknown-perms systemd +ubac +unconfined" - -DESCRIPTION="Gentoo base policy for SELinux" -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux" -LICENSE="GPL-2" -SLOT="0" - -RDEPEND=">=sys-apps/policycoreutils-2.8" -DEPEND="${RDEPEND}" -BDEPEND=" - ${PYTHON_DEPS} - >=sys-apps/checkpolicy-2.8 - sys-devel/m4" - -S=${WORKDIR}/ - -src_prepare() { - if [[ ${PV} != 9999* ]]; then - einfo "Applying SELinux policy updates ... " - eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch" - fi - - eapply_user - - cd "${S}/refpolicy" || die - emake bare -} - -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 unknown-perms; then - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/build.conf" \ - || die "Failed to allow Unknown Permissions Handling" - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/Makefile" \ - || die "Failed to allow Unknown Permissions Handling" - 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 - emake conf - - # 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 - - 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 - - emake DESTDIR="${D}" install - emake DESTDIR="${D}" install-headers - - 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 - docinto ${i}/html - dodoc -r doc/html/*; - fi - - insinto /usr/share/selinux/devel; - doins doc/policy.xml; - - done - - docinto / - 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" -} diff --git a/sec-policy/selinux-base/selinux-base-2.20210908-r1.ebuild b/sec-policy/selinux-base/selinux-base-2.20210908-r1.ebuild deleted file mode 100644 index 501b401f0312..000000000000 --- a/sec-policy/selinux-base/selinux-base-2.20210908-r1.ebuild +++ /dev/null @@ -1,158 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI="7" - -PYTHON_COMPAT=( python3_{8,9,10} ) -PYTHON_REQ_USE="xml" -inherit python-any-r1 - -if [[ ${PV} == 9999* ]]; then - EGIT_REPO_URI="${SELINUX_GIT_REPO:-https://anongit.gentoo.org/git/proj/hardened-refpolicy.git}" - EGIT_BRANCH="${SELINUX_GIT_BRANCH:-master}" - EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy" - - inherit git-r3 -else - SRC_URI="https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_${PV/./_}/refpolicy-${PV}.tar.bz2 - https://dev.gentoo.org/~perfinion/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2" - - KEYWORDS="amd64 arm arm64 ~mips x86" -fi - -IUSE="doc +unknown-perms systemd +ubac +unconfined" - -DESCRIPTION="Gentoo base policy for SELinux" -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux" -LICENSE="GPL-2" -SLOT="0" - -RDEPEND=">=sys-apps/policycoreutils-2.8" -DEPEND="${RDEPEND}" -BDEPEND=" - ${PYTHON_DEPS} - >=sys-apps/checkpolicy-2.8 - sys-devel/m4" - -S=${WORKDIR}/ - -src_prepare() { - if [[ ${PV} != 9999* ]]; then - einfo "Applying SELinux policy updates ... " - eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch" - fi - - eapply_user - - cd "${S}/refpolicy" || die - emake bare -} - -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 unknown-perms; then - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/build.conf" \ - || die "Failed to allow Unknown Permissions Handling" - sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/Makefile" \ - || die "Failed to allow Unknown Permissions Handling" - 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 - emake conf - - # 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 - - 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 - - emake DESTDIR="${D}" install - emake DESTDIR="${D}" install-headers - - 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 - docinto ${i}/html - dodoc -r doc/html/*; - fi - - insinto /usr/share/selinux/devel; - doins doc/policy.xml; - - done - - docinto / - 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" -} diff --git a/sec-policy/selinux-base/selinux-base-2.20220106-r1.ebuild b/sec-policy/selinux-base/selinux-base-2.20220106-r1.ebuild index ec2f07463379..16ffa2766f65 100644 --- a/sec-policy/selinux-base/selinux-base-2.20220106-r1.ebuild +++ b/sec-policy/selinux-base/selinux-base-2.20220106-r1.ebuild @@ -17,7 +17,7 @@ else SRC_URI="https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_${PV/./_}/refpolicy-${PV}.tar.bz2 https://dev.gentoo.org/~perfinion/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2" - KEYWORDS="amd64 ~arm ~arm64 ~mips x86" + KEYWORDS="amd64 arm arm64 ~mips x86" fi IUSE="doc +unknown-perms systemd +ubac +unconfined" diff --git a/sec-policy/selinux-base/selinux-base-2.20220106-r2.ebuild b/sec-policy/selinux-base/selinux-base-2.20220106-r2.ebuild index 659fad659691..16ffa2766f65 100644 --- a/sec-policy/selinux-base/selinux-base-2.20220106-r2.ebuild +++ b/sec-policy/selinux-base/selinux-base-2.20220106-r2.ebuild @@ -17,7 +17,7 @@ else SRC_URI="https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_${PV/./_}/refpolicy-${PV}.tar.bz2 https://dev.gentoo.org/~perfinion/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2" - KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86" + KEYWORDS="amd64 arm arm64 ~mips x86" fi IUSE="doc +unknown-perms systemd +ubac +unconfined" diff --git a/sec-policy/selinux-base/selinux-base-2.20220106-r3.ebuild b/sec-policy/selinux-base/selinux-base-2.20220106-r3.ebuild new file mode 100644 index 000000000000..16ffa2766f65 --- /dev/null +++ b/sec-policy/selinux-base/selinux-base-2.20220106-r3.ebuild @@ -0,0 +1,158 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +PYTHON_COMPAT=( python3_{8,9,10} ) +PYTHON_REQ_USE="xml" +inherit python-any-r1 + +if [[ ${PV} == 9999* ]]; then + EGIT_REPO_URI="${SELINUX_GIT_REPO:-https://anongit.gentoo.org/git/proj/hardened-refpolicy.git}" + EGIT_BRANCH="${SELINUX_GIT_BRANCH:-master}" + EGIT_CHECKOUT_DIR="${WORKDIR}/refpolicy" + + inherit git-r3 +else + SRC_URI="https://github.com/SELinuxProject/refpolicy/releases/download/RELEASE_${PV/./_}/refpolicy-${PV}.tar.bz2 + https://dev.gentoo.org/~perfinion/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2" + + KEYWORDS="amd64 arm arm64 ~mips x86" +fi + +IUSE="doc +unknown-perms systemd +ubac +unconfined" + +DESCRIPTION="Gentoo base policy for SELinux" +HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux" +LICENSE="GPL-2" +SLOT="0" + +RDEPEND=">=sys-apps/policycoreutils-2.8" +DEPEND="${RDEPEND}" +BDEPEND=" + ${PYTHON_DEPS} + >=sys-apps/checkpolicy-2.8 + sys-devel/m4" + +S=${WORKDIR}/ + +src_prepare() { + if [[ ${PV} != 9999* ]]; then + einfo "Applying SELinux policy updates ... " + eapply -p0 "${WORKDIR}/0001-full-patch-against-stable-release.patch" + fi + + eapply_user + + cd "${S}/refpolicy" || die + emake bare +} + +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 unknown-perms; then + sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/build.conf" \ + || die "Failed to allow Unknown Permissions Handling" + sed -i -e '/^UNK_PERMS/s/deny/allow/' "${S}/refpolicy/Makefile" \ + || die "Failed to allow Unknown Permissions Handling" + 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 + emake conf + + # 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 + + 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 + + emake DESTDIR="${D}" install + emake DESTDIR="${D}" install-headers + + 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 + docinto ${i}/html + dodoc -r doc/html/*; + fi + + insinto /usr/share/selinux/devel; + doins doc/policy.xml; + + done + + docinto / + 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" +} -- cgit v1.2.3