diff options
Diffstat (limited to 'sys-apps/selinux-python')
-rw-r--r-- | sys-apps/selinux-python/Manifest | 5 | ||||
-rw-r--r-- | sys-apps/selinux-python/metadata.xml | 19 | ||||
-rw-r--r-- | sys-apps/selinux-python/selinux-python-2.7.ebuild | 97 | ||||
-rw-r--r-- | sys-apps/selinux-python/selinux-python-9999.ebuild | 97 |
4 files changed, 218 insertions, 0 deletions
diff --git a/sys-apps/selinux-python/Manifest b/sys-apps/selinux-python/Manifest new file mode 100644 index 000000000000..7185c4f69ef3 --- /dev/null +++ b/sys-apps/selinux-python/Manifest @@ -0,0 +1,5 @@ +DIST selinux-python-2.7.tar.gz 2068004 SHA256 4217cb965ecda96c91e15ffcc2e7ddd13ecc2bf5631100f3cd072a7616f140ed SHA512 df8645e7ac9ca568f0c9d81c42b93d0abadc43c22f14d38451ab262b52132cfb7abd7742e3a00ab9c153f95dd5b23b3a496d84875debcd9787f75d940eb45c28 WHIRLPOOL b1848dec315b23009b192dbc54a4ccf2433b83f87c254ad36d8c090a9d33fb15fe45b87b22a6979b0f115c385605f4359a4f3da7ab4b0abec84ebdbbc86c2531 +EBUILD selinux-python-2.7.ebuild 2669 SHA256 22685849659d3969cff9beefbfb669f43e28642fc1a9aa6ec06582f2deaa9920 SHA512 7319def94fe6e2fca46f9a4cfa361cbda66f389c2874873a8efadec8aa5083644d9f888d82733a98aa44142b0fc888419139898ffcf3f3431fd2e2a9223576cd WHIRLPOOL a31d876e092babd8e070405c7efbc58aa6ee7972064612f609d90262ba7a774d7a1245578ca39619f366e8756db01bcb05894f27564159733fc79964ad54f7e2 +EBUILD selinux-python-9999.ebuild 2676 SHA256 6da0b5c4be2d460c2a0bd1a2e4fe6431cc82b5d97faddbbbcefdfdefc9e690c6 SHA512 c646ba210a01e9ccddd639681aab38ce98abf7bb1fc07627f6a56ad5bbfe25a3b2f4664da5b414efe8b03b469a40fbf5d8cd2100a45a6b71d2d0188834b2cee7 WHIRLPOOL 6180feb776b4897bcc655643dfd87608f39d5a32f96f3ba479595911df28f2d1e57b67ee18b8e79b53b33773c461d0ee57bcfb162355e1abc293e9a733ec7401 +MISC ChangeLog 363 SHA256 43ddceee058e75fea49283bcadd9f4b9a62f745ae6b593d508d013487524b4ca SHA512 993f34ccb279db00fb94b9aa9a366e72d33cbc570c01ab3cbb7d30a22a883c0e5f563310ecf3d5a2ca411260e71104763aacda662667d7f5fe82565240d86772 WHIRLPOOL 7aacd62cf13b6b952b904b8c5bfb3ea17cff3b2fb3578ae93f520663ac6f37d7cb29b833ec4f40ca681b88ed5d77dbfa825ce286c39aa19ca2909420a77814dd +MISC metadata.xml 718 SHA256 2d75aacb884f0150e3a24ee15c8f741d7e64521e3a52a7f3a8a543427621453b SHA512 a45a1c3e516dd956e60be67ddce632d055a98ff0fb45b920adfb5d1253da77822286f9742865027a47e94386dad2a1478a5b51f2bf9a97e2c2571470fdb34e04 WHIRLPOOL 1226d55630fb3a2f9724eef78149c150d0a098c8976e9f5c2f0ccff289502e50eeba149ad0cea1cad77a991faa015625cc1e9e77e040536a4da257b40a0d76de diff --git a/sys-apps/selinux-python/metadata.xml b/sys-apps/selinux-python/metadata.xml new file mode 100644 index 000000000000..94e50a7ff05e --- /dev/null +++ b/sys-apps/selinux-python/metadata.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>selinux@gentoo.org</email> + <name>SELinux Team</name> + </maintainer> + <longdescription> + selinux-python contains the core python selinux utilities and libraries + that are required for basic operation of a SELinux system. These + include semanage, sepolicy and sepolgen. + </longdescription> + <use> + <flag name="audit">Enable support for <pkg>sys-process/audit</pkg> and use the audit_* functions (like audit_getuid instead of getuid())</flag> + </use> + <upstream> + <remote-id type="github">SELinuxProject/selinux</remote-id> + </upstream> +</pkgmetadata> diff --git a/sys-apps/selinux-python/selinux-python-2.7.ebuild b/sys-apps/selinux-python/selinux-python-2.7.ebuild new file mode 100644 index 000000000000..832b4b2d809c --- /dev/null +++ b/sys-apps/selinux-python/selinux-python-2.7.ebuild @@ -0,0 +1,97 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" +PYTHON_COMPAT=( python{2_7,3_4,3_5} ) +PYTHON_REQ_USE="xml" + +inherit python-r1 toolchain-funcs + +MY_P="${P//_/-}" + +MY_RELEASEDATE="20170804" +SEPOL_VER="${PV}" +SELNX_VER="${PV}" +SEMNG_VER="${PV}" + +IUSE="audit pam dbus" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +DESCRIPTION="SELinux core utilities" +HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki" + +if [[ ${PV} == 9999 ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git" + S="${WORKDIR}/${MY_P}/${PN#selinux-}" +else + SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz" + KEYWORDS="amd64 ~arm64 ~mips x86" + S="${WORKDIR}/${MY_P}" +fi + +LICENSE="GPL-2" +SLOT="0" + +DEPEND=">=sys-libs/libselinux-${SELNX_VER}:=[python] + >=sys-libs/libsemanage-${SEMNG_VER}:=[python] + >=sys-libs/libsepol-${SEPOL_VER}:= + >=app-admin/setools-4.1.1[${PYTHON_USEDEP}] + dev-python/ipy[${PYTHON_USEDEP}] + !dev-python/sepolgen + ${PYTHON_DEPS}" + +RDEPEND="${DEPEND}" + +src_prepare() { + default + sed -i 's/-Werror//g' "${S}"/*/Makefile || die "Failed to remove Werror" + + python_copy_sources +} + +src_compile() { + building() { + emake -C "${BUILD_DIR}" \ + CC="$(tc-getCC)" \ + PYLIBVER="${EPYTHON}" \ + LIBDIR="\$(PREFIX)/$(get_libdir)" + } + python_foreach_impl building +} + +src_install() { + installation() { + emake -C "${BUILD_DIR}" \ + DESTDIR="${D}" \ + LIBDIR="\$(PREFIX)/$(get_libdir)" \ + LIBSEPOLA="/usr/$(get_libdir)/libsepol.a" \ + install + python_optimize + } + python_foreach_impl installation + + # Set version-specific scripts + for pyscript in audit2allow sepolgen-ifgen sepolicy chcat; do + python_replicate_script "${ED}/usr/bin/${pyscript}" + done + for pyscript in semanage; do + python_replicate_script "${ED}/usr/sbin/${pyscript}" + done + + # Create sepolgen.conf with different devel location definition + if [[ -f /etc/selinux/config ]]; + then + local selinuxtype=$(awk -F'=' '/^SELINUXTYPE/ {print $2}' /etc/selinux/config); + mkdir -p "${D}"/etc/selinux || die "Failed to create selinux directory"; + echo "SELINUX_DEVEL_PATH=/usr/share/selinux/${selinuxtype}/include:/usr/share/selinux/${selinuxtype}" > "${D}"/etc/selinux/sepolgen.conf; + else + local selinuxtype="${POLICY_TYPES%% *}"; + if [[ -n "${selinuxtype}" ]]; + then + echo "SELINUX_DEVEL_PATH=/usr/share/selinux/${selinuxtype}/include:/usr/share/selinux/${selinuxtype}" > "${D}"/etc/selinux/sepolgen.conf; + else + echo "SELINUX_DEVEL_PATH=/usr/share/selinux/strict/include:/usr/share/selinux/strict" > "${D}"/etc/selinux/sepolgen.conf; + fi + fi +} diff --git a/sys-apps/selinux-python/selinux-python-9999.ebuild b/sys-apps/selinux-python/selinux-python-9999.ebuild new file mode 100644 index 000000000000..510a3b731c47 --- /dev/null +++ b/sys-apps/selinux-python/selinux-python-9999.ebuild @@ -0,0 +1,97 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" +PYTHON_COMPAT=( python{2_7,3_4,3_5} ) +PYTHON_REQ_USE="xml" + +inherit python-r1 toolchain-funcs + +MY_P="${P//_/-}" + +MY_RELEASEDATE="20170804" +SEPOL_VER="${PV}" +SELNX_VER="${PV}" +SEMNG_VER="${PV}" + +IUSE="audit pam dbus" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +DESCRIPTION="SELinux core utilities" +HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki" + +if [[ ${PV} == 9999 ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git" + S="${WORKDIR}/${MY_P}/${PN#selinux-}" +else + SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86" + S="${WORKDIR}/${MY_P}" +fi + +LICENSE="GPL-2" +SLOT="0" + +DEPEND=">=sys-libs/libselinux-${SELNX_VER}:=[python] + >=sys-libs/libsemanage-${SEMNG_VER}:=[python] + >=sys-libs/libsepol-${SEPOL_VER}:= + >=app-admin/setools-4.1.1[${PYTHON_USEDEP}] + dev-python/ipy[${PYTHON_USEDEP}] + !dev-python/sepolgen + ${PYTHON_DEPS}" + +RDEPEND="${DEPEND}" + +src_prepare() { + default + sed -i 's/-Werror//g' "${S}"/*/Makefile || die "Failed to remove Werror" + + python_copy_sources +} + +src_compile() { + building() { + emake -C "${BUILD_DIR}" \ + CC="$(tc-getCC)" \ + PYLIBVER="${EPYTHON}" \ + LIBDIR="\$(PREFIX)/$(get_libdir)" + } + python_foreach_impl building +} + +src_install() { + installation() { + emake -C "${BUILD_DIR}" \ + DESTDIR="${D}" \ + LIBDIR="\$(PREFIX)/$(get_libdir)" \ + LIBSEPOLA="/usr/$(get_libdir)/libsepol.a" \ + install + python_optimize + } + python_foreach_impl installation + + # Set version-specific scripts + for pyscript in audit2allow sepolgen-ifgen sepolicy chcat; do + python_replicate_script "${ED}/usr/bin/${pyscript}" + done + for pyscript in semanage; do + python_replicate_script "${ED}/usr/sbin/${pyscript}" + done + + # Create sepolgen.conf with different devel location definition + if [[ -f /etc/selinux/config ]]; + then + local selinuxtype=$(awk -F'=' '/^SELINUXTYPE/ {print $2}' /etc/selinux/config); + mkdir -p "${D}"/etc/selinux || die "Failed to create selinux directory"; + echo "SELINUX_DEVEL_PATH=/usr/share/selinux/${selinuxtype}/include:/usr/share/selinux/${selinuxtype}" > "${D}"/etc/selinux/sepolgen.conf; + else + local selinuxtype="${POLICY_TYPES%% *}"; + if [[ -n "${selinuxtype}" ]]; + then + echo "SELINUX_DEVEL_PATH=/usr/share/selinux/${selinuxtype}/include:/usr/share/selinux/${selinuxtype}" > "${D}"/etc/selinux/sepolgen.conf; + else + echo "SELINUX_DEVEL_PATH=/usr/share/selinux/strict/include:/usr/share/selinux/strict" > "${D}"/etc/selinux/sepolgen.conf; + fi + fi +} |