diff options
author | Shiz <hi@shiz.me> | 2018-08-05 17:47:02 +0200 |
---|---|---|
committer | Shiz <hi@shiz.me> | 2018-08-05 17:47:02 +0200 |
commit | 1fa35e6d8adecf3646730ea070af3be110bbe1f4 (patch) | |
tree | d519a62113b82de739de202f345f7039f39f0e87 /community/zabbix | |
parent | 7606fbf37529f500776926096a2dae3f75262c3e (diff) | |
download | aports-1fa35e6d8adecf3646730ea070af3be110bbe1f4.tar.bz2 aports-1fa35e6d8adecf3646730ea070af3be110bbe1f4.tar.xz |
community/zabbix: modernize and add agent OpenRC subpackage
Diffstat (limited to 'community/zabbix')
-rw-r--r-- | community/zabbix/APKBUILD | 66 |
1 files changed, 29 insertions, 37 deletions
diff --git a/community/zabbix/APKBUILD b/community/zabbix/APKBUILD index 5ccb5f0df3..70788c7784 100644 --- a/community/zabbix/APKBUILD +++ b/community/zabbix/APKBUILD @@ -23,7 +23,8 @@ pkgusers="zabbix" pkggroups="zabbix" options="!check" # no tests available subpackages="$pkgname-doc $pkgname-agent $pkgname-pgsql $pkgname-mysql $pkgname-sqlite - $pkgname-webif::noarch $pkgname-utils $pkgname-setup::noarch $pkgname-openrc" + $pkgname-webif::noarch $pkgname-utils $pkgname-setup::noarch + $pkgname-openrc $pkgname-agent-openrc" source="https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz zabbix-server.initd zabbix-server.confd @@ -43,31 +44,15 @@ builddir="$srcdir"/$pkgname-$pkgver # - CVE N/A ZBX-11023 prepare() { - cd "$builddir" - # update_config_sub || return 1 - for i in $source; do - case $i in - *eglibc*.patch) - if [ "$CLIBC" == "eglibc" ]; then - msg "Applying $i" - patch -p1 -i "$srcdir"/$i || return 1 - fi - ;; - *.patch) - msg "Applying $i" - patch -p1 -i "$srcdir"/$i || return 1 - ;; - esac - done - aclocal -I m4 && autoconf && autoheader \ - && automake --add-missing || return 1 - # update_config_sub + default_prepare + autoreconf -fvi + # Fix config file locations for file in server agentd proxy; do sed -i "$builddir"/conf/zabbix_${file}.conf \ -e 's|SNMPTrapperFile=/tmp|SNMPTrapperFile=/var/log/zabbix|' \ -e 's|PidFile=/tmp|PidFile=/var/run/zabbix|' \ - -e 's|LogFile=/tmp|LogFile=/var/log/zabbix|' || return 1 + -e 's|LogFile=/tmp|LogFile=/var/log/zabbix|' done } @@ -101,7 +86,7 @@ build() { --build=$CBUILD \ --host=$CHOST \ --with-$db \ - $_configure \ + $_configure ;; *) ./configure \ @@ -109,10 +94,10 @@ build() { --host=$CHOST \ --enable-server \ --with-$db \ - $_configure \ - || return 1 + $_configure + ;; esac - make || return 1 + make done } @@ -132,16 +117,16 @@ package() { "$pkgdir"/etc/zabbix/zabbix_server.conf for i in server proxy; do install -D -m0755 "$srcdir"/zabbix-$i.initd \ - "$pkgdir"/etc/init.d/zabbix-$i || return 1 + "$pkgdir"/etc/init.d/zabbix-$i done install -D -m0644 "$srcdir"/zabbix-server.confd \ - "$pkgdir"/etc/conf.d/zabbix-server || return 1 + "$pkgdir"/etc/conf.d/zabbix-server } setup() { pkgdesc="Zabbix images and sql files" depends= - mkdir -p "$subpkgdir"/usr/share/zabbix/ || return 1 + mkdir -p "$subpkgdir"/usr/share/zabbix mv "$builddir"/database "$subpkgdir"/usr/share/zabbix/ } @@ -152,12 +137,12 @@ _do_db() { mkdir -p "$subpkgdir"/usr/sbin if [ "$1" != "sqlite3" ]; then mv "$builddir-$1"/src/zabbix_server/zabbix_server \ - "$subpkgdir"/usr/sbin/ || return 1 + "$subpkgdir"/usr/sbin fi mv "$builddir-$1"/src/zabbix_proxy/zabbix_proxy \ - "$subpkgdir"/usr/sbin/ || return 1 + "$subpkgdir"/usr/sbin install -D -m0644 "$builddir"/conf/zabbix_proxy.conf \ - "$pkgdir"/etc/zabbix/zabbix_proxy.conf || return 1 + "$pkgdir"/etc/zabbix/zabbix_proxy.conf cd "$builddir" for i in upgrades/dbpatches/*/$1; do [ -e $i ] || continue @@ -193,16 +178,23 @@ agent() { pkgdesc="Zabbix Network Monitoring Agent" depends= install="$subpkgname.pre-install" - install -d -m0750 -o zabbix -g zabbix \ - "$subpkgdir"/var/run/zabbix "$subpkgdir"/var/log/zabbix + + install -d -m0750 -o zabbix -g zabbix \ + "$subpkgdir"/var/run/zabbix "$subpkgdir"/var/log/zabbix + mkdir -p "$subpkgdir"/usr/sbin + mv "$builddir-postgresql"/src/zabbix_agent/zabbix_agentd \ + "$subpkgdir"/usr/sbin +} + +agent_openrc() { + pkgdesc="Zabbix Network Monitoring Agent (OpenRC init scripts)" + depends=openrc + install_if="openrc $pkgname-agent=$pkgver-r$pkgrel" + install -D -m0644 "$builddir"/conf/zabbix_agentd.conf \ "$subpkgdir"/etc/zabbix/zabbix_agentd.conf install -D -m0755 "$srcdir"/zabbix-agentd.initd \ "$subpkgdir"/etc/init.d/zabbix-agentd - mkdir -p "$subpkgdir"/usr/sbin - mv "$builddir-postgresql"/src/zabbix_agent/zabbix_agentd \ - "$subpkgdir"/usr/sbin/ - } sha512sums="6707ff5a15d2c139775b4b5de32ceb4982c90aa4023af310ab9cb849895387984d32f59b7dc9fbaff8f317a630238437e4651ab8272b4535fb5fc3d88750e3ef zabbix-3.4.12.tar.gz |