Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-cluster/ceph/
Date: Fri, 26 Feb 2021 00:44:26
Message-Id: 1614300248.30c77e40c2758524359e5017bc695bf34991bda3.chutzpah@gentoo
1 commit: 30c77e40c2758524359e5017bc695bf34991bda3
2 Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
3 AuthorDate: Fri Feb 26 00:42:53 2021 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 26 00:44:08 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=30c77e40
7
8 sys-cluster/ceph-14.2.16-r2: Revbump, drop libressl, fix objdump call
9
10 Closes: https://bugs.gentoo.org/701618
11 Closes: https://bugs.gentoo.org/733814
12 Closes: https://bugs.gentoo.org/724522
13 Copyright: Sony Interactive Entertainment Inc.
14 Package-Manager: Portage-3.0.15, Repoman-3.0.2
15 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
16
17 sys-cluster/ceph/ceph-14.2.16-r2.ebuild | 394 ++++++++++++++++++++++++++++++++
18 1 file changed, 394 insertions(+)
19
20 diff --git a/sys-cluster/ceph/ceph-14.2.16-r2.ebuild b/sys-cluster/ceph/ceph-14.2.16-r2.ebuild
21 new file mode 100644
22 index 00000000000..6809cb10ccd
23 --- /dev/null
24 +++ b/sys-cluster/ceph/ceph-14.2.16-r2.ebuild
25 @@ -0,0 +1,394 @@
26 +# Copyright 1999-2021 Gentoo Authors
27 +# Distributed under the terms of the GNU General Public License v2
28 +
29 +EAPI=7
30 +PYTHON_COMPAT=( python3_{7,8} )
31 +DISTUTILS_USE_SETUPTOOLS=rdepend
32 +CMAKE_MAKEFILE_GENERATOR=emake
33 +
34 +DISTUTILS_OPTIONAL=1
35 +
36 +inherit check-reqs bash-completion-r1 cmake distutils-r1 flag-o-matic \
37 + python-r1 udev readme.gentoo-r1 toolchain-funcs systemd tmpfiles
38 +
39 +if [[ ${PV} == *9999* ]]; then
40 + inherit git-r3
41 + EGIT_REPO_URI="https://github.com/ceph/ceph.git"
42 + SRC_URI=""
43 +else
44 + SRC_URI="https://download.ceph.com/tarballs/${P}.tar.gz"
45 + KEYWORDS="amd64 ~ppc64"
46 +fi
47 +
48 +DESCRIPTION="Ceph distributed filesystem"
49 +HOMEPAGE="https://ceph.com/"
50 +
51 +LICENSE="Apache-2.0 LGPL-2.1 CC-BY-SA-3.0 GPL-2 GPL-2+ LGPL-2+ LGPL-2.1 LGPL-3 GPL-3 BSD Boost-1.0 MIT public-domain"
52 +SLOT="0"
53 +
54 +CPU_FLAGS_X86=(sse{,2,3,4_1,4_2} ssse3)
55 +
56 +IUSE="babeltrace +cephfs custom-cflags diskprediction dpdk fuse grafana jemalloc
57 + kafka kerberos ldap lttng +mgr numa rabbitmq +radosgw +ssl spdk system-boost
58 + systemd +tcmalloc test xfs zfs"
59 +IUSE+=" $(printf "cpu_flags_x86_%s\n" ${CPU_FLAGS_X86[@]})"
60 +
61 +DEPEND="
62 + acct-group/ceph
63 + acct-user/ceph
64 + virtual/libudev:=
65 + app-arch/bzip2:=
66 + app-arch/lz4:=
67 + app-arch/snappy:=
68 + app-arch/zstd:=
69 + app-shells/bash:0
70 + app-misc/jq:=
71 + dev-libs/crypto++:=
72 + dev-libs/leveldb:=[snappy,tcmalloc(-)?]
73 + dev-libs/libaio:=
74 + dev-libs/libnl:3=
75 + dev-libs/libxml2:=
76 + <dev-libs/rocksdb-6.15:=
77 + dev-libs/xmlsec:=[openssl]
78 + dev-cpp/yaml-cpp:=
79 + dev-libs/nss:=
80 + dev-libs/protobuf:=
81 + net-dns/c-ares:=
82 + net-libs/gnutls:=
83 + sys-auth/oath-toolkit:=
84 + sys-apps/coreutils
85 + sys-apps/grep
86 + sys-apps/hwloc:=
87 + sys-apps/keyutils:=
88 + sys-apps/util-linux:=
89 + sys-apps/sed
90 + sys-apps/util-linux
91 + sys-libs/libcap-ng:=
92 + sys-libs/ncurses:0=
93 + sys-libs/zlib:=
94 + sys-process/numactl:=
95 + x11-libs/libpciaccess:=
96 + babeltrace? ( dev-util/babeltrace )
97 + fuse? ( sys-fs/fuse:0= )
98 + jemalloc? ( dev-libs/jemalloc:= )
99 + !jemalloc? ( >=dev-util/google-perftools-2.6.1:= )
100 + kafka? ( dev-libs/librdkafka:= )
101 + kerberos? ( virtual/krb5 )
102 + ldap? ( net-nds/openldap:= )
103 + lttng? ( dev-util/lttng-ust:= )
104 + rabbitmq? ( net-libs/rabbitmq-c:= )
105 + radosgw? (
106 + dev-libs/expat:=
107 + dev-libs/openssl:=
108 + net-misc/curl:=[curl_ssl_openssl]
109 + )
110 + ssl? ( dev-libs/openssl:= )
111 + system-boost? ( dev-libs/boost[threads,context,python,${PYTHON_USEDEP}] )
112 + xfs? ( sys-fs/xfsprogs:= )
113 + zfs? ( sys-fs/zfs:= )
114 + ${PYTHON_DEPS}
115 +"
116 +BDEPEND="
117 + amd64? ( dev-lang/yasm )
118 + x86? ( dev-lang/yasm )
119 + app-arch/cpio
120 + >=dev-util/cmake-3.5.0
121 + dev-python/cython[${PYTHON_USEDEP}]
122 + dev-python/sphinx
123 + dev-util/cunit
124 + dev-util/gperf
125 + dev-util/ragel
126 + dev-util/valgrind
127 + sys-apps/coreutils
128 + sys-apps/findutils
129 + sys-apps/grep
130 + sys-apps/sed
131 + sys-apps/which
132 + sys-devel/bc
133 + sys-devel/patch
134 + virtual/pkgconfig
135 + test? (
136 + dev-python/coverage[${PYTHON_USEDEP}]
137 + dev-python/virtualenv[${PYTHON_USEDEP}]
138 + dev-python/requests-mock[${PYTHON_USEDEP}]
139 + sys-apps/grep[pcre]
140 + sys-fs/btrfs-progs
141 + )
142 +"
143 +RDEPEND="${DEPEND}
144 + app-admin/sudo
145 + net-misc/socat
146 + sys-apps/gptfdisk
147 + >=sys-apps/smartmontools-7.0
148 + sys-block/parted
149 + sys-fs/cryptsetup
150 + sys-fs/lsscsi
151 + sys-fs/lvm2[-device-mapper-only(-)]
152 + virtual/awk
153 + dev-python/bcrypt[${PYTHON_USEDEP}]
154 + dev-python/cherrypy[${PYTHON_USEDEP}]
155 + dev-python/flask[${PYTHON_USEDEP}]
156 + dev-python/jinja[${PYTHON_USEDEP}]
157 + dev-python/pecan[${PYTHON_USEDEP}]
158 + dev-python/prettytable[${PYTHON_USEDEP}]
159 + dev-python/pyopenssl[${PYTHON_USEDEP}]
160 + dev-python/requests[${PYTHON_USEDEP}]
161 + dev-python/werkzeug[${PYTHON_USEDEP}]
162 + mgr? (
163 + dev-python/more-itertools[${PYTHON_USEDEP}]
164 + dev-python/numpy[${PYTHON_USEDEP}]
165 + dev-python/pyjwt[${PYTHON_USEDEP}]
166 + dev-python/pyyaml[${PYTHON_USEDEP}]
167 + dev-python/routes[${PYTHON_USEDEP}]
168 + diskprediction? (
169 + $(python_gen_cond_dep '<dev-python/scipy-1.4.0[${PYTHON_USEDEP}]' python3_{6,7})
170 + )
171 + sci-libs/scikit-learn[${PYTHON_USEDEP}]
172 + dev-python/six[${PYTHON_USEDEP}]
173 + )
174 +"
175 +# diskprediction needs older scipy not compatible with py38
176 +# bug #724438
177 +REQUIRED_USE="
178 + ${PYTHON_REQUIRED_USE}
179 + ?? ( jemalloc tcmalloc )
180 + diskprediction? ( mgr !python_targets_python3_8 )
181 + kafka? ( radosgw )
182 + mgr? ( cephfs )
183 + rabbitmq? ( radosgw )
184 +"
185 +RESTRICT="!test? ( test )"
186 +
187 +# the tests need root access
188 +RESTRICT="test? ( userpriv )"
189 +
190 +# distribution tarball does not include everything needed for tests
191 +RESTRICT+=" test"
192 +
193 +# create a non-debug release
194 +CMAKE_BUILD_TYPE=RelWithDebInfo
195 +
196 +# false positives unless all USE flags are on
197 +CMAKE_WARN_UNUSED_CLI=no
198 +
199 +PATCHES=(
200 + "${FILESDIR}/ceph-12.2.0-use-provided-cpu-flag-values.patch"
201 + "${FILESDIR}/ceph-14.2.0-cflags.patch"
202 + "${FILESDIR}/ceph-12.2.4-boost-build-none-options.patch"
203 + "${FILESDIR}/ceph-13.2.0-cflags.patch"
204 + "${FILESDIR}/ceph-14.2.0-mgr-python-version.patch"
205 + "${FILESDIR}/ceph-14.2.5-no-virtualenvs.patch"
206 + "${FILESDIR}/ceph-13.2.2-dont-install-sysvinit-script.patch"
207 + "${FILESDIR}/ceph-14.2.0-dpdk-cflags.patch"
208 + "${FILESDIR}/ceph-14.2.0-link-crc32-statically.patch"
209 + "${FILESDIR}/ceph-14.2.0-cython-0.29.patch"
210 + "${FILESDIR}/ceph-14.2.3-dpdk-compile-fix-1.patch"
211 + "${FILESDIR}/ceph-14.2.4-python-executable.patch"
212 + "${FILESDIR}/ceph-14.2.4-undefined-behaviour.patch"
213 + "${FILESDIR}/ceph-14.2.10-build-without-mgr.patch"
214 + "${FILESDIR}/ceph-14.2.11-systemd-unit-fix.patch"
215 + "${FILESDIR}/ceph-15.2.9-dont-compile-isal_compress-if-don-t-have-SSE4_1.patch"
216 +)
217 +
218 +check-reqs_export_vars() {
219 + CHECKREQS_DISK_BUILD="5200M"
220 + CHECKREQS_DISK_USR="510M"
221 +
222 + export CHECKREQS_DISK_BUILD CHECKREQS_DISK_USR
223 +}
224 +
225 +pkg_pretend() {
226 + check-reqs_export_vars
227 + check-reqs_pkg_pretend
228 +}
229 +
230 +pkg_setup() {
231 + python_setup
232 + check-reqs_export_vars
233 + check-reqs_pkg_setup
234 +}
235 +
236 +src_prepare() {
237 + cmake_src_prepare
238 +
239 + if use system-boost; then
240 + find "${S}" -name '*.cmake' -or -name 'CMakeLists.txt' -print0 \
241 + | xargs --null sed -r \
242 + -e 's|Boost::|boost_|g' \
243 + -e 's|Boost_|boost_|g' \
244 + -e 's|[Bb]oost_boost|boost_system|g' -i || die
245 + fi
246 +
247 + sed -r -e "s:DESTINATION .+\\):DESTINATION $(get_bashcompdir)\\):" \
248 + -i src/bash_completion/CMakeLists.txt || die
249 +
250 + sed -e "s:objdump -p:$(tc-getOBJDUMP) -p:" -i CMakeLists.txt || die
251 +
252 + if ! use diskprediction; then
253 + rm -rf src/pybind/mgr/diskprediction_local || die
254 + fi
255 +
256 + # remove tests that need root access
257 + rm src/test/cli/ceph-authtool/cap*.t || die
258 +}
259 +
260 +ceph_src_configure() {
261 + local flag
262 + local mycmakeargs=(
263 + -DWITH_BABELTRACE=$(usex babeltrace)
264 + -DWITH_CEPHFS=$(usex cephfs)
265 + -DWITH_CEPHFS_SHELL=$(usex cephfs)
266 + -DWITH_DPDK=$(usex dpdk)
267 + -DWITH_SPDK=$(usex spdk)
268 + -DWITH_FUSE=$(usex fuse)
269 + -DWITH_LTTNG=$(usex lttng)
270 + -DWITH_GSSAPI=$(usex kerberos)
271 + -DWITH_GRAFANA=$(usex grafana)
272 + -DWITH_MGR=$(usex mgr)
273 + -DWITH_MGR_DASHBOARD_FRONTEND=OFF
274 + -DWITH_NUMA=$(usex numa)
275 + -DWITH_OPENLDAP=$(usex ldap)
276 + -DWITH_PYTHON3=3
277 + -DWITH_RADOSGW=$(usex radosgw)
278 + -DWITH_RADOSGW_AMQP_ENDPOINT=$(usex rabbitmq)
279 + -DWITH_RADOSGW_KAFKA_ENDPOINT=$(usex kafka)
280 + -DWITH_SSL=$(usex ssl)
281 + -DWITH_SYSTEMD=$(usex systemd)
282 + -DWITH_TESTS=$(usex test)
283 + -DWITH_XFS=$(usex xfs)
284 + -DWITH_ZFS=$(usex zfs)
285 + -DENABLE_SHARED="ON"
286 + -DALLOCATOR=$(usex tcmalloc 'tcmalloc' "$(usex jemalloc 'jemalloc' 'libc')")
287 + -DWITH_SYSTEM_BOOST=$(usex system-boost)
288 + -DBOOST_J=$(makeopts_jobs)
289 + -DWITH_SYSTEM_ROCKSDB=ON
290 + -DWITH_RDMA=OFF
291 + -DWITH_TBB=OFF
292 + -DSYSTEMD_UNITDIR=$(systemd_get_systemunitdir)
293 + -DCMAKE_INSTALL_SYSTEMD_SERVICEDIR=$(systemd_get_systemunitdir)
294 + -DEPYTHON_VERSION="${EPYTHON#python}"
295 + -DCMAKE_INSTALL_DOCDIR="${EPREFIX}/usr/share/doc/${PN}-${PVR}"
296 + -DCMAKE_INSTALL_SYSCONFDIR="${EPREFIX}/etc"
297 + -Wno-dev
298 + )
299 + if use amd64 || use x86; then
300 + for flag in ${CPU_FLAGS_X86[@]}; do
301 + mycmakeargs+=("$(usex cpu_flags_x86_${flag} "-DHAVE_INTEL_${flag^^}=1")")
302 + done
303 + fi
304 +
305 + # needed for >=glibc-2.32
306 + has_version '>=sys-libs/glibc-2.32' && mycmakeargs+=(-DWITH_REENTRANT_STRSIGNAL:BOOL=ON)
307 +
308 + rm -f "${BUILD_DIR:-${S}}/CMakeCache.txt" \
309 + || die "failed to remove cmake cache"
310 +
311 + cmake_src_configure
312 +
313 + # bug #630232
314 + sed -i "s:\"${T//:\\:}/${EPYTHON}/bin/python\":\"${PYTHON}\":" \
315 + "${BUILD_DIR:-${S}}"/include/acconfig.h \
316 + || die "sed failed"
317 +}
318 +
319 +src_configure() {
320 + use custom-cflags || strip-flags
321 + ceph_src_configure
322 +}
323 +
324 +python_compile() {
325 + local CMAKE_USE_DIR="${S}"
326 + ceph_src_configure
327 +
328 + pushd "${BUILD_DIR}/src/pybind" >/dev/null || die
329 + emake VERBOSE=1 clean
330 + emake VERBOSE=1 all
331 +
332 + # python modules are only compiled with "make install" so we need to do this to
333 + # prevent doing a bunch of compilation in src_install
334 + DESTDIR="${T}" emake VERBOSE=1 install
335 + popd >/dev/null || die
336 +}
337 +
338 +src_compile() {
339 + cmake_build VERBOSE=1 all
340 +
341 + # we have to do this here to prevent from building everything multiple times
342 + python_copy_sources
343 + python_foreach_impl python_compile
344 +}
345 +
346 +src_test() {
347 + make check || die "make check failed"
348 +}
349 +
350 +python_install() {
351 + local CMAKE_USE_DIR="${S}"
352 + pushd "${BUILD_DIR}/src/pybind" >/dev/null || die
353 + DESTDIR="${ED}" emake VERBOSE=1 install
354 + popd >/dev/null || die
355 +
356 + python_optimize
357 +}
358 +
359 +src_install() {
360 + cmake_src_install
361 + python_foreach_impl python_install
362 +
363 + find "${ED}" -name '*.la' -type f -delete || die
364 +
365 + exeinto /usr/$(get_libdir)/ceph
366 + newexe "${BUILD_DIR}/bin/init-ceph" init-ceph
367 +
368 + insinto /etc/logrotate.d/
369 + newins "${FILESDIR}"/ceph.logrotate-r2 ${PN}
370 +
371 + keepdir /var/lib/${PN}{,/tmp} /var/log/${PN}/stat
372 +
373 + fowners -R ceph:ceph /var/log/ceph
374 +
375 + newinitd "${FILESDIR}/rbdmap.initd" rbdmap
376 + newinitd "${FILESDIR}/${PN}.initd-r12" ${PN}
377 + newconfd "${FILESDIR}/${PN}.confd-r5" ${PN}
378 +
379 + insinto /etc/sysctl.d
380 + newins "${FILESDIR}"/sysctld 90-${PN}.conf
381 +
382 + use tcmalloc && newenvd "${FILESDIR}"/envd-tcmalloc 99${PN}-tcmalloc
383 +
384 + # units aren't installed by the build system unless systemd is enabled
385 + # so no point installing these with the USE flag disabled
386 + if use systemd; then
387 + systemd_install_serviced "${FILESDIR}/ceph-mds_at.service.conf" \
388 + "ceph-mds@.service"
389 +
390 + systemd_install_serviced "${FILESDIR}/ceph-osd_at.service.conf" \
391 + "ceph-osd@.service"
392 +
393 + fi
394 +
395 + udev_dorules udev/*.rules
396 + newtmpfiles "${FILESDIR}"/ceph-tmpfilesd ${PN}.conf
397 +
398 + readme.gentoo_create_doc
399 +
400 + python_setup
401 +
402 + # bug #630232
403 + sed -i -r "s:${T//:/\\:}/${EPYTHON}:/usr:" "${ED}"/usr/bin/ceph{,-crash} \
404 + || die "sed failed"
405 +
406 + python_fix_shebang "${ED}"/usr/{,s}bin/
407 +
408 + # python_fix_shebang apparently is not idempotent
409 + local shebang_regex='(/usr/lib/python-exec/python[0-9]\.[0-9]/python)[0-9]\.[0-9]'
410 + grep -r -E -l --null "${shebang_regex}" "${ED}"/usr/{s,}bin/ \
411 + | xargs --null --no-run-if-empty -- sed -i -r "s:${shebang_regex}:\1:" || die
412 +
413 + local -a rados_classes=( "${ED}/usr/$(get_libdir)/rados-classes"/* )
414 + dostrip -x "${rados_classes[@]#${ED}}"
415 +}
416 +
417 +pkg_postinst() {
418 + readme.gentoo_print_elog
419 +}