aboutsummaryrefslogtreecommitdiffstats
path: root/community/libcouchbase/APKBUILD
blob: 9c5229e9400a30c9597cdb022852d1fe114f5060 (plain) (blame)
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
# Contributor: Nathan Johnson <nathan@nathanjohnson.info>
# Maintainer: Nathan Johnson <nathan@nathanjohnson.info>
pkgname=libcouchbase
pkgver=3.2.4
pkgrel=0
pkgdesc="C client library for Couchbase"
url="https://developer.couchbase.com/community"
arch="all"
license="Apache-2.0"
depends_dev="musl-dev openssl1.1-compat-dev snappy-dev"
makedepends="$depends_dev cmake perl libtool libev-dev libevent-dev libuv-dev zlib-dev"
subpackages="$pkgname-dev $pkgname-utils $pkgname-doc $pkgname-libevent $pkgname-libev $pkgname-libuv"
source="$pkgname-$pkgver.tar.gz::https://github.com/couchbase/libcouchbase/archive/$pkgver.tar.gz
	fix_libdir.patch
	fix_socktest.patch"

build() {
	mkdir "$builddir"/build
	cd "$builddir"/build
	../cmake/configure \
		--prefix=/usr \
		--skip-git-version \
		--disable-couchbasemock
	make
}

check() {
	cd "$builddir"/build
	ctest -E 'check-(select|libevent|libev|libuv)-sock-tests'
}

package() {
	cd "$builddir"/build
	make install DESTDIR="$pkgdir"
}

dev() {
	default_dev
	mv "$subpkgdir"/usr/bin/cbc-write-config \
		"$pkgdir"/usr/bin
	rmdir "$subpkgdir"/usr/bin
}

libevent() {
	pkgdesc="$pkgdesc (libevent backend)"
	depends="$pkgname libevent"

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libcouchbase/libcouchbase_libevent.so "$subpkgdir"/usr/lib
}

libev() {
	pkgdesc="$pkgdesc (libev backend)"
	depends="$pkgname libev"

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libcouchbase/libcouchbase_libev.so "$subpkgdir"/usr/lib
}

libuv() {
	pkgdesc="$pkgdesc (libuv backend)"
	depends="$pkgname libuv"

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libcouchbase/libcouchbase_libuv.so "$subpkgdir"/usr/lib
}

utils() {
	pkgdesc="$pkgdesc (command line utilities)"
	depends="$pkgname"
	provides="$pkgname-bin=$pkgver-r$pkgrel"

	amove usr/bin
}

sha512sums="
7882738c9bf4b042f3af180935d94810480cf3ff7aba8b9654d607e47e9fda24cf1fafed0fa052bb33872acfb6910407b4a324690f0bb8611a352aa6842498b0  libcouchbase-3.2.4.tar.gz
270123c57e6e760721ad337db154b8d90bddb81e38c644b854a36e2383fe95f3214227943e7040aa409d5d5ab101681369000054e4738c2a2d1facd0eee923e3  fix_libdir.patch
72319b86fdd91728723ccb091e72199788a84e2ec9ea12c0fcd1ed686eb155ec11e0addbff96735f83e7f31764a85650f0483b6e76d3a8bee16f71b2751fe4a9  fix_socktest.patch
"