aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testing/fluent-bit/APKBUILD53
-rw-r--r--testing/fluent-bit/fluent-bit.confd1
-rw-r--r--testing/fluent-bit/fluent-bit.initd11
3 files changed, 65 insertions, 0 deletions
diff --git a/testing/fluent-bit/APKBUILD b/testing/fluent-bit/APKBUILD
new file mode 100644
index 0000000000..84e644c4d7
--- /dev/null
+++ b/testing/fluent-bit/APKBUILD
@@ -0,0 +1,53 @@
+# Contributor: wener <wenermail@gmail.com>
+# Maintainer: wener <wenermail@gmail.com>
+pkgname=fluent-bit
+pkgver=1.5.3
+pkgrel=0
+pkgdesc="Fast and Lightweight Log processor and forwarder for Linux, BSD and OSX"
+url="https://fluentbit.io/"
+arch="all !ppc64le !s390x"
+license="Apache-2.0"
+makedepends="cmake fts-dev gtest-dev flex bison zlib-dev"
+subpackages="$pkgname-dev"
+source="$pkgname-$pkgver.tar.gz::https://github.com/fluent/fluent-bit/archive/v$pkgver.tar.gz
+ fluent-bit.initd
+ fluent-bit.confd
+ "
+# enable check when this solved - https://github.com/fluent/fluent-bit/issues/2464#issuecomment-673280055
+options="!check"
+
+build() {
+ if [ "$CBUILD" != "$CHOST" ]; then
+ CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
+ fi
+ # default CORE_STACK_SIZE=((3 * PTHREAD_STACK_MIN) / 2)=3072 is invalid
+ # based on https://docs.fluentbit.io/manual/administration/configuring-fluent-bit/configuration-file
+ # set default to 24576
+ cmake -B build \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DCMAKE_BUILD_TYPE=None \
+ -DFLB_CORO_STACK_SIZE=24576 \
+ -DFLB_TESTS_INTERNAL=Yes \
+ $CMAKE_CROSSOPTS .
+ make -C build
+}
+
+check() {
+ CTEST_OUTPUT_ON_FAILURE=1 make -C build test
+}
+
+package() {
+ make -C build DESTDIR="$pkgdir" install
+
+ install -Dm755 "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/$pkgname
+ install -Dm644 "$srcdir"/$pkgname.confd \
+ "$pkgdir"/etc/conf.d/$pkgname
+
+ mv "$pkgdir"/usr/etc/* "$pkgdir"/etc
+}
+
+sha512sums="080a1068df9631c30206b49ffd3ac00d6e46da690e96797f5b03b9101e6d9235ff8b374e8894f9c4a8a399c0faed87993e7977df6bdbaadb529766b0794cecbb fluent-bit-1.5.3.tar.gz
+7bc3f0ccd66c4a1ca1a2f4abd5ce4b261dd17892633f755b1f1b1cbb510816ad2441c3b686dfa9ac7d08a78915658b73e47e5395582fd463a67771414c238dfe fluent-bit.initd
+f6431397c80a036980b5377b51e38aec25dfceeb8dbe4cd54dce1f6e77d669d9f8daf983fcc96d25332385888f1809ced5e8ab0e8ccfcd93d19494036e3dc949 fluent-bit.confd"
diff --git a/testing/fluent-bit/fluent-bit.confd b/testing/fluent-bit/fluent-bit.confd
new file mode 100644
index 0000000000..01ce1799ac
--- /dev/null
+++ b/testing/fluent-bit/fluent-bit.confd
@@ -0,0 +1 @@
+fluentbit_opts="-c /etc/fluent-bit/fluent-bit.conf"
diff --git a/testing/fluent-bit/fluent-bit.initd b/testing/fluent-bit/fluent-bit.initd
new file mode 100644
index 0000000000..3247bf163e
--- /dev/null
+++ b/testing/fluent-bit/fluent-bit.initd
@@ -0,0 +1,11 @@
+#!/sbin/openrc-run
+supervisor=supervise-daemon
+
+name=fluent-bit
+command=/usr/bin/fluent-bit
+command_args="$fluentbit_opts"
+
+depend() {
+ need net
+ after firewall
+}