diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-12-24 14:11:38 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-12-24 14:11:38 +0000 |
commit | de49812990871e1705b64051c35161d5e6400269 (patch) | |
tree | 5e1e8fcb0ff4579dbd22a1bfee28a6b97dc8aaeb /sec-policy/selinux-base | |
parent | 536c3711867ec947c1738f2c4b96f22e4863322d (diff) |
gentoo resync : 24.12.2018
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.20180701-r2.ebuild | 161 |
2 files changed, 163 insertions, 0 deletions
diff --git a/sec-policy/selinux-base/Manifest b/sec-policy/selinux-base/Manifest index 261042ceedd4..e7bfd07649cb 100644 --- a/sec-policy/selinux-base/Manifest +++ b/sec-policy/selinux-base/Manifest @@ -4,11 +4,13 @@ DIST patchbundle-selinux-base-policy-2.20180114-r1.tar.bz2 285245 BLAKE2B 32ff8f DIST patchbundle-selinux-base-policy-2.20180114-r2.tar.bz2 293604 BLAKE2B 4b301021a646431fe3a4431815ef66231e3436c7c5a4b02c4d52492a603ab58b54bfdbd589161779c4331f26f56ef6eac4c6f7d8dbc489410e41f7e3cedecff7 SHA512 bfb8e0fc852bc91c38ecdfb51823f5fa89f7e9021eae108648fa8b574cf8303d28cb74b0a6b6c0745576113e419e1f232131c3166a6da9b431aebd3de642f75d DIST patchbundle-selinux-base-policy-2.20180114-r3.tar.bz2 302345 BLAKE2B b175c5564b44aa4256018e25fbe8ec1bf16bdb0b6a01486bd7afbc5c6332b555838838759fea4859f767211097748bb5e62139264b2f4b792b2dec854d3b7031 SHA512 1586857f6403527470a19e534217805e19460695a854c3630fda80b26cd8e1e5d6f1a327c6d56b3ffa7260858d0c1ae393ea427e9ac0239163e914edc97f1c07 DIST patchbundle-selinux-base-policy-2.20180701-r1.tar.bz2 315378 BLAKE2B eeeb0b04c023c40289b6d964aefd1773d2b5d6912f1dffebf9509e6dcdbb39b17e722ee4483fb2b11193d4b987a85f90c7dc7e61cef3cf982fc2ba368d4900ef SHA512 a8b049120f1c420f9bfb55aba9ed0157ff7896ace402cd1b77b01d1ea52b67e49d915f1c00de83ff4d59b1cf8b8aa1f39b50ba312d842ed4850e75fcc7f5be42 +DIST patchbundle-selinux-base-policy-2.20180701-r2.tar.bz2 320881 BLAKE2B 12382c64ff8d2acef97ae50b0285061b7f018df0d94034670696b6f19003ee9c9c4f66c711e744696e47145857fcbd577a7762fa807921b40a5366e473901687 SHA512 29453f9deb90b7f982d5a6a3161d79a8171d58d20c0e0de523347d4f1296ad3d4ed970ada0823692e8def4f21756d727628bd919802ec2b1c39087ce5d0811b0 DIST refpolicy-2.20180114.tar.bz2 743725 BLAKE2B f64fc08dd68033a1762e147a0f205d8d1b71853017cefe4252ca4ca67029d457f28d81a82ae4e78c01e6c2131e9329d0e5634afee12fb4b291685e7563d59107 SHA512 9acb15d1d84670b25d1fc310e048348f707aa22ea184828e677946817aeb6ee2c590233195ead13aa91c7096544d6d29dfb6e98297120ef9464fc6107ffc9ce7 DIST refpolicy-2.20180701.tar.bz2 753050 BLAKE2B 7069a1b9b9bef25950e62bb50ac09f4a9d5ef6fd0acc667d321da396c3935939348534458df129f7bc81687dca240b4c4fc120d1f46d452665d335c9f023da8c SHA512 9dd5a1e10da5d25fea96cc25efb682f8ac866e835a1d940b161c1ce944cac9a90a5836b03c14311acad6bf9acd9a78003f36e050d35d8edb43606575523857b5 EBUILD selinux-base-2.20180114-r1.ebuild 4225 BLAKE2B 787204b62302c43e3bb5025ae66c9973e0fe1b8f5574e487c2cc916f553aff15ebf14f6047e69299ca14b2f9faf18c39bd711bb4e1acb2aeb75ed1b45d2dec7c SHA512 6c1c7932dbbdf55075b0d0c04fa96767ad490785ce70449f9b4a3344c3a890b361980a04dab62c8d9c30c08fec3436f4c5a60cfac9809c8e913639570e04d66c EBUILD selinux-base-2.20180114-r2.ebuild 4225 BLAKE2B 787204b62302c43e3bb5025ae66c9973e0fe1b8f5574e487c2cc916f553aff15ebf14f6047e69299ca14b2f9faf18c39bd711bb4e1acb2aeb75ed1b45d2dec7c SHA512 6c1c7932dbbdf55075b0d0c04fa96767ad490785ce70449f9b4a3344c3a890b361980a04dab62c8d9c30c08fec3436f4c5a60cfac9809c8e913639570e04d66c EBUILD selinux-base-2.20180114-r3.ebuild 4227 BLAKE2B 2805a6a1851567ba8c92da6fb03bf768474946fc92ab16c99c588a5a837188ecf6ae0c31b4038587770222f00a168daf38ab7a65a569a5977d817b959d8547c6 SHA512 9f5348bbe0daa39df84de5ca32e82590e0e8f3227451b9aa534b78582a4d8579aaba08823f89e29bf30e15d2f2accedac08a8678cc25611d0c4f546a267d37f2 EBUILD selinux-base-2.20180701-r1.ebuild 4233 BLAKE2B d2560420214a32c95b0b1a09af6934e063e8051560cd50e0d2edb9503fd576d904e6b4dde5c78653a64d69fc0ddbff26944b5a7ded249f778693466f74fe8064 SHA512 230dca303671fb35a8f735787ed1b9db2220c4988468d4208ba2b66c05c255b6cec4fe4f2dbe1b9fb8243097d2118592ce101750fa426a755a2489a9fdd2e35e +EBUILD selinux-base-2.20180701-r2.ebuild 4232 BLAKE2B cf6f8a10aef22a10e5ef5f92be27ab3075f2cd4b14c4228483148fd0ce11947d9844baec43aad1ad67cbb4f6be06d9f16702008d60ec910b74d54a229062b32a SHA512 b814a12c28e4891e42c90e9d696906c1e13b8f13febbf7f6de9b5d2d6e959c7443657025da2a2a7b436a342c9f9d19c690f0772e0bac184070acf49230700287 EBUILD selinux-base-9999.ebuild 4235 BLAKE2B bcd08b9b37cbc8e19a85e757ef1bfe0736a8736f206d8262cf7081d7db20fe47cb7f5321702a02fc2fc02a025d1ce673fa83416d886c12a838feecc8821b1093 SHA512 8d6fc573e71558279535eeea8847433828d786a9bcbd0fcf8e7830024605f66d408420893d199eb237c2aaaaa4853a06132aac1d3e92cfe806ff6dbbe9e9fe86 MISC metadata.xml 839 BLAKE2B 797f551065b80455c9538f115d680016954b7fc05cd5232ca09b86d83163c81e9ed868ea6b9be08d3c1284dcfd3527e88660befb747a631f4d2292331410cb52 SHA512 330017a98a3f9f4e6d6004955eb939c8d9c1c92fe6d091f78cdd7d2f6a02838c67a8a3268f38dad7df27f909ff51dc295d5de748f9767a257b5dad36c74d921a diff --git a/sec-policy/selinux-base/selinux-base-2.20180701-r2.ebuild b/sec-policy/selinux-base/selinux-base-2.20180701-r2.ebuild new file mode 100644 index 000000000000..32e8fed4269a --- /dev/null +++ b/sec-policy/selinux-base/selinux-base-2.20180701-r2.ebuild @@ -0,0 +1,161 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +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/~swift/patches/selinux-base-policy/patchbundle-selinux-base-policy-${PVR}.tar.bz2" + + KEYWORDS="~amd64 -arm ~arm64 ~mips ~x86" +fi + +IUSE="doc +open_perms +peer_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 + virtual/udev" +DEPEND="${RDEPEND} + sys-devel/m4 + >=sys-apps/checkpolicy-2.8" + +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 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 + emake 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 + + emake DESTDIR="${D}" install \ + || die "${i} install failed." + + emake 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 + 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" +} |