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