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: Sat, 09 Feb 2019 11:49:17
Message-Id: 1549712900.6289b701121497a05ac7c04c482674521977111e.perfinion@gentoo
1 commit: 6289b701121497a05ac7c04c482674521977111e
2 Author: Jason Zaman <perfinion <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 9 11:31:28 2019 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 9 11:48:20 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6289b701
7
8 sys-apps/policycoreutils: bump to 2.9_rc1
9
10 Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
11 Package-Manager: Portage-2.3.51, Repoman-2.3.11
12
13 sys-apps/policycoreutils/Manifest | 1 +
14 .../policycoreutils/policycoreutils-2.9_rc1.ebuild | 178 +++++++++++++++++++++
15 2 files changed, 179 insertions(+)
16
17 diff --git a/sys-apps/policycoreutils/Manifest b/sys-apps/policycoreutils/Manifest
18 index 5c36cdf671f..4f9013884de 100644
19 --- a/sys-apps/policycoreutils/Manifest
20 +++ b/sys-apps/policycoreutils/Manifest
21 @@ -1,3 +1,4 @@
22 DIST policycoreutils-2.7.tar.gz 2796707 BLAKE2B 4b1c03f2d12252b453950c3d6bcde75780926a1b91263d3881f741399c5630c707f0429b9b144c657b017b7b0c1500b63b6463610dea3caaef8c2f7c3f69fd8f SHA512 ce97d659f72058fd23d8dab8db98fc7c0003806a636c521fa15da465d7358d40ccc8e3eaa9675f00a9b0b8aaa1465d3fb650bc0ebbbf00164e121230673256fb
23 DIST policycoreutils-2.8.tar.gz 2796775 BLAKE2B 36115cc2faf72a4b647312f8faaf4762d7f2fb56bf0531ccadeb46b100c9e577f3148fe6890925d3fed94ac22803dc61729781e54bd0ddeb1539ccce2ec2a29b SHA512 2b4a70836fd8727a16b8f8d4afcc39c9461ab6f5bc1ba5ce5833d41150da921ebb3c9bdbd1cfa7dd31fd382ba18b5433ca9b63bce58bd290db81fa9bedfe29f3
24 +DIST policycoreutils-2.9-rc1.tar.gz 2797222 BLAKE2B 25f51cc1b17744e573450245064b8b65e44fff44693d886e89097308c80ed61b2cb46822d581e8b970053a771262722bdb4a59619d6a94e09505b71e476e45b3 SHA512 6a3a7d4652b44e54c287b327ad691dd0575c6a45fbf1f4676b8182e05760defc37dfa6aaf2e6ab5a77e124d76d1f699c4859c0595a3f9e8ade04ff5ad186fb32
25 DIST policycoreutils-extra-1.36.tar.bz2 8830 BLAKE2B 6d98e41ea379d3e95221a6e53d8a8b144e4e15ca5581381e76a529dbbaca304d5587b30419797c8c70cbd7c2b2588e5ecd62adcf97294e429950899c1c318346 SHA512 c6a18e6fb2d65f51dc55b88907f23241f2fbfc033d3d2888b109596d9ed31d509b2c93456727ea4d1f98544831afb15c449ff72d6aedf93b9e474b27817f7fb3
26
27 diff --git a/sys-apps/policycoreutils/policycoreutils-2.9_rc1.ebuild b/sys-apps/policycoreutils/policycoreutils-2.9_rc1.ebuild
28 new file mode 100644
29 index 00000000000..09b451dfda9
30 --- /dev/null
31 +++ b/sys-apps/policycoreutils/policycoreutils-2.9_rc1.ebuild
32 @@ -0,0 +1,178 @@
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} )
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="20190125"
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 + !<sec-policy/selinux-base-policy-2.20151208-r6"
91 +# 2.20151208-r6 and higher has support for new setfiles
92 +
93 +### libcgroup -> seunshare
94 +### dbus -> restorecond
95 +
96 +# pax-utils for scanelf used by rlpkg
97 +RDEPEND="${DEPEND}
98 + app-misc/pax-utils
99 + !<sys-apps/openrc-0.14"
100 +
101 +PDEPEND="sys-apps/semodule-utils
102 + sys-apps/selinux-python"
103 +
104 +src_unpack() {
105 + # Override default one because we need the SRC_URI ones even in case of 9999 ebuilds
106 + default
107 + if [[ ${PV} == 9999 ]] ; then
108 + git-r3_src_unpack
109 + fi
110 +}
111 +
112 +src_prepare() {
113 + S="${S1}"
114 + cd "${S}" || die "Failed to switch to ${S}"
115 + if [[ ${PV} != 9999 ]] ; then
116 + # If needed for live ebuilds please use /etc/portage/patches
117 + eapply "${FILESDIR}/policycoreutils-2.7-0001-newrole-not-suid.patch"
118 + fi
119 +
120 + # rlpkg is more useful than fixfiles
121 + sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
122 + || die "fixfiles sed 1 failed"
123 + sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
124 + || die "fixfiles sed 2 failed"
125 +
126 + eapply_user
127 +
128 + sed -i 's/-Werror//g' "${S1}"/*/Makefile || die "Failed to remove Werror"
129 +
130 + python_copy_sources
131 + # Our extra code is outside the regular directory, so set it to the extra
132 + # directory. We really should optimize this as it is ugly, but the extra
133 + # code is needed for Gentoo at the same time that policycoreutils is present
134 + # (so we cannot use an additional package for now).
135 + S="${S2}"
136 + python_copy_sources
137 +}
138 +
139 +src_compile() {
140 + building() {
141 + emake -C "${BUILD_DIR}" \
142 + AUDIT_LOG_PRIVS="y" \
143 + AUDITH="$(usex audit y n)" \
144 + PAMH="$(usex pam y n)" \
145 + INOTIFYH="$(usex dbus y n)" \
146 + SESANDBOX="n" \
147 + CC="$(tc-getCC)" \
148 + LIBDIR="\$(PREFIX)/$(get_libdir)"
149 + }
150 + S="${S1}" # Regular policycoreutils
151 + python_foreach_impl building
152 + S="${S2}" # Extra set
153 + python_foreach_impl building
154 +}
155 +
156 +src_install() {
157 + # Python scripts are present in many places. There are no extension modules.
158 + installation-policycoreutils() {
159 + einfo "Installing policycoreutils"
160 + emake -C "${BUILD_DIR}" DESTDIR="${D}" \
161 + AUDIT_LOG_PRIVS="y" \
162 + AUDITH="$(usex audit y n)" \
163 + PAMH="$(usex pam y n)" \
164 + INOTIFYH="$(usex dbus y n)" \
165 + SESANDBOX="n" \
166 + CC="$(tc-getCC)" \
167 + LIBDIR="\$(PREFIX)/$(get_libdir)" \
168 + install
169 + python_optimize
170 + }
171 +
172 + installation-extras() {
173 + einfo "Installing policycoreutils-extra"
174 + emake -C "${BUILD_DIR}" \
175 + DESTDIR="${D}" \
176 + install
177 + python_optimize
178 + }
179 +
180 + S="${S1}" # policycoreutils
181 + python_foreach_impl installation-policycoreutils
182 + S="${S2}" # extras
183 + python_foreach_impl installation-extras
184 + S="${S1}" # back for later
185 +
186 + # remove redhat-style init script
187 + rm -fR "${D}/etc/rc.d" || die
188 +
189 + # compatibility symlinks
190 + dosym /sbin/setfiles /usr/sbin/setfiles
191 + bashcomp_alias setsebool getsebool
192 +
193 + # location for policy definitions
194 + dodir /var/lib/selinux
195 + keepdir /var/lib/selinux
196 +
197 + # Set version-specific scripts
198 + for pyscript in rlpkg; do
199 + python_replicate_script "${ED}/usr/sbin/${pyscript}"
200 + done
201 +}
202 +
203 +pkg_postinst() {
204 + for POLICY_TYPE in ${POLICY_TYPES} ; do
205 + # There have been some changes to the policy store, rebuilding now.
206 + # https://marc.info/?l=selinux&m=143757277819717&w=2
207 + einfo "Rebuilding store ${POLICY_TYPE} (without re-loading)."
208 + semodule -s "${POLICY_TYPE}" -n -B || die "Failed to rebuild policy store ${POLICY_TYPE}"
209 + done
210 +}