2 ## Copyright (C) 2019 Wind River Systems, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 SUMMARY = "User space components of the Ceph file system"
18 Ceph is a massively scalable, open-source, distributed storage system that runs \
19 on commodity hardware and delivers object, block and file system storage. \
21 HOMEPAGE = "https://ceph.io"
23 LICENSE = "LGPLv2.1 & GPLv2 & Apache-2.0 & MIT"
25 file://COPYING-LGPL2.1;md5=fbc093901857fcd118f065f900982c24 \
26 file://COPYING-GPL2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
27 file://COPYING;md5=92d301c8fccd296f2221a68a8dd53828 \
31 boost rdma-core bzip2 curl expat \
32 gperf-native keyutils libaio lz4 \
33 nspr nss oath openldap openssl \
34 python python-cython-native rocksdb \
35 snappy udev valgrind xfsprogs zlib \
39 http://download.ceph.com/tarballs/ceph-${PV}.tar.gz \
40 file://0001-Correct-the-path-to-find-version.h-in-rocksdb.patch \
41 file://0002-zstd-fix-error-for-cross-compile.patch \
42 file://0003-ceph-add-pybind-support-in-OE.patch \
43 file://0004-ceph-detect-init-correct-the-installation-for-OE.patch \
44 file://0005-Add-hooks-for-orderly-shutdown-on-controller.patch \
46 file://ceph-init-wrapper.sh \
47 file://ceph-manage-journal.py \
48 file://ceph-preshutdown.sh \
49 file://ceph-radosgw.service \
51 file://ceph.conf.pmon \
54 file://mgr-restful-plugin.py \
55 file://mgr-restful-plugin.service \
56 file://starlingx-docker-override.conf \
58 SRC_URI[md5sum] = "ce118be451dcb6b89e9e0a45057827dd"
59 SRC_URI[sha256sum] = "f3a61db4c90e00c38a2dac7239b956ec367ef56f601e07335ed3011f931d8840"
61 inherit cmake pythonnative python-dir systemd
63 DISTRO_FEATURES_BACKFILL_CONSIDERED_remove = "sysvinit"
65 SYSTEMD_SERVICE_${PN} = " \
66 ceph-radosgw@.service \
78 ceph-rbd-mirror@.service \
79 ceph-rbd-mirror.target \
80 ceph-volume@.service \
85 SYSTEMD_AUTO_ENABLE = "disable"
87 OECMAKE_GENERATOR = "Unix Makefiles"
95 -DWITH_BABELTRACE=OFF \
100 -DMGR_PYTHON_VERSION=2.7 \
101 -DWITH_MGR_DASHBOARD_FRONTEND=OFF \
102 -DWITH_SYSTEM_BOOST=ON \
103 -DWITH_SYSTEM_ROCKSDB=ON \
106 do_configure_prepend () {
107 echo "set( CMAKE_SYSROOT \"${RECIPE_SYSROOT}\" )" >> ${WORKDIR}/toolchain.cmake
108 echo "set( CMAKE_DESTDIR \"${D}\" )" >> ${WORKDIR}/toolchain.cmake
109 echo "set( PYTHON_SITEPACKAGES_DIR \"${PYTHON_SITEPACKAGES_DIR}\" )" >> ${WORKDIR}/toolchain.cmake
110 ln -sf ${STAGING_LIBDIR}/libboost_python27.so ${STAGING_LIBDIR}/libboost_python.so
113 do_install_append () {
114 mv ${D}${bindir}/ceph-disk ${D}${sbindir}/ceph-disk
115 sed -i -e 's:${WORKDIR}.*python2.7:${bindir}/python:' ${D}${sbindir}/ceph-disk
116 sed -i -e 's:${sbindir}/service:${bindir}/service:' ${D}/${libdir}/python2.7/site-packages/ceph_disk/main.py
117 sed -i -e 's:${WORKDIR}.*python2.7:${bindir}/python:' ${D}${bindir}/ceph
118 sed -i -e 's:${WORKDIR}.*python2.7:${bindir}/python:' ${D}${bindir}/ceph-detect-init
119 find ${D} -name SOURCES.txt | xargs sed -i -e 's:${WORKDIR}::'
121 install -d ${D}${systemd_unitdir}
122 mv ${D}${libexecdir}/systemd/system ${D}${systemd_unitdir}
123 mv ${D}${libexecdir}/ceph/ceph-osd-prestart.sh ${D}${libdir}/ceph
124 install -m 0755 ${D}${libexecdir}/ceph/ceph_common.sh ${D}${libdir}/ceph
126 install -d ${D}${sysconfdir}/ceph
127 install -m 0644 ${WORKDIR}/ceph.conf ${D}${sysconfdir}/ceph/
128 install -m 0644 ${WORKDIR}/ceph-radosgw.service ${D}${systemd_system_unitdir}/ceph-radosgw@.service
129 install -m 0644 ${WORKDIR}/ceph.service ${D}${systemd_system_unitdir}
130 install -m 0644 ${WORKDIR}/mgr-restful-plugin.service ${D}${systemd_system_unitdir}
132 install -m 0700 ${WORKDIR}/ceph-manage-journal.py ${D}${sbindir}/ceph-manage-journal
133 install -Dm 0750 ${WORKDIR}/mgr-restful-plugin.py ${D}${sysconfdir}/rc.d/init.d/mgr-restful-plugin
134 install -Dm 0750 ${WORKDIR}/mgr-restful-plugin.py ${D}${sysconfdir}/init.d/mgr-restful-plugin
135 install -m 0750 ${WORKDIR}/ceph.conf.pmon ${D}${sysconfdir}/ceph/
137 install -d -m 0750 ${D}${sysconfdir}/services.d/controller
138 install -d -m 0750 ${D}${sysconfdir}/services.d/storage
139 install -d -m 0750 ${D}${sysconfdir}/services.d/worker
141 install -m 0750 ${WORKDIR}/ceph.sh ${D}${sysconfdir}/services.d/controller
142 install -m 0750 ${WORKDIR}/ceph.sh ${D}${sysconfdir}/services.d/storage
143 install -m 0750 ${WORKDIR}/ceph.sh ${D}${sysconfdir}/services.d/worker
145 install -Dm 0750 ${WORKDIR}/ceph-init-wrapper.sh ${D}${sysconfdir}/rc.d/init.d/ceph-init-wrapper
146 install -Dm 0750 ${WORKDIR}/ceph-init-wrapper.sh ${D}${sysconfdir}/init.d/ceph-init-wrapper
147 sed -i -e 's|/usr/lib64|${libdir}|' ${D}${sysconfdir}/rc.d/init.d/ceph-init-wrapper ${D}${sysconfdir}/init.d/ceph-init-wrapper
149 install -m 0700 ${WORKDIR}/ceph-preshutdown.sh ${D}${sbindir}/ceph-preshutdown.sh
151 install -Dm 0644 ${WORKDIR}/starlingx-docker-override.conf ${D}${systemd_system_unitdir}/docker.service.d/starlingx-docker-override.conf
153 install -m 0644 -D ${S}/src/etc-rbdmap ${D}${sysconfdir}/ceph/rbdmap
154 install -m 0644 -D ${S}/etc/sysconfig/ceph ${D}${sysconfdir}/sysconfig/ceph
155 install -m 0644 -D ${S}/src/logrotate.conf ${D}${sysconfdir}/logrotate.d/ceph
157 install -m 0644 -D ${S}/COPYING ${D}${docdir}/ceph/COPYING
158 install -m 0644 -D ${S}/etc/sysctl/90-ceph-osd.conf ${D}${libdir}/sysctl.d/90-ceph-osd.conf
159 install -m 0644 -D ${S}/udev/50-rbd.rules ${D}${libdir}/udev/rules.d/50-rbd.rules
160 install -m 0644 -D ${S}/udev/60-ceph-by-parttypeuuid.rules ${D}${libdir}/udev/rules.d/60-ceph-by-parttypeuuid.rules
162 mkdir -p ${D}${localstatedir}/ceph
163 mkdir -p ${D}${localstatedir}/log/ceph
164 mkdir -p ${D}${localstatedir}/lib/ceph/tmp
165 mkdir -p ${D}${localstatedir}/lib/ceph/mon
166 mkdir -p ${D}${localstatedir}/lib/ceph/osd
167 mkdir -p ${D}${localstatedir}/lib/ceph/mds
168 mkdir -p ${D}${localstatedir}/lib/ceph/mgr
169 mkdir -p ${D}${localstatedir}/lib/ceph/radosgw
170 mkdir -p ${D}${localstatedir}/lib/ceph/bootstrap-osd
171 mkdir -p ${D}${localstatedir}/lib/ceph/bootstrap-mds
172 mkdir -p ${D}${localstatedir}/lib/ceph/bootstrap-rgw
173 mkdir -p ${D}${localstatedir}/lib/ceph/bootstrap-mgr
174 mkdir -p ${D}${localstatedir}/lib/ceph/bootstrap-rbd
176 install -m 0755 -d ${D}/${sysconfdir}/tmpfiles.d
177 echo "d ${localstatedir}/run/ceph 0755 ceph ceph -" >> ${D}/${sysconfdir}/tmpfiles.d/ceph.conf
179 install -m 0750 -D ${S}/src/init-radosgw ${D}${sysconfdir}/rc.d/init.d/ceph-radosgw
180 install -m 0750 -D ${S}/src/init-radosgw ${D}${sysconfdir}/init.d/ceph-radosgw
181 sed -i '/### END INIT INFO/a SYSTEMCTL_SKIP_REDIRECT=1' ${D}${sysconfdir}/rc.d/init.d/ceph-radosgw
182 sed -i '/### END INIT INFO/a SYSTEMCTL_SKIP_REDIRECT=1' ${D}${sysconfdir}/init.d/ceph-radosgw
183 install -m 0750 -D ${S}/src/init-rbdmap ${D}${sysconfdir}/rc.d/init.d/rbdmap
184 install -m 0750 -D ${S}/src/init-rbdmap ${D}${sysconfdir}/init.d/rbdmap
185 install -m 0750 -D ${B}/bin/init-ceph ${D}${sysconfdir}/rc.d/init.d/ceph
186 install -m 0750 -D ${B}/bin/init-ceph ${D}${sysconfdir}/init.d/ceph
187 install -d -m 0750 ${D}${localstatedir}/log/radosgw
195 ${libdir}/rados-classes/*.so.* \
196 ${libdir}/ceph/compressor/*.so \
197 ${libdir}/rados-classes/*.so \
198 ${libdir}/ceph/*.so \
200 ${docdir}/ceph/COPYING \
201 ${libdir}/sysctl.d/90-ceph-osd.conf \
202 ${libdir}/udev/rules.d/50-rbd.rules \
203 ${libdir}/udev/rules.d/60-ceph-by-parttypeuuid.rules \
204 ${systemd_system_unitdir}/mgr-restful-plugin.service \
205 ${systemd_system_unitdir}/ceph-radosgw@.service \
206 ${systemd_system_unitdir}/ceph.service \
207 ${systemd_system_unitdir}/docker.service.d/starlingx-docker-override.conf \
209 FILES_${PN}-python = "\
210 ${PYTHON_SITEPACKAGES_DIR}/* \
224 COMPATIBLE_HOST = "(x86_64).*"
226 INSANE_SKIP_${PN}-python += "ldflags"
227 INSANE_SKIP_${PN} += "dev-so"