/[gentoo-x86]/sys-apps/policycoreutils/policycoreutils-2.1.0-r2.ebuild
Gentoo

Contents of /sys-apps/policycoreutils/policycoreutils-2.1.0-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sun May 13 12:53:07 2012 UTC (3 years, 3 months ago) by swift
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Removing obsoleted ebuilds

(Portage version: 2.1.10.49/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-apps/policycoreutils/policycoreutils-2.1.0-r2.ebuild,v 1.2 2012/02/26 10:06:04 swift Exp $
4
5 EAPI="3"
6 PYTHON_DEPEND="*"
7 PYTHON_USE_WITH="xml"
8 SUPPORT_PYTHON_ABIS="1"
9 RESTRICT_PYTHON_ABIS="*-jython"
10
11 inherit multilib python toolchain-funcs eutils
12
13 EXTRAS_VER="1.21"
14 SEMNG_VER="2.1.0"
15 SELNX_VER="2.1.0"
16 SEPOL_VER="2.1.0"
17
18 IUSE="audit pam"
19
20 DESCRIPTION="SELinux core utilities"
21 HOMEPAGE="http://userspace.selinuxproject.org"
22 SRC_URI="http://userspace.selinuxproject.org/releases/20110727/devel/${P}.tar.gz
23 http://dev.gentoo.org/~swift/patches/policycoreutils/policycoreutils-2.0.85-sesandbox.patch.gz
24 http://dev.gentoo.org/~swift/patches/policycoreutils/policycoreutils-2.0.85-fix-seunshare-vuln.patch.gz
25 http://dev.gentoo.org/~swift/patches/policycoreutils/policycoreutils-2.1.0-fix-makefile-pam-audit.patch.gz
26 mirror://gentoo/policycoreutils-extra-${EXTRAS_VER}.tar.bz2
27 mirror://gentoo/policycoreutils-2.0.85-python3.tar.gz"
28
29 LICENSE="GPL-2"
30 SLOT="0"
31 KEYWORDS="amd64 x86"
32
33 COMMON_DEPS=">=sys-libs/libselinux-${SELNX_VER}[python]
34 >=sys-libs/glibc-2.4
35 >=sys-libs/libcap-1.10-r10
36 >=sys-libs/libsemanage-${SEMNG_VER}[python]
37 sys-libs/libcap-ng
38 >=sys-libs/libsepol-${SEPOL_VER}
39 sys-devel/gettext
40 audit? ( >=sys-process/audit-1.5.1 )
41 pam? ( sys-libs/pam )"
42
43 # pax-utils for scanelf used by rlpkg
44 RDEPEND="${COMMON_DEPS}
45 dev-python/sepolgen
46 app-misc/pax-utils"
47
48 DEPEND="${COMMON_DEPS}"
49
50 S2=${WORKDIR}/policycoreutils-extra
51
52 src_prepare() {
53 # rlpkg is more useful than fixfiles
54 sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
55 || die "fixfiles sed 1 failed"
56 sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
57 || die "fixfiles sed 2 failed"
58 # We currently do not support MCS, so the sandbox code in policycoreutils
59 # is not usable yet. However, work for MCS is on the way and a reported
60 # vulnerability (bug #374897) might go by unnoticed if we ignore it now.
61 # As such, we will
62 # - prepare support for switching name from "sandbox" to "sesandbox"
63 epatch "${DISTDIR}/policycoreutils-2.0.85-sesandbox.patch.gz"
64 # - patch the sandbox and seunshare code to fix the vulnerability
65 # (uses, with permission, extract from
66 # http://pkgs.fedoraproject.org/gitweb/?p=policycoreutils.git;a=blob_plain;f=policycoreutils-rhat.patch;hb=HEAD)
67 epatch "${DISTDIR}/policycoreutils-2.0.85-fix-seunshare-vuln.patch.gz"
68 # But for now, disable building sandbox code
69 sed -i -e 's/sandbox //' "${S}/Makefile" || die "failed removing sandbox"
70 # Disable auto-detection of PAM and audit related stuff and override
71 epatch "${DISTDIR}/policycoreutils-2.1.0-fix-makefile-pam-audit.patch.gz"
72 # Overwrite gl.po, id.po and et.po with valid PO file
73 cp "${S}/po/sq.po" "${S}/po/gl.po" || die "failed to copy ${S}/po/sq.po to gl.po"
74 cp "${S}/po/sq.po" "${S}/po/id.po" || die "failed to copy ${S}/po/sq.po to id.po"
75 cp "${S}/po/sq.po" "${S}/po/et.po" || die "failed to copy ${S}/po/sq.po to et.po"
76 # Fixed scripts for Python 3 support
77 cp "${WORKDIR}/seobject.py" "${S}/semanage/seobject.py" || die "failed to copy seobject.py"
78 cp "${WORKDIR}/semanage" "${S}/semanage/semanage" || die "failed to copy semanage"
79 cp "${WORKDIR}/chcat" "${S}/scripts/chcat" || die "failed to copy chcat"
80 cp "${WORKDIR}/audit2allow" "${S}/audit2allow/audit2allow" || die "failed to copy audit2allow"
81 }
82
83 src_compile() {
84 local use_audit="n";
85 local use_pam="n";
86
87 use audit && use_audit="y";
88 use pam && use_pam="y";
89
90 python_copy_sources semanage sandbox
91 building() {
92 einfo "Compiling policycoreutils"
93 emake -C "${S}" AUDIT_LOG_PRIVS="y" AUDITH="${use_audit}" PAMH="${use_pam}" CC="$(tc-getCC)" PYLIBVER="python$(python_get_version)" || die
94 einfo "Compiling policycoreutils-extra "
95 emake -C "${S2}" AUDIT_LOG_PRIVS="y" AUDITH="${use_audit}" PAMH="${use_pam}" CC="$(tc-getCC)" PYLIBVER="python$(python_get_version)" || die
96 }
97 python_execute_function -s --source-dir semanage building
98 }
99
100 src_install() {
101 local use_audit="n";
102 local use_pam="n";
103
104 use audit && use_audit="y";
105 use pam && use_pam="y";
106
107 # Python scripts are present in many places. There are no extension modules.
108 installation() {
109 einfo "Installing policycoreutils"
110 emake -C "${S}" DESTDIR="${T}/images/${PYTHON_ABI}" AUDITH="${use_audit}" PAMH="${use_pam}" AUDIT_LOG_PRIV="y" PYLIBVER="python$(python_get_version)" install || return 1
111
112 einfo "Installing policycoreutils-extra"
113 emake -C "${S2}" DESTDIR="${T}/images/${PYTHON_ABI}" SHLIBDIR="${D}$(get_libdir)/rc" install || return 1
114 }
115 python_execute_function installation
116 python_merge_intermediate_installation_images "${T}/images"
117
118 # remove redhat-style init script
119 rm -fR "${D}/etc/rc.d"
120
121 # compatibility symlinks
122 dosym /sbin/setfiles /usr/sbin/setfiles
123 dosym /$(get_libdir)/rc/runscript_selinux.so /$(get_libdir)/rcscripts/runscript_selinux.so
124
125 # location for permissive definitions
126 dodir /var/lib/selinux
127 keepdir /var/lib/selinux
128 }
129
130 pkg_postinst() {
131 python_mod_optimize seobject.py
132 }
133
134 pkg_postrm() {
135 python_mod_cleanup seobject.py
136 }

  ViewVC Help
Powered by ViewVC 1.1.20