Сравнение selinux-python-3.7-r1 с selinux-python-9999

/usr/portage/sys-apps/selinux-python/selinux-python-9999.ebuild 2026-07-11 20:03:06.467002435 +0300
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4 4
EAPI="8"
5
PYTHON_COMPAT=( python3_12 )
5

  
6
DISTUTILS_USE_PEP517=setuptools
7
PYTHON_COMPAT=( python3_{12..14} )
6 8
PYTHON_REQ_USE="xml(+)"
7 9

  
8
inherit python-r1 toolchain-funcs
10
inherit distutils-r1 toolchain-funcs
9 11

  
10 12
MY_PV="${PV//_/-}"
11 13
MY_P="${PN}-${MY_PV}"
......
19 21
	S="${WORKDIR}/${P}/${PN#selinux-}"
20 22
else
21 23
	SRC_URI="https://github.com/SELinuxProject/selinux/releases/download/${MY_PV}/${MY_P}.tar.gz"
22
	KEYWORDS="amd64 arm arm64 ~riscv x86"
24
	KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86"
23 25
	S="${WORKDIR}/${MY_P}"
24 26
fi
25 27

  
......
27 29
SLOT="0"
28 30
IUSE="test"
29 31
RESTRICT="!test? ( test )"
30
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
31 32

  
32
RDEPEND=">=sys-libs/libselinux-${PV}:=[python]
33
RDEPEND="
34
	>=sys-libs/libselinux-${PV}:=[python,${PYTHON_USEDEP}]
33 35
	>=sys-libs/libsemanage-${PV}:=[python(+)]
34 36
	>=sys-libs/libsepol-${PV}:=[static-libs(+)]
35 37
	>=app-admin/setools-4.2.0[${PYTHON_USEDEP}]
36 38
	>=sys-process/audit-1.5.1[python,${PYTHON_USEDEP}]
37
	${PYTHON_DEPS}"
39
"
38 40
DEPEND="${RDEPEND}"
39 41
BDEPEND="
42
	dev-python/build[${PYTHON_USEDEP}]
40 43
	test? (
41 44
		${RDEPEND}
42 45
		sec-policy/selinux-base
43 46
		>=sys-apps/secilc-${PV}
44 47
	)"
45 48

  
49
PATCHES=(
50
	"${FILESDIR}"/selinux-python-3.11-no-pip.patch
51
)
52

  
46 53
src_prepare() {
47 54
	default
48
	sed -i 's/-Werror//g' "${S}"/*/Makefile || die "Failed to remove Werror"
49 55

  
50
	python_copy_sources
56
	sed -e 's/-Werror//g' -i "${S}"/*/Makefile || die "Failed to remove Werror"
57

  
58
	pushd sepolicy >/dev/null || die
59
	# To avoid default
60
	DISTUTILS_OPTIONAL=1 distutils-r1_src_prepare
61
	popd >/dev/null || die
62
}
63

  
64
python_compile() {
65
	distutils-r1_python_compile
66
	emake -C "${S}" \
67
		CC="$(tc-getCC)" \
68
		LIBDIR="\$(PREFIX)/$(get_libdir)"
51 69
}
52 70

  
53 71
src_compile() {
54
	building() {
55
		emake -C "${BUILD_DIR}" \
56
			CC="$(tc-getCC)" \
57
			LIBDIR="\$(PREFIX)/$(get_libdir)"
58
	}
59
	python_foreach_impl building
72
	pushd sepolicy >/dev/null || die
73
	distutils-r1_src_compile
74
	popd >/dev/null || die
75
}
76

  
77
python_test() {
78
	# The different subprojects have some interproject dependencies:
79
	# - audit2allow depens on sepolgen
80
	# - chcat depends on semanage
81
	# and maybe others.
82
	# Add all the modules of the individual subprojects to the
83
	# PYTHONPATH, so they get actually found and used. In
84
	# particular, already installed versions on the system are not
85
	# used.
86
	local dir
87
	for dir in audit2allow chcat semanage sepolgen/src sepolicy ; do
88
		PYTHONPATH="${S}/${dir}:${PYTHONPATH}"
89
	done
90
	PYTHONPATH=${PYTHONPATH} emake -C "${S}" test
60 91
}
61 92

  
62 93
src_test() {
63
	testing() {
64
		# The different subprojects have some interproject dependencies:
65
		# - audit2allow depens on sepolgen
66
		# - chcat depends on semanage
67
		# and maybe others.
68
		# Add all the modules of the individual subprojects to the
69
		# PYTHONPATH, so they get actually found and used. In
70
		# particular, already installed versions on the system are not
71
		# used.
72
		for dir in audit2allow chcat semanage sepolgen/src sepolicy ; do
73
			PYTHONPATH="${BUILD_DIR}/${dir}:${PYTHONPATH}"
74
		done
75
		PYTHONPATH=${PYTHONPATH} \
76
			emake -C "${BUILD_DIR}" \
77
				test
78
	}
79
	python_foreach_impl testing
94
	pushd sepolicy >/dev/null || die
95
	distutils-r1_src_test
96
	popd >/dev/null || die
80 97
}
81 98

  
82
src_install() {
83
	installation() {
84
		emake -C "${BUILD_DIR}" \
85
			DESTDIR="${D}" \
86
			LIBDIR="\$(PREFIX)/$(get_libdir)" \
87
			install
88
		python_optimize
89
	}
90
	python_foreach_impl installation
91

  
92
	# Set version-specific scripts
93
	for pyscript in audit2allow sepolgen-ifgen sepolicy chcat; do
94
		python_replicate_script "${ED}/usr/bin/${pyscript}"
95
	done
96
	for pyscript in semanage; do
97
		python_replicate_script "${ED}/usr/sbin/${pyscript}"
98
	done
99
python_install() {
100
	distutils-r1_python_install
101
	emake -C "${S}" \
102
		DESTDIR="${D}" \
103
		LIBDIR="\$(PREFIX)/$(get_libdir)" \
104
		install
105

  
106
	# Install over previously installed scripts to ensure proper python support
107
	python_doscript "${S}"/audit2allow/audit2allow
108
	python_doscript "${S}"/audit2allow/sepolgen-ifgen
109
	python_doscript "${S}"/chcat/chcat
110
	python_newscript "${S}"/sepolicy/sepolicy.py sepolicy
111

  
112
	python_scriptinto /usr/sbin
113
	python_doscript "${S}"/semanage/semanage
99 114

  
115
	# set _PYTHON_SCRIPTROOT to the implicit default for the next python target, bug #967869
116
	python_scriptinto /usr/bin
117

  
118
	python_optimize
119
}
120

  
121
python_install_all() {
100 122
	# Create sepolgen.conf with different devel location definition
101 123
	mkdir -p "${D}"/etc/selinux || die "Failed to create selinux directory";
102 124
	if [[ -f /etc/selinux/config ]];
......
116 138
		fi
117 139
	fi
118 140
}
141

  
142
src_install() {
143
	pushd sepolicy >/dev/null || die
144
	distutils-r1_src_install
145
	popd >/dev/null || die
146
}
Спасибо!