mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-04 12:01:41 +02:00
testing/vector: new aport
This commit is contained in:
parent
4ce1ba8b57
commit
b4fed727fd
82
testing/vector/APKBUILD
Normal file
82
testing/vector/APKBUILD
Normal file
@ -0,0 +1,82 @@
|
||||
# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
|
||||
pkgname=vector
|
||||
pkgver=0.28.1
|
||||
pkgrel=0
|
||||
pkgdesc="High-performance observability data pipeline"
|
||||
url="https://vector.dev/"
|
||||
# s390x, ppc64le, riscv64: blocked by ring crate
|
||||
# 32-bit: memory allocation error
|
||||
arch="all !s390x !ppc64le !riscv64 !x86 !armhf !armv7"
|
||||
license="MPL-2.0"
|
||||
makedepends="
|
||||
cargo
|
||||
cmake
|
||||
librdkafka-dev
|
||||
openssl-dev
|
||||
perl
|
||||
protobuf-dev
|
||||
protoc
|
||||
python3
|
||||
"
|
||||
checkdepends="bash cargo-nextest tzdata"
|
||||
subpackages="$pkgname-doc $pkgname-openrc"
|
||||
source="
|
||||
$pkgname-$pkgver.tar.gz::https://github.com/vectordotdev/vector/archive/refs/tags/v$pkgver.tar.gz
|
||||
skip-pkcs12-test.patch
|
||||
vector.initd
|
||||
vector.confd
|
||||
logrotate
|
||||
"
|
||||
|
||||
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL="sparse"
|
||||
export OPENSSL_NO_VENDOR=1
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
|
||||
# "cargo build" still tries to pull dependencies for other platforms
|
||||
cargo fetch --locked
|
||||
}
|
||||
|
||||
build() {
|
||||
cargo build \
|
||||
--release \
|
||||
--frozen \
|
||||
--no-default-features \
|
||||
--features default-musl,component-validation-runner
|
||||
|
||||
# cargo-nextest drops the release build, so back it up here
|
||||
cp -r target/release releasebuild
|
||||
}
|
||||
|
||||
check() {
|
||||
# Upstream recommends running tests with "cargo nextest" instead of "cargo test"
|
||||
cargo nextest run \
|
||||
--fail-fast \
|
||||
--frozen \
|
||||
--no-default-features \
|
||||
--offline \
|
||||
--release \
|
||||
--workspace \
|
||||
--test-threads num-cpus
|
||||
}
|
||||
|
||||
package() {
|
||||
install -Dm755 releasebuild/vector -t "$pkgdir"/usr/bin/
|
||||
install -Dm644 config/vector.toml -t "$pkgdir"/etc/vector/
|
||||
install -Dm644 "$srcdir"/logrotate "$pkgdir"/etc/logrotate.d/vector
|
||||
|
||||
mkdir -p "$pkgdir"/usr/share/doc/vector
|
||||
cp -r config/examples "$pkgdir"/usr/share/doc/vector/examples
|
||||
|
||||
install -Dm755 "$srcdir"/vector.initd "$pkgdir"/etc/init.d/vector
|
||||
install -Dm644 "$srcdir"/vector.confd "$pkgdir"/etc/conf.d/vector
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
c8d31d8bfcf2316fdedbcb3c779cac371bc062ee833f0aeb9fb32b167b04a8ab9fe787e3666270badefe5a652d02176a8e019b9c63e770d0f880a9493f63c2ae vector-0.28.1.tar.gz
|
||||
7c7383005235eaba9bc050273d885b4348c0a3246abfc26da13acef495961e5930f1e309d9bb715216d14a35141a86de719804001cd5d10d33079384a06af5c5 skip-pkcs12-test.patch
|
||||
806c2594d9d7b4bf1c24436a3982801a37ec3d8784acb97266eb7111fe35d8d05a64ef981100bd8aa35a71ad9c7c98de634428f696bded31993143ca572b6757 vector.initd
|
||||
313f79e65e61754e8a611f8221d7c0cf36ee5af6f30aeff720924e64bb03d7f44c54fc31ae20926c354905f61df347830a7cba0c37afd41c1f59a25c52fa6f06 vector.confd
|
||||
62db792de321655558bdb23ab9b3a7b35b84de445657011d88e8205cce4a926ff7b20f5304ec48fa646f1f259ad2136eceb5a377c4520071799da502eeff7592 logrotate
|
||||
"
|
||||
14
testing/vector/logrotate
Normal file
14
testing/vector/logrotate
Normal file
@ -0,0 +1,14 @@
|
||||
/var/log/vector.log {
|
||||
rotate 4
|
||||
weekly
|
||||
compress
|
||||
delaycompress
|
||||
notifempty
|
||||
missingok
|
||||
copytruncate
|
||||
minsize 100k
|
||||
create 0644 vector vector
|
||||
postrotate
|
||||
/sbin/rc-service vector reload
|
||||
endscript
|
||||
}
|
||||
12
testing/vector/skip-pkcs12-test.patch
Normal file
12
testing/vector/skip-pkcs12-test.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff --git a/lib/vector-core/src/tls/settings.rs b/lib/vector-core/src/tls/settings.rs
|
||||
index 6406e43..3e94208 100644
|
||||
--- a/lib/vector-core/src/tls/settings.rs
|
||||
+++ b/lib/vector-core/src/tls/settings.rs
|
||||
@@ -625,6 +625,7 @@ mod test {
|
||||
}
|
||||
|
||||
#[test]
|
||||
+ #[ignore]
|
||||
fn from_options_pkcs12() {
|
||||
let options = TlsConfig {
|
||||
crt_file: Some(TEST_PKCS12_PATH.into()),
|
||||
13
testing/vector/vector.confd
Normal file
13
testing/vector/vector.confd
Normal file
@ -0,0 +1,13 @@
|
||||
# vector service configuration options
|
||||
|
||||
# extra arguments to pass to vector
|
||||
command_args=""
|
||||
|
||||
# user:group to run the process with
|
||||
command_user="vector:vector"
|
||||
|
||||
# where to store logs for vector process output
|
||||
#logfile="/var/log/vector.log"
|
||||
|
||||
# comment to use traditional service management
|
||||
supervisor=supervise-daemon
|
||||
38
testing/vector/vector.initd
Normal file
38
testing/vector/vector.initd
Normal file
@ -0,0 +1,38 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
: ${command_user:="vector:vector"}
|
||||
: ${logfile:="/var/log/$RC_SVCNAME.log"}
|
||||
|
||||
name=vector
|
||||
description="Vector high-performance observability data pipeline"
|
||||
command="/usr/bin/vector"
|
||||
command_background="yes"
|
||||
pidfile="/run/$RC_SVCNAME.pid"
|
||||
capabilities="^cap_net_bind_service"
|
||||
|
||||
extra_started_commands="reload"
|
||||
description_reload="Reload vector daemon"
|
||||
|
||||
output_log="$logfile"
|
||||
error_log="$logfile"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
after firewall
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath -d -o $command_user /var/lib/vector
|
||||
$command validate
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "Reloading $RC_SVCNAME"
|
||||
$command validate
|
||||
if [ -n "$supervisor" ]; then
|
||||
$supervisor "$RC_SVCNAME" --signal HUP
|
||||
else
|
||||
start-stop-daemon --signal HUP --pidfile "$pidfile"
|
||||
fi
|
||||
eend $?
|
||||
}
|
||||
7
testing/vector/vector.pre-install
Normal file
7
testing/vector/vector.pre-install
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
addgroup -S vector 2>/dev/null
|
||||
adduser -S -D -h /var/lib/vector -s /sbin/nologin -G vector -g vector vector 2>/dev/null
|
||||
adduser vector adm 2>/dev/null
|
||||
|
||||
exit 0
|
||||
Loading…
x
Reference in New Issue
Block a user