aboutsummaryrefslogtreecommitdiffstats
path: root/testing/odyssey
diff options
context:
space:
mode:
authorMichael Pirogov <vbnet.ru@gmail.com>2020-03-18 07:46:54 +0000
committerLeo <thinkabit.ukim@gmail.com>2020-03-18 07:46:54 +0000
commit7151537ff2bea878c0e6e792c7f0385908cfc8c4 (patch)
tree15a23f17a787032f22ef83f24077d63c00e39244 /testing/odyssey
parent2c750666c9586732d9cf8714ada79cd9adc75709 (diff)
downloadaports-7151537ff2bea878c0e6e792c7f0385908cfc8c4.tar.bz2
aports-7151537ff2bea878c0e6e792c7f0385908cfc8c4.tar.xz
testing/odyssey: new aport
Diffstat (limited to 'testing/odyssey')
-rw-r--r--testing/odyssey/APKBUILD52
-rw-r--r--testing/odyssey/odyssey.confd3
-rw-r--r--testing/odyssey/odyssey.initd39
3 files changed, 94 insertions, 0 deletions
diff --git a/testing/odyssey/APKBUILD b/testing/odyssey/APKBUILD
new file mode 100644
index 0000000000..a28bf08788
--- /dev/null
+++ b/testing/odyssey/APKBUILD
@@ -0,0 +1,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"
diff --git a/testing/odyssey/odyssey.confd b/testing/odyssey/odyssey.confd
new file mode 100644
index 0000000000..0fbb664a46
--- /dev/null
+++ b/testing/odyssey/odyssey.confd
@@ -0,0 +1,3 @@
+# Location of configuration file for Odyssey.
+CONFFILE="/etc/odyssey/odyssey.conf"
+PIDFILE="/var/run/odyssey.pid"
diff --git a/testing/odyssey/odyssey.initd b/testing/odyssey/odyssey.initd
new file mode 100644
index 0000000000..967c5bd242
--- /dev/null
+++ b/testing/odyssey/odyssey.initd
@@ -0,0 +1,39 @@
+#!/sbin/openrc-run
+
+depend() {
+ use net
+ after postgresql
+}
+
+get_config() {
+ [ -f "${CONFFILE}" ] || eend 1 "'${CONFFILE}' not found"
+}
+
+start() {
+ ebegin "Starting Odyssey"
+ get_config
+ local ret=$?
+ if [ $ret -ne 0 ] ; then
+ eend $ret
+ exit $ret
+ fi
+ start-stop-daemon --start \
+ --pidfile ${PIDFILE} \
+ --user odyssey -b -m \
+ --exec /usr/bin/odyssey -- "${CONFFILE}"
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Odyssey"
+ start-stop-daemon --stop \
+ --pidfile ${PIDFILE}
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading Odyssey configuration from '${CONFFILE}'"
+ start-stop-daemon --signal HUP --pidfile ${PIDFILE}
+ eend $?
+}
+