From 35cc84d1cf71a761e44044f5f1b2d3ecdf965d7d Mon Sep 17 00:00:00 2001 From: wener Date: Wed, 12 Aug 2020 11:02:07 +0000 Subject: testing/fluent-bit: new aport --- testing/fluent-bit/APKBUILD | 53 +++++++++++++++++++++++++++++++++++++ testing/fluent-bit/fluent-bit.confd | 1 + testing/fluent-bit/fluent-bit.initd | 11 ++++++++ 3 files changed, 65 insertions(+) create mode 100644 testing/fluent-bit/APKBUILD create mode 100644 testing/fluent-bit/fluent-bit.confd create mode 100644 testing/fluent-bit/fluent-bit.initd diff --git a/testing/fluent-bit/APKBUILD b/testing/fluent-bit/APKBUILD new file mode 100644 index 00000000000..84e644c4d72 --- /dev/null +++ b/testing/fluent-bit/APKBUILD @@ -0,0 +1,53 @@ +# Contributor: wener +# Maintainer: wener +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 00000000000..01ce1799ac1 --- /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 00000000000..3247bf163e0 --- /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 +} -- cgit v1.2.3