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, 27 Sep 2017 21:19:47
Message-Id: 1506547167.9dd511f4d8969258c23668e21dbd08f5ab76ae46.chutzpah@gentoo
1 commit: 9dd511f4d8969258c23668e21dbd08f5ab76ae46
2 Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 27 21:19:27 2017 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 27 21:19:27 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9dd511f4
7
8 sys-cluster/ceph: Version bump to 12.2.1
9
10 Package-Manager: Portage-2.3.10, Repoman-2.3.3
11
12 sys-cluster/ceph/Manifest | 1 +
13 sys-cluster/ceph/ceph-12.2.1.ebuild | 290 +++++++++++++++++++++
14 .../ceph/files/ceph-12.2.1-systemd-unitdir.patch | 10 +
15 3 files changed, 301 insertions(+)
16
17 diff --git a/sys-cluster/ceph/Manifest b/sys-cluster/ceph/Manifest
18 index 54c044058ee..22da72e93ca 100644
19 --- a/sys-cluster/ceph/Manifest
20 +++ b/sys-cluster/ceph/Manifest
21 @@ -2,3 +2,4 @@ DIST ceph-10.2.3.tar.gz 11596171 SHA256 dca933aa14db67b404d836ef510bd418091978ed
22 DIST ceph-10.2.7.tar.gz 14518491 SHA256 2cdfeaa9a08e94c2d35f540b450bbf64b2a694bd537679834185e98fc59d8ba2 SHA512 7e0686e9efa4ddd9d548f4145b448f8232f1ca29b08428daa5cd60a74ce26f1176a1f2ebbf2ac1761d9e6c1d364a5ffa194d2b3a18a8111f59b7c27f7a1d7734 WHIRLPOOL b6b6902230401b5f4c6f27801f315678bdc7b99aab4e50b54d941fc3a425b4f0fa9390484f2e12d6b4f962253fb8772fb706dad35d490b4542b06db166fab59b
23 DIST ceph-10.2.9.tar.gz 14550219 SHA256 3d93f4fc4a66b1d9f9ce43f65868dc18287cea32fbb2c7421faca6aed2b52a80 SHA512 1d59146614aa87ca551b05b795a684071a3cfb4ce6013e978ba650403c6732b2aa13f3c3cc191e6a1ea34b4631c82e97700593c24e200c41ec2f2b43b3ef5547 WHIRLPOOL 42215d33c4f617087e1b0ef81cd41b42330c3605acf625b0668d44eba9e982239683b466a1cc1a6f926fc1d439dfd6be4ce220f783da7d2214d36a2a6cc9181f
24 DIST ceph-12.2.0.tar.gz 148372459 SHA256 0f601a9e28e9ce6837119b3ef0d89e1e44e0432f1f5d55567a947efefdd4d4ce SHA512 e084109c48f5666e35df5ee49262dee36ba5e7620fda30002dec538a87de11bdd21157436b5656557cd909a0943071046f3a17dd679aa1129b88b8b925f73113 WHIRLPOOL 60016eb5a20159bfc74b16c4135055cf8bf68bd868ef897b2455107a1014d4663efd55e6f5977e7d2e29010660a59d6134e3af32922d15dccbae07145c9023ea
25 +DIST ceph-12.2.1.tar.gz 148738778 SHA256 512666ee88610640d66b261f9307c96ccd70eb25cd3349acd083fb1220c8a32e SHA512 ec2623c1f6ab563c6fd0bb5fd046c78528fdbedca7cde347c92a9b15005d2ab2b1a46d7294e93f56933386462f1066750285109aafb6bf94f7d5bcdb7214d8a8 WHIRLPOOL 6a22bc7080483b3fe161bfc441b9fdf1a85d2bd9a394e89db2005a229397d206614d3e7a0d84cf7521822688faf4b92ca75ad4ce586de0d262fdda5c94b4f904
26
27 diff --git a/sys-cluster/ceph/ceph-12.2.1.ebuild b/sys-cluster/ceph/ceph-12.2.1.ebuild
28 new file mode 100644
29 index 00000000000..c7fa5ee49c0
30 --- /dev/null
31 +++ b/sys-cluster/ceph/ceph-12.2.1.ebuild
32 @@ -0,0 +1,290 @@
33 +# Copyright 1999-2017 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=6
37 +PYTHON_COMPAT=( python{2_7,3_{4,5,6}} )
38 +DISTUTILS_OPTIONAL=1
39 +
40 +inherit check-reqs cmake-utils distutils-r1 python-r1 udev user systemd \
41 + readme.gentoo-r1 flag-o-matic
42 +
43 +if [[ ${PV} == *9999* ]]; then
44 + inherit git-r3
45 + EGIT_REPO_URI="https://github.com/ceph/ceph.git"
46 + SRC_URI=""
47 +else
48 + SRC_URI="https://download.ceph.com/tarballs/${P}.tar.gz"
49 + KEYWORDS="~amd64 ~arm64 ~x86"
50 +fi
51 +
52 +DESCRIPTION="Ceph distributed filesystem"
53 +HOMEPAGE="https://ceph.com/"
54 +
55 +LICENSE="LGPL-2.1 CC-BY-SA-1.0 GPL-2 BSD Boost-1.0 MIT"
56 +SLOT="0"
57 +
58 +CPU_FLAGS_X86=(sse{,2,3,4_1,4_2} ssse3)
59 +
60 +IUSE="babeltrace cephfs fuse jemalloc ldap lttng +mgr nss +radosgw +ssl"
61 +IUSE+=" static-libs systemd +tcmalloc test xfs zfs"
62 +IUSE+=" $(printf "cpu_flags_x86_%s\n" ${CPU_FLAGS_X86[@]})"
63 +
64 +# unbundling code commented out pending bugs 584056 and 584058
65 +#>=dev-libs/jerasure-2.0.0-r1
66 +#>=dev-libs/gf-complete-2.0.0
67 +COMMON_DEPEND="
68 + virtual/libudev
69 + app-arch/bzip2:=[static-libs?]
70 + app-arch/lz4:=[static-libs?]
71 + app-arch/snappy:=[static-libs?]
72 + app-arch/zstd:=[static-libs?]
73 + app-misc/jq:=[static-libs?]
74 + dev-libs/boost:=[threads,context,python,static-libs?,${PYTHON_USEDEP}]
75 + dev-libs/crypto++:=[static-libs?]
76 + dev-libs/leveldb:=[snappy,static-libs?]
77 + dev-libs/libaio:=[static-libs?]
78 + dev-libs/libxml2:=[static-libs?]
79 + sys-apps/keyutils:=[static-libs?]
80 + sys-apps/util-linux:=[static-libs?]
81 + sys-libs/zlib:=[static-libs?]
82 + babeltrace? ( dev-util/babeltrace )
83 + ldap? ( net-nds/openldap:=[static-libs?] )
84 + lttng? ( dev-util/lttng-ust:= )
85 + nss? ( dev-libs/nss:= )
86 + fuse? ( sys-fs/fuse:0=[static-libs?] )
87 + ssl? ( dev-libs/openssl:=[static-libs?] )
88 + xfs? ( sys-fs/xfsprogs:=[static-libs?] )
89 + zfs? ( sys-fs/zfs:=[static-libs?] )
90 + radosgw? (
91 + dev-libs/expat:=[static-libs?]
92 + dev-libs/openssl:=[static-libs?]
93 + net-misc/curl:=[static-libs?]
94 + )
95 + jemalloc? ( dev-libs/jemalloc:=[static-libs?] )
96 + !jemalloc? ( >=dev-util/google-perftools-2.4:=[static-libs?] )
97 + ${PYTHON_DEPS}
98 + "
99 +DEPEND="${COMMON_DEPEND}
100 + app-arch/cpio
101 + dev-lang/yasm
102 + dev-python/cython[${PYTHON_USEDEP}]
103 + dev-python/sphinx
104 + dev-util/gperf
105 + dev-util/valgrind
106 + sys-apps/which
107 + sys-devel/bc
108 + virtual/pkgconfig
109 + test? (
110 + dev-python/tox[${PYTHON_USEDEP}]
111 + dev-python/virtualenv[${PYTHON_USEDEP}]
112 + sys-apps/grep[pcre]
113 + sys-fs/btrfs-progs
114 + )"
115 +RDEPEND="${COMMON_DEPEND}
116 + net-misc/socat
117 + sys-apps/gptfdisk
118 + sys-block/parted
119 + sys-fs/cryptsetup
120 + !<sys-apps/openrc-0.26.3
121 + dev-python/cherrypy[${PYTHON_USEDEP}]
122 + dev-python/flask[${PYTHON_USEDEP}]
123 + dev-python/pecan[${PYTHON_USEDEP}]
124 + dev-python/prettytable[${PYTHON_USEDEP}]
125 + dev-python/pyopenssl[${PYTHON_USEDEP}]
126 + dev-python/requests[${PYTHON_USEDEP}]
127 + dev-python/werkzeug[${PYTHON_USEDEP}]
128 + "
129 +REQUIRED_USE="
130 + $(python_gen_useflags 'python2*')
131 + ${PYTHON_REQUIRED_USE}
132 + ?? ( ssl nss )
133 + ?? ( jemalloc tcmalloc )
134 + "
135 +
136 +# radosgw seems to be required to actually build
137 +REQUIRED_USE+=" radosgw"
138 +
139 +RESTRICT="test? ( userpriv )"
140 +
141 +# distribution tarball does not include everything needed for tests
142 +RESTRICT+=" test"
143 +
144 +STRIP_MASK="/usr/lib*/rados-classes/*"
145 +
146 +UNBUNDLE_LIBS=(
147 + src/erasure-code/jerasure/jerasure
148 + src/erasure-code/jerasure/gf-complete
149 +)
150 +
151 +PATCHES=(
152 + "${FILESDIR}/${PN}-12.2.0-use-provided-cpu-flag-values.patch"
153 + "${FILESDIR}/${PN}-12.2.0-cflags.patch"
154 + "${FILESDIR}/${PN}-12.2.1-systemd-unitdir.patch"
155 +)
156 +
157 +check-reqs_export_vars() {
158 + if use amd64; then
159 + CHECKREQS_DISK_BUILD="12G"
160 + CHECKREQS_DISK_USR="460M"
161 + else
162 + CHECKREQS_DISK_BUILD="1400M"
163 + CHECKREQS_DISK_USR="450M"
164 + fi
165 +
166 + export CHECKREQS_DISK_BUILD CHECKREQS_DISK_USR
167 +}
168 +
169 +user_setup() {
170 + enewgroup ceph ${CEPH_GID:--1}
171 + enewuser ceph "${CEPH_UID:--1}" -1 /var/lib/ceph ceph
172 +}
173 +
174 +pkg_pretend() {
175 + check-reqs_export_vars
176 + check-reqs_pkg_pretend
177 +}
178 +
179 +pkg_setup() {
180 + python_setup 'python2*'
181 + check-reqs_export_vars
182 + check-reqs_pkg_setup
183 + user_setup
184 +}
185 +
186 +src_prepare() {
187 + default
188 +
189 + # remove tests that need root access
190 + rm src/test/cli/ceph-authtool/cap*.t
191 +
192 + #rm -rf "${UNBUNDLE_LIBS[@]}"
193 +}
194 +
195 +ceph_src_configure() {
196 + local flag
197 + local mycmakeargs=(
198 + -DWITH_BABELTRACE=$(usex babeltrace)
199 + -DWITH_CEPHFS=$(usex cephfs)
200 + -DWITH_FUSE=$(usex fuse)
201 + -DWITH_LTTNG=$(usex lttng)
202 + -DWITH_MGR=$(usex mgr)
203 + -DWITH_NSS=$(usex nss)
204 + -DWITH_OPENLDAP=$(usex ldap)
205 + -DWITH_RADOSGW=$(usex radosgw)
206 + -DWITH_SSL=$(usex ssl)
207 + -DWITH_SYSTEMD=$(usex systemd)
208 + -DWITH_TESTS=$(usex test)
209 + -DWITH_XFS=$(usex xfs)
210 + -DWITH_ZFS=$(usex zfs)
211 + -DENABLE_SHARED=$(usex static-libs '' 'yes' 'no')
212 + -DALLOCATOR=$(usex tcmalloc 'tcmalloc' '' "$(usex jemalloc 'jemalloc' '' 'libc' '')" '')
213 + -DWITH_SYSTEM_BOOST=yes
214 + -DWITH_RDMA=no
215 + -DSYSTEMD_UNITDIR=$(systemd_get_systemunitdir)
216 + )
217 + if use amd64 || use x86; then
218 + for flag in ${CPU_FLAGS_X86[@]}; do
219 + mycmakeargs+=("$(usex cpu_flags_x86_${flag} "-DHAVE_INTEL_${flag^^}=1")")
220 + done
221 + fi
222 +
223 + rm -f "${BUILD_DIR:-${S}}/CMakeCache.txt"
224 + cmake-utils_src_configure
225 +
226 + # bug #630232
227 + sed -i "s:\"${T//:\\:}/${EPYTHON}/bin/python\":\"${PYTHON}\":" \
228 + "${BUILD_DIR:-${CMAKE_BUILD_DIR:-${S}}}"/include/acconfig.h \
229 + || die "sed failed"
230 +}
231 +
232 +src_configure() {
233 + ceph_src_configure
234 +}
235 +
236 +python_compile() {
237 + local CMAKE_USE_DIR="${S}"
238 +
239 + ceph_src_configure
240 + pushd "${BUILD_DIR}/src/pybind" >/dev/null || die
241 + emake VERBOSE=1 all
242 +
243 + # python modules are only compiled with "make install" so we need to do this to
244 + # prevent doing a bunch of compilation in src_install
245 + DESTDIR="${T}" emake VERBOSE=1 install
246 + popd >/dev/null || die
247 +}
248 +
249 +src_compile() {
250 + cmake-utils_src_make all
251 +
252 + # we have to do this here to prevent from building everything multiple times
253 + BUILD_DIR="${CMAKE_BUILD_DIR}" python_copy_sources
254 + python_foreach_impl python_compile
255 +}
256 +
257 +src_test() {
258 + make check || die "make check failed"
259 +}
260 +
261 +python_install() {
262 + local CMAKE_USE_DIR="${S}"
263 + pushd "${BUILD_DIR}/src/pybind" >/dev/null || die
264 + DESTDIR="${D}" emake install
265 + popd >/dev/null || die
266 +}
267 +
268 +src_install() {
269 + cmake-utils_src_install
270 + python_foreach_impl python_install
271 +
272 + prune_libtool_files --all
273 +
274 + exeinto /usr/$(get_libdir)/ceph
275 + newexe "${CMAKE_BUILD_DIR}/bin/init-ceph" ceph_init.sh
276 +
277 + insinto /etc/logrotate.d/
278 + newins "${FILESDIR}"/ceph.logrotate ${PN}
279 +
280 + keepdir /var/lib/${PN}{,/tmp} /var/log/${PN}/stat
281 +
282 + fowners -R ceph:ceph /var/lib/ceph /var/log/ceph
283 +
284 + newinitd "${FILESDIR}/rbdmap.initd" rbdmap
285 + newinitd "${FILESDIR}/${PN}.initd-r5" ${PN}
286 + newconfd "${FILESDIR}/${PN}.confd-r3" ${PN}
287 +
288 + insinto /etc/sysctl.d
289 + newins "${FILESDIR}"/sysctld 90-${PN}.conf
290 +
291 + use tcmalloc && newenvd "${FILESDIR}"/envd-tcmalloc 99${PN}-tcmalloc
292 +
293 + # units aren't installed by the build system unless systemd is enabled
294 + # so no point installing these with the USE flag disabled
295 + if use systemd; then
296 + systemd_install_serviced "${FILESDIR}/ceph-mds_at.service.conf" \
297 + "ceph-mds@.service"
298 +
299 + systemd_install_serviced "${FILESDIR}/ceph-osd_at.service.conf" \
300 + "ceph-osd@.service"
301 + fi
302 +
303 + udev_dorules udev/*.rules
304 +
305 + readme.gentoo_create_doc
306 +
307 + python_setup 'python2*'
308 +
309 + # bug #630232
310 + sed -i -r "s:${T//:/\\:}/${EPYTHON}:/usr:" "${ED}"/usr/bin/ceph \
311 + || die "sed failed"
312 +
313 + python_fix_shebang "${ED}"/usr/{,s}bin/
314 +
315 + # python_fix_shebang apparently is not idempotent
316 + sed -i -r 's:(/usr/lib/python-exec/python[0-9]\.[0-9]/python)[0-9]\.[0-9]:\1:' \
317 + "${ED}"/usr/{sbin/ceph-disk,bin/ceph-detect-init} || die "sed failed"
318 +}
319 +
320 +pkg_postinst() {
321 + readme.gentoo_print_elog
322 +}
323
324 diff --git a/sys-cluster/ceph/files/ceph-12.2.1-systemd-unitdir.patch b/sys-cluster/ceph/files/ceph-12.2.1-systemd-unitdir.patch
325 new file mode 100644
326 index 00000000000..28d1a02d711
327 --- /dev/null
328 +++ b/sys-cluster/ceph/files/ceph-12.2.1-systemd-unitdir.patch
329 @@ -0,0 +1,10 @@
330 +diff --git a/systemd/CMakeLists.txt b/systemd/CMakeLists.txt
331 +index 3b03b6e613..c359ad2df9 100644
332 +--- a/systemd/CMakeLists.txt
333 ++++ b/systemd/CMakeLists.txt
334 +@@ -17,4 +17,4 @@ install(FILES
335 + ceph-disk@.service
336 + ceph-volume@.service
337 + rbdmap.service
338 +- DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/systemd/system)
339 ++ DESTINATION ${SYSTEMD_UNITDIR})