/[gentoo-x86]/sys-apps/policycoreutils/policycoreutils-2.2.5-r4.ebuild
Gentoo

Contents of /sys-apps/policycoreutils/policycoreutils-2.2.5-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat May 10 12:54:21 2014 UTC (4 years, 6 months ago) by swift
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +2 -2 lines
Stabilize to work around CVE-2014-3215

(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 0x2EDD52403B68AF47)

1 # Copyright 1999-2014 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.2.5-r4.ebuild,v 1.1 2014/05/09 18:39:16 swift Exp $
4
5 EAPI="5"
6 PYTHON_COMPAT=( python2_7 )
7 PYTHON_REQ_USE="xml"
8
9 inherit multilib python-r1 toolchain-funcs eutils
10
11 EXTRAS_VER="1.31"
12 SEMNG_VER="2.2"
13 SELNX_VER="2.2"
14 SEPOL_VER="2.2"
15
16 IUSE="audit pam dbus"
17
18 DESCRIPTION="SELinux core utilities"
19 HOMEPAGE="http://userspace.selinuxproject.org"
20 SRC_URI="http://userspace.selinuxproject.org/releases/20131030/${P}.tar.gz
21 http://dev.gentoo.org/~swift/patches/policycoreutils/patchbundle-${P}-gentoo-r1.tar.gz
22 mirror://gentoo/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
23
24 LICENSE="GPL-2"
25 SLOT="0"
26 KEYWORDS="amd64 x86"
27
28 COMMON_DEPS=">=sys-libs/libselinux-${SELNX_VER}[python]
29 >=sys-libs/glibc-2.4
30 >=sys-libs/libcap-1.10-r10
31 >=sys-libs/libsemanage-${SEMNG_VER}[python]
32 sys-libs/libcap-ng
33 >=sys-libs/libsepol-${SEPOL_VER}
34 sys-devel/gettext
35 dev-python/ipy
36 dbus? (
37 sys-apps/dbus
38 dev-libs/dbus-glib
39 )
40 audit? ( >=sys-process/audit-1.5.1 )
41 pam? ( sys-libs/pam )
42 ${PYTHON_DEPS}"
43
44 ### libcgroup -> seunshare
45 ### dbus -> restorecond
46
47 # pax-utils for scanelf used by rlpkg
48 RDEPEND="${COMMON_DEPS}
49 dev-python/sepolgen
50 app-misc/pax-utils"
51
52 DEPEND="${COMMON_DEPS}"
53
54 S1="${WORKDIR}/${P}"
55 S2="${WORKDIR}/policycoreutils-extra"
56
57 src_prepare() {
58 # rlpkg is more useful than fixfiles
59 sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
60 || die "fixfiles sed 1 failed"
61 sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
62 || die "fixfiles sed 2 failed"
63
64 EPATCH_MULTI_MSG="Applying policycoreutils patches ... " \
65 EPATCH_SUFFIX="patch" \
66 EPATCH_SOURCE="${WORKDIR}/gentoo-patches" \
67 EPATCH_FORCE="yes" \
68 epatch
69
70 epatch_user
71
72 python_copy_sources
73 # Our extra code is outside the regular directory, so set it to the extra
74 # directory. We really should optimize this as it is ugly, but the extra
75 # code is needed for Gentoo at the same time that policycoreutils is present
76 # (so we cannot use an additional package for now).
77 S="${S2}"
78 python_copy_sources
79 }
80
81 src_compile() {
82 local use_audit="n";
83 local use_pam="n";
84 local use_dbus="n";
85 local use_sesandbox="n";
86
87 use audit && use_audit="y";
88 use pam && use_pam="y";
89 use dbus && use_dbus="y";
90
91 building() {
92 emake -C "${BUILD_DIR}" AUDIT_LOG_PRIVS="y" AUDITH="${use_audit}" PAMH="${use_pam}" INOTIFYH="${use_dbus}" SESANDBOX="${use_sesandbox}" CC="$(tc-getCC)" PYLIBVER="${EPYTHON}" || die
93 }
94 S="${S1}" # Regular policycoreutils
95 python_foreach_impl building
96 S="${S2}" # Extra set
97 python_foreach_impl building
98 }
99
100 src_install() {
101 local use_audit="n";
102 local use_pam="n";
103 local use_dbus="n";
104 local use_sesandbox="n";
105
106 use audit && use_audit="y";
107 use pam && use_pam="y";
108 use dbus && use_dbus="y";
109
110 # Python scripts are present in many places. There are no extension modules.
111 installation-policycoreutils() {
112 einfo "Installing policycoreutils"
113 emake -C "${BUILD_DIR}" DESTDIR="${D}" AUDITH="${use_audit}" PAMH="${use_pam}" INOTIFYH="${use_dbus}" SESANDBOX="${use_sesandbox}" AUDIT_LOG_PRIV="y" PYLIBVER="${EPYTHON}" install || return 1
114 }
115
116 installation-extras() {
117 einfo "Installing policycoreutils-extra"
118 emake -C "${BUILD_DIR}" DESTDIR="${D}" INOTIFYH="${use_dbus}" SHLIBDIR="${D}$(get_libdir)/rc" install || return 1
119 }
120
121 S="${S1}" # policycoreutils
122 python_foreach_impl installation-policycoreutils
123 S="${S2}" # extras
124 python_foreach_impl installation-extras
125 S="${S1}" # back for later
126
127 # remove redhat-style init script
128 rm -fR "${D}/etc/rc.d"
129
130 # compatibility symlinks
131 dosym /sbin/setfiles /usr/sbin/setfiles
132 dosym /$(get_libdir)/rc/runscript_selinux.so /$(get_libdir)/rcscripts/runscript_selinux.so
133
134 # location for permissive definitions
135 dodir /var/lib/selinux
136 keepdir /var/lib/selinux
137
138 # Set version-specific scripts
139 for pyscript in audit2allow sepolgen-ifgen sepolicy chcat; do
140 python_replicate_script "${ED}/usr/bin/${pyscript}"
141 done
142 for pyscript in semanage rlpkg; do
143 python_replicate_script "${ED}/usr/sbin/${pyscript}"
144 done
145
146 dodir /usr/share/doc/${PF}/mcstrans/examples
147 cp -dR "${S1}"/mcstrans/share/examples/* "${D}/usr/share/doc/${PF}/mcstrans/examples"
148 }
149
150 pkg_postinst() {
151 elog "Previous versions of policycoreutils optionally installed sesandbox support."
152 elog "However, due to the possible unsafe state of seunshare (CVE-2014-3215) and the"
153 elog "fact that sesandbox (called 'sandbox' upstream but collides with Portage sandbox)"
154 elog "has not been supported in Gentoo for a while (for one, our policies do not provide"
155 elog "sandboxing support) we have discontinued providing the sandbox related files."
156 }

  ViewVC Help
Powered by ViewVC 1.1.20