aboutsummaryrefslogtreecommitdiffstats
path: root/community/zabbix
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-03-28 13:54:43 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-03-28 18:38:20 +0200
commit4272e802a1be191657becb739e6a248c1d0411a7 (patch)
treea07a25b7c99d7da326957a88173ba49583cf6b2a /community/zabbix
parent3e272105092cd9804a5a022a188db929ebf440da (diff)
downloadaports-4272e802a1be191657becb739e6a248c1d0411a7.tar.bz2
aports-4272e802a1be191657becb739e6a248c1d0411a7.tar.xz
community/*: move php5 and dependent pkgs from main
There two main reasons for this change: * Active support of PHP 5.x ended on January 2017, security support will end on December 2018. Packages in the main repository should be supported for at least 2 years, this means until first quarter of 2019 for the upcoming v3.6. * php7 and its extensions are currently in the community repository, so we can't use single abuild for both php5-* and php7-* packages (as we do for Python and Lua packages). This change was suggested by @vakartel, approved by @ncopa, @kaniini, and @jirutka.
Diffstat (limited to 'community/zabbix')
-rw-r--r--community/zabbix/APKBUILD201
-rw-r--r--community/zabbix/automake.patch11
-rw-r--r--community/zabbix/musl-fix-includes.patch13
-rw-r--r--community/zabbix/zabbix-agent.pre-install6
-rw-r--r--community/zabbix/zabbix-agentd.initd33
-rw-r--r--community/zabbix/zabbix-getloadavg.patch31
-rw-r--r--community/zabbix/zabbix-proxy.initd21
-rw-r--r--community/zabbix/zabbix-server.confd2
-rw-r--r--community/zabbix/zabbix-server.initd11
-rw-r--r--community/zabbix/zabbix.pre-install6
-rw-r--r--community/zabbix/zabbix_server.conf.patch11
11 files changed, 346 insertions, 0 deletions
diff --git a/community/zabbix/APKBUILD b/community/zabbix/APKBUILD
new file mode 100644
index 0000000000..e0f148d734
--- /dev/null
+++ b/community/zabbix/APKBUILD
@@ -0,0 +1,201 @@
+# Contributor: Ɓukasz Jendrysik <scadu@yandex.com>
+# Contributor: Jeff Bilyk <jbilyk at gmail>
+# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=zabbix
+pkgver=3.2.4
+pkgrel=1
+pkgdesc="Enterprise-class open source distributed monitoring"
+url="http://www.zabbix.com"
+arch="all"
+license="GPL"
+depends="fping"
+_php=php5
+_php_depends="$_php ${_php}-gd ${_php}-curl ${_php}-bcmath ${_php}-sockets
+ ${_php}-iconv ${_php}-xmlreader ${_php}-ctype ${_php}-gettext"
+makedepends="postgresql-dev curl-dev net-snmp-dev
+ sqlite-dev mariadb-dev curl-dev openipmi-dev unixodbc-dev
+ libxml2-dev autoconf automake libssh2-dev gnutls-dev
+ $_php_depends"
+install="$pkgname.pre-install"
+pkgusers="zabbix"
+pkggroups="zabbix"
+subpackages="$pkgname-doc $pkgname-agent $pkgname-pgsql $pkgname-mysql
+ $pkgname-webif::noarch $pkgname-sqlite $pkgname-utils $pkgname-setup::noarch"
+source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
+ zabbix-getloadavg.patch
+ automake.patch
+ musl-fix-includes.patch
+ zabbix-server.initd
+ zabbix-server.confd
+ zabbix-agentd.initd
+ zabbix-proxy.initd
+ zabbix_server.conf.patch
+ "
+
+_builddir="$srcdir"/$pkgname-$pkgver
+
+# security fixes:
+# 3.0.4-r0:
+# - 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
+ # 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
+ done
+}
+
+build() {
+ # set default configure flags
+ _configure="--prefix=/usr \
+ --sysconfdir=/etc/zabbix \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --enable-server \
+ --enable-agent \
+ --enable-proxy \
+ --enable-ipv6 \
+ --with-net-snmp \
+ --with-libcurl \
+ --with-libxml2 \
+ --with-openipmi \
+ --with-unixodbc \
+ --with-ssh2 \
+ --with-gnutls
+ "
+ # we run build for each db type
+ # make sure prepare is same for each db
+ for db in postgresql mysql sqlite3; do
+ cd "$srcdir"
+ msg "Building for $db"
+ cp -r "$pkgname-$pkgver" "$pkgname-$pkgver-$db"
+ cd "$_builddir-$db"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --with-$db \
+ $_configure \
+ || return 1
+ make || return 1
+ done
+}
+
+package() {
+ # doing manual install
+ for i in agentd proxy server; do
+ install -D -m755 "$_builddir"/man/zabbix_$i.man \
+ "$pkgdir"/usr/share/man/man8/zabbix_$i.8
+ done
+ for i in get sender; do
+ install -D -m755 "$_builddir"/man/zabbix_$i.man \
+ "$pkgdir"/usr/share/man/man1/zabbix_$i.1
+ done
+ install -d -m0750 -o zabbix -g zabbix \
+ "$pkgdir"/var/run/zabbix "$pkgdir"/var/log/zabbix
+ install -D -m0644 "$_builddir"/conf/zabbix_server.conf \
+ "$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
+ done
+ install -D -m0644 "$srcdir"/zabbix-server.confd \
+ "$pkgdir"/etc/conf.d/zabbix-server || return 1
+}
+
+setup() {
+ pkgdesc="Zabbix images and sql files"
+ depends=
+ mkdir -p "$subpkgdir"/usr/share/zabbix/ || return 1
+ mv "$_builddir"/database "$subpkgdir"/usr/share/zabbix/
+}
+
+_do_db() {
+ pkgdesc="Zabbix server with $1 database support"
+ depends="$pkgname $2"
+ local i=
+ mkdir -p "$subpkgdir"/usr/sbin
+ mv "$_builddir-$1"/src/zabbix_server/zabbix_server \
+ "$subpkgdir"/usr/sbin/ || return 1
+ mv "$_builddir-$1"/src/zabbix_proxy/zabbix_proxy \
+ "$subpkgdir"/usr/sbin/ || return 1
+ install -D -m0644 "$_builddir"/conf/zabbix_proxy.conf \
+ "$pkgdir"/etc/zabbix/zabbix_proxy.conf || return 1
+ cd "$_builddir"
+ for i in upgrades/dbpatches/*/$1; do
+ [ -e $i ] || continue
+ mkdir -p "$subpkgdir"/usr/share/zabbix/${i%/*}
+ mv "$i" "$subpkgdir"/usr/share/zabbix/$i
+ done
+ return 0
+}
+
+pgsql() { _do_db postgresql "!$pkgname-mysql !$pkgname-sqlite";}
+mysql() { _do_db mysql "!$pkgname-pgsql !$pkgname-sqlite";}
+sqlite(){ _do_db sqlite3 "!$pkgname-pgsql !$pkgname-mysql";}
+
+utils() {
+ pkgdesc="Zabbix client utilities"
+ depends=
+ mkdir -p "$subpkgdir"/usr/bin
+ mv "$_builddir-postgresql"/src/zabbix_get/zabbix_get \
+ "$subpkgdir"/usr/bin
+ mv "$_builddir-postgresql"/src/zabbix_sender/zabbix_sender \
+ "$subpkgdir"/usr/bin
+}
+
+webif() {
+ pkgdesc="Zabbix web-interface"
+ depends="$_php_depends"
+ _wwwdir="$subpkgdir"/usr/share/webapps/zabbix
+ mkdir -p $_wwwdir
+ mv "$_builddir"/frontends/php/* "$_wwwdir"
+}
+
+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 -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="62e532bcf6a5ab82b1f943e28d46d1e64782758a405680d2c1a54e9c1092a340a50987045acbbad2b57439e3c2640d8a11fe1a29a234764859befa6a7fd779d1 zabbix-3.2.4.tar.gz
+b65c6ba7701d98ae7f6fe2124c1d2b8b8fea3c3cc7ee080bf99f5afff0aaa6a025c2a1f5136b4700b53d1b7609e6185642650d7edd013c554b2af37fddae771c zabbix-getloadavg.patch
+9bff8966cb8b3f1767bfb1b3f3529bca5c9957f2c8179a40ded3b4e43615ba9fb408aef43092fd119b7df80b042555d05c9780fac3760176b95524aa48252fee automake.patch
+9b87ec1ea4a9cbb501c16012d498cdae82a696f4cd495e1e8cb201d9e31c6e135da5bb264c6273f2de87297bd3e4bd16f66703610686f5d610e3316ee24aac91 musl-fix-includes.patch
+3a25bf9f428f55545dd735aea2855e0e4927e006ca01a2f918ec161ffe9b2ec66e46598bf34208e24535e1d04e33087f42eb8226b17eb4118abd6507bbb10ff5 zabbix-server.initd
+a91821c6086a1fc0197750cc68073419defcb7d775b11b14a993409a8f61c7a1a0a0af95de27eed9f3b8357f8362640cb1b26b91b56f4f1d714ca6f222d02b80 zabbix-server.confd
+7cc2672b717f1b47b12342fe225e9dc3838c61a0bf81d359d0a71efb0adc9b354fb8bc8b5bb64c9defa5700bcaf651b35778194a50b6b03b0a723dce76460092 zabbix-agentd.initd
+e19490e724c6e4ecdadf7ee3898567b82f18ea2a894ef709bfc181c3076d50435b45429207dd4d537aacbec0242d83393240e48b434d9681ebb0d67a45643ed1 zabbix-proxy.initd
+e0c9f937d39e15fa34e70e8ae9e6578b221b51c13dc0515e807675d153a85ab6370ed20ce2d06aa4457baaf3963edce525cd00e85fb105b36b58741798d13836 zabbix_server.conf.patch"
diff --git a/community/zabbix/automake.patch b/community/zabbix/automake.patch
new file mode 100644
index 0000000000..d92e10b077
--- /dev/null
+++ b/community/zabbix/automake.patch
@@ -0,0 +1,11 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -27,7 +27,7 @@
+
+ AC_PROG_MAKE_SET
+
+-AM_CONFIG_HEADER(include/config.h)
++AC_CONFIG_HEADER(include/config.h)
+
+ AC_CANONICAL_HOST
+
diff --git a/community/zabbix/musl-fix-includes.patch b/community/zabbix/musl-fix-includes.patch
new file mode 100644
index 0000000000..c36759dcde
--- /dev/null
+++ b/community/zabbix/musl-fix-includes.patch
@@ -0,0 +1,13 @@
+--- zabbix-2.2.1.orig/include/sysinc.h
++++ zabbix-2.2.1/include/sysinc.h
+@@ -126,10 +126,6 @@
+ # include <sys/times.h>
+ #endif
+
+-#ifdef HAVE_LINUX_KERNEL_H
+-# include <linux/kernel.h>
+-#endif
+-
+ #ifdef HAVE_ARPA_NAMESER_H
+ #ifdef MAC_OS_X
+ # define BIND_8_COMPAT 1
diff --git a/community/zabbix/zabbix-agent.pre-install b/community/zabbix/zabbix-agent.pre-install
new file mode 100644
index 0000000000..9cc2bfb908
--- /dev/null
+++ b/community/zabbix/zabbix-agent.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S zabbix 2>/dev/null
+adduser -S -D -H -h /dev/null -s /sbin/nologin -G zabbix -g zabbix zabbix 2>/dev/null
+
+exit 0
diff --git a/community/zabbix/zabbix-agentd.initd b/community/zabbix/zabbix-agentd.initd
new file mode 100644
index 0000000000..5b49535a59
--- /dev/null
+++ b/community/zabbix/zabbix-agentd.initd
@@ -0,0 +1,33 @@
+#!/sbin/openrc-run
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix/files/1.6.6/init.d/zabbix-agentd,v 1.1 2009/10/05 15:55:23 patrick Exp $
+
+# ensure the same file is specified as PidFile in /etc/zabbix/zabbix_agentd.conf
+pidfile=/var/run/zabbix/zabbix_agentd.pid
+user=zabbix
+group=zabbix
+
+start_pre() {
+ checkpath --owner ${user}:${group} --directory ${pidfile%/*}
+}
+
+
+depend() {
+ need net
+ provide zabbix-agent
+ use zabbix-server
+}
+
+start() {
+ ebegin "Starting Zabbix agent"
+ start-stop-daemon --pidfile ${pidfile} --start --user ${user}:${group} --exec /usr/sbin/zabbix_agentd
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Zabbix agent"
+ start-stop-daemon --stop --user ${user} --pidfile ${pidfile}
+ eend $?
+}
+
diff --git a/community/zabbix/zabbix-getloadavg.patch b/community/zabbix/zabbix-getloadavg.patch
new file mode 100644
index 0000000000..c6a458e1b4
--- /dev/null
+++ b/community/zabbix/zabbix-getloadavg.patch
@@ -0,0 +1,31 @@
+--- a/src/libs/zbxsysinfo/linux/cpu.c
++++ b/src/libs/zbxsysinfo/linux/cpu.c
+@@ -21,6 +21,28 @@
+ #include "sysinfo.h"
+ #include "stats.h"
+
++#ifndef HAVE_GETLOADAVG
++/*! \brief Alternative method of getting load avg on Linux only */
++int getloadavg(double *list, int nelem)
++{
++ FILE *LOADAVG;
++ double avg[3] = { 0.0, 0.0, 0.0 };
++ int i, res = -1;
++
++ if ((LOADAVG = fopen("/proc/loadavg", "r"))) {
++ fscanf(LOADAVG, "%lf %lf %lf", &avg[0], &avg[1], &avg[2]);
++ res = 0;
++ fclose(LOADAVG);
++ }
++
++ for (i = 0; (i < nelem) && (i < 3); i++) {
++ list[i] = avg[i];
++ }
++
++ return res;
++}
++#endif
++
+ int SYSTEM_CPU_NUM(AGENT_REQUEST *request, AGENT_RESULT *result)
+ {
+ char *type;
diff --git a/community/zabbix/zabbix-proxy.initd b/community/zabbix/zabbix-proxy.initd
new file mode 100644
index 0000000000..619596415e
--- /dev/null
+++ b/community/zabbix/zabbix-proxy.initd
@@ -0,0 +1,21 @@
+#!/sbin/openrc-run
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix/files/1.6.6/init.d/zabbix-proxy,v 1.1 2009/10/06 16:24:35 patrick Exp $
+
+depend() {
+ need net
+ #use mysql postgresql
+}
+
+start() {
+ ebegin "Starting Zabbix proxy"
+ start-stop-daemon --start --user zabbix:zabbix --exec /usr/sbin/zabbix_proxy
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Zabbix proxy"
+ start-stop-daemon --stop --user zabbix --pidfile /var/run/zabbix/zabbix_proxy.pid
+ eend $?
+}
diff --git a/community/zabbix/zabbix-server.confd b/community/zabbix/zabbix-server.confd
new file mode 100644
index 0000000000..3cc9996400
--- /dev/null
+++ b/community/zabbix/zabbix-server.confd
@@ -0,0 +1,2 @@
+pidfile="/var/run/zabbix/zabbix_server.pid"
+command="/usr/sbin/zabbix_server"
diff --git a/community/zabbix/zabbix-server.initd b/community/zabbix/zabbix-server.initd
new file mode 100644
index 0000000000..c2697cba4d
--- /dev/null
+++ b/community/zabbix/zabbix-server.initd
@@ -0,0 +1,11 @@
+#!/sbin/openrc-run
+
+depend() {
+ need net
+ use mysql postgresql
+ after firewall
+}
+
+start_pre() {
+ checkpath -d -m 0775 -o zabbix:zabbix /var/run/zabbix
+}
diff --git a/community/zabbix/zabbix.pre-install b/community/zabbix/zabbix.pre-install
new file mode 100644
index 0000000000..9cc2bfb908
--- /dev/null
+++ b/community/zabbix/zabbix.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S zabbix 2>/dev/null
+adduser -S -D -H -h /dev/null -s /sbin/nologin -G zabbix -g zabbix zabbix 2>/dev/null
+
+exit 0
diff --git a/community/zabbix/zabbix_server.conf.patch b/community/zabbix/zabbix_server.conf.patch
new file mode 100644
index 0000000000..44c22f114f
--- /dev/null
+++ b/community/zabbix/zabbix_server.conf.patch
@@ -0,0 +1,11 @@
+--- a/conf/zabbix_server.conf
++++ b/conf/zabbix_server.conf
+@@ -56,7 +56,7 @@
+ #
+ # Mandatory: no
+ # Default:
+-# PidFile=/tmp/zabbix_server.pid
++PidFile=/tmp/zabbix_server.pid
+
+ ### Option: DBHost
+ # Database host name.