Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/policycoreutils/
Date: Thu, 26 Apr 2018 11:22:56
Message-Id: 1524741738.7dc6b54ec3e70aa941e9c4ed57f1c11fa758aeba.perfinion@gentoo
1 commit: 7dc6b54ec3e70aa941e9c4ed57f1c11fa758aeba
2 Author: Jason Zaman <perfinion <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 26 10:50:11 2018 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 26 11:22:18 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7dc6b54e
7
8 sys-apps/policycoreutils: bump to 2.8_rc1
9
10 Package-Manager: Portage-2.3.24, Repoman-2.3.6
11
12 sys-apps/policycoreutils/Manifest | 1 +
13 .../policycoreutils/policycoreutils-2.8_rc1.ebuild | 179 +++++++++++++++++++++
14 2 files changed, 180 insertions(+)
15
16 diff --git a/sys-apps/policycoreutils/Manifest b/sys-apps/policycoreutils/Manifest
17 index 38aec9564a6..14e6468a22d 100644
18 --- a/sys-apps/policycoreutils/Manifest
19 +++ b/sys-apps/policycoreutils/Manifest
20 @@ -1,2 +1,3 @@
21 DIST policycoreutils-2.7.tar.gz 2796707 BLAKE2B 4b1c03f2d12252b453950c3d6bcde75780926a1b91263d3881f741399c5630c707f0429b9b144c657b017b7b0c1500b63b6463610dea3caaef8c2f7c3f69fd8f SHA512 ce97d659f72058fd23d8dab8db98fc7c0003806a636c521fa15da465d7358d40ccc8e3eaa9675f00a9b0b8aaa1465d3fb650bc0ebbbf00164e121230673256fb
22 +DIST policycoreutils-2.8-rc1.tar.gz 2797172 BLAKE2B f75549e05af02038481807e78267b0af2df4d2c8ab5568e9f4be853c742e358ce3c6fd4a4f2f56e022aa76235b41a80676eee342cd79f43be2270b5753151a71 SHA512 252b1a2784221cd1b960d584e17c3c116b46a36ef4900510f8caf34908784dd1d19d2a5d2c394aaa4d920485183365af2ab23056eb5867ccbaf284e2ca8612cd
23 DIST policycoreutils-extra-1.36.tar.bz2 8830 BLAKE2B 6d98e41ea379d3e95221a6e53d8a8b144e4e15ca5581381e76a529dbbaca304d5587b30419797c8c70cbd7c2b2588e5ecd62adcf97294e429950899c1c318346 SHA512 c6a18e6fb2d65f51dc55b88907f23241f2fbfc033d3d2888b109596d9ed31d509b2c93456727ea4d1f98544831afb15c449ff72d6aedf93b9e474b27817f7fb3
24
25 diff --git a/sys-apps/policycoreutils/policycoreutils-2.8_rc1.ebuild b/sys-apps/policycoreutils/policycoreutils-2.8_rc1.ebuild
26 new file mode 100644
27 index 00000000000..aebedfb6cd4
28 --- /dev/null
29 +++ b/sys-apps/policycoreutils/policycoreutils-2.8_rc1.ebuild
30 @@ -0,0 +1,179 @@
31 +# Copyright 1999-2018 Gentoo Foundation
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI="6"
35 +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
36 +PYTHON_REQ_USE="xml"
37 +
38 +inherit multilib python-r1 toolchain-funcs bash-completion-r1
39 +
40 +MY_P="${P//_/-}"
41 +
42 +MY_RELEASEDATE="20180419"
43 +EXTRAS_VER="1.36"
44 +SEMNG_VER="${PV}"
45 +SELNX_VER="${PV}"
46 +SEPOL_VER="${PV}"
47 +
48 +IUSE="audit pam dbus"
49 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
50 +
51 +DESCRIPTION="SELinux core utilities"
52 +HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
53 +
54 +if [[ ${PV} == 9999 ]]; then
55 + inherit git-r3
56 + EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
57 + SRC_URI="https://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
58 + S1="${WORKDIR}/${MY_P}/${PN}"
59 + S2="${WORKDIR}/policycoreutils-extra"
60 + S="${S1}"
61 +else
62 + SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz
63 + https://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
64 + KEYWORDS="~amd64 ~arm64 ~mips ~x86"
65 + S1="${WORKDIR}/${MY_P}"
66 + S2="${WORKDIR}/policycoreutils-extra"
67 + S="${S1}"
68 +fi
69 +
70 +LICENSE="GPL-2"
71 +SLOT="0"
72 +
73 +DEPEND=">=sys-libs/libselinux-${SELNX_VER}:=[python,${PYTHON_USEDEP}]
74 + >=sys-libs/glibc-2.4
75 + >=sys-libs/libcap-1.10-r10:=
76 + >=sys-libs/libsemanage-${SEMNG_VER}:=[python,${PYTHON_USEDEP}]
77 + sys-libs/libcap-ng:=
78 + >=sys-libs/libsepol-${SEPOL_VER}:=
79 + >=app-admin/setools-4.1.1[${PYTHON_USEDEP}]
80 + sys-devel/gettext
81 + dev-python/ipy[${PYTHON_USEDEP}]
82 + dbus? (
83 + sys-apps/dbus
84 + dev-libs/dbus-glib:=
85 + )
86 + audit? ( >=sys-process/audit-1.5.1[python,${PYTHON_USEDEP}] )
87 + pam? ( sys-libs/pam:= )
88 + ${PYTHON_DEPS}
89 + !<sec-policy/selinux-base-policy-2.20151208-r6"
90 +# 2.20151208-r6 and higher has support for new setfiles
91 +
92 +### libcgroup -> seunshare
93 +### dbus -> restorecond
94 +
95 +# pax-utils for scanelf used by rlpkg
96 +RDEPEND="${DEPEND}
97 + app-misc/pax-utils
98 + !<sys-apps/openrc-0.14"
99 +
100 +PDEPEND="sys-apps/semodule-utils
101 + sys-apps/selinux-python"
102 +
103 +src_unpack() {
104 + # Override default one because we need the SRC_URI ones even in case of 9999 ebuilds
105 + default
106 + if [[ ${PV} == 9999 ]] ; then
107 + git-r3_src_unpack
108 + fi
109 +}
110 +
111 +src_prepare() {
112 + S="${S1}"
113 + cd "${S}" || die "Failed to switch to ${S}"
114 + if [[ ${PV} != 9999 ]] ; then
115 + # If needed for live ebuilds please use /etc/portage/patches
116 + eapply "${FILESDIR}/policycoreutils-2.7-0001-newrole-not-suid.patch"
117 + fi
118 +
119 + # rlpkg is more useful than fixfiles
120 + sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
121 + || die "fixfiles sed 1 failed"
122 + sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
123 + || die "fixfiles sed 2 failed"
124 +
125 + eapply_user
126 +
127 + sed -i 's/-Werror//g' "${S1}"/*/Makefile || die "Failed to remove Werror"
128 +
129 + python_copy_sources
130 + # Our extra code is outside the regular directory, so set it to the extra
131 + # directory. We really should optimize this as it is ugly, but the extra
132 + # code is needed for Gentoo at the same time that policycoreutils is present
133 + # (so we cannot use an additional package for now).
134 + S="${S2}"
135 + python_copy_sources
136 +}
137 +
138 +src_compile() {
139 + building() {
140 + emake -C "${BUILD_DIR}" \
141 + AUDIT_LOG_PRIVS="y" \
142 + AUDITH="$(usex audit y n)" \
143 + PAMH="$(usex pam y n)" \
144 + INOTIFYH="$(usex dbus y n)" \
145 + SESANDBOX="n" \
146 + CC="$(tc-getCC)" \
147 + LIBDIR="\$(PREFIX)/$(get_libdir)"
148 + }
149 + S="${S1}" # Regular policycoreutils
150 + python_foreach_impl building
151 + S="${S2}" # Extra set
152 + python_foreach_impl building
153 +}
154 +
155 +src_install() {
156 + # Python scripts are present in many places. There are no extension modules.
157 + installation-policycoreutils() {
158 + einfo "Installing policycoreutils"
159 + emake -C "${BUILD_DIR}" DESTDIR="${D}" \
160 + AUDIT_LOG_PRIVS="y" \
161 + AUDITH="$(usex audit y n)" \
162 + PAMH="$(usex pam y n)" \
163 + INOTIFYH="$(usex dbus y n)" \
164 + SESANDBOX="n" \
165 + CC="$(tc-getCC)" \
166 + LIBDIR="\$(PREFIX)/$(get_libdir)" \
167 + install
168 + python_optimize
169 + }
170 +
171 + installation-extras() {
172 + einfo "Installing policycoreutils-extra"
173 + emake -C "${BUILD_DIR}" \
174 + DESTDIR="${D}" \
175 + install
176 + python_optimize
177 + }
178 +
179 + S="${S1}" # policycoreutils
180 + python_foreach_impl installation-policycoreutils
181 + S="${S2}" # extras
182 + python_foreach_impl installation-extras
183 + S="${S1}" # back for later
184 +
185 + # remove redhat-style init script
186 + rm -fR "${D}/etc/rc.d" || die
187 +
188 + # compatibility symlinks
189 + dosym /sbin/setfiles /usr/sbin/setfiles
190 + bashcomp_alias setsebool getsebool
191 +
192 + # location for policy definitions
193 + dodir /var/lib/selinux
194 + keepdir /var/lib/selinux
195 +
196 + # Set version-specific scripts
197 + for pyscript in rlpkg; do
198 + python_replicate_script "${ED}/usr/sbin/${pyscript}"
199 + done
200 +}
201 +
202 +pkg_postinst() {
203 + for POLICY_TYPE in ${POLICY_TYPES} ; do
204 + # There have been some changes to the policy store, rebuilding now.
205 + # https://marc.info/?l=selinux&m=143757277819717&w=2
206 + einfo "Rebuilding store ${POLICY_TYPE} (without re-loading)."
207 + semodule -s "${POLICY_TYPE}" -n -B || die "Failed to rebuild policy store ${POLICY_TYPE}"
208 + done
209 +}