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-libs/libselinux/
Date: Fri, 27 Apr 2018 04:45:26
Message-Id: 1524804261.9243b52261a590bc52683b3ca1503370102e5e2c.perfinion@gentoo
1 commit: 9243b52261a590bc52683b3ca1503370102e5e2c
2 Author: Jason Zaman <perfinion <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 27 03:52:50 2018 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 27 04:44:21 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9243b522
7
8 sys-libs/libselinux: bump to 2.8_rc2
9
10 Package-Manager: Portage-2.3.24, Repoman-2.3.6
11
12 sys-libs/libselinux/Manifest | 1 +
13 sys-libs/libselinux/libselinux-2.8_rc2.ebuild | 149 ++++++++++++++++++++++++++
14 2 files changed, 150 insertions(+)
15
16 diff --git a/sys-libs/libselinux/Manifest b/sys-libs/libselinux/Manifest
17 index bcd95ce6737..6ad9ab643b4 100644
18 --- a/sys-libs/libselinux/Manifest
19 +++ b/sys-libs/libselinux/Manifest
20 @@ -1,3 +1,4 @@
21 DIST libselinux-2.6.tar.gz 203119 BLAKE2B ee18d11258e8ea1611d46b5c748bd972084809c8c02832a5dc7d58577760330f58ce4a01e26e9e849eb26da7a663bbdaae74112ecbc16820de1b150829bfbc8d SHA512 906e1bf98c669862ab4f4e883d511db8d739a5763dc857c9405ad3cc6c70766a482853d07134698a1a98257a8632cc756d0549a7640c2915d051714f502ff14b
22 DIST libselinux-2.7.tar.gz 187574 BLAKE2B cc6ee51d5015943dd73fe16efb2ce2478616f43eaf7da55655de50502010e69973c2de13c8a562c8814a31211a8dbd7200fa2f22761f3d0f81fa3a1d3cd1e998 SHA512 415d10306692d4323455b61fb61d7e56e53b9144276ff206d72760e1df9b04ab07c62a4d6f04bf4e5fa708f9f14b21a9801069b16ece0a0aade886950941ab8d
23 DIST libselinux-2.8-rc1.tar.gz 187670 BLAKE2B b3ea4c32571a78fd535c4144487a5ceb83ab74642fec89effaec992f467b7ed3efd899487173a9b0ebb898b369cc2dadab8add38e27093beab85d21ca0b47e75 SHA512 11f51348d1b743e82b5c01abed4664b3513295436bec109e414df1ed86334422e294109c9563e6552ecab0d16e23c2fb3ea5f420f6ba3f11d35be1d9c8d20477
24 +DIST libselinux-2.8-rc2.tar.gz 187700 BLAKE2B 51ce916fc40fc8d551f3578d6eff87a53442e75644cb9877aa68e85d7db63057d3c33bb7a860fcb13d0fd094c23c024f9d6668ce6ff9d4294d380b0e5f71519d SHA512 052b86ba717820b482df056de69ce225090f39974b6fcc06d50d669601339deaeb2b507f7c1a18a614edee036e75a0ee59108742bd97fe78d19dda9afcdadf52
25
26 diff --git a/sys-libs/libselinux/libselinux-2.8_rc2.ebuild b/sys-libs/libselinux/libselinux-2.8_rc2.ebuild
27 new file mode 100644
28 index 00000000000..6c156d54a16
29 --- /dev/null
30 +++ b/sys-libs/libselinux/libselinux-2.8_rc2.ebuild
31 @@ -0,0 +1,149 @@
32 +# Copyright 1999-2018 Gentoo Foundation
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI="6"
36 +PYTHON_COMPAT=( python2_7 python3_4 python3_5 python3_6 )
37 +USE_RUBY="ruby22 ruby23"
38 +
39 +# No, I am not calling ruby-ng
40 +inherit multilib python-r1 toolchain-funcs multilib-minimal
41 +
42 +MY_P="${P//_/-}"
43 +SEPOL_VER="${PV}"
44 +MY_RELEASEDATE="20180426"
45 +
46 +DESCRIPTION="SELinux userland library"
47 +HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
48 +
49 +if [[ ${PV} == 9999 ]] ; then
50 + inherit git-r3
51 + EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
52 + S="${WORKDIR}/${MY_P}/${PN}"
53 +else
54 + SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz"
55 + KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86"
56 + S="${WORKDIR}/${MY_P}"
57 +fi
58 +
59 +LICENSE="public-domain"
60 +SLOT="0"
61 +IUSE="pcre2 python ruby static-libs ruby_targets_ruby21 ruby_targets_ruby22 ruby_targets_ruby23"
62 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
63 +
64 +RDEPEND=">=sys-libs/libsepol-${SEPOL_VER}:=[${MULTILIB_USEDEP}]
65 + !pcre2? ( >=dev-libs/libpcre-8.33-r1:=[static-libs?,${MULTILIB_USEDEP}] )
66 + pcre2? ( dev-libs/libpcre2:=[static-libs?,${MULTILIB_USEDEP}] )
67 + python? ( ${PYTHON_DEPS} )
68 + ruby? (
69 + ruby_targets_ruby22? ( dev-lang/ruby:2.2 )
70 + ruby_targets_ruby23? ( dev-lang/ruby:2.3 )
71 + )"
72 +DEPEND="${RDEPEND}
73 + virtual/pkgconfig
74 + python? ( >=dev-lang/swig-2.0.9 )"
75 +
76 +src_prepare() {
77 + eapply_user
78 +
79 + multilib_copy_sources
80 +}
81 +
82 +multilib_src_compile() {
83 + tc-export AR CC PKG_CONFIG RANLIB
84 +
85 + emake \
86 + LIBDIR="\$(PREFIX)/$(get_libdir)" \
87 + SHLIBDIR="/$(get_libdir)" \
88 + LDFLAGS="-fPIC ${LDFLAGS} -pthread" \
89 + USE_PCRE2="$(usex pcre2 y n)" \
90 + all
91 +
92 + if multilib_is_native_abi && use python; then
93 + building() {
94 + emake \
95 + LDFLAGS="-fPIC ${LDFLAGS} -lpthread" \
96 + LIBDIR="\$(PREFIX)/$(get_libdir)" \
97 + SHLIBDIR="/$(get_libdir)" \
98 + USE_PCRE2="$(usex pcre2 y n)" \
99 + pywrap
100 + }
101 + python_foreach_impl building
102 + fi
103 +
104 + if multilib_is_native_abi && use ruby; then
105 + building() {
106 + einfo "Calling rubywrap for ${1}"
107 + # Clean up .lo file to force rebuild
108 + rm -f src/selinuxswig_ruby_wrap.lo || die
109 + emake \
110 + RUBY=${1} \
111 + LDFLAGS="-fPIC ${LDFLAGS} -lpthread" \
112 + LIBDIR="\$(PREFIX)/$(get_libdir)" \
113 + SHLIBDIR="/$(get_libdir)" \
114 + USE_PCRE2="$(usex pcre2 y n)" \
115 + rubywrap
116 + }
117 + for RUBYTARGET in ${USE_RUBY}; do
118 + use ruby_targets_${RUBYTARGET} || continue
119 +
120 + building ${RUBYTARGET}
121 + done
122 + fi
123 +}
124 +
125 +multilib_src_install() {
126 + emake DESTDIR="${D}" \
127 + LIBDIR="\$(PREFIX)/$(get_libdir)" \
128 + SHLIBDIR="/$(get_libdir)" \
129 + USE_PCRE2="$(usex pcre2 y n)" \
130 + install
131 +
132 + if multilib_is_native_abi && use python; then
133 + installation() {
134 + emake DESTDIR="${D}" \
135 + LIBDIR="\$(PREFIX)/$(get_libdir)" \
136 + SHLIBDIR="/$(get_libdir)" \
137 + USE_PCRE2="$(usex pcre2 y n)" \
138 + install-pywrap
139 + python_optimize # bug 531638
140 + }
141 + python_foreach_impl installation
142 + fi
143 +
144 + if multilib_is_native_abi && use ruby; then
145 + installation() {
146 + einfo "Calling install-rubywrap for ${1}"
147 + # Forcing (re)build here as otherwise the resulting SO file is used for all ruby versions
148 + rm src/selinuxswig_ruby_wrap.lo
149 + emake DESTDIR="${D}" \
150 + LIBDIR="\$(PREFIX)/$(get_libdir)" \
151 + SHLIBDIR="/$(get_libdir)" \
152 + RUBY=${1} \
153 + USE_PCRE2="$(usex pcre2 y n)" \
154 + install-rubywrap
155 + }
156 + for RUBYTARGET in ${USE_RUBY}; do
157 + use ruby_targets_${RUBYTARGET} || continue
158 +
159 + installation ${RUBYTARGET}
160 + done
161 + fi
162 +
163 + use static-libs || rm "${D}"/usr/lib*/*.a || die
164 +}
165 +
166 +pkg_postinst() {
167 + # Fix bug 473502
168 + for POLTYPE in ${POLICY_TYPES};
169 + do
170 + mkdir -p /etc/selinux/${POLTYPE}/contexts/files || die
171 + touch /etc/selinux/${POLTYPE}/contexts/files/file_contexts.local || die
172 + # Fix bug 516608
173 + for EXPRFILE in file_contexts file_contexts.homedirs file_contexts.local ; do
174 + if [[ -f "/etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE}" ]]; then
175 + sefcontext_compile /etc/selinux/${POLTYPE}/contexts/files/${EXPRFILE} \
176 + || die "Failed to recompile contexts"
177 + fi
178 + done
179 + done
180 +}