1 |
commit: f3ed284557758a1d2e86ea8eea96a4ad4f49d514 |
2 |
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Feb 28 00:07:24 2017 +0000 |
4 |
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 28 00:13:08 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f3ed2845 |
7 |
|
8 |
sys-cluster/ceph: Revision bump, add fix to compile python bindings with proper flags |
9 |
|
10 |
Unfortunately this adds a QA warning about running econf in src_compile and |
11 |
src_install. Unfortunately the only other way to do this would involve |
12 |
building all of for each python implementation times, which wastes a |
13 |
_lot_ of CPU time and disk space. This hack will no longer be needed |
14 |
with >=ceph-11.2. |
15 |
|
16 |
Gentoo-Bug: 610780 |
17 |
|
18 |
Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
19 |
|
20 |
sys-cluster/ceph/ceph-10.2.5-r2.ebuild | 285 +++++++++++++++++++++++++++++++++ |
21 |
1 file changed, 285 insertions(+) |
22 |
|
23 |
diff --git a/sys-cluster/ceph/ceph-10.2.5-r2.ebuild b/sys-cluster/ceph/ceph-10.2.5-r2.ebuild |
24 |
new file mode 100644 |
25 |
index 0000000000..568216bfa4 |
26 |
--- /dev/null |
27 |
+++ b/sys-cluster/ceph/ceph-10.2.5-r2.ebuild |
28 |
@@ -0,0 +1,285 @@ |
29 |
+# Copyright 1999-2017 Gentoo Foundation |
30 |
+# Distributed under the terms of the GNU General Public License v2 |
31 |
+# $Id$ |
32 |
+ |
33 |
+EAPI=6 |
34 |
+PYTHON_COMPAT=( python{2_7,3_{4,5,6}} ) |
35 |
+ |
36 |
+inherit check-reqs autotools eutils python-r1 udev user \ |
37 |
+ readme.gentoo-r1 systemd versionator flag-o-matic |
38 |
+ |
39 |
+if [[ ${PV} == *9999* ]]; then |
40 |
+ inherit git-r3 |
41 |
+ EGIT_REPO_URI=" |
42 |
+ git://github.com/ceph/ceph.git |
43 |
+ https://github.com/ceph/ceph.git" |
44 |
+ SRC_URI="" |
45 |
+else |
46 |
+ SRC_URI="http://ceph.com/download/${P}.tar.gz" |
47 |
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" |
48 |
+fi |
49 |
+ |
50 |
+DESCRIPTION="Ceph distributed filesystem" |
51 |
+HOMEPAGE="http://ceph.com/" |
52 |
+ |
53 |
+LICENSE="LGPL-2.1" |
54 |
+SLOT="0" |
55 |
+ |
56 |
+IUSE="babeltrace cephfs cryptopp debug fuse gtk jemalloc ldap +libaio" |
57 |
+IUSE+=" libatomic lttng +nss +radosgw static-libs +tcmalloc test xfs zfs" |
58 |
+ |
59 |
+# unbundling code commented out pending bugs 584056 and 584058 |
60 |
+#>=dev-libs/jerasure-2.0.0-r1 |
61 |
+#>=dev-libs/gf-complete-2.0.0 |
62 |
+COMMON_DEPEND=" |
63 |
+ app-arch/snappy |
64 |
+ app-arch/lz4:= |
65 |
+ app-arch/bzip2 |
66 |
+ dev-libs/boost:=[threads] |
67 |
+ dev-libs/libaio |
68 |
+ dev-libs/leveldb[snappy] |
69 |
+ nss? ( dev-libs/nss ) |
70 |
+ libatomic? ( dev-libs/libatomic_ops ) |
71 |
+ cryptopp? ( dev-libs/crypto++:= ) |
72 |
+ sys-apps/keyutils |
73 |
+ sys-apps/util-linux |
74 |
+ dev-libs/libxml2 |
75 |
+ radosgw? ( dev-libs/fcgi ) |
76 |
+ ldap? ( net-nds/openldap ) |
77 |
+ babeltrace? ( dev-util/babeltrace ) |
78 |
+ fuse? ( sys-fs/fuse ) |
79 |
+ xfs? ( sys-fs/xfsprogs ) |
80 |
+ zfs? ( sys-fs/zfs ) |
81 |
+ gtk? ( |
82 |
+ x11-libs/gtk+:2 |
83 |
+ dev-cpp/gtkmm:2.4 |
84 |
+ gnome-base/librsvg |
85 |
+ ) |
86 |
+ radosgw? ( |
87 |
+ dev-libs/fcgi |
88 |
+ dev-libs/expat |
89 |
+ net-misc/curl |
90 |
+ ) |
91 |
+ jemalloc? ( dev-libs/jemalloc ) |
92 |
+ !jemalloc? ( dev-util/google-perftools ) |
93 |
+ lttng? ( dev-util/lttng-ust ) |
94 |
+ ${PYTHON_DEPS} |
95 |
+ " |
96 |
+DEPEND="${COMMON_DEPEND} |
97 |
+ dev-python/cython[${PYTHON_USEDEP}] |
98 |
+ app-arch/cpio |
99 |
+ sys-apps/lsb-release |
100 |
+ virtual/pkgconfig |
101 |
+ dev-python/sphinx |
102 |
+ test? ( |
103 |
+ sys-fs/btrfs-progs |
104 |
+ sys-apps/grep[pcre] |
105 |
+ dev-python/tox[${PYTHON_USEDEP}] |
106 |
+ dev-python/virtualenv[${PYTHON_USEDEP}] |
107 |
+ )" |
108 |
+RDEPEND="${COMMON_DEPEND} |
109 |
+ sys-apps/hdparm |
110 |
+ sys-block/parted |
111 |
+ sys-fs/cryptsetup |
112 |
+ sys-apps/gptfdisk |
113 |
+ dev-python/flask[${PYTHON_USEDEP}] |
114 |
+ dev-python/requests[${PYTHON_USEDEP}] |
115 |
+ " |
116 |
+REQUIRED_USE=" |
117 |
+ $(python_gen_useflags 'python2*') |
118 |
+ ${PYTHON_REQUIRED_USE} |
119 |
+ ^^ ( nss cryptopp ) |
120 |
+ ?? ( jemalloc tcmalloc ) |
121 |
+ " |
122 |
+ |
123 |
+# work around bug in ceph compilation (rgw/ceph_dencoder-rgw_dencoder.o... undefined reference to `vtable for RGWZoneGroup') |
124 |
+REQUIRED_USE+=" radosgw" |
125 |
+ |
126 |
+RESTRICT="test? ( userpriv )" |
127 |
+ |
128 |
+# distribution tarball does not include everything needed for tests |
129 |
+RESTRICT+=" test" |
130 |
+ |
131 |
+STRIP_MASK="/usr/lib*/rados-classes/*" |
132 |
+ |
133 |
+UNBUNDLE_LIBS=( |
134 |
+ src/erasure-code/jerasure/jerasure |
135 |
+ src/erasure-code/jerasure/gf-complete |
136 |
+) |
137 |
+ |
138 |
+PATCHES=( |
139 |
+ "${FILESDIR}/ceph-10.2.0-dont-use-virtualenvs.patch" |
140 |
+ #"${FILESDIR}/ceph-10.2.1-unbundle-jerasure.patch" |
141 |
+ "${FILESDIR}/${PN}-10.2.1-libzfs.patch" |
142 |
+ "${FILESDIR}/${PN}-10.2.3-build-without-openldap.patch" |
143 |
+) |
144 |
+ |
145 |
+check-reqs_export_vars() { |
146 |
+ if use debug; then |
147 |
+ CHECKREQS_DISK_BUILD="23G" |
148 |
+ CHECKREQS_DISK_USR="7G" |
149 |
+ elif use amd64; then |
150 |
+ CHECKREQS_DISK_BUILD="12G" |
151 |
+ CHECKREQS_DISK_USR="450M" |
152 |
+ else |
153 |
+ CHECKREQS_DISK_BUILD="1400M" |
154 |
+ CHECKREQS_DISK_USR="450M" |
155 |
+ fi |
156 |
+ |
157 |
+ export CHECKREQS_DISK_BUILD CHECKREQS_DISK_USR |
158 |
+} |
159 |
+ |
160 |
+user_setup() { |
161 |
+ enewgroup ceph ${CEPH_GID} |
162 |
+ enewuser ceph "${CEPH_UID:--1}" -1 /var/lib/ceph ceph |
163 |
+} |
164 |
+ |
165 |
+emake_python_bindings() { |
166 |
+ local action="${1}" params binding |
167 |
+ shift |
168 |
+ params=("${@}") |
169 |
+ |
170 |
+ __emake_python_bindings_do_impl() { |
171 |
+ ceph_run_econf "${EPYTHON}" |
172 |
+ emake "${params[@]}" PYTHON="${EPYTHON}" "${binding}-pybind-${action}" |
173 |
+ |
174 |
+ # these don't work and aren't needed on python3 |
175 |
+ if [[ ${EBUILD_PHASE} == install ]] && python_is_python3; then |
176 |
+ rm -f "${ED}/$(python_get_sitedir)"/ceph_{argparse,volume_client}.py |
177 |
+ fi |
178 |
+ } |
179 |
+ |
180 |
+ pushd "${S}/src" |
181 |
+ for binding in rados rbd $(use cephfs && echo cephfs); do |
182 |
+ python_foreach_impl __emake_python_bindings_do_impl |
183 |
+ done |
184 |
+ popd |
185 |
+ |
186 |
+ unset __emake_python_bindings_do_impl |
187 |
+} |
188 |
+ |
189 |
+pkg_pretend() { |
190 |
+ check-reqs_export_vars |
191 |
+ check-reqs_pkg_pretend |
192 |
+} |
193 |
+ |
194 |
+pkg_setup() { |
195 |
+ python_setup |
196 |
+ check-reqs_export_vars |
197 |
+ check-reqs_pkg_setup |
198 |
+ user_setup |
199 |
+} |
200 |
+ |
201 |
+src_prepare() { |
202 |
+ default |
203 |
+ |
204 |
+ # remove tests that need root access |
205 |
+ rm src/test/cli/ceph-authtool/cap*.t |
206 |
+ |
207 |
+ #rm -rf "${UNBUNDLE_LIBS[@]}" |
208 |
+ |
209 |
+ append-flags -fPIC |
210 |
+ eautoreconf |
211 |
+} |
212 |
+ |
213 |
+src_configure() { |
214 |
+ ECONFARGS=( |
215 |
+ --without-hadoop |
216 |
+ --includedir=/usr/include |
217 |
+ $(use_with cephfs) |
218 |
+ $(use_with debug) |
219 |
+ $(use_with fuse) |
220 |
+ $(use_with libaio) |
221 |
+ $(use_with libatomic libatomic-ops) |
222 |
+ $(use_with nss) |
223 |
+ $(use_with cryptopp) |
224 |
+ $(use_with radosgw) |
225 |
+ $(use_with gtk gtk2) |
226 |
+ $(use_enable static-libs static) |
227 |
+ $(use_with jemalloc) |
228 |
+ $(use_with xfs libxfs) |
229 |
+ $(use_with zfs libzfs) |
230 |
+ $(use_with lttng ) |
231 |
+ $(use_with babeltrace) |
232 |
+ $(use_with ldap openldap) |
233 |
+ $(use jemalloc || usex tcmalloc " --with-tcmalloc" " --with-tcmalloc-minimal") |
234 |
+ --with-mon |
235 |
+ --with-eventfd |
236 |
+ --with-cython |
237 |
+ --without-kinetic |
238 |
+ --without-librocksdb |
239 |
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" |
240 |
+ ) |
241 |
+ |
242 |
+ # we can only use python2.7 for building at the moment |
243 |
+ ceph_run_econf "python2*" |
244 |
+} |
245 |
+ |
246 |
+ceph_run_econf() { |
247 |
+ [[ -z ${ECONFARGS} ]] && die "called ${FUNCNAME[0]} with ECONFARGS unset" |
248 |
+ [[ -z ${1} ]] && die "called ${FUNCNAME[0]} without passing python implementation" |
249 |
+ |
250 |
+ pushd "${S}" >/dev/null || die |
251 |
+ # |
252 |
+ # This generates a QA warning about running econf in src_compile |
253 |
+ # and src_install. Unfortunately the only other way to do this would |
254 |
+ # involve building all of for each python implementation times, which |
255 |
+ # wastes a _lot_ of CPU time and disk space. This hack will no longer |
256 |
+ # be needed with >=ceph-11.2. |
257 |
+ # |
258 |
+ python_setup "${1}" |
259 |
+ econf "${ECONFARGS[@]}" |
260 |
+ |
261 |
+ popd >/dev/null || die |
262 |
+} |
263 |
+ |
264 |
+src_compile() { |
265 |
+ emake |
266 |
+ emake_python_bindings all |
267 |
+ |
268 |
+ use test && emake check-local |
269 |
+} |
270 |
+ |
271 |
+src_test() { |
272 |
+ make check || die "make check failed" |
273 |
+} |
274 |
+ |
275 |
+src_install() { |
276 |
+ default |
277 |
+ emake_python_bindings install-exec "DESTDIR=\"${D}\"" |
278 |
+ |
279 |
+ prune_libtool_files --all |
280 |
+ |
281 |
+ exeinto /usr/$(get_libdir)/ceph |
282 |
+ newexe src/init-ceph ceph_init.sh |
283 |
+ |
284 |
+ insinto /etc/logrotate.d/ |
285 |
+ newins "${FILESDIR}"/ceph.logrotate ${PN} |
286 |
+ |
287 |
+ keepdir /var/lib/${PN}{,/tmp} /var/log/${PN}/stat |
288 |
+ |
289 |
+ fowners -R ceph:ceph /var/lib/ceph /var/log/ceph |
290 |
+ |
291 |
+ newinitd "${FILESDIR}/rbdmap.initd" rbdmap |
292 |
+ newinitd "${FILESDIR}/${PN}.initd-r3" ${PN} |
293 |
+ newconfd "${FILESDIR}/${PN}.confd-r1" ${PN} |
294 |
+ |
295 |
+ systemd_install_serviced "${FILESDIR}/ceph-mds_at.service.conf" "ceph-mds@.service" |
296 |
+ systemd_install_serviced "${FILESDIR}/ceph-osd_at.service.conf" "ceph-osd@.service" |
297 |
+ systemd_install_serviced "${FILESDIR}/ceph-mon_at.service.conf" "ceph-mon@.service" |
298 |
+ |
299 |
+ udev_dorules udev/*.rules |
300 |
+ |
301 |
+ readme.gentoo_create_doc |
302 |
+ |
303 |
+ python_setup 'python2*' |
304 |
+ python_fix_shebang "${ED}"/usr/{,s}bin/ |
305 |
+ |
306 |
+ # python_fix_shebang apparently is not idempotent |
307 |
+ sed -i -r 's:(/usr/lib/python-exec/python[0-9]\.[0-9]/python)[0-9]\.[0-9]:\1:' \ |
308 |
+ "${ED}"/usr/{sbin/ceph-disk,bin/ceph-detect-init} || die "sed failed" |
309 |
+} |
310 |
+ |
311 |
+pkg_postinst() { |
312 |
+ readme.gentoo_print_elog |
313 |
+} |