138 lines
3.2 KiB
Plaintext
138 lines
3.2 KiB
Plaintext
# Maintainer: Zabbix APK Builder <support@example.com>
|
|
pkgname=zabbix
|
|
pkgver=7.4.2
|
|
pkgrel=0
|
|
pkgdesc="An enterprise-class open source distributed monitoring solution"
|
|
url="https://www.zabbix.com/"
|
|
arch="all"
|
|
license="AGPL-3.0-only"
|
|
makedepends="
|
|
alpine-sdk
|
|
autoconf
|
|
automake
|
|
libtool
|
|
pcre2-dev
|
|
libevent-dev
|
|
openssl-dev
|
|
net-snmp-dev
|
|
curl-dev
|
|
sqlite-dev
|
|
unixodbc-dev
|
|
postgresql-dev
|
|
mysql-dev
|
|
libxml2-dev
|
|
zlib-dev
|
|
"
|
|
subpackages="$pkgname-agent $pkgname-proxy"
|
|
source="https://cdn.zabbix.com/zabbix/sources/stable/7.4/zabbix-$pkgver.tar.gz"
|
|
|
|
# User and group for Zabbix
|
|
_zabbix_user="zabbix"
|
|
_zabbix_group="zabbix"
|
|
|
|
prepare() {
|
|
default_prepare
|
|
autoreconf -fiv
|
|
}
|
|
|
|
build() {
|
|
# Common configuration options
|
|
local _common_config="
|
|
--prefix=/usr
|
|
--sysconfdir=/etc/zabbix
|
|
--localstatedir=/var
|
|
--enable-ipv6
|
|
--with-libcurl
|
|
--with-libxml2
|
|
--with-net-snmp
|
|
--with-openssl
|
|
--with-pcre2
|
|
"
|
|
|
|
# Build agent
|
|
./configure $_common_config \
|
|
--enable-agent \
|
|
--disable-server \
|
|
--disable-proxy
|
|
make
|
|
|
|
# Save agent binary
|
|
mv src/zabbix_agentd/zabbix_agentd zabbix_agentd.built
|
|
|
|
# Clean for proxy build
|
|
make clean
|
|
|
|
# Build proxy
|
|
./configure $_common_config \
|
|
--disable-agent \
|
|
--disable-server \
|
|
--enable-proxy \
|
|
--with-sqlite3
|
|
make
|
|
|
|
# Save proxy binary
|
|
mv src/zabbix_proxy/zabbix_proxy zabbix_proxy.built
|
|
}
|
|
|
|
package() {
|
|
# Main package - create zabbix user
|
|
addgroup -S $_zabbix_group
|
|
adduser -S -D -H -h /var/lib/zabbix -s /sbin/nologin -G $_zabbix_group $_zabbix_user
|
|
|
|
# Create common directories
|
|
install -d -m755 -o $_zabbix_user -g $_zabbix_group \
|
|
"$pkgdir"/var/lib/zabbix \
|
|
"$pkgdir"/var/log/zabbix \
|
|
"$pkgdir"/var/run/zabbix
|
|
|
|
# Install common configuration files
|
|
install -d -m755 "$pkgdir"/etc/zabbix
|
|
}
|
|
|
|
agent() {
|
|
pkgdesc="Zabbix monitoring agent"
|
|
depends="pcre2 libevent openssl net-snmp curl"
|
|
|
|
# Install agent binary
|
|
install -d -m755 "$subpkgdir"/usr/sbin
|
|
install -m755 "$builddir"/zabbix_agentd.built "$subpkgdir"/usr/sbin/zabbix_agentd
|
|
|
|
# Install agent configuration
|
|
install -d -m755 "$subpkgdir"/etc/zabbix
|
|
install -m640 -o root -g $_zabbix_group \
|
|
"$builddir"/conf/zabbix_agentd.conf "$subpkgdir"/etc/zabbix/
|
|
|
|
# Create agent-specific directories
|
|
install -d -m755 -o $_zabbix_user -g $_zabbix_group \
|
|
"$subpkgdir"/var/lib/zabbix/agent \
|
|
"$subpkgdir"/var/log/zabbix/agent
|
|
|
|
# Install init script placeholder (to be created separately)
|
|
install -d -m755 "$subpkgdir"/etc/init.d
|
|
}
|
|
|
|
proxy() {
|
|
pkgdesc="Zabbix monitoring proxy with SQLite support"
|
|
depends="pcre2 libevent openssl net-snmp curl sqlite libxml2"
|
|
|
|
# Install proxy binary
|
|
install -d -m755 "$subpkgdir"/usr/sbin
|
|
install -m755 "$builddir"/zabbix_proxy.built "$subpkgdir"/usr/sbin/zabbix_proxy
|
|
|
|
# Install proxy configuration
|
|
install -d -m755 "$subpkgdir"/etc/zabbix
|
|
install -m640 -o root -g $_zabbix_group \
|
|
"$builddir"/conf/zabbix_proxy.conf "$subpkgdir"/etc/zabbix/
|
|
|
|
# Create proxy-specific directories
|
|
install -d -m755 -o $_zabbix_user -g $_zabbix_group \
|
|
"$subpkgdir"/var/lib/zabbix/proxy \
|
|
"$subpkgdir"/var/log/zabbix/proxy
|
|
|
|
# Install init script placeholder (to be created separately)
|
|
install -d -m755 "$subpkgdir"/etc/init.d
|
|
}
|
|
|
|
# Checksums will be updated by CI/CD workflow
|
|
sha512sums="SKIP"
|