Package Details: fluent-bit 3.0.2-1

Git Clone URL: https://aur.archlinux.org/fluent-bit.git (read-only, click to copy)
Package Base: fluent-bit
Description: Collect data/logs from different sources, unify and send them to multiple destinations.
Upstream URL: https://fluentbit.io/
Keywords: elasticsearch fluentd
Licenses: Apache
Submitter: jjm
Maintainer: jjm
Last Packager: jjm
Votes: 5
Popularity: 0.000012
First Submitted: 2018-08-13 11:24 (UTC)
Last Updated: 2024-04-17 18:14 (UTC)

Pinned Comments

jjm commented on 2021-12-31 08:36 (UTC) (edited on 2023-09-18 19:57 (UTC) by jjm)

Merge requests for this PKGBUILD are welcome at https://gitlab.com/j0057-git/aur/fluent-bit.

Latest Comments

« First ‹ Previous 1 2 3 Next › Last »

jjm commented on 2021-07-20 10:11 (UTC)

Sorry about that, 1.8.1-2 fixes it.

jbg commented on 2021-07-17 04:41 (UTC) (edited on 2021-07-17 04:41 (UTC) by jbg)

1.8.1 fails to build with install: cannot stat 'Dockerfile*': No such file or directory, this patch fixes it for me:

--- a/PKGBUILD
+++ b/PKGBUILD
@@ -69,7 +69,7 @@ package() {
     # install license file and documentation
     cd "${srcdir}/${pkgname}-${pkgver}"
     install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
-    install -Dm 644 *.md Dockerfile* -t "$pkgdir/usr/share/doc/$pkgname/"
+    install -Dm 644 *.md -t "$pkgdir/usr/share/doc/$pkgname/"
 }

 sha512sums=('9607aae924278130db374757bf0df0cddb329088a9f97da17ebca039a0d37f93a0664273c14729ccbd123d1a25c7bc9329cb58c9dd2cf7d2a5fd086e726c73c8')

grawlinson commented on 2021-04-22 15:15 (UTC)

Upstream PR #3394 should fix the systemd install issue (lines 64-67 in the PKGBUILD).

Since there have been many commits between the last release (1.7.4) and latest branch, this is a simplified patch:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -743,6 +743,13 @@
   set(FLB_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${FLB_OUT_NAME}")
   set(FLB_INSTALL_CONFDIR "${CMAKE_INSTALL_SYSCONFDIR}/${FLB_OUT_NAME}/")
   set(FLB_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR})
+  if(${CMAKE_INSTALL_PREFIX} MATCHES "/usr/local")
+    set(FLB_INSTALL_SYSTEMDUNITDIR "/lib/systemd/system/")
+    set(FLB_INSTALL_UPSTARTUNITDIR "/etc/init")
+  else()
+    set(FLB_INSTALL_SYSTEMDUNITDIR "${CMAKE_INSTALL_PREFIX}/lib/systemd/system/")
+    set(FLB_INSTALL_UPSTARTUNITDIR "${CMAKE_INSTALL_PREFIX}/etc/init")
+  endif()
 endif()

 # Instruct CMake to build the Fluent Bit Core

--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -416,7 +416,7 @@
       "${PROJECT_SOURCE_DIR}/init/systemd.in"
       ${FLB_SYSTEMD_SCRIPT}
       )
-    install(FILES ${FLB_SYSTEMD_SCRIPT} DESTINATION /lib/systemd/system)
+    install(FILES ${FLB_SYSTEMD_SCRIPT} DESTINATION ${FLB_INSTALL_SYSTEMDUNITDIR})
     install(DIRECTORY DESTINATION ${FLB_INSTALL_CONFDIR})
   elseif(IS_DIRECTORY /usr/share/upstart)
     set(FLB_UPSTART_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.conf")
@@ -424,7 +424,7 @@
       "${PROJECT_SOURCE_DIR}/init/upstart.in"
       ${FLB_UPSTART_SCRIPT}
       )
-    install(FILES ${FLB_UPSTART_SCRIPT} DESTINATION /etc/init)
+    install(FILES ${FLB_UPSTART_SCRIPT} DESTINATION ${FLB_INSTALL_UPSTARTUNITDIR})
     install(DIRECTORY DESTINATION ${FLB_INSTALL_CONFDIR})
   else()
     # FIXME: should we support Sysv init script ?

bastelfreak commented on 2020-06-07 21:14 (UTC)

Hi, my PKGBUILD works fine for me. I use extra-x86_64-build to build the package. As far as I can tell that's the recommended way for building packages in a clean environment. Also this seems to be the correct version:

$ sudo pacman -U fluent-bit-1.4.5-1-x86_64.pkg.tar.zst
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) fluent-bit-1.4.5-1

Total Installed Size:  7.32 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                                                                 [########################################################################################] 100%
(1/1) checking package integrity                                                                                                               [########################################################################################] 100%
(1/1) loading package files                                                                                                                    [########################################################################################] 100%
(1/1) checking for file conflicts                                                                                                              [########################################################################################] 100%
(1/1) checking available disk space                                                                                                            [########################################################################################] 100%
:: Processing package changes...
(1/1) installing fluent-bit                                                                                                                    [########################################################################################] 100%
:: Running post-transaction hooks...
(1/2) Reloading system manager configuration...
(2/2) Arming ConditionNeedsUpdate...
$ sudo systemctl start fluent-bit.service 
$ sudo systemctl status fluent-bit.service 
● fluent-bit.service - Fluent Bit
     Loaded: loaded (/usr/lib/systemd/system/fluent-bit.service; disabled; vendor preset: disabled)
     Active: active (running) since Sun 2020-06-07 23:11:08 CEST; 2s ago
   Main PID: 431969 (fluent-bit)
      Tasks: 2 (limit: 19035)
     Memory: 896.0K
     CGroup: /system.slice/fluent-bit.service
             └─431969 /usr/bin/fluent-bit -c /etc/fluent-bit/fluent-bit.conf

Jun 07 23:11:08  fluent-bit[431969]: Fluent Bit v1.4.5
Jun 07 23:11:08  fluent-bit[431969]: * Copyright (C) 2019-2020 The Fluent Bit Authors
Jun 07 23:11:08  fluent-bit[431969]: * Copyright (C) 2015-2018 Treasure Data
Jun 07 23:11:08  fluent-bit[431969]: * Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
Jun 07 23:11:08  fluent-bit[431969]: * https://fluentbit.io
Jun 07 23:11:08  fluent-bit[431969]: [2020/06/07 23:11:08] [ info] [storage] version=1.0.3, initializing...
Jun 07 23:11:08  fluent-bit[431969]: [2020/06/07 23:11:08] [ info] [storage] in-memory
Jun 07 23:11:08  fluent-bit[431969]: [2020/06/07 23:11:08] [ info] [storage] normal synchronization mode, checksum disabled, max_chunks_up=128
Jun 07 23:11:08  fluent-bit[431969]: [2020/06/07 23:11:08] [ info] [engine] started (pid=431969)
Jun 07 23:11:08  fluent-bit[431969]: [2020/06/07 23:11:08] [ info] [sp] stream processor started
$ 

jjm commented on 2020-06-07 13:42 (UTC)

@bastelfreak, that PKGBUILD as is doesn't build, because the download urls don't match up. In addition to updating to 1.4.5, it also changes a number of other things, for this reason I've made this into the first pull request, can you confirm it also works for you?

jjm commented on 2020-06-07 13:05 (UTC)

Hi people, pull requests welcome at https://github.com/j0057/fluent-bit-pkgbuild.

The reason updates have been slow is that I can't fix an error that is not happening on my system -- on my system the build output lands in /usr/lib64, whereas on other system it lands in /usr/lib. I think it's good to have more broad review, we can do so in the github pull requests.

bastelfreak commented on 2020-06-07 12:02 (UTC)

Hi I updated the PKGBUILD to support 1.4.5:

# Maintainer: Joost Molenaar <jjm@j0057.nl>
# Contributor: Tim Meusel <tim@bastelfreak.de>
pkgname=fluent-bit

_pkgmaj=1.4
pkgver="${_pkgmaj}.5"
pkgrel=1
pkgdesc='Collect data/logs from different sources, unify and send them to multiple destinations.'
arch=(x86_64)
url='https://fluentbit.io/'
license=('Apache')
depends=('systemd-libs')
# PostgreSQL_TYPE_INCLUDE_DIR is provided by postgresql, this is currently a bug
makedepends=('cmake' 'postgresql-libs' 'postgresql' 'python' 'valgrind' 'gcc8')
checkdepends=('gtest' 'doxygen' 'graphviz')
backup=('etc/fluent-bit/fluent-bit.conf'
        'etc/fluent-bit/parsers.conf')
source=("${url}/releases/${pkgmaj}/${pkgname}-${pkgver}.tar.gz")
sha512sums=('98a971c62913db7b7689889c9365234e9d68e220dd510d45522150806cf1e23b208208f765b3d51519753071068114f6a3fc25f499688551a3b63df37c7f516e')

build() {
  cd "${pkgname}-${pkgver}/build"
  export CC=/usr/bin/gcc-8
  export CXX=/usr/bin/gcc-8
  cmake \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_SYSCONFDIR=/etc \
    -DFLB_TESTS_INTERNAL=Yes \
    -DFLB_IN_MQTT=Yes \
    -DFLB_TLS=Yes \
    -DFLB_ALL=Yes \
    -DFLB_OUT_NATS=Yes \
    ..
  make
}

check() {
  cd "${pkgname}-${pkgver}/build"
  make test
}

package() {
  cd "${pkgname}-${pkgver}/build"

  make DESTDIR="$pkgdir/" install

  mkdir -p "${pkgdir}/usr/lib/systemd/system"
  mv "${pkgdir}/lib/systemd/system/fluent-bit.service" "${pkgdir}/usr/lib/systemd/system"
  rm -rf "${pkgdir}/lib"
  cd "${srcdir}/${pkgname}-${pkgver}"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"
  install -Dm 644 README.md README.Dockerfile.md MAINTAINERS.md CODE_OF_CONDUCT.md  CONTRIBUTING.md DEVELOPER_GUIDE.md GOLANG_OUTPUT_PLUGIN.md Dockerfile Dockerfile.debug -t "${pkgdir}/usr/share/doc/${pkgname}"
}

seishinryohosha commented on 2019-09-11 16:42 (UTC) (edited on 2019-09-11 16:47 (UTC) by seishinryohosha)

Current build 1.2.2-4 fails. Used git bisect (current bad, 0fafc28 (1.0.4-1) good) Last version building is 1.2.2-1.

1.2.2-2 introduced: (see git diff master~3 master~2)

+    mv $pkgdir/usr/lib64/* $pkgdir/usr/lib
+    rmdir $pkgdir/usr/lib64

Downloading the tarball from https://fluentbit.io/releases/1.2/fluent-bit-1.2.2.tar.gz and compiling it manually (same md5sum as in PKGBUILD) and installing it showed that no lib64 directory gets created thus the 'stat' error from mv is genuine. Commenting out the moving of nonexistent files solved this release.

1.2.2-3 Still commenting out the mv from 1.2.2-2. Does not break anything as only make parameter got removed (-j8).

1.2.2-4

+    mkdir -p $pkgdir/usr/lib/systemd
+    mv $pkgdir/usr/lib/system $pkgdir/usr/lib/systemd

Still commenting out the mv from 1.2.2-2. Now the also nonexistent /usr/lib/system in the tarball triggers the same error as in 1.2.2-2 thus also a genuine error. The tarball has a service-file under $pkgdir/lib/systemd/system/. Commenting this line also out solved the building error and the package got cleanly installed.

It seems libfluent-bit.so depends on libsystemd/systemd-libs and zlib. They're both inlcuded as many base packages need zlib and libsystemd is provided by systemd but it doesn't hurt. libsystemd seems only needed if journald support is needed. (cmake includes it if systemd detected)

Custom variables should start with an underscore. Either pkgmaj should be _pkgmaj or use ${$pkgver%.2} in the url to strip the patchnumber.

If you want to get rid of the WARNING reference to $srcdir contact upstream and ask them why they hardcode path references in their binary. As this is not a big issue (as far as known) you can leave the warning be.

A suggested PKGBUILD diff is shown below.

Notice: For testing purposes, before running makepkg, I executed each time git clean -xdf to make sure no artifacts would conflict.

diff:

diff --git a/PKGBUILD b/PKGBUILD
index 5ff1dc1..18e49e9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,9 +2,8 @@

 pkgname=fluent-bit

-pkgmaj=1.2
 pkgver=1.2.2
-pkgrel=4
+pkgrel=5
 epoch=

 pkgdesc='Collect data/logs from different sources, unify and send them to multiple destinations.'
@@ -13,7 +12,7 @@ url='https://fluentbit.io/'
 license=('Apache')
 groups=()

-depends=()
+depends=(libsystemd zlib)
 makedepends=(cmake)
 checkdepends=()
 optdepends=()
@@ -27,7 +26,7 @@ backup=('etc/fluent-bit/fluent-bit.conf'
 options=()
 install=
 changelog=
-source=("https://fluentbit.io/releases/$pkgmaj/$pkgname-$pkgver.tar.gz")
+source=("https://fluentbit.io/releases/${pkgver%.2}/$pkgname-$pkgver.tar.gz")
 noextract=()
 validpgpkeys=()

@@ -49,20 +48,11 @@ check() {

 package() {
     cd $pkgname-$pkgver/build
-
     make DESTDIR="$pkgdir/" install

-    # put /lib/* in /usr/lib
+    # put /lib/* in /usr/lib to fix symlink errors
     mv $pkgdir/lib/* $pkgdir/usr/lib
     rmdir $pkgdir/lib
-
-    # also put /usr/lib64/* in /usr/lib
-    mv $pkgdir/usr/lib64/* $pkgdir/usr/lib
-    rmdir $pkgdir/usr/lib64
-
-    # put /usr/lib/system/* in /usr/lib/systemd/system/* so that systemd can actually find it ...
-    mkdir -p $pkgdir/usr/lib/systemd
-    mv $pkgdir/usr/lib/system $pkgdir/usr/lib/systemd
 }

 md5sums=('761ca237b4a96491fa157f1dd9d0d09e')