aboutsummaryrefslogtreecommitdiffstats
path: root/testing/odyssey/APKBUILD
blob: a28bf0878867f7c1278d30a3f8589722ce1494c1 (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
# Contributor: Michael Pirogov <vbnet.ru@gmail.com>
# Maintainer: Michael Pirogov <vbnet.ru@gmail.com>
pkgname=odyssey
pkgver=1.1
pkgrel=0
pkgdesc="Scalable PostgreSQL connection pooler"
url="https://github.com/yandex/odyssey"
arch="x86_64 x86" # limited by machinarium supported architecture
license="BSD-3-Clause"
makedepends="cmake postgresql-dev openssl-dev linux-pam-dev"
options="!check" # https://github.com/yandex/odyssey/issues/134
subpackages="$pkgname-openrc"
source="$pkgname-$pkgver-$pkgrel.tar.gz::https://github.com/yandex/odyssey/archive/$pkgver.tar.gz
	odyssey.initd
	odyssey.confd"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DPOSTGRESQL_INCLUDE_DIR="$(pg_config --includedir)/server" \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		$CMAKE_CROSSOPTS .
	make -C build
}

check() {
	cd "$builddir"/build/test
	./odyssey_test
}

package() {
	install -Dm755 "$builddir"/build/sources/$pkgname \
		"$pkgdir"/usr/bin/$pkgname
	install -Dm600 "$builddir"/$pkgname.conf \
		"$pkgdir"/etc/$pkgname.conf.example
	install -Dm755 "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname

}

sha512sums="640eb0c68c274ad2b58edf854ae969e47b83376303c39a61cb8752598feb1afe612e62e41a373fa2630dea2f2b1682b2427058501b2db1b4f5b5eb1d9cc03090  odyssey-1.1-0.tar.gz
a1f129b06476c103465e9e649e88e1d5da071a377453e7a5b6dce4734928e8a5eb1c29b4a026d38b81587e6ca813ac3f533c668a264ae4ae7997716c2ec85715  odyssey.initd
1e9fdd3cc7cf0d789b2ea57b275cca6de171d3adc887f1cddfb5a0b273988a514db133e58403fd5a01ec0511446b8746c6a78137df1d5141c7499065e9bd745a  odyssey.confd"