PKGBUILDs/extra/netdata/PKGBUILD

98 lines
4.3 KiB
Bash
Raw Normal View History

2021-12-01 14:16:33 +00:00
# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
2017-03-26 21:34:52 +00:00
# Contributor: SanskritFritz (gmail)
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - disable LTO
pkgname=netdata
2024-02-22 17:44:52 +00:00
pkgver=1.44.3
2024-02-07 00:58:59 +00:00
pkgrel=1
2024-01-06 00:52:58 +00:00
_go_ver="0.57.2"
2017-07-17 23:33:22 +00:00
pkgdesc="Real-time performance monitoring, in the greatest possible detail, over the web"
2018-11-06 13:51:20 +00:00
url="https://github.com/netdata/netdata"
2017-12-18 13:26:20 +00:00
arch=('x86_64')
2017-03-26 21:34:52 +00:00
license=('GPL')
2018-11-09 04:10:03 +00:00
backup=('etc/netdata/netdata.conf')
2020-12-28 04:15:59 +00:00
depends=('libmnl' 'libnetfilter_acct' 'zlib' 'judy' 'libuv' 'json-c' 'libcap' 'lz4' 'openssl' 'which' 'snappy' 'protobuf'
2023-05-09 01:55:43 +00:00
'libwebsockets' 'mongo-c-driver' 'libyaml')
2024-01-06 00:52:58 +00:00
makedepends=('cups' 'go')
2017-05-24 12:37:55 +00:00
optdepends=('nodejs: for monitoring named and SNMP devices'
'lm_sensors: for monitoring hardware sensors'
'iproute2: for monitoring Linux QoS'
'python: for most of the external plugins'
'python-psycopg2: for monitoring PostgreSQL databases'
2019-04-12 17:44:15 +00:00
'python-mysqlclient: for monitoring MySQL/MariaDB databases'
2017-05-24 12:37:55 +00:00
'python-requests: for monitoring elasticsearch'
'hddtemp: for monitoring hhd temperature'
2021-07-15 23:35:22 +00:00
'fping: for for fping module'
2017-05-24 12:37:55 +00:00
'apcupsd: for monitoring APC UPS'
2021-03-01 23:47:44 +00:00
'cups: for CUPS plugin'
2017-05-24 12:37:55 +00:00
'iw: for monitoring Linux as access point')
2022-01-27 00:34:28 +00:00
source=("$pkgname-$pkgver.tar.gz::https://github.com/netdata/netdata/releases/download/v$pkgver/netdata-v$pkgver.tar.gz"
2024-01-06 00:52:58 +00:00
"go.d.plugin-${_go_ver}.tar.gz::https://github.com/netdata/go.d.plugin/archive/refs/tags/v${_go_ver}.tar.gz"
"https://github.com/netdata/go.d.plugin/releases/download/v${_go_ver}/go.d.plugin-config-v${_go_ver}.tar.gz"
"netdata.sysusers")
2024-02-22 17:44:52 +00:00
sha512sums=('cbc0698b33d27d78b13fe0a915288a22fc4bb3246c37cf48037650ef9465553a6a92f1702ca273c05cdd9385eecc0713f230939a8341dfe174403d8623388922'
2024-01-06 00:52:58 +00:00
'b8bc855d18245bfa69407a1449be4179375ecd6b6d9014f8726b0ac0c9b52a7ff193e50df82cf09c7a598f96a4edc8f9178b4f77c78af07a1e15e49a2d06b9e8'
'a64683be6d3327ce9500606b22d8d908cf36206934b5437d1c91d893c72cd8e44057f895c7e3986aa22335884903f2835d4b64196a65060d4dee41a6bca321b1'
'a910809a823ba58ca7bdaa72e8d68427b48f452c1fbb2343fa182ecb0a091a7640e73af24b8ba2fdd90e00aed8ef53b7fccd25cb8f04ca9b9fa6c8e52223ca66')
2023-07-04 13:43:53 +00:00
prepare() {
cd $pkgname-v$pkgver
# protobuf 23 requires c++17
sed -e 's|\# AX_CXX_COMPILE_STDCXX(17, noext, optional)|AX_CXX_COMPILE_STDCXX(17, noext, optional)|' -i configure.ac
}
2017-03-26 21:34:52 +00:00
build() {
2021-04-15 14:05:49 +00:00
cd "$pkgname-v$pkgver"
2017-12-18 13:26:20 +00:00
2019-08-07 19:24:23 +00:00
autoreconf -i
2017-12-18 13:26:20 +00:00
./configure \
2020-12-28 04:15:59 +00:00
--prefix="/usr" \
--sbindir="/usr/bin" \
--sysconfdir="/etc" \
--libexecdir="/usr/lib" \
--localstatedir="/var" \
2024-01-06 00:52:58 +00:00
--disable-lto \
--with-zlib \
--with-math \
--with-user=netdata
2017-12-18 13:26:20 +00:00
make
2024-01-06 00:52:58 +00:00
cd ../go.d.plugin-${_go_ver}
go build \
-trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags "-X main.version=${_go_ver} -linkmode external -extldflags \"${LDFLAGS}\"" \
-o go.d.plugin \
./cmd/godplugin
2017-03-26 21:34:52 +00:00
}
package() {
2021-04-15 14:05:49 +00:00
cd "$pkgname-v$pkgver"
2017-03-26 21:34:52 +00:00
2017-12-18 13:26:20 +00:00
make DESTDIR="$pkgdir" install
2017-03-26 21:34:52 +00:00
2024-01-06 00:52:58 +00:00
# go.d.plugin
install -Dm755 ${srcdir}/go.d.plugin-${_go_ver}/go.d.plugin "${pkgdir}/usr/lib/netdata/plugins.d/go.d.plugin"
cp -r "${srcdir}/go.d.conf" "${srcdir}/go.d" "${pkgdir}/usr/lib/${pkgname}/conf.d"
2020-03-19 01:09:30 +00:00
install -Dm644 system/netdata.conf "$pkgdir"/etc/netdata/netdata.conf
2020-03-19 23:56:54 +00:00
chown -R 0:134 "$pkgdir"/usr/share/netdata/web
2017-03-26 21:34:52 +00:00
2024-01-06 00:52:58 +00:00
install -Dm0644 "system/systemd/netdata.service.v235" "${pkgdir}/usr/lib/systemd/system/netdata.service"
install -Dm0644 "system/logrotate/netdata" "${pkgdir}/etc/logrotate.d/netdata"
install -Dm0644 "${srcdir}/netdata.sysusers" "${pkgdir}/usr/lib/sysusers.d/netdata.conf"
2023-08-13 22:06:11 +00:00
# https://github.com/netdata/netdata/tree/master/collectors/apps.plugin#permissions
2024-01-06 00:52:58 +00:00
# Also check curl -Ss https://raw.githubusercontent.com/netdata/netdata/master/netdata.spec.in | grep "%caps"
setcap cap_net_admin,cap_net_raw+eip "${pkgdir}/usr/lib/netdata/plugins.d/go.d.plugin"
setcap cap_dac_read_search,cap_sys_ptrace+ep "${pkgdir}/usr/lib/netdata/plugins.d/apps.plugin"
setcap cap_dac_read_search+ep "${pkgdir}/usr/lib/netdata/plugins.d/slabinfo.plugin"
setcap cap_perfmon,cap_sys_admin+ep "${pkgdir}/usr/lib/netdata/plugins.d/perf.plugin"
setcap cap_dac_read_search+ep "${pkgdir}/usr/lib/netdata/plugins.d/debugfs.plugin"
setcap cap_dac_read_search+ep "${pkgdir}/usr/lib/netdata/plugins.d/systemd-journal.plugin"
2017-03-26 21:34:52 +00:00
}