@@ -17,45 +17,32 @@ HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
1717if [[ ${PV} == 9999 ]]; then
1818 inherit git-r3
1919 EGIT_REPO_URI=" https://github.com/SELinuxProject/selinux.git"
20- SRC_URI=" !vanilla? ( https://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER} .tar.bz2 ) "
20+ SRC_URI=" https://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER} .tar.bz2"
2121 S1=" ${WORKDIR} /${P} /${PN} "
2222 S2=" ${WORKDIR} /policycoreutils-extra"
2323 S=" ${S1} "
2424else
2525 SRC_URI=" https://github.com/SELinuxProject/selinux/releases/download/${MY_PV} /${MY_P} .tar.gz
26- !vanilla? ( https://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER} .tar.bz2 ) "
27- KEYWORDS=" amd64 ~ arm ~ arm64 ~riscv x86"
26+ https://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER} .tar.bz2"
27+ KEYWORDS=" amd64 arm arm64 ~riscv x86"
2828 S1=" ${WORKDIR} /${MY_P} "
2929 S2=" ${WORKDIR} /policycoreutils-extra"
3030 S=" ${S1} "
3131fi
3232
3333LICENSE=" GPL-2"
3434SLOT=" 0"
35- IUSE=" audit pam split-usr vanilla +python"
36- REQUIRED_USE="
37- !vanilla? ( python ${PYTHON_REQUIRED_USE} )
38- "
39-
40- DEPEND="
41- python? (
42- >=sys-libs/libselinux-${PV} :=[python,${PYTHON_USEDEP} ]
43- >=sys-libs/libsemanage-${PV} :=[python(+),${PYTHON_USEDEP} ]
44- audit? ( >=sys-process/audit-1.5.1[python,${PYTHON_USEDEP} ] )
45- ${PYTHON_DEPS}
46- )
47- !python? (
48- >=sys-libs/libselinux-${PV} :=
49- >=sys-libs/libsemanage-${PV} :=
50- audit? ( >=sys-process/audit-1.5.1 )
51- )
35+ IUSE=" audit pam split-usr"
36+ REQUIRED_USE=" ${PYTHON_REQUIRED_USE} "
37+
38+ DEPEND=" >=sys-libs/libselinux-${PV} :=[python,${PYTHON_USEDEP} ]
39+ >=sys-libs/libsemanage-${PV} :=[python(+),${PYTHON_USEDEP} ]
5240 >=sys-libs/libsepol-${PV} :=
5341 sys-libs/libcap-ng:=
42+ >=app-admin/setools-4.2.0[${PYTHON_USEDEP} ]
43+ audit? ( >=sys-process/audit-1.5.1[python,${PYTHON_USEDEP} ] )
5444 pam? ( sys-libs/pam:= )
55- !vanilla? (
56- >=app-admin/setools-4.2.0[${PYTHON_USEDEP} ]
57- )
58- "
45+ ${PYTHON_DEPS} "
5946
6047# Avoid dependency loop in the cross-compile case, bug #755173
6148# (Still exists in native)
@@ -66,7 +53,7 @@ RDEPEND="${DEPEND}
6653 app-misc/pax-utils"
6754
6855PDEPEND=" sys-apps/semodule-utils
69- python? ( sys-apps/selinux-python ) "
56+ sys-apps/selinux-python"
7057
7158src_unpack () {
7259 # Override default one because we need the SRC_URI ones even in case of 9999 ebuilds
@@ -84,96 +71,69 @@ src_prepare() {
8471 eapply " ${FILESDIR} /policycoreutils-3.1-0001-newrole-not-suid.patch"
8572 fi
8673
87- if ! use vanilla; then
88- # rlpkg is more useful than fixfiles
89- sed -i -e ' /^all/s/fixfiles//' " ${S} /scripts/Makefile" \
90- || die " fixfiles sed 1 failed"
91- sed -i -e ' /fixfiles/d' " ${S} /scripts/Makefile" \
92- || die " fixfiles sed 2 failed"
93- fi
74+ # rlpkg is more useful than fixfiles
75+ sed -i -e ' /^all/s/fixfiles//' " ${S} /scripts/Makefile" \
76+ || die " fixfiles sed 1 failed"
77+ sed -i -e ' /fixfiles/d' " ${S} /scripts/Makefile" \
78+ || die " fixfiles sed 2 failed"
9479
9580 eapply_user
9681
9782 sed -i ' s/-Werror//g' " ${S1} " /* /Makefile || die " Failed to remove Werror"
9883
99- if ! use vanilla; then
100- python_copy_sources
101- # Our extra code is outside the regular directory, so set it to the extra
102- # directory. We really should optimize this as it is ugly, but the extra
103- # code is needed for Gentoo at the same time that policycoreutils is present
104- # (so we cannot use an additional package for now).
105- S=" ${S2} "
106- python_copy_sources
107- fi
84+ python_copy_sources
85+ # Our extra code is outside the regular directory, so set it to the extra
86+ # directory. We really should optimize this as it is ugly, but the extra
87+ # code is needed for Gentoo at the same time that policycoreutils is present
88+ # (so we cannot use an additional package for now).
89+ S=" ${S2} "
90+ python_copy_sources
10891}
10992
11093src_compile () {
11194 building () {
112- local build_dir=${1}
113- emake -C " ${build_dir} " \
95+ emake -C " ${BUILD_DIR} " \
11496 AUDIT_LOG_PRIVS=" y" \
11597 AUDITH=" $( usex audit y n) " \
11698 PAMH=" $( usex pam y n) " \
11799 SESANDBOX=" n" \
118100 CC=" $( tc-getCC) " \
119101 LIBDIR=" \$ (PREFIX)/$( get_libdir) "
120102 }
121- if ! use vanilla; then
122- building_with_python () {
123- building " ${BUILD_DIR} "
124- }
125- S=" ${S1} " # Regular policycoreutils
126- python_foreach_impl building_with_python
127- S=" ${S2} " # Extra set
128- python_foreach_impl building_with_python
129- unset -f building_with_python
130- else
131- S=" ${S1} " # Regular policycoreutils
132- building " ${S} "
133- fi
134- unset -f building
103+ S=" ${S1} " # Regular policycoreutils
104+ python_foreach_impl building
105+ S=" ${S2} " # Extra set
106+ python_foreach_impl building
135107}
136108
137109src_install () {
138- installation-policycoreutils-base () {
139- local build_dir= ${1}
110+ # Python scripts are present in many places. There are no extension modules.
111+ installation-policycoreutils () {
140112 einfo " Installing policycoreutils"
141- emake -C " ${build_dir } " DESTDIR=" ${D} " \
113+ emake -C " ${BUILD_DIR } " DESTDIR=" ${D} " \
142114 AUDIT_LOG_PRIVS=" y" \
143115 AUDITH=" $( usex audit y n) " \
144116 PAMH=" $( usex pam y n) " \
145117 SESANDBOX=" n" \
146118 CC=" $( tc-getCC) " \
147119 LIBDIR=" \$ (PREFIX)/$( get_libdir) " \
148120 install
121+ python_optimize
149122 }
150123
151- if ! use vanilla; then
152- # Python scripts are present in many places. There are no extension modules.
153- installation-policycoreutils () {
154- installation-policycoreutils-base " ${BUILD_DIR} "
155- python_optimize
156- }
157-
158- installation-extras () {
159- einfo " Installing policycoreutils-extra"
160- emake -C " ${BUILD_DIR} " \
161- DESTDIR=" ${D} " \
162- install
163- python_optimize
164- }
165-
166- S=" ${S1} " # policycoreutils
167- python_foreach_impl installation-policycoreutils
168- S=" ${S2} " # extras
169- python_foreach_impl installation-extras
170- S=" ${S1} " # back for later
171- unset -f installation-extras installation-policycoreutils
172- else
173- S=" ${S1} " # policycoreutils
174- installation-policycoreutils-base " ${S} "
175- fi
176- unset -f installation-policycoreutils-base
124+ installation-extras () {
125+ einfo " Installing policycoreutils-extra"
126+ emake -C " ${BUILD_DIR} " \
127+ DESTDIR=" ${D} " \
128+ install
129+ python_optimize
130+ }
131+
132+ S=" ${S1} " # policycoreutils
133+ python_foreach_impl installation-policycoreutils
134+ S=" ${S2} " # extras
135+ python_foreach_impl installation-extras
136+ S=" ${S1} " # back for later
177137
178138 # remove redhat-style init script
179139 rm -fR " ${D} /etc/rc.d" || die
@@ -192,12 +152,10 @@ src_install() {
192152 dodir /var/lib/selinux
193153 keepdir /var/lib/selinux
194154
195- if ! use vanilla; then
196- # Set version-specific scripts
197- for pyscript in rlpkg; do
198- python_replicate_script " ${ED} /usr/sbin/${pyscript} "
199- done
200- fi
155+ # Set version-specific scripts
156+ for pyscript in rlpkg; do
157+ python_replicate_script " ${ED} /usr/sbin/${pyscript} "
158+ done
201159}
202160
203161pkg_postinst () {
0 commit comments