aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ceph/APKBUILD
blob: eef6bb787a88e4c04bd128d713115bc263e3c1fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
# Contributor: John Coyle <dx9err@gmail.com>
# Maintainer: John Coyle <dx9err@gmail.com>

: ${WITH_TESTS:=OFF}

pkgname=ceph
pkgver=11.0.1
pkgrel=5
pkgdesc="User space components of the Ceph file system"
pkgusers="ceph"
pkggroups="ceph"
url="http://ceph.com"
arch="x86_64"
license="LGPL-2.1 and CC-BY-SA-1.0 and GPL-2.0 and BSL-1.0 and GPL-2.0-with-autoconf-exception and BSD-3-Clause and MIT"
depends="ceph-osd ceph-mds ceph-mon"

makedepends="
	acl-dev
	argp-standalone
	boost-dev
	btrfs-progs
	bzip2-dev
	cmake
	coreutils
	cryptsetup
	curl-dev
	cython
	cython-dev
	diffutils
	eudev-dev
	expat-dev
	fcgi-dev
	findutils
	flex
	fuse-dev
	git
	jq
	keyutils-dev
	leveldb-dev
	libaio-dev
	libatomic_ops-dev
	libedit-dev
	libtirpc-dev
	libtool
	libxml2-dev
	linux-headers
	lvm2-dev
	nss-dev
	openldap-dev
	libressl-dev
	parted
	procps
	python-dev
	py2-pip
	py-nose
	py-sphinx
	py-virtualenv
	readline-dev
	rpcgen
	snappy-dev
	userspace-rcu-dev
	xfsprogs-dev
	xmlstarlet
	yasm
"

#source="$pkgname-$pkgver.tar.gz::https://github.com/ceph/ceph/archive/v$pkgver.tar.gz"
source="https://github.com/dx9/ceph/releases/download/11.0.1/ceph-$pkgver-beta1.tar.bz2"

subpackages="
	$pkgname-base
	$pkgname-common
	$pkgname-mds
	$pkgname-mon
	$pkgname-fuse:ceph_fuse
	$pkgname-radosgw
	$pkgname-osd
	$pkgname-doc
	$pkgname-bash-completion:bash_completion
	rbd-fuse:rbd_fuse
	rbd-mirror:rbd_mirror
	rbd-nbd:rbd_nbd
	librbd
	librbd-dev:librbd_dev
	libcephfs
	libcephfs-dev:libcephfs_dev
	librados
	librados-dev:librados_dev
	librgw
	librgw-dev:librgw_dev
	py-rados:py_rados
	libradosstriper
	libradosstriper-dev:libradosstriper_dev
	py-rbd:py_rbd
	py-cephfs:py_cephfs
"

if [ "$WITH_TESTS" = ON ]; then
	subpackages="$subpackages $pkgname-test:ceph_test"
fi

_prefix=/usr
_bindir=$_prefix/bin
_datadir=$_prefix/share
_docdir=$_datadir/doc
_includedir=$_prefix/include
_libdir=$_prefix/lib
_libexecdir=$_prefix/libexec
_localstatedir=/var
_mandir=$_datadir/man
_sbindir=/usr/sbin
_sysconfdir=/etc

_udevrulesdir=/etc/udev/rules.d
_python_sitelib=/usr/lib/python2.7/site-packages


_builddir="$srcdir"/$pkgname-$pkgver

build() {
   cd "$_builddir"
   mkdir build
   cd build
   cmake .. \
	   -DCMAKE_INSTALL_PREFIX=$_prefix \
	   -DCMAKE_INSTALL_LIBDIR=$_libdir \
	   -DCMAKE_INSTALL_LIBEXECDIR=$_libexecdir \
	   -DCMAKE_INSTALL_LOCALSTATEDIR=$_localstatedir \
	   -DCMAKE_INSTALL_SYSCONFDIR=$_sysconfdir \
	   -DCMAKE_INSTALL_DOCDIR=$_docdir/ceph \
	   -DCMAKE_INSTALL_MANDIR=$_mandir \
	   -DWITH_REENTRANT_STRSIGNAL=ON \
	   -DWITH_THREAD_SAFE_RES_QUERY=ON \
	   -DWITH_MANPAGE=OFF \
	   -DWITH_PYTHON3=OFF \
	   -DWITH_TESTS=$WITH_TESTS \
	   || return 1
   make
}

package() {
	cd "$_builddir"
	cd build
	make DESTDIR="$pkgdir" install
	cd ..

	rm -f "$pkgdir"$_sysconfdir/init.d/ceph

	install -D src/etc-rbdmap "$pkgdir"$_sysconfdir/ceph/rbdmap

	install -m 0644 -D src/logrotate.conf "$pkgdir"$_sysconfdir/logrotate.d/ceph

	chmod 0644 "$pkgdir"$_docdir/ceph/sample.ceph.conf
	chmod 0644 "$pkgdir"$_docdir/ceph/sample.fetch_config

	# udev rules
	install -m 0644 -D udev/50-rbd.rules "$pkgdir"$_udevrulesdir/50-rbd.rules
	install -m 0644 -D udev/60-ceph-by-parttypeuuid.rules  \
		"$pkgdir"$_udevrulesdir/60-ceph-by-parttypeuuid.rules
	install -m 0644 -D udev/95-ceph-osd.rules \
		"$pkgdir"$_udevrulesdir/95-ceph-osd.rules
}

base() {
	pkgdesc="Base is the package that includes all the files shared amongst ceph servers"
	depends="
		ceph-common
		cryptsetup
		findutils
		librbd
		librados
		libcephfs
		librgw
		logrotate
		py-requests
		py-setuptools
		util-linux
		xfsprogs
	"

	mkdir -p "$subpkgdir"$_docdir/ceph
	mv "$pkgdir"$_docdir/ceph/sample.ceph.conf \
		"$subpkgdir"$_docdir/ceph/sample.ceph.conf
	mv "$pkgdir"$_docdir/ceph/sample.fetch_config \
		"$subpkgdir"$_docdir/ceph/sample.fetch_config

	mkdir -p "$subpkgdir"$_bindir
	for file in crushtool monmaptool osdmaptool ceph-run ceph-detect-init; do
		mv "$pkgdir"$_bindir/$file "$subpkgdir"$_bindir
	done

	mkdir -p "$subpkgdir"$_sbindir
	mv "$pkgdir"$_sbindir/ceph-create-keys "$subpkgdir"$_sbindir/ceph-create-keys
	mv "$pkgdir"$_sbindir/mount.ceph "$subpkgdir"$_sbindir/mount.ceph

	mkdir -p "$subpkgdir"$_libexecdir/ceph
	mv "$pkgdir"$_libexecdir/ceph/ceph_common.sh "$subpkgdir"$_libexecdir/ceph

	mkdir -p "$subpkgdir"$_libdir/rados-classes
	mv "$pkgdir"$_libdir/rados-classes/* "$subpkgdir"$_libdir/rados-classes
	mkdir -p "$subpkgdir"$_libdir/ceph/erasure-code
	mv "$pkgdir"$_libdir/ceph/erasure-code/libec_*.so* \
		"$subpkgdir"$_libdir/ceph/erasure-code
	mkdir -p "$subpkgdir"$_libdir/ceph/compressor
	mv "$pkgdir"$_libdir/ceph/compressor/libceph_*.so* \
		"$subpkgdir"$_libdir/ceph/compressor

	mkdir -p "$subpkgdir"$_sysconfdir/logrotate.d
	mv "$pkgdir"$_sysconfdir/logrotate.d/ceph \
		"$subpkgdir"$_sysconfdir/logrotate.d/ceph

	mkdir -p "$subpkgdir"$_python_sitelib
	mv "$pkgdir"$_python_sitelib/ceph_detect_init* "$subpkgdir"$_python_sitelib
	mv "$pkgdir"$_python_sitelib/ceph_disk* "$subpkgdir"$_python_sitelib

	for dir in tmp bootstrap-osd bootstrap-mds bootstrap-rgw; do
		install -m 750 -o ceph -g ceph -d \
			"$subpkgdir"$_localstatedir/lib/ceph/$dir
	done
}

common() {
	pkgdesc="Common utilities to mount and interact with a ceph storage cluster."
	depends="py-rados py-rbd py-cephfs"
	install="$pkgname-common.pre-install"

	mkdir -p "$subpkgdir"$_bindir
	for file in \
		ceph \
		ceph-authtool \
		ceph-conf \
		ceph-dencoder \
		ceph-rbdnamer \
		ceph-syn \
		ceph-crush-location \
		cephfs-data-scan \
		cephfs-journal-tool \
		cephfs-table-tool \
		rados \
		rbd \
		rbd-replay \
		rbd-replay-many \
		rbdmap \
		ceph-post-file \
		ceph-brag \
		; do \
		mv "$pkgdir"$_bindir/$file "$subpkgdir"$_bindir
	done

	mkdir -p "$subpkgdir"$_datadir/ceph
	mv "$pkgdir"$_datadir/ceph/known_hosts_drop.ceph.com "$subpkgdir"$_datadir/ceph
	mv "$pkgdir"$_datadir/ceph/id_rsa_drop.ceph.com "$subpkgdir"$_datadir/ceph
	mv "$pkgdir"$_datadir/ceph/id_rsa_drop.ceph.com.pub "$subpkgdir"$_datadir/ceph

	mkdir -p "$subpkgdir"$_sysconfdir/ceph
	mv "$pkgdir"$_sysconfdir/ceph/rbdmap "$subpkgdir"$_sysconfdir/ceph

	mkdir -p "$subpkgdir"$_python_sitelib
	mv "$pkgdir"$_python_sitelib/ceph_argparse.py* "$subpkgdir"$_python_sitelib
	mv "$pkgdir"$_python_sitelib/ceph_daemon.py* "$subpkgdir"$_python_sitelib

	mkdir -p "$subpkgdir"$_udevrulesdir
	mv "$pkgdir"$_udevrulesdir/50-rbd.rules "$subpkgdir"$_udevrulesdir

	install -m 3770 -o ceph -g ceph -d "$subpkgdir"$_localstatedir/log/ceph
	install -m 750 -o ceph -g ceph -d "$subpkgdir"$_localstatedir/lib/ceph
}

mds() {
	pkgdesc="Metadata server daemon for the Ceph distributed file system."
	depends="ceph-base"

	mkdir -p "$subpkgdir"$_bindir
	mv "$pkgdir"$_bindir/ceph-mds "$subpkgdir"$_bindir

	install -m 750 -o ceph -g ceph -d "$subpkgdir"$_localstatedir/lib/ceph/mds
}

mon() {
	pkgdesc="Cluster monitor daemon for the Ceph distributed file system."
	depends="ceph-base"

	mkdir -p "$subpkgdir"$_bindir
	mv "$pkgdir"$_bindir/ceph-mon "$subpkgdir"$_bindir
	mv "$pkgdir"$_bindir/ceph-rest-api "$subpkgdir"$_bindir

	mkdir -p "$subpkgdir"$_python_sitelib
	mv "$pkgdir"$_python_sitelib/ceph_rest_api.py* "$subpkgdir"$_python_sitelib

	install -m 750 -o ceph -g ceph -d "$subpkgdir"$_localstatedir/lib/ceph/mon
}

ceph_fuse() {
	pkgdesc="FUSE based client for Ceph distributed network file system."

	mkdir -p "$subpkgdir"$_bindir
	mv "$pkgdir"$_bindir/ceph-fuse "$subpkgdir"$_bindirn
	mkdir -p "$subpkgdir"$_sbindir
	mv "$pkgdir"$_sbindir/mount.fuse.ceph "$subpkgdir"$_sbindir
}

rbd_fuse() {
	pkgdesc="FUSE based client to map Ceph rbd images to files."
	depends="librados librbd"
	mkdir -p "$subpkgdir"$_bindir
	mv "$pkgdir"$_bindir/rbd-fuse "$subpkgdir"$_bindir
}

rbd_mirror() {
	pkgdesc="Daemon for mirroring RBD images between Ceph clusters."
	depends="ceph-common librados"
	mkdir -p "$subpkgdir"$_bindir
	mv "$pkgdir"$_bindir/rbd-mirror "$subpkgdir"$_bindir
}

rbd_nbd() {
	pkgdesc="NBD based client to map Ceph rbd images to local device."
	depends="librbd librados"
	mkdir -p "$subpkgdir"$_bindir
	mv "$pkgdir"$_bindir/rbd-nbd "$subpkgdir"$_bindir
}

radosgw() {
	pkgdesc="Rados REST gateway which implements Amazon's S3 and OpenStack's Swift APIs."
	depends="ceph-common"
	mkdir -p "$subpkgdir"$_bindir
	mv "$pkgdir"$_bindir/radosgw "$subpkgdir"$_bindir
	mv "$pkgdir"$_bindir/radosgw-admin "$subpkgdir"$_bindir
	mv "$pkgdir"$_bindir/radosgw-token "$subpkgdir"$_bindir
	mv "$pkgdir"$_bindir/radosgw-object-expirer "$subpkgdir"$_bindir
	mkdir -p "$subpkgdir"$_localstatedir/lib/ceph/radosgw
}

osd() {
	pkgdesc="Object storage daemon for the Ceph distributed file system."
	depends="ceph-base parted gptfdisk hdparm"

	mkdir -p "$subpkgdir"$_bindir
	mv "$pkgdir"$_bindir/ceph-clsinfo "$subpkgdir"$_bindir
	mv "$pkgdir"$_bindir/ceph-bluefs-tool "$subpkgdir"$_bindir
	mv "$pkgdir"$_bindir/ceph-objectstore-tool "$subpkgdir"$_bindir
	mv "$pkgdir"$_bindir/ceph-osd "$subpkgdir"$_bindir

	mkdir -p "$subpkgdir"$_sbindir
	mv "$pkgdir"$_sbindir/ceph-disk "$subpkgdir"$_sbindir
	mv "$pkgdir"$_sbindir/ceph-disk-udev "$subpkgdir"$_sbindir

	mkdir -p "$subpkgdir"$_libexecdir/ceph
	mv "$pkgdir"$_libexecdir/ceph/ceph-osd-prestart.sh "$subpkgdir"$_libexecdir/ceph

	mkdir -p "$subpkgdir"$_udevrulesdir
	mv "$pkgdir"$_udevrulesdir/60-ceph-by-parttypeuuid.rules "$subpkgdir"$_udevrulesdir
	mv "$pkgdir"$_udevrulesdir/95-ceph-osd.rules "$subpkgdir"$_udevrulesdir

	install -m 750 -o ceph -g ceph -d "$subpkgdir"$_localstatedir/lib/ceph/osd
}

librados() {
	pkgdesc="RADOS distributed object store client library"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/librados.so.* "$subpkgdir"/usr/lib
}

librados_dev() {
	pkgdesc="RADOS distributed object store client library headers"
	depends="librados"
	mkdir -p "$subpkgdir"$_includedir/rados
	mv "$pkgdir"$_includedir/rados/librados.h "$subpkgdir"$_includedir
	mv "$pkgdir"$_includedir/rados/librados.hpp "$subpkgdir"$_includedir
	mv "$pkgdir"$_includedir/rados/buffer.h "$subpkgdir"$_includedir
	mv "$pkgdir"$_includedir/rados/buffer_fwd.h "$subpkgdir"$_includedir
	mv "$pkgdir"$_includedir/rados/page.h "$subpkgdir"$_includedir
	mv "$pkgdir"$_includedir/rados/crc32c.h "$subpkgdir"$_includedir
	mv "$pkgdir"$_includedir/rados/rados_types.h "$subpkgdir"$_includedir
	mv "$pkgdir"$_includedir/rados/rados_types.hpp "$subpkgdir"$_includedir
	mv "$pkgdir"$_includedir/rados/memory.h "$subpkgdir"$_includedir
	mv "$pkgdir"$_libdir/librados.so "$subpkgdir"$_libdir
	mv "$pkgdir"$_bindir/librados-config "$subpkgdir"$_bindir
}

librgw() {
	pkgdesc="RADOS gateway client library"
	depends="librados"
	mkdir -p "$subpkgdir"$_libdir
	mv "$pkgdir"$_libdir/librgw.so.* "$subpkgdir"$_libdir
}

librgw_dev() {
	pkgdesc="RADOS gateway client library headers"
	depends="librados"

	mkdir -p "$subpkgdir"$_includedir/rados
	mv "$pkgdir"$_includedir/rados/librgw.h "$subpkgdir"$_includedir/rados
	mv "$pkgdir"$_includedir/rados/rgw_file.h "$subpkgdir"$_includedir/rados
	mv "$pkgdir"$_libdir/librgw.so "$subpkgdir"$_libdir
}

py_rados() {
	pkgdesc="Python libraries for the RADOS object store"
	depends="librados"
	mkdir -p "$subpkgdir"$_python_sitelib
	mv "$pkgdir"$_python_sitelib/rados.so "$subpkgdir"$_python_sitelib
	mv "$pkgdir"$_python_sitelib/rados-*.egg-info "$subpkgdir"$_python_sitelib
}

libradosstriper() {
	pkgdesc="RADOS striping library"
	depends="librados"
	mkdir -p "$subpkgdir"$_libdir
	mv "$pkgdir"$_libdir/libradosstriper.so.* "$subpkgdir"$_libdir
}

libradosstriper_dev() {
	pkgdesc="RADOS striping library headers"
	depends="libradosstriper librados-dev"
	mkdir -p "$subpkgdir"$_includedir/radosstriper
	mv "$pkgdir"$_includedir/radosstriper "$subpkgdir"$_includedir/radosstriper
	mv "$pkgdir"$_libdir/libradosstriper.so "$subpkgdir"$_libdir
}

librbd() {
	pkgdesc="RADOS block device client library"
	depends="librados"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/librbd.so.* "$subpkgdir"/usr/lib

	# TODO: look into this
	#mkdir -p /usr/lib64/qemu/
	#ln -sf %{_libdir}/librbd.so.1 /usr/lib64/qemu/librbd.so.1
}

librbd_dev() {
	pkgdesc="RADOS block device client library headers"
	depends="librbd librados-dev"
	mkdir -p "$subpkgdir"/usr/include/rbd
	mv "$pkgdir"/usr/include/rbd "$subpkgdir"/usr/include
	mv "$pkgdir"/usr/lib/librbd.so "$subpkgdir"/usr/lib
}

py_rbd() {
	pkgdesc="Python libraries for the RADOS block device"
	depends="librbd py-rados"
	mkdir -p "$subpkgdir"$_python_sitelib
	mv "$pkgdir"$_python_sitelib/rbd.so "$subpkgdir"$_python_sitelib
	mv "$pkgdir"$_python_sitelib/rbd-*.egg-info "$subpkgdir"$_python_sitelib
}

libcephfs() {
	pkgdesc="Ceph distributed file system client library"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libcephfs.so.* "$subpkgdir"/usr/lib
}

libcephfs_dev() {
	pkgdesc="Ceph distributed file system client library headers"
	depends="libcephfs librados-devel"
	mkdir -p "$subpkgdir"/usr/include/cephfs
	mv "$pkgdir"/usr/include/cephfs "$subpkgdir"/usr/include
	mv "$pkgdir"/usr/lib/libcephfs.so "$subpkgdir"/usr/lib
}

py_cephfs() {
	pkgdesc="Python libraries for Ceph distributed file system"
	depends="libcephfs py-rados"
	mkdir -p "$subpkgdir"$_python_sitelib
	mv "$pkgdir"$_python_sitelib/cephfs.so "$subpkgdir"$_python_sitelib
	mv "$pkgdir"$_python_sitelib/cephfs-*.egg-info "$subpkgdir"$_python_sitelib
	mv "$pkgdir"$_python_sitelib/ceph_volume_client.py* "$subpkgdir"$_python_sitelib
}

ceph_test() {
	depends="ceph-common"
	mkdir -p "$subpkgdir"$_bindir
	for file in \
		ceph_bench_log \
		ceph_kvstorebench \
		ceph_multi_stress_watch \
		ceph_erasure_code \
		ceph_erasure_code_benchmark \
		ceph_omapbench \
		ceph_objectstore_bench \
		ceph_perf_objectstore \
		ceph_perf_local \
		ceph_perf_msgr_client \
		ceph_perf_msgr_server \
		ceph_psim \
		ceph_radosacl \
		ceph_rgw_jsonparser \
		ceph_rgw_multiparser \
		ceph_scratchtool \
		ceph_scratchtoolpp \
		ceph_smalliobench \
		ceph_smalliobenchdumb \
		ceph_smalliobenchfs \
		ceph_smalliobenchrbd \
		ceph_test_* \
		ceph_tpbench \
		ceph_xattr_bench \
		ceph-coverage \
		ceph-monstore-tool \
		ceph-osdomap-tool \
		ceph-kvstore-tool \
		ceph-debugpack \
		ceph-client-debug \
		; do \
		mv "$pkgdir"$_bindir/$file "$subpkgdir"$_bindir
	done

	mkdir -p "$subpkgdir"$_libdir
	mv "$pkgdir"$_libdir/ceph/ceph-monstore-update-crush.sh "$subpkgdir"$_libdir
}

bash_completion() {
	depends="bash-completion"
	pkgdesc="Bash completions for Ceph"
	mkdir -p "$subpkgdir"$_sysconfdir/bash_completion.d
	mv "$pkgdir"$_sysconfdir/bash_completion.d/* "$subpkgdir"$_sysconfdir/bash_completion.d
}
md5sums="edae3d83b4dd0f1316bdc0799ea61769  ceph-11.0.1-beta1.tar.bz2"
sha256sums="fedaff78cd590021087edf168c0649505880cfbd73cde4029933b823f5ac617f  ceph-11.0.1-beta1.tar.bz2"
sha512sums="d8bc28a25b9444134527f22856a6f0ea97b21a6100b0576a092d8988da0f191aca1e59bd14129361aee53f3032295169117ff02207e2ff361bb526461b9c5462  ceph-11.0.1-beta1.tar.bz2"