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