Добавление ebuild из старого оверлея

This commit is contained in:
imax-ua
2024-04-09 15:52:53 +00:00
parent dadbb93565
commit 9daff4138f
35 changed files with 2053 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
AUX zabbix-jmx-proxy.conf 432 BLAKE2B 188737819d39b9e8ec8913237ff048a68ef19f2ec8849bab6c62bea612ac927d00a6c7042ba87261297ff580ef9976618d6acbd24c7fda8f6eb26b2b3dc891bb SHA512 0d68b9681528256131e35b5115053242f8558f5ad06254e61a16ab14f6530048551f0b777fa81d4afe07cc6282c31a6204fd0ee2e56e0e792ed3252222212250
AUX zabbix-jmx-proxy.init 849 BLAKE2B 14a312911a11d765210f3bd86d38c8ce3a2f230c821a03d2dd3b2a2aaf05a86cf64a59ea283ad0f11b62fe17a81936cef03463e5cee6535f1a51558b7bad790a SHA512 79a1966405546899b2e6eb4cb53f0ea1ec70575cbf97ff0f9de16d662c5750f8bf276bf8eadaf00cb69ffa078b79e9144eb9824eec6a23df6b2cd315b79b05d8
AUX zabbix-proxy.init 487 BLAKE2B b094521d1ec12ea27f1dec78a858ff3b78acde6a0473a2f8a53cbf46c75c3b0f72a1f44f24dc5294b7157576b06abc631dfed469dcf1a1c7b8c4609a9c81b2b8 SHA512 55f1df96d7d7e6ec16d16162e37a7a494131f4dd53d5988b28663b82a6bbe17b16e901a8f4870f14fd2e1c7dd96a84fe6aa5cd9e6a745462af7b83b3f0455839
AUX zabbix-proxy.tmpfiles 35 BLAKE2B 98e917ef03bd6dc5d73e5cbdb140c7e115c7593d5cebf2df9bf3d15713b16c6a44b165a3f68fd36a9119163144a2761457d16ce318bd094ed76ae6040c8b09df SHA512 3c63a2791e6ac77cb3144eb47a275cc8748f5c8943a076052300d6964994b95b18d60f504584fdcb683739dc514261402895e3f30ae2fbdb218acbc42c3d72df
AUX zabbix-server-3.0.30-mysql8.patch 608 BLAKE2B 56e2cb893269cdeefbc6ca7c40e73b9af2012e4075d997369c516253211d6de6266a1f565ecbf39cd4520fe76f65968d43320ea8e5b2cd59d2a0eb9f8febc9f4 SHA512 13e95e0f3fd1aff4f2546ce5b3cb48c59e117984192a2574d799ca062ce763982d2984e5fa94b49f077aaebbbb3442a06a0d9982a38a21f5ea739fd0fed87148
AUX zabbix-server-3.0.30-security-disable-PidFile.patch 1378 BLAKE2B c1efdfd0b223987c9d9bf1a3f7731f0bdfeb42d1641bbf4387d70ece757f5cb2fb88bafb87f6938a5efbec091f73d5fde0450e8aa0edc3143d589df5efbe5d19 SHA512 854b198b980e4b58dc6149e285bfa6361ab2a10b83a6d8f07b46754316d6764669e68da8018b402b59317ed95b50a13d25f68f28c4c33d76f0ef1e8dedc8da99
AUX zabbix-server-3.0.31-fix-cve-2020-15803.patch 3081 BLAKE2B 269b3efedf4f2f4c5365f2119ae166a0bee673841ab0eeae1f3e6311d7015fd35b11330a62c705a567775429319bd440adff48f92c689d35104893eab82a86ec SHA512 950dfe3311dc74fc9068b1c51d22f2a9b2ff20c9011e551151b1aed8212ab26cd5ec369317ec5ad9b52193f59d5f79298205996dd9f2aec48608759769c63c85
AUX zabbix-server-4.0.18-modulepathfix.patch 330 BLAKE2B 99b3f1082e220ff842e4c4c86e8fcf57666443dd1e124412f167548ab886352077e1f0548e49cf77f28a51d20cc37dc980448eb87c9e7814ac73dcbfe43388e0 SHA512 75330dddde2f47553ac6a6f71d6f2383ab34c0d64ac5dbe45dd31707d8797d1400215d698072df3a0f0eaf862f00509791a6a0eaa43a0f686657d885c03465b5
AUX zabbix-server.init 494 BLAKE2B e58063bfdb0bcb6ea70325d31bff4ffebab2686b7063916619aaabc5b39b1ff5d960b968e382615f84b18531465cf0ad0eab5ffa171c0b4b1797e70d58ed3450 SHA512 7dd55ffe8062bee9104218bf673aeeeea56a4a332ef6a5676b83e7f026a2b6ebc70446c63d6116b684ad16abd95de355cdbdf07c81a51daf1424b3fd8d627c74
AUX zabbix-server.tmpfiles 35 BLAKE2B 98e917ef03bd6dc5d73e5cbdb140c7e115c7593d5cebf2df9bf3d15713b16c6a44b165a3f68fd36a9119163144a2761457d16ce318bd094ed76ae6040c8b09df SHA512 3c63a2791e6ac77cb3144eb47a275cc8748f5c8943a076052300d6964994b95b18d60f504584fdcb683739dc514261402895e3f30ae2fbdb218acbc42c3d72df
DIST zabbix-server-5.0.4.tar.gz 19315019 BLAKE2B 45a13c835385bb9f039123385ab0512a20167b90e1faf6e79fff76908b2425fe71fefcef37612020200923bb06bec9e65d637ced71e82206953feb6a7e3d3f2e SHA512 8355a416d2f622c0c5c1834a12cc220d1ab4bca3e914f263a4dd11f9aba62dfa3fee6eb716a91e8e7b992cb30cf4fabaf444a3b62e1d261eb332e79ad61a5503
DIST zabbix-server-5.2.1.tar.gz 19869073 BLAKE2B 3b0c07aa82183afa3f9760aa878bf3934e75e530b5cb259a393dc893da0e0339237bc286ea4bbf921b3eef1a2fb89e076f165ee3e0eb56e250cfaece76992ecc SHA512 eb45ce3d1209a516424fd0eddfff7cd95442031767b42ee6436bc85f24696452e05142c4b5bb8d004aa2d1079aca7f5eadcc53f9c649466c1637adfa893ced11
EBUILD zabbix-server-5.0.4.ebuild 8169 BLAKE2B 2c34211df14cd85e11e05a0c638eeff77f8fbf90b2b4691f785fc7136e24d717a1b2ad05a9b3880c4885c9feee80407aeb3d09dab5a8bb5efba68b1068db01e7 SHA512 9e99c5071d505c99182209996af07bc551684507062f819e0b86ea398323fd6b81960058d12bb88b774c1aa1ae18973a5001949cfedfec429ec9d85072e164ab
EBUILD zabbix-server-5.2.1.ebuild 8064 BLAKE2B 41ae48e413a5a8c6ce287ce3454c9cde144eb3b1bc811b39ebb39bcaad4f16a5fdc9be10df18c88772f4c894c011aa06762de4f995bd4e57cfddb86509fef937 SHA512 4e9e540a0efa337207415399713a4619d0627b22336b925d6d08ddd732f3a357e532002a139ae6fd55f98c6632a89b9f8019ef05bff6a7b3c4784a860dac92e6

View File

@@ -0,0 +1,12 @@
# Configuration variables for the zabbix jmx proxy
# LISTEN_IP="0.0.0.0"
# LISTEN_PORT=10052
# START_POLLERS=5
# TIMEOUT=3
# uncomment to enable remote monitoring of the standard JMX objects on the Zabbix Java Gateway itself
# JAVA_OPTIONS="$JAVA_OPTIONS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=12345
# -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

View File

@@ -0,0 +1,33 @@
#!/sbin/openrc-run
LISTEN_IP=${LISTEN_IP:-127.0.0.1}
LISTEN_PORT=${LISTEN_PORT:-10052}
START_POLLERS=${START_POLLERS:-5}
TIMEOUT=${TIMEOUT:-3}
PID_FILE="/run/zabbix-jmx-proxy"
start() {
ZABBIX_OPTIONS="-Dzabbix.pidFile=$PID_FILE \
-Dzabbix.listenIP=$LISTEN_IP \
-Dzabbix.listenPort=$LISTEN_PORT \
-Dzabbix.startPollers=$START_POLLERS \
-Dzabbix.timeout=$TIMEOUT \
-Dsun.rmi.transport.tcp.responseTimeout=${TIMEOUT}000"
JAVA_OPTIONS="-server $JAVA_OPTIONS -Dlogback.configurationFile=logback-console.xml"
cd /opt/zabbix_java
CLASSPATH="lib"
for jar in lib/*.jar bin/*.jar; do
CLASSPATH="$CLASSPATH:$jar"
done
start-stop-daemon -m --background --pidfile $PID_FILE -- java $JAVA_OPTIONS -classpath $CLASSPATH $ZABBIX_OPTIONS com.zabbix.gateway.JavaGateway
}
stop() {
start-stop-daemon --stop --pidfile $PID_FILE
}

View File

@@ -0,0 +1,20 @@
#!/sbin/openrc-run
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
command="/usr/sbin/zabbix_proxy"
command_args="--foreground --config /etc/zabbix/zabbix_proxy.conf"
command_background="true"
command_user="zabbix:zabbix"
pidfile="/run/${RC_SVCNAME}.pid"
depend() {
need net
provide zabbix-proxy
}
start_pre() {
checkpath -q -d -m 0750 -o root:zabbix /etc/zabbix
checkpath -q -f -m 0640 -o root:zabbix /etc/zabbix/*.conf
}

View File

@@ -0,0 +1 @@
d /run/zabbix 0755 zabbix zabbix -

View File

@@ -0,0 +1,17 @@
diff --git a/src/libs/zbxdb/db.c b/src/libs/zbxdb/db.c
index a65b9c4..e011c51 100644
--- a/src/libs/zbxdb/db.c
+++ b/src/libs/zbxdb/db.c
@@ -285,7 +285,11 @@ int zbx_db_connect(char *host, char *user, char *password, char *dbname, char *d
#if defined(HAVE_IBM_DB2)
char *connect = NULL;
#elif defined(HAVE_MYSQL)
- my_bool mysql_reconnect = 1;
+#if LIBMYSQL_VERSION_ID >= 80000 /* my_bool type is removed in MySQL 8.0 */
+ bool mysql_reconnect = 1;
+#else
+ my_bool mysql_reconnect = 1;
+#endif
#elif defined(HAVE_ORACLE)
char *connect = NULL;
sword err = OCI_SUCCESS;

View File

@@ -0,0 +1,49 @@
diff --git a/conf/zabbix_agentd.conf b/conf/zabbix_agentd.conf
index b73bd45..c10daca 100644
--- a/conf/zabbix_agentd.conf
+++ b/conf/zabbix_agentd.conf
@@ -5,6 +5,7 @@
### Option: PidFile
# Name of PID file.
+# THIS PARAMETER IS IGNORED IN GENTOO FOR SECURITY REASONS (https://bugs.gentoo.org/629884)
#
# Mandatory: no
# Default:
diff --git a/conf/zabbix_proxy.conf b/conf/zabbix_proxy.conf
index 082f14e..de0284d 100644
--- a/conf/zabbix_proxy.conf
+++ b/conf/zabbix_proxy.conf
@@ -109,6 +109,7 @@ LogFile=/tmp/zabbix_proxy.log
### Option: PidFile
# Name of PID file.
+# THIS PARAMETER IS IGNORED IN GENTOO FOR SECURITY REASONS (https://bugs.gentoo.org/629884)
#
# Mandatory: no
# Default:
diff --git a/conf/zabbix_server.conf b/conf/zabbix_server.conf
index 9f754ca..3999196 100644
--- a/conf/zabbix_server.conf
+++ b/conf/zabbix_server.conf
@@ -62,6 +62,7 @@ LogFile=/tmp/zabbix_server.log
### Option: PidFile
# Name of PID file.
+# THIS PARAMETER IS IGNORED IN GENTOO FOR SECURITY REASONS (https://bugs.gentoo.org/629884)
#
# Mandatory: no
# Default:
diff --git a/src/libs/zbxnix/pid.c b/src/libs/zbxnix/pid.c
index baa8415..04c7e0c 100644
--- a/src/libs/zbxnix/pid.c
+++ b/src/libs/zbxnix/pid.c
@@ -26,6 +26,8 @@ static int fdpid = -1;
int create_pid_file(const char *pidfile)
{
+ return SUCCEED;
+
int fd;
zbx_stat_t buf;
struct flock fl;

View File

@@ -0,0 +1,83 @@
diff --git a/frontends/php/include/classes/screens/CScreenUrl.php b/frontends/php/include/classes/screens/CScreenUrl.php
index e35c5f1..1df396e 100644
--- a/frontends/php/include/classes/screens/CScreenUrl.php
+++ b/frontends/php/include/classes/screens/CScreenUrl.php
@@ -29,18 +29,10 @@ class CScreenUrl extends CScreenBase {
public function get() {
// prevent from resolving macros in configuration page
if ($this->mode != SCREEN_MODE_PREVIEW && $this->mode != SCREEN_MODE_SLIDESHOW) {
- return $this->getOutput(
- CHtmlUrlValidator::validate($this->screenitem['url'], false)
- ? new CIFrame($this->screenitem['url'], $this->screenitem['width'], $this->screenitem['height'],
- 'auto')
- : makeMessageBox(false, [[
- 'type' => 'error',
- 'message' => _s('Provided URL "%1$s" is invalid.', $this->screenitem['url'])
- ]]
- )
- );
+ return $this->getOutput($this->prepareElement());
}
- elseif ($this->screenitem['dynamic'] == SCREEN_DYNAMIC_ITEM && $this->hostid == 0) {
+
+ if ($this->screenitem['dynamic'] == SCREEN_DYNAMIC_ITEM && $this->hostid == 0) {
return $this->getOutput((new CTableInfo())->setNoDataMessage(_('No host selected.')));
}
@@ -54,14 +46,28 @@ class CScreenUrl extends CScreenBase {
$this->screenitem['url'] = $url ? $url : $this->screenitem['url'];
- return $this->getOutput(
- CHtmlUrlValidator::validate($this->screenitem['url'], false)
- ? new CIFrame($this->screenitem['url'], $this->screenitem['width'], $this->screenitem['height'], 'auto')
- : makeMessageBox(false, [[
- 'type' => 'error',
- 'message' => _s('Provided URL "%1$s" is invalid.', $this->screenitem['url'])
- ]]
- )
- );
+ return $this->getOutput($this->prepareElement());
+ }
+
+ /**
+ * @return CTag
+ */
+ public function prepareElement() {
+ if (CHtmlUrlValidator::validate($this->screenitem['url'], false)) {
+ $item = new CIFrame($this->screenitem['url'], $this->screenitem['width'], $this->screenitem['height'],
+ 'auto'
+ );
+
+ if (ZBX_IFRAME_SANDBOX !== false) {
+ $item->setAttribute('sandbox', ZBX_IFRAME_SANDBOX);
+ }
+
+ return $item;
+ }
+
+ return makeMessageBox(false, [[
+ 'type' => 'error',
+ 'message' => _s('Provided URL "%1$s" is invalid.', $this->screenitem['url'])
+ ]]);
}
}
diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php
index a67a625..c6a437c 100644
--- a/frontends/php/include/defines.inc.php
+++ b/frontends/php/include/defines.inc.php
@@ -1284,6 +1284,14 @@ if (function_exists('bcscale')) {
bcscale(7);
}
+/**
+ * The sandbox attribute enables an extra set of restrictions for the content in the iframe. Default is set to empty
+ * string, which means all restrictions are applied. To disable, set to FALSE. To set a specific set of restrictions,
+ * write a custom string.
+ * https://www.w3.org/TR/2010/WD-html5-20100624/the-iframe-element.html#attr-iframe-sandbox
+ */
+define('ZBX_IFRAME_SANDBOX', '');
+
// HTTP headers
/*
* Value of HTTP X-Frame-options header.

View File

@@ -0,0 +1,11 @@
--- zabbix-4.0.1/configure 2018-10-29 10:36:05.000000000 -0700
+++ zfx/configure 2018-11-07 16:59:28.015968345 -0800
@@ -12510,7 +12510,7 @@
CURL_SSL_CERT_LOCATION="${datadir}/zabbix/ssl/certs"
CURL_SSL_KEY_LOCATION="${datadir}/zabbix/ssl/keys"
-LOAD_MODULE_PATH="${libdir}/modules"
+LOAD_MODULE_PATH="${libdir}/zabbix"

View File

@@ -0,0 +1,19 @@
#!/sbin/openrc-run
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
command="/usr/sbin/zabbix_server"
command_args="--foreground --config /etc/zabbix/zabbix_server.conf"
command_background="true"
command_user="zabbix:zabbix"
pidfile="/run/${RC_SVCNAME}.pid"
depend() {
need net
use mysql postgresql
}
start_pre() {
checkpath -q -d -m 0750 -o root:zabbix /etc/zabbix
checkpath -q -f -m 0640 -o root:zabbix /etc/zabbix/*.conf
}

View File

@@ -0,0 +1 @@
d /run/zabbix 0755 zabbix zabbix -

View File

@@ -0,0 +1,322 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
# needed to make webapp-config dep optional
WEBAPP_OPTIONAL="yes"
inherit flag-o-matic webapp java-pkg-opt-2 user systemd toolchain-funcs
DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers"
HOMEPAGE="https://www.zabbix.com/"
MY_P=${P/_/}
MY_PV=${PV/_/}
SRC_URI="http://mirror.imax.name/src/zabbix/${PV}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
WEBAPP_MANUAL_SLOT="yes"
KEYWORDS="amd64 x86"
IUSE="java curl +frontend ipv6 ldap libxml2 mysql openipmi oracle +postgres proxy +server ssh ssl snmp sqlite odbc static"
REQUIRED_USE="|| ( frontend proxy server )
proxy? ( ^^ ( mysql oracle postgres sqlite odbc ) )
server? ( ^^ ( mysql oracle postgres odbc ) )
static? ( !oracle !snmp )"
COMMON_DEPEND="
curl? ( net-misc/curl )
java? ( >=virtual/jdk-1.8:* )
ldap? (
=dev-libs/cyrus-sasl-2*
net-libs/gnutls
net-nds/openldap
)
libxml2? ( dev-libs/libxml2 )
mysql? ( dev-db/mysql-connector-c )
odbc? ( dev-db/unixODBC )
openipmi? ( sys-libs/openipmi )
oracle? ( dev-db/oracle-instantclient-basic )
postgres? ( dev-db/postgresql:* )
proxy? ( sys-libs/zlib )
server? (
dev-libs/libevent
sys-libs/zlib
)
snmp? ( net-analyzer/net-snmp )
sqlite? ( dev-db/sqlite )
ssh? ( net-libs/libssh2 )
ssl? ( dev-libs/openssl:=[-bindist] )
"
RDEPEND="${COMMON_DEPEND}
java? ( >=virtual/jre-1.8:* )
mysql? ( virtual/mysql )
proxy? ( net-analyzer/fping[suid] )
server? (
app-admin/webapp-config
dev-libs/libevent
dev-libs/libpcre
net-analyzer/fping[suid]
)
frontend? (
app-admin/webapp-config
dev-lang/php:*[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode]
media-libs/gd[png]
virtual/httpd-php:*
mysql? ( dev-lang/php[mysqli] )
odbc? ( dev-lang/php[odbc] )
oracle? ( dev-lang/php[oci8-instant-client] )
postgres? ( dev-lang/php[postgres] )
sqlite? ( dev-lang/php[sqlite] )
)
"
DEPEND="${COMMON_DEPEND}
static? (
curl? ( net-misc/curl[static-libs] )
ldap? (
=dev-libs/cyrus-sasl-2*[static-libs]
net-libs/gnutls[static-libs]
net-nds/openldap[static-libs]
)
libxml2? ( dev-libs/libxml2[static-libs] )
mysql? ( dev-db/mysql-connector-c[static-libs] )
odbc? ( dev-db/unixODBC[static-libs] )
postgres? ( dev-db/postgresql:*[static-libs] )
sqlite? ( dev-db/sqlite[static-libs] )
ssh? ( net-libs/libssh2 )
)
"
BDEPEND="
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}/${PN}-4.0.18-modulepathfix.patch"
"${FILESDIR}/${PN}-3.0.30-security-disable-PidFile.patch"
)
S=${WORKDIR}/${MY_P}
ZABBIXJAVA_BASE="opt/zabbix_java"
pkg_setup() {
if use oracle; then
if [ -z "${ORACLE_HOME}" ]; then
eerror
eerror "The environment variable ORACLE_HOME must be set"
eerror "and point to the correct location."
eerror "It looks like you don't have Oracle installed."
eerror
die "Environment variable ORACLE_HOME is not set"
fi
if has_version 'dev-db/oracle-instantclient-basic'; then
ewarn
ewarn "Please ensure you have a full install of the Oracle client."
ewarn "dev-db/oracle-instantclient* is NOT sufficient."
ewarn
fi
fi
if use frontend; then
webapp_pkg_setup
fi
enewgroup zabbix
enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix
java-pkg-opt-2_pkg_setup
}
src_prepare() {
default
}
src_configure() {
econf \
$(use_enable ipv6) \
$(use_enable java) \
$(use_enable proxy) \
$(use_enable server) \
$(use_enable static) \
$(use_with curl libcurl) \
$(use_with ldap) \
$(use_with libxml2) \
$(use_with mysql) \
$(use_with odbc unixodbc) \
$(use_with openipmi openipmi) \
$(use_with oracle) \
$(use_with postgres postgresql) \
$(use_with snmp net-snmp) \
$(use_with sqlite sqlite3) \
$(use_with ssh ssh2) \
$(use_with ssl openssl)
}
src_compile() {
if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)"
fi
}
src_install() {
local dirs=(
/etc/zabbix
/var/lib/zabbix
/var/lib/zabbix/home
/var/lib/zabbix/scripts
/var/lib/zabbix/alertscripts
/var/lib/zabbix/externalscripts
/var/log/zabbix
)
for dir in "${dirs[@]}"; do
dodir "${dir}"
keepdir "${dir}"
done
if use server; then
insinto /etc/zabbix
doins "${S}"/conf/zabbix_server.conf
fperms 0640 /etc/zabbix/zabbix_server.conf
fowners root:zabbix /etc/zabbix/zabbix_server.conf
newinitd "${FILESDIR}"/zabbix-server.init zabbix-server
dosbin src/zabbix_server/zabbix_server
insinto /usr/share/zabbix
doins -r "${S}"/database/
fi
if use proxy; then
insinto /etc/zabbix
doins "${S}"/conf/zabbix_proxy.conf
fperms 0640 /etc/zabbix/zabbix_proxy.conf
fowners root:zabbix /etc/zabbix/zabbix_proxy.conf
newinitd "${FILESDIR}"/zabbix-proxy.init zabbix-proxy
dosbin src/zabbix_proxy/zabbix_proxy
insinto /usr/share/zabbix
doins -r "${S}"/database/
fi
fowners root:zabbix /etc/zabbix
fowners zabbix:zabbix \
/var/lib/zabbix \
/var/lib/zabbix/home \
/var/lib/zabbix/scripts \
/var/lib/zabbix/alertscripts \
/var/lib/zabbix/externalscripts \
/var/log/zabbix
fperms 0750 \
/etc/zabbix \
/var/lib/zabbix \
/var/lib/zabbix/home \
/var/lib/zabbix/scripts \
/var/lib/zabbix/alertscripts \
/var/lib/zabbix/externalscripts \
/var/log/zabbix
dodoc README INSTALL NEWS ChangeLog \
conf/zabbix_proxy.conf \
conf/zabbix_agentd/userparameter_examples.conf \
conf/zabbix_agentd/userparameter_mysql.conf \
conf/zabbix_server.conf
if use frontend; then
webapp_src_preinst
cp -R ui/* "${D}/${MY_HTDOCSDIR}"
webapp_configfile \
"${MY_HTDOCSDIR}"/include/db.inc.php \
"${MY_HTDOCSDIR}"/include/config.inc.php
webapp_src_install
fi
if use java; then
dodir \
/${ZABBIXJAVA_BASE} \
/${ZABBIXJAVA_BASE}/bin \
/${ZABBIXJAVA_BASE}/lib
keepdir /${ZABBIXJAVA_BASE}
exeinto /${ZABBIXJAVA_BASE}/bin
doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar
exeinto /${ZABBIXJAVA_BASE}/lib
doexe \
src/zabbix_java/lib/logback-classic-0.9.27.jar \
src/zabbix_java/lib/logback-console.xml \
src/zabbix_java/lib/logback-core-0.9.27.jar \
src/zabbix_java/lib/logback.xml \
src/zabbix_java/lib/android-json-4.3_r3.1.jar \
src/zabbix_java/lib/slf4j-api-1.6.1.jar
newinitd "${FILESDIR}"/zabbix-jmx-proxy.init zabbix-jmx-proxy
newconfd "${FILESDIR}"/zabbix-jmx-proxy.conf zabbix-jmx-proxy
fi
}
pkg_postinst() {
if use server || use proxy ; then
elog
elog "You may need to configure your database for Zabbix"
elog "if you have not already done so."
elog
zabbix_homedir=$(egethome zabbix)
if [ -n "${zabbix_homedir}" ] && \
[ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
ewarn
ewarn "The user 'zabbix' should have his homedir changed"
ewarn "to /var/lib/zabbix/home if you want to use"
ewarn "custom alert scripts."
ewarn
ewarn "A real homedir might be needed for configfiles"
ewarn "for custom alert scripts."
ewarn
ewarn "To change the homedir use:"
ewarn " usermod -d /var/lib/zabbix/home zabbix"
ewarn
fi
fi
if use server; then
elog
elog "For distributed monitoring you have to run:"
elog
elog "zabbix_server -n <nodeid>"
elog
elog "This will convert database data for use with Node ID"
elog "and also adds a local node."
elog
fi
elog "--"
elog
elog "You may need to add these lines to /etc/services:"
elog
elog "zabbix-trapper 10051/tcp Zabbix Trapper"
elog "zabbix-trapper 10051/udp Zabbix Trapper"
elog
if use server || use proxy ; then
# check for fping
fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
case "${fping_perms}" in
4[157][157][157])
;;
*)
ewarn
ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
ewarn "you have to make /usr/sbin/fping setuid root and executable"
ewarn "by everyone. Run the following command to fix it:"
ewarn
ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
ewarn
ewarn "Please be aware that this might impose a security risk,"
ewarn "depending on the code quality of fping."
ewarn
;;
esac
fi
}

View File

@@ -0,0 +1,320 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
# needed to make webapp-config dep optional
WEBAPP_OPTIONAL="yes"
inherit flag-o-matic webapp java-pkg-opt-2 user systemd toolchain-funcs
DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers"
HOMEPAGE="https://www.zabbix.com/"
MY_P=${P/_/}
MY_PV=${PV/_/}
SRC_URI="http://mirror.imax.name/src/zabbix/${PV}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
WEBAPP_MANUAL_SLOT="yes"
KEYWORDS="amd64 x86 arm"
IUSE="java curl +frontend ipv6 ldap libxml2 mysql openipmi oracle postgres +server proxy ssh ssl snmp sqlite odbc static"
REQUIRED_USE="|| ( frontend proxy server )
proxy? ( ^^ ( mysql oracle sqlite odbc ) )
server? ( ^^ ( mysql oracle postgres odbc ) )
static? ( !oracle !snmp )"
COMMON_DEPEND="
curl? ( net-misc/curl )
java? ( >=virtual/jdk-1.8:* )
ldap? (
=dev-libs/cyrus-sasl-2*
net-libs/gnutls
net-nds/openldap
)
libxml2? ( dev-libs/libxml2 )
mysql? ( dev-db/mysql-connector-c )
odbc? ( dev-db/unixODBC )
openipmi? ( sys-libs/openipmi )
oracle? ( dev-db/oracle-instantclient-basic )
postgres? ( dev-db/postgresql:* )
proxy? ( sys-libs/zlib )
server? (
dev-libs/libevent
sys-libs/zlib
)
snmp? ( net-analyzer/net-snmp )
sqlite? ( dev-db/sqlite )
ssh? ( net-libs/libssh2 )
ssl? ( dev-libs/openssl:=[-bindist] )
"
RDEPEND="${COMMON_DEPEND}
java? ( >=virtual/jre-1.8:* )
mysql? ( virtual/mysql )
proxy? ( net-analyzer/fping[suid] )
server? (
app-admin/webapp-config
dev-libs/libevent
dev-libs/libpcre
net-analyzer/fping[suid]
)
frontend? (
app-admin/webapp-config
dev-lang/php:*[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode]
media-libs/gd[png]
virtual/httpd-php:*
mysql? ( dev-lang/php[mysqli] )
odbc? ( dev-lang/php[odbc] )
oracle? ( dev-lang/php[oci8-instant-client] )
postgres? ( dev-lang/php[postgres] )
sqlite? ( dev-lang/php[sqlite] )
)
"
DEPEND="${COMMON_DEPEND}
static? (
curl? ( net-misc/curl[static-libs] )
ldap? (
=dev-libs/cyrus-sasl-2*[static-libs]
net-libs/gnutls[static-libs]
net-nds/openldap[static-libs]
)
libxml2? ( dev-libs/libxml2[static-libs] )
mysql? ( dev-db/mysql-connector-c[static-libs] )
odbc? ( dev-db/unixODBC[static-libs] )
postgres? ( dev-db/postgresql:*[static-libs] )
sqlite? ( dev-db/sqlite[static-libs] )
ssh? ( net-libs/libssh2 )
)
"
BDEPEND="
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}/${PN}-4.0.18-modulepathfix.patch"
"${FILESDIR}/${PN}-3.0.30-security-disable-PidFile.patch"
)
S=${WORKDIR}/${MY_P}
ZABBIXJAVA_BASE="opt/zabbix_java"
pkg_setup() {
if use oracle; then
if [ -z "${ORACLE_HOME}" ]; then
eerror
eerror "The environment variable ORACLE_HOME must be set"
eerror "and point to the correct location."
eerror "It looks like you don't have Oracle installed."
eerror
die "Environment variable ORACLE_HOME is not set"
fi
if has_version 'dev-db/oracle-instantclient-basic'; then
ewarn
ewarn "Please ensure you have a full install of the Oracle client."
ewarn "dev-db/oracle-instantclient* is NOT sufficient."
ewarn
fi
fi
if use frontend; then
webapp_pkg_setup
fi
enewgroup zabbix
enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix
java-pkg-opt-2_pkg_setup
}
src_prepare() {
default
}
src_configure() {
econf \
$(use_enable ipv6) \
$(use_enable java) \
$(use_enable proxy) \
$(use_enable server) \
$(use_enable static) \
$(use_with curl libcurl) \
$(use_with ldap) \
$(use_with libxml2) \
$(use_with mysql) \
$(use_with odbc unixodbc) \
$(use_with openipmi openipmi) \
$(use_with oracle) \
$(use_with postgres postgresql) \
$(use_with snmp net-snmp) \
$(use_with sqlite sqlite3) \
$(use_with ssh ssh2) \
$(use_with ssl openssl)
}
src_compile() {
if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)"
fi
}
src_install() {
local dirs=(
/etc/zabbix
/var/lib/zabbix
/var/lib/zabbix/home
/var/lib/zabbix/scripts
/var/lib/zabbix/alertscripts
/var/lib/zabbix/externalscripts
/var/log/zabbix
)
for dir in "${dirs[@]}"; do
dodir "${dir}"
keepdir "${dir}"
done
if use server; then
insinto /etc/zabbix
doins "${S}"/conf/zabbix_server.conf
fperms 0640 /etc/zabbix/zabbix_server.conf
fowners root:zabbix /etc/zabbix/zabbix_server.conf
newinitd "${FILESDIR}"/zabbix-server.init zabbix-server
dosbin src/zabbix_server/zabbix_server
insinto /usr/share/zabbix
doins -r "${S}"/database/
fi
if use proxy; then
insinto /etc/zabbix
doins "${S}"/conf/zabbix_proxy.conf
fperms 0640 /etc/zabbix/zabbix_proxy.conf
fowners root:zabbix /etc/zabbix/zabbix_proxy.conf
newinitd "${FILESDIR}"/zabbix-proxy.init zabbix-proxy
dosbin src/zabbix_proxy/zabbix_proxy
insinto /usr/share/zabbix
doins -r "${S}"/database/
fi
fowners root:zabbix /etc/zabbix
fowners zabbix:zabbix \
/var/lib/zabbix \
/var/lib/zabbix/home \
/var/lib/zabbix/scripts \
/var/lib/zabbix/alertscripts \
/var/lib/zabbix/externalscripts \
/var/log/zabbix
fperms 0750 \
/etc/zabbix \
/var/lib/zabbix \
/var/lib/zabbix/home \
/var/lib/zabbix/scripts \
/var/lib/zabbix/alertscripts \
/var/lib/zabbix/externalscripts \
/var/log/zabbix
dodoc README INSTALL NEWS ChangeLog \
conf/zabbix_proxy.conf \
conf/zabbix_server.conf
if use frontend; then
webapp_src_preinst
cp -R ui/* "${D}/${MY_HTDOCSDIR}"
webapp_configfile \
"${MY_HTDOCSDIR}"/include/db.inc.php \
"${MY_HTDOCSDIR}"/include/config.inc.php
webapp_src_install
fi
if use java; then
dodir \
/${ZABBIXJAVA_BASE} \
/${ZABBIXJAVA_BASE}/bin \
/${ZABBIXJAVA_BASE}/lib
keepdir /${ZABBIXJAVA_BASE}
exeinto /${ZABBIXJAVA_BASE}/bin
doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar
exeinto /${ZABBIXJAVA_BASE}/lib
doexe \
src/zabbix_java/lib/logback-classic-0.9.27.jar \
src/zabbix_java/lib/logback-console.xml \
src/zabbix_java/lib/logback-core-0.9.27.jar \
src/zabbix_java/lib/logback.xml \
src/zabbix_java/lib/android-json-4.3_r3.1.jar \
src/zabbix_java/lib/slf4j-api-1.6.1.jar
newinitd "${FILESDIR}"/zabbix-jmx-proxy.init zabbix-jmx-proxy
newconfd "${FILESDIR}"/zabbix-jmx-proxy.conf zabbix-jmx-proxy
fi
}
pkg_postinst() {
if use server || use proxy ; then
elog
elog "You may need to configure your database for Zabbix"
elog "if you have not already done so."
elog
zabbix_homedir=$(egethome zabbix)
if [ -n "${zabbix_homedir}" ] && \
[ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
ewarn
ewarn "The user 'zabbix' should have his homedir changed"
ewarn "to /var/lib/zabbix/home if you want to use"
ewarn "custom alert scripts."
ewarn
ewarn "A real homedir might be needed for configfiles"
ewarn "for custom alert scripts."
ewarn
ewarn "To change the homedir use:"
ewarn " usermod -d /var/lib/zabbix/home zabbix"
ewarn
fi
fi
if use server; then
elog
elog "For distributed monitoring you have to run:"
elog
elog "zabbix_server -n <nodeid>"
elog
elog "This will convert database data for use with Node ID"
elog "and also adds a local node."
elog
fi
elog "--"
elog
elog "You may need to add these lines to /etc/services:"
elog
elog "zabbix-trapper 10051/tcp Zabbix Trapper"
elog "zabbix-trapper 10051/udp Zabbix Trapper"
elog
if use server || use proxy ; then
# check for fping
fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
case "${fping_perms}" in
4[157][157][157])
;;
*)
ewarn
ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
ewarn "you have to make /usr/sbin/fping setuid root and executable"
ewarn "by everyone. Run the following command to fix it:"
ewarn
ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
ewarn
ewarn "Please be aware that this might impose a security risk,"
ewarn "depending on the code quality of fping."
ewarn
;;
esac
fi
}