2023-07-31 18:19:31 +00:00
|
|
|
# Contributor: Stefan Reimer <stefan@zero-downtime.net>
|
|
|
|
# Maintainer: Stefan Reimer <stefan@zero-downtime.net>
|
2024-03-12 15:18:42 +00:00
|
|
|
_flavor=lts
|
|
|
|
_extra_flavors=virt
|
|
|
|
|
|
|
|
pkgver=0.37.1
|
2023-07-31 18:19:31 +00:00
|
|
|
pkgrel=0
|
2024-03-12 15:18:42 +00:00
|
|
|
pkgname=falco-kernel-$_flavor
|
2023-07-31 18:19:31 +00:00
|
|
|
pkgdesc="Falco kernel module"
|
|
|
|
url="https://github.com/falcosecurity/falco"
|
|
|
|
arch="x86_64 aarch64"
|
|
|
|
license="AGPL-3.0"
|
2024-03-12 15:18:42 +00:00
|
|
|
makedepends="cmake linux-$_flavor-dev linux-headers"
|
2023-07-31 18:19:31 +00:00
|
|
|
# protobuf-dev jq-dev openssl-dev curl-dev c-ares-dev grpc-dev yaml-dev yaml-cpp-dev jsoncpp-dev re2-dev"
|
|
|
|
# perl autoconf elfutils-dev libtool argp-standalone musl-fts-dev musl-libintl musl-obstack-dev"
|
|
|
|
options="!check"
|
|
|
|
|
|
|
|
source="
|
|
|
|
falco-$pkgver.tar.gz::https://github.com/falcosecurity/falco/archive/refs/tags/$pkgver.tar.gz
|
|
|
|
"
|
|
|
|
builddir="$srcdir/falco-$pkgver"
|
|
|
|
|
2024-03-12 15:18:42 +00:00
|
|
|
for f in $_extra_flavors; do
|
|
|
|
makedepends="$makedepends linux-$f-dev"
|
|
|
|
subpackages="$subpackages falco-kernel-$f:_extra"
|
|
|
|
done
|
2023-07-31 18:19:31 +00:00
|
|
|
|
|
|
|
build() {
|
2024-03-12 15:18:42 +00:00
|
|
|
for flavor in $_flavor $_extra_flavors; do
|
|
|
|
mkdir -p $srcdir/falco-$pkgver/build-$flavor
|
|
|
|
|
|
|
|
# Hack running the build inside a container other uname -r returns host kernel
|
|
|
|
KERNEL_VERSION=$(basename $(ls -d /lib/modules/*-"$flavor"))
|
|
|
|
|
|
|
|
cd $srcdir/falco-$pkgver/build-$flavor
|
|
|
|
cmake .. \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DFALCO_VERSION=$pkgver \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
-DUSE_BUNDLED_DEPS=On \
|
|
|
|
-DMUSL_OPTIMIZED_BUILD=On
|
|
|
|
|
|
|
|
KERNELDIR=/lib/modules/$KERNEL_VERSION/build make driver
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
_package() {
|
|
|
|
local flavor=$1
|
|
|
|
local _out=$2
|
|
|
|
|
|
|
|
KERNEL_VERSION=$(basename $(ls -d /lib/modules/*-"$flavor"))
|
|
|
|
depends="linux-$flavor~$(echo $KERNEL_VERSION | sed -e 's/-.*$//')"
|
|
|
|
|
|
|
|
cd $srcdir/falco-$pkgver/build-$flavor
|
|
|
|
mkdir -p "$_out"/lib/modules/$KERNEL_VERSION/kernel
|
|
|
|
gzip -9 -c driver/falco.ko > "$_out"/lib/modules/$KERNEL_VERSION/kernel/falco.ko.gz
|
2023-07-31 18:19:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2024-03-12 15:18:42 +00:00
|
|
|
_package $_flavor $pkgdir
|
|
|
|
}
|
|
|
|
|
|
|
|
_extra() {
|
|
|
|
flavor=${subpkgname##*-}
|
2023-07-31 18:19:31 +00:00
|
|
|
|
2024-03-12 15:18:42 +00:00
|
|
|
_package $flavor $subpkgdir
|
2023-07-31 18:19:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sha512sums="
|
2024-03-12 15:18:42 +00:00
|
|
|
257d526c4d3eadbe2c79852221fdb8076f94e421aa66753628770ae7384137b4672064cbe1ba0a4d88d14e8a7d08e2521d5bd82a312c4b1442d8ea6fbbbb2f28 falco-0.37.1.tar.gz
|
2023-07-31 18:19:31 +00:00
|
|
|
"
|