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/, sys-cluster/ceph/files/
Date: Wed, 12 Apr 2017 20:44:40
Message-Id: 1492029856.17519e6e45d0244df45ce7494b50fa1477a0f541.chutzpah@gentoo
1 commit: 17519e6e45d0244df45ce7494b50fa1477a0f541
2 Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 12 20:42:55 2017 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 12 20:44:16 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=17519e6e
7
8 sys-cluster/ceph: Revision bump, add patch from bug 601610, fix automagic deps
9
10 This adds a dep on zstd to fix the automagic dep, and drops keywords for
11 arm, ppc and ppc64 since zstd is not keyworded on those arches.
12
13 Package-Manager: Portage-2.3.5, Repoman-2.3.2
14
15 sys-cluster/ceph/ceph-10.2.7-r1.ebuild | 295 +++++++++++++++++++++
16 .../ceph-10.2.7-fix-compilation-with-zstd.patch | 49 ++++
17 2 files changed, 344 insertions(+)
18
19 diff --git a/sys-cluster/ceph/ceph-10.2.7-r1.ebuild b/sys-cluster/ceph/ceph-10.2.7-r1.ebuild
20 new file mode 100644
21 index 00000000000..87d36ae0852
22 --- /dev/null
23 +++ b/sys-cluster/ceph/ceph-10.2.7-r1.ebuild
24 @@ -0,0 +1,295 @@
25 +# Copyright 1999-2017 Gentoo Foundation
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=6
29 +PYTHON_COMPAT=( python{2_7,3_{4,5,6}} )
30 +
31 +inherit check-reqs autotools eutils python-r1 udev user \
32 + readme.gentoo-r1 systemd versionator flag-o-matic
33 +
34 +if [[ ${PV} == *9999* ]]; then
35 + inherit git-r3
36 + EGIT_REPO_URI="
37 + git://github.com/ceph/ceph.git
38 + https://github.com/ceph/ceph.git"
39 + SRC_URI=""
40 +else
41 + SRC_URI="http://download.ceph.com/tarballs/${P}.tar.gz"
42 + KEYWORDS="~amd64 ~x86"
43 +fi
44 +
45 +DESCRIPTION="Ceph distributed filesystem"
46 +HOMEPAGE="http://ceph.com/"
47 +
48 +LICENSE="LGPL-2.1"
49 +SLOT="0"
50 +
51 +IUSE="babeltrace cephfs cryptopp debug fuse gtk jemalloc ldap +libaio"
52 +IUSE+=" libatomic lttng +nss +radosgw static-libs +tcmalloc test xfs zfs"
53 +
54 +# unbundling code commented out pending bugs 584056 and 584058
55 +#>=dev-libs/jerasure-2.0.0-r1
56 +#>=dev-libs/gf-complete-2.0.0
57 +COMMON_DEPEND="
58 + app-arch/snappy:=
59 + sys-libs/zlib:=
60 + app-arch/lz4:=
61 + app-arch/bzip2:=
62 + app-arch/zstd:=
63 + dev-libs/boost:=[threads]
64 + dev-libs/libaio:=
65 + dev-libs/leveldb:=[snappy]
66 + nss? ( dev-libs/nss:= )
67 + libatomic? ( dev-libs/libatomic_ops:= )
68 + cryptopp? ( dev-libs/crypto++:= )
69 + sys-apps/keyutils
70 + sys-apps/util-linux
71 + dev-libs/libxml2:=
72 + radosgw? ( dev-libs/fcgi:= )
73 + ldap? ( net-nds/openldap:= )
74 + babeltrace? ( dev-util/babeltrace )
75 + fuse? ( sys-fs/fuse:= )
76 + xfs? ( sys-fs/xfsprogs:= )
77 + zfs? ( sys-fs/zfs:= )
78 + gtk? (
79 + x11-libs/gtk+:2=
80 + dev-cpp/gtkmm:2.4
81 + gnome-base/librsvg:=
82 + )
83 + radosgw? (
84 + dev-libs/fcgi:=
85 + dev-libs/expat:=
86 + net-misc/curl:=
87 + )
88 + jemalloc? ( dev-libs/jemalloc:= )
89 + !jemalloc? ( dev-util/google-perftools )
90 + lttng? ( dev-util/lttng-ust:= )
91 + ${PYTHON_DEPS}
92 + "
93 +DEPEND="${COMMON_DEPEND}
94 + dev-python/cython[${PYTHON_USEDEP}]
95 + app-arch/cpio
96 + virtual/pkgconfig
97 + dev-python/sphinx
98 + test? (
99 + sys-fs/btrfs-progs
100 + sys-apps/grep[pcre]
101 + dev-python/tox[${PYTHON_USEDEP}]
102 + dev-python/virtualenv[${PYTHON_USEDEP}]
103 + )"
104 +RDEPEND="${COMMON_DEPEND}
105 + sys-apps/hdparm
106 + sys-block/parted
107 + sys-fs/cryptsetup
108 + sys-apps/gptfdisk
109 + dev-python/flask[${PYTHON_USEDEP}]
110 + dev-python/requests[${PYTHON_USEDEP}]
111 + "
112 +REQUIRED_USE="
113 + $(python_gen_useflags 'python2*')
114 + ${PYTHON_REQUIRED_USE}
115 + ^^ ( nss cryptopp )
116 + ?? ( jemalloc tcmalloc )
117 + "
118 +
119 +# work around bug in ceph compilation (rgw/ceph_dencoder-rgw_dencoder.o... undefined reference to `vtable for RGWZoneGroup')
120 +REQUIRED_USE+=" radosgw"
121 +
122 +#RESTRICT="test? ( userpriv )"
123 +
124 +# distribution tarball does not include everything needed for tests
125 +RESTRICT+=" test"
126 +
127 +STRIP_MASK="/usr/lib*/rados-classes/*"
128 +
129 +UNBUNDLE_LIBS=(
130 + src/erasure-code/jerasure/jerasure
131 + src/erasure-code/jerasure/gf-complete
132 +)
133 +
134 +PATCHES=(
135 + "${FILESDIR}/ceph-10.2.0-dont-use-virtualenvs.patch"
136 + #"${FILESDIR}/ceph-10.2.1-unbundle-jerasure.patch"
137 + "${FILESDIR}/${PN}-10.2.1-libzfs.patch"
138 + "${FILESDIR}/${PN}-10.2.3-build-without-openldap.patch"
139 + "${FILESDIR}/${PN}-10.2.5-Make-RBD-Python-bindings-compatible-with-Python-3.patch"
140 + "${FILESDIR}/${PN}-10.2.5-Make-CephFS-bindings-and-tests-compatible-with-Python-3.patch"
141 + "${FILESDIR}/${PN}-10.2.7-fix-compilation-with-zstd.patch"
142 +)
143 +
144 +check-reqs_export_vars() {
145 + if use debug; then
146 + CHECKREQS_DISK_BUILD="23G"
147 + CHECKREQS_DISK_USR="7G"
148 + elif use amd64; then
149 + CHECKREQS_DISK_BUILD="12G"
150 + CHECKREQS_DISK_USR="450M"
151 + else
152 + CHECKREQS_DISK_BUILD="1400M"
153 + CHECKREQS_DISK_USR="450M"
154 + fi
155 +
156 + export CHECKREQS_DISK_BUILD CHECKREQS_DISK_USR
157 +}
158 +
159 +user_setup() {
160 + enewgroup ceph ${CEPH_GID}
161 + enewuser ceph "${CEPH_UID:--1}" -1 /var/lib/ceph ceph
162 +}
163 +
164 +emake_python_bindings() {
165 + local action="${1}" params binding module
166 + shift
167 + params=("${@}")
168 +
169 + __emake_python_bindings_do_impl() {
170 + ceph_run_econf "${EPYTHON}"
171 + emake "${params[@]}" PYTHON="${EPYTHON}" "${binding}-pybind-${action}"
172 +
173 + # these don't work and aren't needed on python3
174 + if [[ ${EBUILD_PHASE} == install ]]; then
175 + for module in "${S}"/src/pybind/*.py; do
176 + module_basename="$(basename "${module}")"
177 + if [[ ${module_basename} == ceph_volume_client.py ]] && ! use cephfs; then
178 + continue
179 + elif [[ ! -e "${ED}/$(python_get_sitedir)/${module_basename}" ]]; then
180 + python_domodule ${module}
181 + fi
182 + done
183 + fi
184 + }
185 +
186 + pushd "${S}/src"
187 + for binding in rados rbd $(use cephfs && echo cephfs); do
188 + python_foreach_impl __emake_python_bindings_do_impl
189 + done
190 + popd
191 +
192 + unset __emake_python_bindings_do_impl
193 +}
194 +
195 +pkg_pretend() {
196 + check-reqs_export_vars
197 + check-reqs_pkg_pretend
198 +}
199 +
200 +pkg_setup() {
201 + python_setup
202 + check-reqs_export_vars
203 + check-reqs_pkg_setup
204 + user_setup
205 +}
206 +
207 +src_prepare() {
208 + default
209 +
210 + # remove tests that need root access
211 + rm src/test/cli/ceph-authtool/cap*.t
212 +
213 + #rm -rf "${UNBUNDLE_LIBS[@]}"
214 +
215 + append-flags -fPIC
216 + eautoreconf
217 +}
218 +
219 +src_configure() {
220 + ECONFARGS=(
221 + --without-hadoop
222 + --includedir=/usr/include
223 + $(use_with cephfs)
224 + $(use_with debug)
225 + $(use_with fuse)
226 + $(use_with libaio)
227 + $(use_with libatomic libatomic-ops)
228 + $(use_with nss)
229 + $(use_with cryptopp)
230 + $(use_with radosgw)
231 + $(use_with gtk gtk2)
232 + $(use_enable static-libs static)
233 + $(use_with jemalloc)
234 + $(use_with xfs libxfs)
235 + $(use_with zfs libzfs)
236 + $(use_with lttng )
237 + $(use_with babeltrace)
238 + $(use_with ldap openldap)
239 + $(use jemalloc || usex tcmalloc " --with-tcmalloc" " --with-tcmalloc-minimal")
240 + --with-mon
241 + --with-eventfd
242 + --with-cython
243 + --without-kinetic
244 + --without-librocksdb
245 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
246 + )
247 +
248 + # we can only use python2.7 for building at the moment
249 + ceph_run_econf "python2*"
250 +}
251 +
252 +ceph_run_econf() {
253 + [[ -z ${ECONFARGS} ]] && die "called ${FUNCNAME[0]} with ECONFARGS unset"
254 + [[ -z ${1} ]] && die "called ${FUNCNAME[0]} without passing python implementation"
255 +
256 + pushd "${S}" >/dev/null || die
257 + #
258 + # This generates a QA warning about running econf in src_compile
259 + # and src_install. Unfortunately the only other way to do this would
260 + # involve building all of for each python implementation times, which
261 + # wastes a _lot_ of CPU time and disk space. This hack will no longer
262 + # be needed with >=ceph-11.2.
263 + #
264 + python_setup "${1}"
265 + econf "${ECONFARGS[@]}"
266 +
267 + popd >/dev/null || die
268 +}
269 +
270 +src_compile() {
271 + emake
272 + emake_python_bindings all
273 +
274 + use test && emake check-local
275 +}
276 +
277 +src_test() {
278 + make check || die "make check failed"
279 +}
280 +
281 +src_install() {
282 + default
283 + emake_python_bindings install-exec "DESTDIR=\"${D}\""
284 +
285 + prune_libtool_files --all
286 +
287 + exeinto /usr/$(get_libdir)/ceph
288 + newexe src/init-ceph ceph_init.sh
289 +
290 + insinto /etc/logrotate.d/
291 + newins "${FILESDIR}"/ceph.logrotate ${PN}
292 +
293 + keepdir /var/lib/${PN}{,/tmp} /var/log/${PN}/stat
294 +
295 + fowners -R ceph:ceph /var/lib/ceph /var/log/ceph
296 +
297 + newinitd "${FILESDIR}/rbdmap.initd" rbdmap
298 + newinitd "${FILESDIR}/${PN}.initd-r4" ${PN}
299 + newconfd "${FILESDIR}/${PN}.confd-r2" ${PN}
300 +
301 + systemd_install_serviced "${FILESDIR}/ceph-mds_at.service.conf" "ceph-mds@.service"
302 + systemd_install_serviced "${FILESDIR}/ceph-osd_at.service.conf" "ceph-osd@.service"
303 + systemd_install_serviced "${FILESDIR}/ceph-mon_at.service.conf" "ceph-mon@.service"
304 +
305 + udev_dorules udev/*.rules
306 +
307 + readme.gentoo_create_doc
308 +
309 + python_setup 'python2*'
310 + python_fix_shebang "${ED}"/usr/{,s}bin/
311 +
312 + # python_fix_shebang apparently is not idempotent
313 + sed -i -r 's:(/usr/lib/python-exec/python[0-9]\.[0-9]/python)[0-9]\.[0-9]:\1:' \
314 + "${ED}"/usr/{sbin/ceph-disk,bin/ceph-detect-init} || die "sed failed"
315 +}
316 +
317 +pkg_postinst() {
318 + readme.gentoo_print_elog
319 +}
320
321 diff --git a/sys-cluster/ceph/files/ceph-10.2.7-fix-compilation-with-zstd.patch b/sys-cluster/ceph/files/ceph-10.2.7-fix-compilation-with-zstd.patch
322 new file mode 100644
323 index 00000000000..4e76deabe65
324 --- /dev/null
325 +++ b/sys-cluster/ceph/files/ceph-10.2.7-fix-compilation-with-zstd.patch
326 @@ -0,0 +1,49 @@
327 +From 5a11f31aac4fa6a5c5ebb4fa0964e1c07a420e8c Mon Sep 17 00:00:00 2001
328 +From: Zac Medico <zmedico@g.o>
329 +Date: Wed, 12 Apr 2017 01:49:09 -0700
330 +Subject: [PATCH] configure: link against zstd if detected
331 +
332 +https://bugs.gentoo.org/show_bug.cgi?id=601610
333 +---
334 + configure.ac | 6 ++++--
335 + src/Makefile-env.am | 3 +++
336 + 2 files changed, 7 insertions(+), 2 deletions(-)
337 +
338 +diff --git a/configure.ac b/configure.ac
339 +index 51daf91..8914b71 100644
340 +--- a/configure.ac
341 ++++ b/configure.ac
342 +@@ -851,12 +851,14 @@ AS_IF([test "x$with_librocksdb_static" = "xyes"],
343 + AM_CONDITIONAL(WITH_SLIBROCKSDB, [ test "x$with_librocksdb_static" = "xyes" ])
344 + AM_CONDITIONAL(WITH_LIBROCKSDB, [ test "x$with_librocksdb_static" = "xyes" -o "x$with_librocksdb" = "xyes" ])
345 +
346 +-# rocksdb detects bzlib and lz4 in its Makefile, which forces us to do the same.
347 ++# rocksdb detects headers in its Makefile, which forces us to do the same.
348 + AS_IF([test "x$with_librocksdb_static" = "xyes"], [
349 + AC_CHECK_HEADER([bzlib.h], [have_bzlib=yes])
350 +- AC_CHECK_HEADER([lz4.h], [have_lz4=yes])])
351 ++ AC_CHECK_HEADER([lz4.h], [have_lz4=yes])]
352 ++ AC_CHECK_HEADER([zstd.h], [have_zstd=yes])])
353 + AM_CONDITIONAL(HAVE_BZLIB, [test "x$have_bzlib" = "xyes"])
354 + AM_CONDITIONAL(HAVE_LZ4, [test "x$have_lz4" = "xyes"])
355 ++AM_CONDITIONAL(HAVE_ZSTD, [test "x$have_zstd" = "xyes"])
356 +
357 + # needs libcurl and libxml2
358 + if test "x$with_rest_bench" = xyes && test "x$with_system_libs3" = xno; then
359 +diff --git a/src/Makefile-env.am b/src/Makefile-env.am
360 +index 4771bad..0ee42f8 100644
361 +--- a/src/Makefile-env.am
362 ++++ b/src/Makefile-env.am
363 +@@ -280,6 +280,9 @@ endif
364 + if HAVE_LZ4
365 + LIBKV += -llz4
366 + endif
367 ++if HAVE_ZSTD
368 ++LIBKV += -lzstd
369 ++endif
370 + endif # WITH_SLIBROCKSDB
371 + LIBKV += -lz -lleveldb -lsnappy
372 + LIBOS += $(LIBOS_TYPES) $(LIBKV) $(LIBFUSE_LIBS)
373 +--
374 +2.10.2
375 +