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: Fri, 10 Feb 2017 01:18:23
Message-Id: 1486689494.b25fd2666765a5ce74cab2b6ac27e2927f6c9bc4.chutzpah@gentoo
1 commit: b25fd2666765a5ce74cab2b6ac27e2927f6c9bc4
2 Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 10 01:17:53 2017 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 10 01:18:14 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b25fd266
7
8 sys-cluster/ceph: Revision bump, minor fix to init script
9
10 Package-Manager: Portage-2.3.3, Repoman-2.3.1
11
12 sys-cluster/ceph/ceph-10.2.5-r1.ebuild | 267 +++++++++++++++++++++++++++++++++
13 sys-cluster/ceph/files/ceph.initd-r3 | 40 +++++
14 2 files changed, 307 insertions(+)
15
16 diff --git a/sys-cluster/ceph/ceph-10.2.5-r1.ebuild b/sys-cluster/ceph/ceph-10.2.5-r1.ebuild
17 new file mode 100644
18 index 0000000000..1f381009dd
19 --- /dev/null
20 +++ b/sys-cluster/ceph/ceph-10.2.5-r1.ebuild
21 @@ -0,0 +1,267 @@
22 +# Copyright 1999-2017 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +# $Id$
25 +
26 +EAPI=6
27 +PYTHON_COMPAT=( python{2_7,3_{4,5}} )
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 +)
137 +
138 +check-reqs_export_vars() {
139 + if use debug; then
140 + CHECKREQS_DISK_BUILD="23G"
141 + CHECKREQS_DISK_USR="7G"
142 + elif use amd64; then
143 + CHECKREQS_DISK_BUILD="12G"
144 + CHECKREQS_DISK_USR="450M"
145 + else
146 + CHECKREQS_DISK_BUILD="1400M"
147 + CHECKREQS_DISK_USR="450M"
148 + fi
149 +
150 + export CHECKREQS_DISK_BUILD CHECKREQS_DISK_USR
151 +}
152 +
153 +user_setup() {
154 + enewgroup ceph ${CEPH_GID}
155 + enewuser ceph "${CEPH_UID:--1}" -1 /var/lib/ceph ceph
156 +}
157 +
158 +emake_python_bindings() {
159 + local action="${1}" params binding
160 + shift
161 + params=("${@}")
162 +
163 + __emake_python_bindings_do_impl() {
164 + emake "${params[@]}" PYTHON="${EPYTHON}" "${binding}-pybind-${action}"
165 +
166 + # these don't work and aren't needed on python3
167 + if [[ ${EBUILD_PHASE} == install ]] && python_is_python3; then
168 + rm -f "${ED}/$(python_get_sitedir)"/ceph_{argparse,volume_client}.py
169 + fi
170 + }
171 +
172 + pushd "${S}/src"
173 + for binding in rados rbd $(use cephfs && echo cephfs); do
174 + python_foreach_impl __emake_python_bindings_do_impl
175 + done
176 + popd
177 +
178 + unset __emake_python_bindings_do_impl
179 +}
180 +
181 +pkg_pretend() {
182 + check-reqs_export_vars
183 + check-reqs_pkg_pretend
184 +}
185 +
186 +pkg_setup() {
187 + python_setup
188 + check-reqs_export_vars
189 + check-reqs_pkg_setup
190 + user_setup
191 +}
192 +
193 +src_prepare() {
194 + default
195 +
196 + # remove tests that need root access
197 + rm src/test/cli/ceph-authtool/cap*.t
198 +
199 + #rm -rf "${UNBUNDLE_LIBS[@]}"
200 +
201 + append-flags -fPIC
202 + eautoreconf
203 +}
204 +
205 +src_configure() {
206 + local myeconfargs=(
207 + --without-hadoop
208 + --includedir=/usr/include
209 + $(use_with cephfs)
210 + $(use_with debug)
211 + $(use_with fuse)
212 + $(use_with libaio)
213 + $(use_with libatomic libatomic-ops)
214 + $(use_with nss)
215 + $(use_with cryptopp)
216 + $(use_with radosgw)
217 + $(use_with gtk gtk2)
218 + $(use_enable static-libs static)
219 + $(use_with jemalloc)
220 + $(use_with xfs libxfs)
221 + $(use_with zfs libzfs)
222 + $(use_with lttng )
223 + $(use_with babeltrace)
224 + $(use_with ldap openldap)
225 + $(use jemalloc || usex tcmalloc " --with-tcmalloc" " --with-tcmalloc-minimal")
226 + --with-mon
227 + --with-eventfd
228 + --with-cython
229 + --without-kinetic
230 + --without-librocksdb
231 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
232 + )
233 +
234 + # we can only use python2.7 for building at the moment
235 + python_setup 'python2*'
236 + econf "${myeconfargs[@]}"
237 +}
238 +
239 +src_compile() {
240 + emake
241 + emake_python_bindings all
242 +
243 + use test && emake check-local
244 +}
245 +
246 +src_test() {
247 + make check || die "make check failed"
248 +}
249 +
250 +src_install() {
251 + default
252 + emake_python_bindings install-exec "DESTDIR=\"${D}\""
253 +
254 + prune_libtool_files --all
255 +
256 + exeinto /usr/$(get_libdir)/ceph
257 + newexe src/init-ceph ceph_init.sh
258 +
259 + insinto /etc/logrotate.d/
260 + newins "${FILESDIR}"/ceph.logrotate ${PN}
261 +
262 + keepdir /var/lib/${PN}{,/tmp} /var/log/${PN}/stat
263 +
264 + fowners -R ceph:ceph /var/lib/ceph /var/log/ceph
265 +
266 + newinitd "${FILESDIR}/rbdmap.initd" rbdmap
267 + newinitd "${FILESDIR}/${PN}.initd-r3" ${PN}
268 + newconfd "${FILESDIR}/${PN}.confd-r1" ${PN}
269 +
270 + systemd_install_serviced "${FILESDIR}/ceph-mds_at.service.conf" "ceph-mds@.service"
271 + systemd_install_serviced "${FILESDIR}/ceph-osd_at.service.conf" "ceph-osd@.service"
272 + systemd_install_serviced "${FILESDIR}/ceph-mon_at.service.conf" "ceph-mon@.service"
273 +
274 + udev_dorules udev/*.rules
275 +
276 + readme.gentoo_create_doc
277 +
278 + python_setup 'python2*'
279 + python_fix_shebang "${ED}"/usr/{,s}bin/
280 +
281 + # python_fix_shebang apparently is not idempotent
282 + sed -i -r 's:(/usr/lib/python-exec/python[0-9]\.[0-9]/python)[0-9]\.[0-9]:\1:' \
283 + "${ED}"/usr/{sbin/ceph-disk,bin/ceph-detect-init} || die "sed failed"
284 +}
285 +
286 +pkg_postinst() {
287 + readme.gentoo_print_elog
288 +}
289
290 diff --git a/sys-cluster/ceph/files/ceph.initd-r3 b/sys-cluster/ceph/files/ceph.initd-r3
291 new file mode 100644
292 index 0000000000..9476aa9191
293 --- /dev/null
294 +++ b/sys-cluster/ceph/files/ceph.initd-r3
295 @@ -0,0 +1,40 @@
296 +#!/sbin/openrc-run
297 +
298 +ceph_conf="${ceph_conf:-/etc/ceph/ceph.conf}"
299 +extra_commands="reload"
300 +daemon_type="${RC_SVCNAME#ceph-}"
301 +daemon_type="${daemon_type%%.*}"
302 +daemon_id="${RC_SVCNAME#ceph-*.}"
303 +daemon_id="${daemon_id:-0}"
304 +command="/usr/bin/ceph-${daemon_type}"
305 +pidfile="/run/ceph/${daemon_type}.${daemon_id}.pid"
306 +command_args="-i ${daemon_id} --pid-file ${pidfile} -c ${ceph_conf}"
307 +start_stop_daemon_args="--user ceph --group ceph"
308 +
309 +depend() {
310 + after net ntpd ntp-client chronyd
311 + before netmount
312 +}
313 +
314 +is_type_valid() {
315 + case ${daemon_type} in
316 + mon|mds|osd) return 0;;
317 + *) return 1;;
318 + esac
319 +}
320 +
321 +start_pre() {
322 + checkpath -d -q -o ceph "$(dirname "${pidfile}")"
323 + if ! is_type_valid ;then
324 + eerror "Please give valid Ceph Server Type: mds, mon, osd"
325 + return 1
326 + fi
327 +}
328 +
329 +reload() {
330 + ebegin "Reloading Ceph ${daemon_type}.${daemon_id}"
331 + start-stop-daemon --signal 1 ${start_stop_daemon_args} --pidfile "${pidfile}"
332 + eend $?
333 +}
334 +
335 +# vim:ft=gentoo-init-d:ts=4:sts=4:sw=4:noet: