1 |
commit: ddd6de576d3d0f0e992974e3f6064c48f2c31039 |
2 |
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Mar 2 00:37:34 2017 +0000 |
4 |
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Mar 2 00:38:06 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ddd6de57 |
7 |
|
8 |
sys-cluster/ceph: Revision bump, pull in some python3 patches from upstream |
9 |
|
10 |
Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
11 |
|
12 |
sys-cluster/ceph/ceph-10.2.5-r4.ebuild | 293 +++++++++++++++++++++ |
13 |
...ndings-and-tests-compatible-with-Python-3.patch | 22 ++ |
14 |
...-Python-bindings-compatible-with-Python-3.patch | 45 ++++ |
15 |
3 files changed, 360 insertions(+) |
16 |
|
17 |
diff --git a/sys-cluster/ceph/ceph-10.2.5-r4.ebuild b/sys-cluster/ceph/ceph-10.2.5-r4.ebuild |
18 |
new file mode 100644 |
19 |
index 00000000000..2cac94d409d |
20 |
--- /dev/null |
21 |
+++ b/sys-cluster/ceph/ceph-10.2.5-r4.ebuild |
22 |
@@ -0,0 +1,293 @@ |
23 |
+# Copyright 1999-2017 Gentoo Foundation |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+ |
26 |
+EAPI=6 |
27 |
+PYTHON_COMPAT=( python{2_7,3_{4,5,6}} ) |
28 |
+ |
29 |
+inherit check-reqs autotools eutils python-r1 udev user \ |
30 |
+ readme.gentoo-r1 systemd versionator flag-o-matic |
31 |
+ |
32 |
+if [[ ${PV} == *9999* ]]; then |
33 |
+ inherit git-r3 |
34 |
+ EGIT_REPO_URI=" |
35 |
+ git://github.com/ceph/ceph.git |
36 |
+ https://github.com/ceph/ceph.git" |
37 |
+ SRC_URI="" |
38 |
+else |
39 |
+ SRC_URI="http://ceph.com/download/${P}.tar.gz" |
40 |
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" |
41 |
+fi |
42 |
+ |
43 |
+DESCRIPTION="Ceph distributed filesystem" |
44 |
+HOMEPAGE="http://ceph.com/" |
45 |
+ |
46 |
+LICENSE="LGPL-2.1" |
47 |
+SLOT="0" |
48 |
+ |
49 |
+IUSE="babeltrace cephfs cryptopp debug fuse gtk jemalloc ldap +libaio" |
50 |
+IUSE+=" libatomic lttng +nss +radosgw static-libs +tcmalloc test xfs zfs" |
51 |
+ |
52 |
+# unbundling code commented out pending bugs 584056 and 584058 |
53 |
+#>=dev-libs/jerasure-2.0.0-r1 |
54 |
+#>=dev-libs/gf-complete-2.0.0 |
55 |
+COMMON_DEPEND=" |
56 |
+ app-arch/snappy |
57 |
+ app-arch/lz4:= |
58 |
+ app-arch/bzip2 |
59 |
+ dev-libs/boost:=[threads] |
60 |
+ dev-libs/libaio |
61 |
+ dev-libs/leveldb[snappy] |
62 |
+ nss? ( dev-libs/nss ) |
63 |
+ libatomic? ( dev-libs/libatomic_ops ) |
64 |
+ cryptopp? ( dev-libs/crypto++:= ) |
65 |
+ sys-apps/keyutils |
66 |
+ sys-apps/util-linux |
67 |
+ dev-libs/libxml2 |
68 |
+ radosgw? ( dev-libs/fcgi ) |
69 |
+ ldap? ( net-nds/openldap ) |
70 |
+ babeltrace? ( dev-util/babeltrace ) |
71 |
+ fuse? ( sys-fs/fuse ) |
72 |
+ xfs? ( sys-fs/xfsprogs ) |
73 |
+ zfs? ( sys-fs/zfs ) |
74 |
+ gtk? ( |
75 |
+ x11-libs/gtk+:2 |
76 |
+ dev-cpp/gtkmm:2.4 |
77 |
+ gnome-base/librsvg |
78 |
+ ) |
79 |
+ radosgw? ( |
80 |
+ dev-libs/fcgi |
81 |
+ dev-libs/expat |
82 |
+ net-misc/curl |
83 |
+ ) |
84 |
+ jemalloc? ( dev-libs/jemalloc ) |
85 |
+ !jemalloc? ( dev-util/google-perftools ) |
86 |
+ lttng? ( dev-util/lttng-ust ) |
87 |
+ ${PYTHON_DEPS} |
88 |
+ " |
89 |
+DEPEND="${COMMON_DEPEND} |
90 |
+ dev-python/cython[${PYTHON_USEDEP}] |
91 |
+ app-arch/cpio |
92 |
+ sys-apps/lsb-release |
93 |
+ virtual/pkgconfig |
94 |
+ dev-python/sphinx |
95 |
+ test? ( |
96 |
+ sys-fs/btrfs-progs |
97 |
+ sys-apps/grep[pcre] |
98 |
+ dev-python/tox[${PYTHON_USEDEP}] |
99 |
+ dev-python/virtualenv[${PYTHON_USEDEP}] |
100 |
+ )" |
101 |
+RDEPEND="${COMMON_DEPEND} |
102 |
+ sys-apps/hdparm |
103 |
+ sys-block/parted |
104 |
+ sys-fs/cryptsetup |
105 |
+ sys-apps/gptfdisk |
106 |
+ dev-python/flask[${PYTHON_USEDEP}] |
107 |
+ dev-python/requests[${PYTHON_USEDEP}] |
108 |
+ " |
109 |
+REQUIRED_USE=" |
110 |
+ $(python_gen_useflags 'python2*') |
111 |
+ ${PYTHON_REQUIRED_USE} |
112 |
+ ^^ ( nss cryptopp ) |
113 |
+ ?? ( jemalloc tcmalloc ) |
114 |
+ " |
115 |
+ |
116 |
+# work around bug in ceph compilation (rgw/ceph_dencoder-rgw_dencoder.o... undefined reference to `vtable for RGWZoneGroup') |
117 |
+REQUIRED_USE+=" radosgw" |
118 |
+ |
119 |
+RESTRICT="test? ( userpriv )" |
120 |
+ |
121 |
+# distribution tarball does not include everything needed for tests |
122 |
+RESTRICT+=" test" |
123 |
+ |
124 |
+STRIP_MASK="/usr/lib*/rados-classes/*" |
125 |
+ |
126 |
+UNBUNDLE_LIBS=( |
127 |
+ src/erasure-code/jerasure/jerasure |
128 |
+ src/erasure-code/jerasure/gf-complete |
129 |
+) |
130 |
+ |
131 |
+PATCHES=( |
132 |
+ "${FILESDIR}/ceph-10.2.0-dont-use-virtualenvs.patch" |
133 |
+ #"${FILESDIR}/ceph-10.2.1-unbundle-jerasure.patch" |
134 |
+ "${FILESDIR}/${PN}-10.2.1-libzfs.patch" |
135 |
+ "${FILESDIR}/${PN}-10.2.3-build-without-openldap.patch" |
136 |
+ "${FILESDIR}/${PN}-10.2.5-Make-RBD-Python-bindings-compatible-with-Python-3.patch" |
137 |
+ "${FILESDIR}/${PN}-10.2.5-Make-CephFS-bindings-and-tests-compatible-with-Python-3.patch" |
138 |
+) |
139 |
+ |
140 |
+check-reqs_export_vars() { |
141 |
+ if use debug; then |
142 |
+ CHECKREQS_DISK_BUILD="23G" |
143 |
+ CHECKREQS_DISK_USR="7G" |
144 |
+ elif use amd64; then |
145 |
+ CHECKREQS_DISK_BUILD="12G" |
146 |
+ CHECKREQS_DISK_USR="450M" |
147 |
+ else |
148 |
+ CHECKREQS_DISK_BUILD="1400M" |
149 |
+ CHECKREQS_DISK_USR="450M" |
150 |
+ fi |
151 |
+ |
152 |
+ export CHECKREQS_DISK_BUILD CHECKREQS_DISK_USR |
153 |
+} |
154 |
+ |
155 |
+user_setup() { |
156 |
+ enewgroup ceph ${CEPH_GID} |
157 |
+ enewuser ceph "${CEPH_UID:--1}" -1 /var/lib/ceph ceph |
158 |
+} |
159 |
+ |
160 |
+emake_python_bindings() { |
161 |
+ local action="${1}" params binding module |
162 |
+ shift |
163 |
+ params=("${@}") |
164 |
+ |
165 |
+ __emake_python_bindings_do_impl() { |
166 |
+ ceph_run_econf "${EPYTHON}" |
167 |
+ emake "${params[@]}" PYTHON="${EPYTHON}" "${binding}-pybind-${action}" |
168 |
+ |
169 |
+ # these don't work and aren't needed on python3 |
170 |
+ if [[ ${EBUILD_PHASE} == install ]]; then |
171 |
+ for module in "${S}"/src/pybind/*.py; do |
172 |
+ module_basename="$(basename "${module}")" |
173 |
+ if [[ ${module_basename} == ceph_volume_client.py ]] && ! use cephfs; then |
174 |
+ continue |
175 |
+ elif [[ ! -e "${ED}/$(python_get_sitedir)/${module_basename}" ]]; then |
176 |
+ python_domodule ${module} |
177 |
+ fi |
178 |
+ done |
179 |
+ fi |
180 |
+ } |
181 |
+ |
182 |
+ pushd "${S}/src" |
183 |
+ for binding in rados rbd $(use cephfs && echo cephfs); do |
184 |
+ python_foreach_impl __emake_python_bindings_do_impl |
185 |
+ done |
186 |
+ popd |
187 |
+ |
188 |
+ unset __emake_python_bindings_do_impl |
189 |
+} |
190 |
+ |
191 |
+pkg_pretend() { |
192 |
+ check-reqs_export_vars |
193 |
+ check-reqs_pkg_pretend |
194 |
+} |
195 |
+ |
196 |
+pkg_setup() { |
197 |
+ python_setup |
198 |
+ check-reqs_export_vars |
199 |
+ check-reqs_pkg_setup |
200 |
+ user_setup |
201 |
+} |
202 |
+ |
203 |
+src_prepare() { |
204 |
+ default |
205 |
+ |
206 |
+ # remove tests that need root access |
207 |
+ rm src/test/cli/ceph-authtool/cap*.t |
208 |
+ |
209 |
+ #rm -rf "${UNBUNDLE_LIBS[@]}" |
210 |
+ |
211 |
+ append-flags -fPIC |
212 |
+ eautoreconf |
213 |
+} |
214 |
+ |
215 |
+src_configure() { |
216 |
+ ECONFARGS=( |
217 |
+ --without-hadoop |
218 |
+ --includedir=/usr/include |
219 |
+ $(use_with cephfs) |
220 |
+ $(use_with debug) |
221 |
+ $(use_with fuse) |
222 |
+ $(use_with libaio) |
223 |
+ $(use_with libatomic libatomic-ops) |
224 |
+ $(use_with nss) |
225 |
+ $(use_with cryptopp) |
226 |
+ $(use_with radosgw) |
227 |
+ $(use_with gtk gtk2) |
228 |
+ $(use_enable static-libs static) |
229 |
+ $(use_with jemalloc) |
230 |
+ $(use_with xfs libxfs) |
231 |
+ $(use_with zfs libzfs) |
232 |
+ $(use_with lttng ) |
233 |
+ $(use_with babeltrace) |
234 |
+ $(use_with ldap openldap) |
235 |
+ $(use jemalloc || usex tcmalloc " --with-tcmalloc" " --with-tcmalloc-minimal") |
236 |
+ --with-mon |
237 |
+ --with-eventfd |
238 |
+ --with-cython |
239 |
+ --without-kinetic |
240 |
+ --without-librocksdb |
241 |
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" |
242 |
+ ) |
243 |
+ |
244 |
+ # we can only use python2.7 for building at the moment |
245 |
+ ceph_run_econf "python2*" |
246 |
+} |
247 |
+ |
248 |
+ceph_run_econf() { |
249 |
+ [[ -z ${ECONFARGS} ]] && die "called ${FUNCNAME[0]} with ECONFARGS unset" |
250 |
+ [[ -z ${1} ]] && die "called ${FUNCNAME[0]} without passing python implementation" |
251 |
+ |
252 |
+ pushd "${S}" >/dev/null || die |
253 |
+ # |
254 |
+ # This generates a QA warning about running econf in src_compile |
255 |
+ # and src_install. Unfortunately the only other way to do this would |
256 |
+ # involve building all of for each python implementation times, which |
257 |
+ # wastes a _lot_ of CPU time and disk space. This hack will no longer |
258 |
+ # be needed with >=ceph-11.2. |
259 |
+ # |
260 |
+ python_setup "${1}" |
261 |
+ econf "${ECONFARGS[@]}" |
262 |
+ |
263 |
+ popd >/dev/null || die |
264 |
+} |
265 |
+ |
266 |
+src_compile() { |
267 |
+ emake |
268 |
+ emake_python_bindings all |
269 |
+ |
270 |
+ use test && emake check-local |
271 |
+} |
272 |
+ |
273 |
+src_test() { |
274 |
+ make check || die "make check failed" |
275 |
+} |
276 |
+ |
277 |
+src_install() { |
278 |
+ default |
279 |
+ emake_python_bindings install-exec "DESTDIR=\"${D}\"" |
280 |
+ |
281 |
+ prune_libtool_files --all |
282 |
+ |
283 |
+ exeinto /usr/$(get_libdir)/ceph |
284 |
+ newexe src/init-ceph ceph_init.sh |
285 |
+ |
286 |
+ insinto /etc/logrotate.d/ |
287 |
+ newins "${FILESDIR}"/ceph.logrotate ${PN} |
288 |
+ |
289 |
+ keepdir /var/lib/${PN}{,/tmp} /var/log/${PN}/stat |
290 |
+ |
291 |
+ fowners -R ceph:ceph /var/lib/ceph /var/log/ceph |
292 |
+ |
293 |
+ newinitd "${FILESDIR}/rbdmap.initd" rbdmap |
294 |
+ newinitd "${FILESDIR}/${PN}.initd-r3" ${PN} |
295 |
+ newconfd "${FILESDIR}/${PN}.confd-r1" ${PN} |
296 |
+ |
297 |
+ systemd_install_serviced "${FILESDIR}/ceph-mds_at.service.conf" "ceph-mds@.service" |
298 |
+ systemd_install_serviced "${FILESDIR}/ceph-osd_at.service.conf" "ceph-osd@.service" |
299 |
+ systemd_install_serviced "${FILESDIR}/ceph-mon_at.service.conf" "ceph-mon@.service" |
300 |
+ |
301 |
+ udev_dorules udev/*.rules |
302 |
+ |
303 |
+ readme.gentoo_create_doc |
304 |
+ |
305 |
+ python_setup 'python2*' |
306 |
+ python_fix_shebang "${ED}"/usr/{,s}bin/ |
307 |
+ |
308 |
+ # python_fix_shebang apparently is not idempotent |
309 |
+ sed -i -r 's:(/usr/lib/python-exec/python[0-9]\.[0-9]/python)[0-9]\.[0-9]:\1:' \ |
310 |
+ "${ED}"/usr/{sbin/ceph-disk,bin/ceph-detect-init} || die "sed failed" |
311 |
+} |
312 |
+ |
313 |
+pkg_postinst() { |
314 |
+ readme.gentoo_print_elog |
315 |
+} |
316 |
|
317 |
diff --git a/sys-cluster/ceph/files/ceph-10.2.5-Make-CephFS-bindings-and-tests-compatible-with-Python-3.patch b/sys-cluster/ceph/files/ceph-10.2.5-Make-CephFS-bindings-and-tests-compatible-with-Python-3.patch |
318 |
new file mode 100644 |
319 |
index 00000000000..08a7920035a |
320 |
--- /dev/null |
321 |
+++ b/sys-cluster/ceph/files/ceph-10.2.5-Make-CephFS-bindings-and-tests-compatible-with-Python-3.patch |
322 |
@@ -0,0 +1,22 @@ |
323 |
+commit e1dc386f93eb4613dc7e89cc76a031aeee5022ba |
324 |
+Author: Oleh Prypin <oleh@××××.in> |
325 |
+Date: Thu Jul 21 18:33:25 2016 +0300 |
326 |
+ |
327 |
+ pybind: Make CephFS bindings and tests compatible with Python 3 |
328 |
+ |
329 |
+ Signed-off-by: Oleh Prypin <oleh@××××.in> |
330 |
+ |
331 |
+diff --git a/src/pybind/cephfs/cephfs.pyx b/src/pybind/cephfs/cephfs.pyx |
332 |
+index ac17ada1a1..bd14de3b16 100644 |
333 |
+--- a/src/pybind/cephfs/cephfs.pyx |
334 |
++++ b/src/pybind/cephfs/cephfs.pyx |
335 |
+@@ -613,8 +613,7 @@ cdef class LibCephFS(object): |
336 |
+ |
337 |
+ if not isinstance(mode, int): |
338 |
+ raise TypeError('mode must be an int') |
339 |
+- if isinstance(flags, basestring): |
340 |
+- flags = cstr(flags, 'flags') |
341 |
++ if isinstance(flags, str_type): |
342 |
+ cephfs_flags = 0 |
343 |
+ if flags == '': |
344 |
+ cephfs_flags = os.O_RDONLY |
345 |
|
346 |
diff --git a/sys-cluster/ceph/files/ceph-10.2.5-Make-RBD-Python-bindings-compatible-with-Python-3.patch b/sys-cluster/ceph/files/ceph-10.2.5-Make-RBD-Python-bindings-compatible-with-Python-3.patch |
347 |
new file mode 100644 |
348 |
index 00000000000..a81aae6e7ce |
349 |
--- /dev/null |
350 |
+++ b/sys-cluster/ceph/files/ceph-10.2.5-Make-RBD-Python-bindings-compatible-with-Python-3.patch |
351 |
@@ -0,0 +1,45 @@ |
352 |
+commit 773e01294da518c6ec18f0a8b72e05def85fef6c |
353 |
+Author: Oleh Prypin <oleh@××××.in> |
354 |
+Date: Fri Jun 24 15:48:57 2016 +0300 |
355 |
+ |
356 |
+ pybind: Make RBD Python bindings compatible with Python 3 |
357 |
+ |
358 |
+ Signed-off-by: Oleh Prypin <oleh@××××.in> |
359 |
+ |
360 |
+diff --git a/src/pybind/rbd/rbd.pyx b/src/pybind/rbd/rbd.pyx |
361 |
+index 52727bf39e..8f25dfbee0 100644 |
362 |
+--- a/src/pybind/rbd/rbd.pyx |
363 |
++++ b/src/pybind/rbd/rbd.pyx |
364 |
+@@ -745,7 +745,7 @@ class RBD(object): |
365 |
+ break |
366 |
+ elif ret != -errno.ERANGE: |
367 |
+ raise make_ex(ret, 'error listing images') |
368 |
+- return [decode_cstr(name) for name in c_names[:ret].split('\0') |
369 |
++ return [decode_cstr(name) for name in c_names[:ret].split(b'\0') |
370 |
+ if name] |
371 |
+ finally: |
372 |
+ free(c_names) |
373 |
+@@ -1885,8 +1885,8 @@ written." % (self.name, ret, length)) |
374 |
+ raise make_ex(ret, 'error listing images') |
375 |
+ if ret == 0: |
376 |
+ return [] |
377 |
+- pools = map(decode_cstr, c_pools[:pools_size - 1].split('\0')) |
378 |
+- images = map(decode_cstr, c_images[:images_size - 1].split('\0')) |
379 |
++ pools = map(decode_cstr, c_pools[:pools_size - 1].split(b'\0')) |
380 |
++ images = map(decode_cstr, c_images[:images_size - 1].split(b'\0')) |
381 |
+ return list(zip(pools, images)) |
382 |
+ finally: |
383 |
+ free(c_pools) |
384 |
+@@ -1933,9 +1933,9 @@ written." % (self.name, ret, length)) |
385 |
+ raise make_ex(ret, 'error listing images') |
386 |
+ if ret == 0: |
387 |
+ return [] |
388 |
+- clients = map(decode_cstr, c_clients[:clients_size - 1].split('\0')) |
389 |
+- cookies = map(decode_cstr, c_cookies[:cookies_size - 1].split('\0')) |
390 |
+- addrs = map(decode_cstr, c_addrs[:addrs_size - 1].split('\0')) |
391 |
++ clients = map(decode_cstr, c_clients[:clients_size - 1].split(b'\0')) |
392 |
++ cookies = map(decode_cstr, c_cookies[:cookies_size - 1].split(b'\0')) |
393 |
++ addrs = map(decode_cstr, c_addrs[:addrs_size - 1].split(b'\0')) |
394 |
+ return { |
395 |
+ 'tag' : decode_cstr(c_tag), |
396 |
+ 'exclusive' : exclusive == 1, |