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