aboutsummaryrefslogtreecommitdiffstats
path: root/main/rabbitmq-c/APKBUILD
blob: d39c8b9f64dbbe3350960b3dc4e8bdea3741c16e (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
# Contributor: Fabio Ribeiro <fabiorphp@gmail.com>
# Maintainer: Fabio Ribeiro <fabiorphp@gmail.com>
pkgname=rabbitmq-c
pkgver=0.11.0
pkgrel=0
pkgdesc="RabbitMQ C client"
url="https://github.com/alanxz/rabbitmq-c"
arch="all"
license="MIT"
depends_dev="popt-dev"
makedepends="$depends_dev openssl-dev cmake xmlto doxygen"
subpackages="$pkgname-utils $pkgname-doc::noarch $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/alanxz/rabbitmq-c/archive/v$pkgver.tar.gz"

build() {
	cmake -B build . \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DBUILD_STATIC_LIBS=ON \
		-DBUILD_SHARED_LIBS=ON \
		-DENABLE_SSL_SUPPORT=ON \
		-DBUILD_TESTS=ON \
		-DBUILD_TOOLS=ON
	make -C build
}

check() {
	cd build
	ctest -E basic
}

package() {
	make -C build DESTDIR="$pkgdir" install
	rm -f "$pkgdir"/usr/lib/*.a
}

utils() {
	pkgdesc="$pkgdesc (command line utilities)"

	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

doc() {
	pkgdesc="$pkgdesc (documentation and examples)"

	mkdir -p "$subpkgdir"/usr/share/"$pkgname"
	cp -a "$builddir"/build/docs "$builddir"/examples \
		"$subpkgdir"/usr/share/"$pkgname"/
}

sha512sums="
0c3dbb6e2b862e9f25e3f76df798ea272bbd81de2865950b95adf1f1e5791eb20d7c9d5a76cb7d2fda54bad5f12bdf69cbfa7e9fd1afdede6f9ec729ca2287de  rabbitmq-c-0.11.0.tar.gz
"