Gentoo Archives: gentoo-commits

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