Gentoo Archives: gentoo-commits

From: "Anthony G. Basile (blueness)" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/policycoreutils: ChangeLog policycoreutils-2.0.85.ebuild
Date: Fri, 15 Jul 2011 23:29:42
Message-Id: 20110715232930.85E0920051@flycatcher.gentoo.org
1 blueness 11/07/15 23:29:30
2
3 Modified: ChangeLog
4 Added: policycoreutils-2.0.85.ebuild
5 Log:
6 Add fix for bug #374897 and initial support for python3
7
8 (Portage version: 2.1.10.3/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.87 sys-apps/policycoreutils/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/policycoreutils/ChangeLog?rev=1.87&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/policycoreutils/ChangeLog?rev=1.87&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/policycoreutils/ChangeLog?r1=1.86&r2=1.87
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-apps/policycoreutils/ChangeLog,v
20 retrieving revision 1.86
21 retrieving revision 1.87
22 diff -u -r1.86 -r1.87
23 --- ChangeLog 8 Jul 2011 10:54:27 -0000 1.86
24 +++ ChangeLog 15 Jul 2011 23:29:30 -0000 1.87
25 @@ -1,6 +1,14 @@
26 # ChangeLog for sys-apps/policycoreutils
27 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/policycoreutils/ChangeLog,v 1.86 2011/07/08 10:54:27 ssuominen Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/policycoreutils/ChangeLog,v 1.87 2011/07/15 23:29:30 blueness Exp $
30 +
31 +*policycoreutils-2.0.85 (15 Jul 2011)
32 +
33 + 15 Jul 2011; Anthony G. Basile <blueness@g.o>
34 + +policycoreutils-2.0.85.ebuild,
35 + +files/policycoreutils-2.0.85-fix-seunshare-vuln.patch.gz,
36 + +files/policycoreutils-2.0.85-sesandbox.patch.gz:
37 + Add fix for bug #374897 and initial support for python3
38
39 08 Jul 2011; Samuli Suominen <ssuominen@g.o>
40 policycoreutils-2.0.55.ebuild, policycoreutils-2.0.69.ebuild,
41
42
43
44 1.1 sys-apps/policycoreutils/policycoreutils-2.0.85.ebuild
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/policycoreutils/policycoreutils-2.0.85.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/policycoreutils/policycoreutils-2.0.85.ebuild?rev=1.1&content-type=text/plain
48
49 Index: policycoreutils-2.0.85.ebuild
50 ===================================================================
51 # Copyright 1999-2011 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 # $Header: /var/cvsroot/gentoo-x86/sys-apps/policycoreutils/policycoreutils-2.0.85.ebuild,v 1.1 2011/07/15 23:29:30 blueness Exp $
54
55 EAPI="3"
56 PYTHON_DEPEND="*"
57 PYTHON_USE_WITH="xml"
58 SUPPORT_PYTHON_ABIS="1"
59 RESTRICT_PYTHON_ABIS="*-jython"
60
61 inherit multilib python toolchain-funcs eutils
62
63 EXTRAS_VER="1.20"
64 SEMNG_VER="2.0.46"
65 SELNX_VER="2.0.98"
66 SEPOL_VER="2.0.42"
67
68 IUSE=""
69
70 DESCRIPTION="SELinux core utilities"
71 HOMEPAGE="http://userspace.selinuxproject.org"
72 SRC_URI="http://userspace.selinuxproject.org/releases/20101221/devel/${P}.tar.gz
73 mirror://gentoo/policycoreutils-extra-${EXTRAS_VER}.tar.bz2
74 mirror://gentoo/policycoreutils-2.0.85-python3.tar.gz"
75
76 LICENSE="GPL-2"
77 SLOT="0"
78 KEYWORDS="~amd64 ~x86"
79
80 COMMON_DEPS=">=sys-libs/libselinux-${SELNX_VER}[python]
81 >=sys-libs/glibc-2.4
82 >=sys-process/audit-1.5.1
83 >=sys-libs/libcap-1.10-r10
84 sys-libs/pam
85 >=sys-libs/libsemanage-${SEMNG_VER}[python]
86 sys-libs/libcap-ng
87 >=sys-libs/libsepol-${SEPOL_VER}
88 sys-devel/gettext"
89
90 # pax-utils for scanelf used by rlpkg
91 RDEPEND="${COMMON_DEPS}
92 dev-python/sepolgen
93 app-misc/pax-utils"
94
95 DEPEND="${COMMON_DEPS}"
96
97 S2=${WORKDIR}/policycoreutils-extra
98
99 src_prepare() {
100 # rlpkg is more useful than fixfiles
101 sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
102 || die "fixfiles sed 1 failed"
103 sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
104 || die "fixfiles sed 2 failed"
105 # We currently do not support MCS, so the sandbox code in policycoreutils
106 # is not usable yet. However, work for MCS is on the way and a reported
107 # vulnerability (bug #374897) might go by unnoticed if we ignore it now.
108 # As such, we will
109 # - prepare support for switching name from "sandbox" to "sesandbox"
110 epatch "${FILESDIR}/policycoreutils-2.0.85-sesandbox.patch.gz"
111 # - patch the sandbox and seunshare code to fix the vulnerability
112 # (uses, with permission, extract from
113 # http://pkgs.fedoraproject.org/gitweb/?p=policycoreutils.git;a=blob_plain;f=policycoreutils-rhat.patch;hb=HEAD)
114 epatch "${FILESDIR}/policycoreutils-2.0.85-fix-seunshare-vuln.patch.gz"
115 # But for now, disable building sandbox code
116 sed -i -e 's/sandbox //' "${S}/Makefile" || die "failed removing sandbox"
117 # Overwrite gl.po, id.po and et.po with valid PO file
118 cp "${S}/po/sq.po" "${S}/po/gl.po" || die "failed to copy ${S}/po/sq.po to gl.po"
119 cp "${S}/po/sq.po" "${S}/po/id.po" || die "failed to copy ${S}/po/sq.po to id.po"
120 cp "${S}/po/sq.po" "${S}/po/et.po" || die "failed to copy ${S}/po/sq.po to et.po"
121 # Fixed scripts for Python 3 support
122 cp "${WORKDIR}/seobject.py" "${S}/semanage/seobject.py" || die "failed to copy seobject.py"
123 cp "${WORKDIR}/semanage" "${S}/semanage/semanage" || die "failed to copy semanage"
124 cp "${WORKDIR}/chcat" "${S}/scripts/chcat" || die "failed to copy chcat"
125 cp "${WORKDIR}/audit2allow" "${S}/audit2allow/audit2allow" || die "failed to copy audit2allow"
126 cp "${WORKDIR}/rlpkg" "${S2}/scripts/rlpkg" || die "failed to copy rlpkg"
127 }
128
129 src_compile() {
130 python_copy_sources semanage sandbox
131 building() {
132 einfo "Compiling policycoreutils"
133 emake -C "${S}" AUDIT_LOG_PRIVS="y" CC="$(tc-getCC)" PYLIBVER="python$(python_get_version)" || die
134 einfo "Compiling policycoreutils-extra"
135 emake -C "${S2}" AUDIT_LOG_PRIVS="y" CC="$(tc-getCC)" PYLIBVER="python$(python_get_version)" || die
136 }
137 python_execute_function -s --source-dir semanage building
138 }
139
140 src_install() {
141 # Python scripts are present in many places. There are no extension modules.
142 installation() {
143 einfo "Installing policycoreutils"
144 emake -C "${S}" DESTDIR="${T}/images/${PYTHON_ABI}" AUDIT_LOG_PRIV="y" PYLIBVER="python$(python_get_version)" install || return 1
145
146 einfo "Installing policycoreutils-extra"
147 emake -C "${S2}" DESTDIR="${T}/images/${PYTHON_ABI}" SHLIBDIR="${D}$(get_libdir)/rc" install || return 1
148 }
149 python_execute_function installation
150 python_merge_intermediate_installation_images "${T}/images"
151
152 # remove redhat-style init script
153 rm -fR "${D}/etc/rc.d"
154
155 # compatibility symlinks
156 dosym /sbin/setfiles /usr/sbin/setfiles
157 dosym /$(get_libdir)/rc/runscript_selinux.so /$(get_libdir)/rcscripts/runscript_selinux.so
158 }
159
160 pkg_postinst() {
161 python_mod_optimize seobject.py
162 }
163
164 pkg_postrm() {
165 python_mod_cleanup seobject.py
166 }