1 |
commit: 7590e53ff51655bdcb4065c272e323824c244ed7 |
2 |
Author: Kenton Groombridge <concord <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 3 13:30:36 2022 +0000 |
4 |
Commit: Kenton Groombridge <concord <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 4 01:03:09 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7590e53f |
7 |
|
8 |
sys-libs/libsemanage: bump to 3.4 |
9 |
|
10 |
Signed-off-by: Kenton Groombridge <concord <AT> gentoo.org> |
11 |
|
12 |
sys-libs/libsemanage/Manifest | 1 + |
13 |
sys-libs/libsemanage/libsemanage-3.4.ebuild | 129 ++++++++++++++++++++++++++++ |
14 |
2 files changed, 130 insertions(+) |
15 |
|
16 |
diff --git a/sys-libs/libsemanage/Manifest b/sys-libs/libsemanage/Manifest |
17 |
index afe07bc69cb9..809f5ef7f94b 100644 |
18 |
--- a/sys-libs/libsemanage/Manifest |
19 |
+++ b/sys-libs/libsemanage/Manifest |
20 |
@@ -1,2 +1,3 @@ |
21 |
DIST libsemanage-3.3.tar.gz 178890 BLAKE2B f1ff2d25f0c98e9794cb443365e6193db80a42104b645ef4edf783db2eb3d940d1f39cddfa59f9a86ba16957c77852159b3ced83c5d01ecb1811aa6255f8be83 SHA512 6026d9773c0886436ad801bc0c8beac888b6fb62034edeb863192dea4b6ef34a88e080758820fe635a20e048ac666beee505a0f946258f18571709cca5228aad |
22 |
DIST libsemanage-3.4-rc1.tar.gz 185794 BLAKE2B 0e1d537eddf465cbe895a931340c46869dc152abf39fb7cdc21002c9a12b613ab297063704a0a01c0eb0676ee3410482267cdef3940f2cdf088ca4683d76f452 SHA512 65bcb569981bc45b5520829e7df79bd6de75cd1877b75233727aa89484b123c730fd4dca4f297cf85616597632ec3c4be36b6cca1178811ac8cc0d45465954ca |
23 |
+DIST libsemanage-3.4.tar.gz 185177 BLAKE2B 45276ae6f54cf3dc453bc0d99fb4d7439970bb14ff5b909ebc5511ec31bce1d2bdc477ba9c1fb4fd04ab494ccb37cd8bf47a90d81460c2974af2196d9019bf67 SHA512 831dc789545bb9a0b009bdb4f7fe52f6197ad8325946640f886a960d08e40b8a69eccd5a70cce51466bb5cb7f742feb78d19a9ec63383fbd03aa451508677e73 |
24 |
|
25 |
diff --git a/sys-libs/libsemanage/libsemanage-3.4.ebuild b/sys-libs/libsemanage/libsemanage-3.4.ebuild |
26 |
new file mode 100644 |
27 |
index 000000000000..2a19bc2117d1 |
28 |
--- /dev/null |
29 |
+++ b/sys-libs/libsemanage/libsemanage-3.4.ebuild |
30 |
@@ -0,0 +1,129 @@ |
31 |
+# Copyright 1999-2022 Gentoo Authors |
32 |
+# Distributed under the terms of the GNU General Public License v2 |
33 |
+ |
34 |
+EAPI=7 |
35 |
+PYTHON_COMPAT=( python3_{8..11} ) |
36 |
+ |
37 |
+inherit python-r1 toolchain-funcs multilib-minimal |
38 |
+ |
39 |
+MY_PV="${PV//_/-}" |
40 |
+MY_P="${PN}-${MY_PV}" |
41 |
+ |
42 |
+DESCRIPTION="SELinux kernel and policy management library" |
43 |
+HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki" |
44 |
+ |
45 |
+if [[ ${PV} == 9999 ]]; then |
46 |
+ inherit git-r3 |
47 |
+ EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git" |
48 |
+ S="${WORKDIR}/${P}/${PN}" |
49 |
+else |
50 |
+ SRC_URI="https://github.com/SELinuxProject/selinux/releases/download/${MY_PV}/${MY_P}.tar.gz" |
51 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~mips ~riscv ~x86" |
52 |
+ S="${WORKDIR}/${MY_P}" |
53 |
+fi |
54 |
+ |
55 |
+LICENSE="GPL-2" |
56 |
+SLOT="0/2" |
57 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
58 |
+ |
59 |
+RDEPEND=">=sys-libs/libsepol-${PV}:=[${MULTILIB_USEDEP}] |
60 |
+ >=sys-libs/libselinux-${PV}:=[${MULTILIB_USEDEP}] |
61 |
+ >=sys-process/audit-2.2.2[${MULTILIB_USEDEP}] |
62 |
+ ${PYTHON_DEPS}" |
63 |
+DEPEND="${RDEPEND}" |
64 |
+BDEPEND=">=dev-lang/swig-2.0.4-r1 |
65 |
+ sys-devel/bison |
66 |
+ sys-devel/flex |
67 |
+ virtual/pkgconfig" |
68 |
+ |
69 |
+# tests are not meant to be run outside of the |
70 |
+# full SELinux userland repo |
71 |
+RESTRICT="test" |
72 |
+ |
73 |
+src_prepare() { |
74 |
+ eapply_user |
75 |
+ |
76 |
+ echo >> "${S}/src/semanage.conf" |
77 |
+ echo "# Set this to true to save the linked policy." >> "${S}/src/semanage.conf" |
78 |
+ echo "# This is normally only useful for analysis" >> "${S}/src/semanage.conf" |
79 |
+ echo "# or debugging of policy." >> "${S}/src/semanage.conf" |
80 |
+ echo "save-linked=false" >> "${S}/src/semanage.conf" |
81 |
+ echo >> "${S}/src/semanage.conf" |
82 |
+ echo "# Set this to 0 to disable assertion checking." >> "${S}/src/semanage.conf" |
83 |
+ echo "# This should speed up building the kernel policy" >> "${S}/src/semanage.conf" |
84 |
+ echo "# from policy modules, but may leave you open to" >> "${S}/src/semanage.conf" |
85 |
+ echo "# dangerous rules which assertion checking" >> "${S}/src/semanage.conf" |
86 |
+ echo "# would catch." >> "${S}/src/semanage.conf" |
87 |
+ echo "expand-check=1" >> "${S}/src/semanage.conf" |
88 |
+ echo >> "${S}/src/semanage.conf" |
89 |
+ echo "# Modules in the module store can be compressed" >> "${S}/src/semanage.conf" |
90 |
+ echo "# with bzip2. Set this to the bzip2 blocksize" >> "${S}/src/semanage.conf" |
91 |
+ echo "# 1-9 when compressing. The higher the number," >> "${S}/src/semanage.conf" |
92 |
+ echo "# the more memory is traded off for disk space." >> "${S}/src/semanage.conf" |
93 |
+ echo "# Set to 0 to disable bzip2 compression." >> "${S}/src/semanage.conf" |
94 |
+ echo "bzip-blocksize=0" >> "${S}/src/semanage.conf" |
95 |
+ echo >> "${S}/src/semanage.conf" |
96 |
+ echo "# Reduce memory usage for bzip2 compression and" >> "${S}/src/semanage.conf" |
97 |
+ echo "# decompression of modules in the module store." >> "${S}/src/semanage.conf" |
98 |
+ echo "bzip-small=true" >> "${S}/src/semanage.conf" |
99 |
+ |
100 |
+ multilib_copy_sources |
101 |
+} |
102 |
+ |
103 |
+multilib_src_compile() { |
104 |
+ local -x CFLAGS="${CFLAGS} -fno-semantic-interposition" |
105 |
+ |
106 |
+ emake \ |
107 |
+ AR="$(tc-getAR)" \ |
108 |
+ CC="$(tc-getCC)" \ |
109 |
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \ |
110 |
+ all |
111 |
+ |
112 |
+ if multilib_is_native_abi; then |
113 |
+ building_py() { |
114 |
+ emake \ |
115 |
+ AR="$(tc-getAR)" \ |
116 |
+ CC="$(tc-getCC)" \ |
117 |
+ PKG_CONFIG="$(tc-getPKG_CONFIG)" \ |
118 |
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \ |
119 |
+ "$@" |
120 |
+ } |
121 |
+ python_foreach_impl building_py swigify |
122 |
+ python_foreach_impl building_py pywrap |
123 |
+ fi |
124 |
+} |
125 |
+ |
126 |
+multilib_src_install() { |
127 |
+ emake \ |
128 |
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \ |
129 |
+ DESTDIR="${ED}" install |
130 |
+ |
131 |
+ if multilib_is_native_abi; then |
132 |
+ installation_py() { |
133 |
+ emake DESTDIR="${ED}" \ |
134 |
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \ |
135 |
+ PKG_CONFIG="$(tc-getPKG_CONFIG)" \ |
136 |
+ install-pywrap |
137 |
+ python_optimize # bug 531638 |
138 |
+ } |
139 |
+ python_foreach_impl installation_py |
140 |
+ fi |
141 |
+} |
142 |
+ |
143 |
+multiib_src_install_all() { |
144 |
+ python_setup |
145 |
+ python_fix_shebang "${ED}"/usr/libexec/selinux/semanage_migrate_store |
146 |
+} |
147 |
+ |
148 |
+pkg_postinst() { |
149 |
+ # Migrate the SELinux semanage configuration store if not done already |
150 |
+ local selinuxtype=$(awk -F'=' '/SELINUXTYPE=/ {print $2}' "${EROOT}"/etc/selinux/config 2>/dev/null) |
151 |
+ if [ -n "${selinuxtype}" ] && [ ! -d "${EROOT}"/var/lib/selinux/${selinuxtype}/active ] ; then |
152 |
+ ewarn "Since the 2.4 SELinux userspace, the policy module store is moved" |
153 |
+ ewarn "from /etc/selinux to /var/lib/selinux. The migration will be run now." |
154 |
+ ewarn "If there are any issues, it can be done manually by running:" |
155 |
+ ewarn "/usr/libexec/selinux/semanage_migrate_store" |
156 |
+ ewarn "For more information, please see" |
157 |
+ ewarn "- https://github.com/SELinuxProject/selinux/wiki/Policy-Store-Migration" |
158 |
+ fi |
159 |
+} |