Skip to content

Commit

Permalink
net-analyzer/zabbix: bump to 4.0.41
Browse files Browse the repository at this point in the history
Signed-off-by: Miroslav Šulc <[email protected]>
  • Loading branch information
fordfrog committed Jun 6, 2022
1 parent 998dd77 commit 7d8af03
Show file tree
Hide file tree
Showing 2 changed files with 363 additions and 0 deletions.
1 change: 1 addition & 0 deletions net-analyzer/zabbix/Manifest
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DIST zabbix-4.0.38.tar.gz 17558387 BLAKE2B 1ddf27d76734128ddd197eb9dffeb59018282464a7322973dc4102992c0ade003d4d0291194f5b5a487d83a702917d6f0036636e56acc424bd7a7d6beb3f787c SHA512 0d38a74336c9e46b3f9985aca3508312dd5b15affeadee3497ebf8d5e59b4fa7b99ff28819b01878cbc5c9c304c1992a6a91d73f35bf1a333ae2ee561e0d7e1f
DIST zabbix-4.0.41.tar.gz 17641873 BLAKE2B f3bb40e78662c68f0752233a72ad71d2a7ffae03a0e334736c0b9037fe3566d1b3c4c09fd3183456ae3266ac84f2cbc57c73d5e0e1853f86ebd8eafc42e0b4bb SHA512 7df356c6e99a94876abd05e708eb350448593018017eb2e3434403505a48651ddd6b40b69d84bb49b8eed5cb945c2b974fd44b85dc27fc5c3141d1cdad1b371f
DIST zabbix-5.0.22-go-deps.tar.xz 34395200 BLAKE2B 3065878d5d61617f52ec48381a248ea13a603c13bb1cc18b6fde4e81f47bfd9dc4bafe34303e4bb46f1d7e9809d0b17acf48b782c11162fdcf04f0de89402f2b SHA512 fc30d33066248fe7c9049fec7538e1d1880d9c23d10516032027ea90e90a7531288990a33a48cbab2722a6ca67f49f79507cce7351d2c026317fc58843d4868e
DIST zabbix-5.0.22.tar.gz 21245241 BLAKE2B d2343fc5dbc4112ef77c75bd00b8344a363a8e2acc6623a009ebd24d7116377a66d2ca94f22dee386fbee1fa9822ce7e08287cb1336fe939bd2b621fe57b5b1f SHA512 d326ed5dd81b44adf80e8cc01d32b3b7ebed0b8ffddc2870e76ffcd010513f2b2bbe4586681e5c5ab5202f88c7861078efad537bb852ee52d5c00b7712cc2aab
DIST zabbix-5.0.24-go-deps.tar.xz 34371892 BLAKE2B 273978d3a4dd46e4d41d892f3217ae2ee0d2bfe9bed753283b5fdf3a13e6cb8f912a4726b92cc2637cb8103c63141f24d3c49c884f54598a9c4d99bed3830552 SHA512 bfafb96c6d69ad2c775add9392117c384a633b334ad447e1ec61cf6f01bd72ded0870d778650ff18a912f6ca3bc98f581052464353b22350eaf724bddc29f8d8
Expand Down
362 changes: 362 additions & 0 deletions net-analyzer/zabbix/zabbix-4.0.41.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,362 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

# needed to make webapp-config dep optional
WEBAPP_OPTIONAL="yes"
inherit webapp java-pkg-opt-2 systemd toolchain-funcs tmpfiles user-info

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="https://cdn.zabbix.com/${PN}/sources/stable/4.0/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0/$(ver_cut 1-2)"
WEBAPP_MANUAL_SLOT="yes"
KEYWORDS="~amd64 ~x86"
IUSE="+agent curl frontend gnutls ipv6 java ldap libxml2 mbedtls mysql odbc openipmi +openssl oracle +postgres proxy server snmp sqlite ssh static xmpp"
REQUIRED_USE="|| ( agent frontend proxy server )
?? ( gnutls mbedtls openssl )
proxy? ( ^^ ( mysql oracle postgres sqlite ) )
server? ( ^^ ( mysql oracle postgres ) !sqlite )
static? ( !oracle !snmp )"

COMMON_DEPEND="
curl? ( net-misc/curl )
gnutls? ( net-libs/gnutls:0= )
java? ( >=virtual/jdk-1.8:* )
ldap? (
=dev-libs/cyrus-sasl-2*
net-libs/gnutls:=
net-nds/openldap:=
)
libxml2? ( dev-libs/libxml2 )
mbedtls? ( net-libs/mbedtls:0= )
mysql? ( dev-db/mysql-connector-c:= )
odbc? ( dev-db/unixODBC )
openipmi? ( sys-libs/openipmi )
openssl? ( dev-libs/openssl:=[-bindist(-)] )
oracle? ( dev-db/oracle-instantclient[odbc,sdk] )
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 )
xmpp? ( dev-libs/iksemel )
"

RDEPEND="${COMMON_DEPEND}
acct-group/zabbix
acct-user/zabbix
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
fi

if use frontend; then
webapp_pkg_setup
fi

java-pkg-opt-2_pkg_setup
}

src_prepare() {
default
}

src_configure() {
econf \
$(use_enable agent) \
$(use_enable ipv6) \
$(use_enable java) \
$(use_enable proxy) \
$(use_enable server) \
$(use_enable static) \
$(use_with curl libcurl) \
$(use_with gnutls) \
$(use_with ldap) \
$(use_with libxml2) \
$(use_with mbedtls) \
$(use_with mysql) \
$(use_with odbc unixodbc) \
$(use_with openipmi openipmi) \
$(use_with openssl) \
$(use_with oracle) \
$(use_with postgres postgresql) \
$(use_with snmp net-snmp) \
$(use_with sqlite sqlite3) \
$(use_with ssh ssh2) \
$(use_with xmpp jabber)
}

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-r1.init zabbix-server

dosbin src/zabbix_server/zabbix_server

insinto /usr/share/zabbix
doins -r "${S}"/database/

systemd_dounit "${FILESDIR}"/zabbix-server.service
newtmpfiles "${FILESDIR}"/zabbix-server.tmpfiles zabbix-server.conf
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/

systemd_dounit "${FILESDIR}"/zabbix-proxy.service
newtmpfiles "${FILESDIR}"/zabbix-proxy.tmpfiles zabbix-proxy.conf
fi

if use agent; then
insinto /etc/zabbix
doins "${S}"/conf/zabbix_agentd.conf
fperms 0640 /etc/zabbix/zabbix_agentd.conf
fowners root:zabbix /etc/zabbix/zabbix_agentd.conf

newinitd "${FILESDIR}"/zabbix-agentd.init zabbix-agentd

dosbin src/zabbix_agent/zabbix_agentd
dobin \
src/zabbix_sender/zabbix_sender \
src/zabbix_get/zabbix_get

systemd_dounit "${FILESDIR}"/zabbix-agentd.service
newtmpfiles "${FILESDIR}"/zabbix-agentd.tmpfiles zabbix-agentd.conf
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_agentd.conf \
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 frontends/php/* "${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-1.2.9.jar \
src/zabbix_java/lib/logback-console.xml \
src/zabbix_java/lib/logback-core-1.2.9.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.7.32.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 (e.g. ~/.sendxmpprc when"
ewarn "using sendxmpp for Jabber alerts)."
ewarn
ewarn "To change the homedir use:"
ewarn " usermod -d /var/lib/zabbix/home zabbix"
ewarn
fi
fi

if use server; then
tmpfiles_process zabbix-server.conf

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

if use proxy; then
tmpfiles_process zabbix-proxy.conf
fi

if use agent; then
tmpfiles_process zabbix-agentd.conf
fi

elog "--"
elog
elog "You may need to add these lines to /etc/services:"
elog
elog "zabbix-agent 10050/tcp Zabbix Agent"
elog "zabbix-agent 10050/udp Zabbix Agent"
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
}

pkg_prerm() {
(use frontend || use server) && webapp_pkg_prerm
}

0 comments on commit 7d8af03

Please sign in to comment.