]> git.proxmox.com Git - ceph.git/blob - ceph/alpine/APKBUILD.in
import 15.2.4
[ceph.git] / ceph / alpine / APKBUILD.in
1 # Contributor: John Coyle <dx9err@gmail.com>
2 # Maintainer: John Coyle <dx9err@gmail.com>
3 pkgname=ceph
4 pkgver=@PROJECT_VERSION@
5 pkgrel=@RPM_RELEASE@
6 pkgdesc="Ceph is a distributed object store and file system"
7 pkgusers="ceph"
8 pkggroups="ceph"
9 url="http://ceph.com"
10 arch="x86_64"
11 license="LGPL-2.1 and LGPL-3.0 and CC-BY-SA-1.0 and GPL-2.0 and BSL-1.0 and \
12 GPL-2.0-with-autoconf-exception and BSD-3-Clause and MIT"
13 depends="ceph-osd ceph-mds ceph-mgr ceph-mon"
14 # grep --quiet option required
15 # diffutils -y option required by osd-scrub-snaps.sh
16 # util-linux uuidgen required
17 makedepends="
18 acl-dev
19 argp-standalone
20 bc
21 boost-dev
22 btrfs-progs
23 bzip2-dev
24 cmake
25 coreutils
26 cryptsetup
27 curl-dev
28 cython-dev
29 diffutils
30 eudev-dev
31 expat-dev
32 fcgi-dev
33 flex
34 fuse-dev
35 git
36 grep
37 jq
38 keyutils-dev
39 leveldb-dev
40 libaio-dev
41 libedit-dev
42 libressl-dev
43 libtirpc-dev
44 libtool
45 libxml2-dev
46 linux-headers
47 lvm2-dev
48 nss-dev
49 openldap-dev
50 krb5-dev
51 parted
52 procps
53 python-dev
54 py-pip
55 py-nose
56 py-sphinx
57 py-virtualenv
58 readline-dev
59 rpcgen
60 snappy-dev
61 util-linux
62 xfsprogs-dev
63 xmlstarlet
64 yasm
65 "
66 source="@TARBALL_BASENAME@.tar.bz2"
67 subpackages="
68 $pkgname-base
69 $pkgname-common
70 $pkgname-mds
71 $pkgname-mgr
72 $pkgname-mon
73 $pkgname-fuse:ceph_fuse
74 $pkgname-radosgw
75 $pkgname-osd
76 $pkgname-doc
77 $pkgname-bash-completion:bash_completion
78 rbd-fuse:rbd_fuse
79 rbd-mirror:rbd_mirror
80 rbd-nbd:rbd_nbd
81 librbd
82 librbd-dev:librbd_dev
83 libcephfs
84 libcephfs-dev:libcephfs_dev
85 librados
86 librados-dev:librados_dev
87 librgw
88 librgw-dev:librgw_dev
89 py-rados:py_rados
90 py-rgw:py_rgw
91 libradosstriper
92 libradosstriper-dev:libradosstriper_dev
93 py-rbd:py_rbd
94 py-cephfs:py_cephfs
95 "
96
97 if [ -n "$CEPH_TEST_PKG" ]; then
98 subpackages="$subpackages $pkgname-test:ceph_test"
99 fi
100
101 _ceph_uid=167
102 _ceph_gid=167
103
104 _prefix=/usr
105 _bindir=$_prefix/bin
106 _datadir=$_prefix/share
107 _docdir=$_datadir/doc
108 _includedir=$_prefix/include
109 _libdir=$_prefix/lib
110 _libexecdir=$_prefix/libexec
111 _localstatedir=/var
112 _mandir=$_datadir/man
113 _sbindir=/usr/sbin
114 _sysconfdir=/etc
115
116 _udevrulesdir=/etc/udev/rules.d
117 _python_sitelib=/usr/lib/python2.7/site-packages
118
119 builddir=$srcdir/@TARBALL_BASENAME@
120
121 build() {
122 export CEPH_BUILD_VIRTUALENV=$builddir
123
124 mkdir -p $builddir/build
125 cd $builddir/build
126
127 if [ -n "$MAKE_CHECK" ] || [ -n "$CEPH_TEST_PKG" ]; then
128 local _with_tests=ON
129 fi
130
131 cmake .. \
132 -DCMAKE_INSTALL_PREFIX=$_prefix \
133 -DCMAKE_INSTALL_LIBDIR=$_libdir \
134 -DCMAKE_INSTALL_LIBEXECDIR=$_libexecdir \
135 -DCMAKE_INSTALL_LOCALSTATEDIR=$_localstatedir \
136 -DCMAKE_INSTALL_SYSCONFDIR=$_sysconfdir \
137 -DCMAKE_INSTALL_DOCDIR=$_docdir/ceph \
138 -DCMAKE_INSTALL_MANDIR=$_mandir \
139 -DWITH_REENTRANT_STRSIGNAL=ON \
140 -DWITH_THREAD_SAFE_RES_QUERY=ON \
141 -DWITH_MANPAGE=ON \
142 -DWITH_PYTHON3=OFF \
143 -DWITH_LTTNG=OFF \
144 -DWITH_SYSTEM_BOOST=ON \
145 -DWITH_TESTS=${_with_tests:-OFF} \
146 || return 1
147 make -j${JOBS:-2} || return 1
148
149 if [ -n "$MAKE_CHECK" ]; then
150 ctest -j${JOBS:-2}
151 fi
152 }
153
154 package() {
155 cd $builddir/build
156 make DESTDIR=$pkgdir install || return 1
157 cd ..
158
159 rm -f $pkgdir$_sysconfdir/init.d/ceph
160
161 install -m 0644 -D src/etc-rbdmap $pkgdir$_sysconfdir/ceph/rbdmap \
162 || return 1
163
164 install -m 0644 -D src/logrotate.conf $pkgdir$_sysconfdir/logrotate.d/ceph \
165 || return 1
166
167 chmod 0644 $pkgdir$_docdir/ceph/sample.ceph.conf || return 1
168
169 # udev rules
170 install -m 0644 -D udev/50-rbd.rules $pkgdir$_udevrulesdir/50-rbd.rules || return 1
171 }
172
173 base() {
174 pkgdesc="Base is the package that includes all the files shared amongst ceph servers"
175 depends="
176 ceph-common
177 cryptsetup
178 librbd
179 librados
180 libcephfs
181 librgw
182 logrotate
183 py-requests
184 py-setuptools
185 util-linux
186 xfsprogs
187 "
188
189 _pkg $_bindir crushtool monmaptool osdmaptool ceph-run
190 _pkg $_sbindir ceph-create-keys mount.ceph
191 _pkg $_libexecdir/ceph ceph_common.sh
192 _pkg $_libdir/rados-classes *.so*
193 _pkg $_libdir/ceph/erasure-code libec_*.so*
194 _pkg $_libdir/ceph/compressor libceph_*.so*
195 _pkg $_sysconfdir/logrotate.d ceph
196 for dir in tmp bootstrap-osd bootstrap-mds bootstrap-rgw; do
197 install -m 750 -o $_ceph_uid -g $_ceph_gid -d \
198 $subpkgdir$_localstatedir/lib/ceph/$dir || return 1
199 done
200 }
201
202 common() {
203 pkgdesc="Common utilities to mount and interact with a ceph storage cluster."
204 depends="py-rados py-rbd py-cephfs"
205 install="$pkgname-common.pre-install"
206
207 _pkg $_bindir ceph \
208 ceph-authtool \
209 ceph-conf \
210 ceph-dencoder \
211 ceph-rbdnamer \
212 ceph-syn \
213 cephfs-data-scan \
214 cephfs-journal-tool \
215 cephfs-table-tool \
216 rados \
217 rbd \
218 rbd-replay \
219 rbd-replay-many \
220 rbdmap \
221 ceph-post-file \
222 ceph-brag
223 _pkg $_datadir/ceph known_hosts_drop.ceph.com id_rsa_drop.ceph.com \
224 id_rsa_drop.ceph.com.pub
225 _pkg $_sysconfdir/ceph rbdmap
226 _pkg $_python_sitelib ceph_argparse.py* ceph_daemon.py*
227 _pkg $_udevrulesdir 50-rbd.rules
228 install -m 3770 -o $_ceph_uid -g $_ceph_gid -d \
229 $subpkgdir$_localstatedir/log/ceph || return 1
230 install -m 750 -o $_ceph_uid -g $_ceph_gid -d \
231 $subpkgdir$_localstatedir/lib/ceph
232 }
233
234 mds() {
235 pkgdesc="Metadata server daemon for the Ceph distributed file system."
236 depends="ceph-base"
237
238 _pkg $_bindir ceph-mds
239 install -m 750 -o $_ceph_uid -g $_ceph_gid -d \
240 $subpkgdir$_localstatedir/lib/ceph/mds
241 }
242
243 mon() {
244 pkgdesc="Cluster monitor daemon for the Ceph distributed file system."
245 depends="ceph-base"
246
247 _pkg $_bindir ceph-mon ceph-rest-api
248 _pkg $_python_sitelib ceph_rest_api.py*
249 install -m 750 -o $_ceph_uid -g $_ceph_gid -d \
250 $subpkgdir$_localstatedir/lib/ceph/mon
251 }
252
253 ceph_fuse() {
254 pkgdesc="FUSE based client for Ceph distributed network file system."
255
256 _pkg $_bindir ceph-fuse
257 _pkg $_sbindir mount.fuse.ceph
258 }
259
260 rbd_fuse() {
261 pkgdesc="FUSE based client to map Ceph rbd images to files."
262 depends="librados librbd"
263
264 _pkg $_bindir rbd-fuse
265 }
266
267 rbd_mirror() {
268 pkgdesc="Daemon for mirroring RBD images between Ceph clusters."
269 depends="ceph-common librados"
270
271 _pkg $_bindir rbd-mirror
272 }
273
274 rbd_nbd() {
275 pkgdesc="NBD based client to map Ceph rbd images to local device."
276 depends="librbd librados"
277
278 _pkg $_bindir rbd-nbd
279 }
280
281 radosgw() {
282 pkgdesc="Rados REST gateway which implements Amazon's S3 and OpenStack's Swift APIs."
283 depends="ceph-common"
284
285 _pkg $_bindir radosgw radosgw-admin radosgw-token radosgw-es radosgw-object-expirer
286 mkdir -p $subpkgdir$_localstatedir/lib/ceph/radosgw
287 }
288
289 osd() {
290 pkgdesc="Object storage daemon for the Ceph distributed file system."
291 depends="ceph-base parted gptfdisk"
292
293 _pkg $_bindir ceph-clsinfo ceph-bluefs-tool ceph-objectstore-tool ceph-osd
294 _pkg $_sbindir ceph-volume
295 _pkg $_libexecdir/ceph ceph-osd-prestart.sh
296 install -m 750 -o $_ceph_uid -g $_ceph_gid -d \
297 $subpkgdir$_localstatedir/lib/ceph/osd
298 }
299
300 librados() {
301 pkgdesc="RADOS distributed object store client library"
302
303 _pkg $_libdir librados.so.*
304 }
305
306 librados_dev() {
307 pkgdesc="RADOS distributed object store client library headers"
308 depends="librados"
309
310 _pkg $_includedir/rados librados.h \
311 librados.hpp \
312 buffer.h \
313 buffer_fwd.h \
314 inline_memory.h \
315 page.h \
316 crc32c.h \
317 rados_types.h \
318 rados_types.hpp
319 _pkg $_libdir librados.so
320 _pkg $_bindir librados-config
321 }
322
323 librgw() {
324 pkgdesc="RADOS gateway client library"
325 depends="librados"
326
327 _pkg $_libdir librgw.so.*
328 }
329
330 librgw_dev() {
331 pkgdesc="RADOS gateway client library headers"
332 depends="librados"
333
334 _pkg $_includedir/rados librgw.h rgw_file.h
335 _pkg $_libdir librgw.so
336 }
337
338 py_rgw() {
339 pkgdesc="Python 2 libraries for the RADOS gateway"
340 depends="librgw py-rados"
341
342 _pkg $_python_sitelib rgw.so rgw-*.egg-info
343 }
344
345 py_rados() {
346 pkgdesc="Python libraries for the RADOS object store"
347 depends="librados"
348
349 _pkg $_python_sitelib rados.so rados-*.egg-info
350 }
351
352 libradosstriper() {
353 pkgdesc="RADOS striping library"
354 depends="librados"
355
356 _pkg $_libdir libradosstriper.so.*
357 }
358
359 libradosstriper_dev() {
360 pkgdesc="RADOS striping library headers"
361 depends="libradosstriper librados-dev"
362
363 _pkg $_includedir/radosstriper libradosstriper.h libradosstriper.hpp
364 _pkg $_libdir libradosstriper.so
365 }
366
367 librbd() {
368 pkgdesc="RADOS block device client library"
369 depends="librados"
370
371 _pkg $_libdir librbd.so.*
372 }
373
374 librbd_dev() {
375 pkgdesc="RADOS block device client library headers"
376 depends="librbd librados-dev"
377
378 _pkg $_includedir/rbd features.h librbd.h librbd.hpp
379 _pkg $_libdir librbd.so
380 }
381
382 py_rbd() {
383 pkgdesc="Python libraries for the RADOS block device"
384 depends="librbd py-rados"
385
386 _pkg $_python_sitelib rbd.so rbd-*.egg-info
387 }
388
389 libcephfs() {
390 pkgdesc="Ceph distributed file system client library"
391
392 _pkg $_libdir libcephfs.so.*
393 }
394
395 libcephfs_dev() {
396 pkgdesc="Ceph distributed file system client library headers"
397 depends="libcephfs librados-devel"
398
399 _pkg $_includedir/cephfs ceph_ll_client.h libcephfs.h
400 _pkg $_libdir libcephfs.so
401 }
402
403 py_cephfs() {
404 pkgdesc="Python libraries for Ceph distributed file system"
405 depends="libcephfs py-rados"
406
407 _pkg $_python_sitelib cephfs.so cephfs-*.egg-info ceph_volume_client.py*
408 }
409
410 ceph_test() {
411 pkgdesc="Ceph benchmarks and test tools"
412 depends="ceph-common xmlstarlet"
413
414 _pkg $_bindir ceph-client-debug \
415 ceph_bench_log \
416 ceph_kvstorebench \
417 ceph_multi_stress_watch \
418 ceph_erasure_code \
419 ceph_erasure_code_benchmark \
420 ceph_omapbench \
421 ceph_objectstore_bench \
422 ceph_perf_objectstore \
423 ceph_perf_local \
424 ceph_perf_msgr_client \
425 ceph_perf_msgr_server \
426 ceph_psim \
427 ceph_radosacl \
428 ceph_rgw_jsonparser \
429 ceph_rgw_multiparser \
430 ceph_scratchtool \
431 ceph_scratchtoolpp \
432 ceph_test_* \
433 ceph-coverage \
434 ceph-monstore-tool \
435 ceph-osdomap-tool \
436 ceph-kvstore-tool \
437 ceph-debugpack \
438 ceph-dedup-tool
439
440 _pkg $_libdir ceph/ceph-monstore-update-crush.sh
441 }
442
443 bash_completion() {
444 depends="bash-completion"
445 pkgdesc="Bash completions for Ceph"
446 _pkg $_sysconfdir/bash_completion.d ceph rados radosgw-admin rbd
447 }
448
449 mgr() {
450 pkgdesc="Ceph Manager Daemon"
451 depends="ceph-base"
452
453 _pkg $_bindir ceph-mgr
454 _pkg $_libdir/ceph mgr
455
456 install -m 750 -o $_ceph_uid -g $_ceph_gid -d \
457 $subpkgdir$_localstatedir/lib/ceph/mgr
458 }
459
460 _pkg() {
461 local path=$1
462 shift
463 local files=$@
464 mkdir -p $subpkgdir$path || exit 1
465 for _file in $files; do
466 mv $pkgdir$path/$_file $subpkgdir$path || exit 1
467 done
468 }