[152440] trunk/dports/net
eborisch at macports.org
eborisch at macports.org
Thu Sep 8 21:28:04 PDT 2016
Revision: 152440
https://trac.macports.org/changeset/152440
Author: eborisch at macports.org
Date: 2016-09-08 21:28:04 -0700 (Thu, 08 Sep 2016)
Log Message:
-----------
zabbix3: New port.
Modified Paths:
--------------
trunk/dports/net/zabbix3/Portfile
trunk/dports/net/zabbix3/files/zabbix_server.init.mysql
Added Paths:
-----------
trunk/dports/net/zabbix3/
Modified: trunk/dports/net/zabbix3/Portfile
===================================================================
--- trunk/dports/net/zabbix2/Portfile 2016-02-12 20:11:33 UTC (rev 145673)
+++ trunk/dports/net/zabbix3/Portfile 2016-09-09 04:28:04 UTC (rev 152440)
@@ -3,8 +3,8 @@
PortSystem 1.0
-name zabbix2
-version 2.4.7
+name zabbix3
+version 3.0.4
revision 0
categories net
maintainers eborisch openmaintainer
@@ -22,68 +22,93 @@
distname zabbix-${version}
livecheck.name zabbix
-livecheck.regex "Stable\/(\[0-9.\]+)\/"
+livecheck.regex "Stable\/(3\[0-9.\]+)\/"
livecheck.url \
http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/
homepage http://www.zabbix.com/
master_sites \
sourceforge:project/zabbix/ZABBIX%20Latest%20Stable/${version} \
sourceforge:project/zabbix/ZABBIX%20Release%20Candidates/${version}
-dist_subdir zabbix2
+dist_subdir zabbix3
+conflicts zabbix zabbix2
+
checksums \
- rmd160 f935c44faf0ae98a04d2deb895fbf1ca825204f1 \
- sha256 d2c47b8f5b9b91f18010d54c45de55845d979014a8b3fe4bef64e0b08f8b00da
+ rmd160 447be2d01e4f409ec3b4f318dfb34ca48eaea521 \
+ sha256 9fa47d97843b6ca9f550d706b40ee6b35b76c5165ff32ff11ef0474f161e7700
+patchfiles log_and_pid_locations.patch
+
universal_variant no
-conflicts zabbix
+subport zabbix3-agent {}
-subport zabbix2-agent {}
-
configure.args --bindir=${prefix}/bin/zabbix \
--sbindir=${prefix}/sbin/zabbix \
--libexecdir=${prefix}/libexec/zabbix \
--datadir=${prefix}/share/zabbix \
--sysconfdir=${prefix}/etc/zabbix \
- --localstatedir=${prefix}/var/zabbix
+ --localstatedir=${prefix}/var/zabbix \
+ --with-gnutls=/opt/local \
+ --enable-ipv6
configure.ldflags-append -lresolv
startupitem.create yes
+depends_lib-append port:libiconv \
+ port:gnutls
if { ${name} ne ${subport} } {
- startupitem.name zabbix2-agentd
+ conflicts zabbix2-agent
+ startupitem.name zabbix3-agentd
startupitem.executable \
${prefix}/sbin/zabbix/zabbix_agentd \
- -c ${prefix}/etc/zabbix/zabbix_agentd.conf
- startupitem.pidfile clean /tmp/zabbix_agentd.pid
+ -c ${prefix}/etc/zabbix3/zabbix_agentd.conf
+ startupitem.pidfile auto ${prefix}/var/run/zabbix/zabbix_agentd.pid
+ startupitem.logfile ${prefix}/var/log/zabbix/zabbix_agentd.launch
configure.args-append --enable-agent
} else {
- depends_lib-append port:apache2 \
- port:curl \
- port:fping \
+ depends_lib-append port:curl \
port:libssh2 \
port:net-snmp \
port:OpenIPMI \
- port:php53 \
- port:php53-apache2handler \
- port:php53-gd \
- port:php53-gettext \
- port:php53-mbstring \
- port:php53-sockets
+ port:libxml2
+ depends_run-append port:fping \
+ port:apache2
+
configure.args-append --enable-server \
--with-libcurl=${prefix}/bin/curl-config \
--with-net-snmp \
--with-openipmi=${prefix} \
- --with-ssh2=${prefix}
+ --with-ssh2=${prefix} \
+ --with-libxml2=${prefix}/bin/xml2-config
- startupitem.name zabbix2-server
- startupitem.start "${prefix}/share/zabbix/zabbix_server.init start"
- startupitem.stop "${prefix}/share/zabbix/zabbix_server.init stop"
+ startupitem.name zabbix3-server
+ startupitem.executable \
+ ${prefix}/sbin/zabbix/zabbix_server \
+ -c ${prefix}/etc/zabbix3/zabbix_server.conf
+ startupitem.pidfile auto ${prefix}/var/run/zabbix/zabbix_server.pid
+ startupitem.logfile ${prefix}/var/log/zabbix/zabbix_agentd.launch
+ foreach php {php56 php70} {
+ eval [subst {
+ variant ${php} description "Use ${php}" {
+ depends_run-append port:${php} \
+ port:${php}-apache2handler \
+ port:${php}-gd \
+ port:${php}-gettext \
+ port:${php}-mbstring \
+ port:${php}-sockets
+ }
+ }]
+ }
+
+ if {![variant_isset php56] && ![variant_isset php70]} {
+ default_variants +php56
+ }
+
variant full_server description {
Adds dependencies a complete server are installed.
} {
@@ -93,24 +118,16 @@
array set DBLIST {
mysql5 {"MySQL 5.x" mysql5 \
mysql=${prefix}/lib/mysql5/bin/mysql_config mysql}
- mysql51 {"MySQL 5.1" mysql51 \
- mysql=${prefix}/lib/mysql51/bin/mysql_config mysql}
- mysql55 {"MySQL 5.5" mysql55 \
- mysql=${prefix}/lib/mysql55/bin/mysql_config mysql}
mysql56 {"MySQL 5.6" mysql56 \
mysql=${prefix}/lib/mysql56/bin/mysql_config mysql}
mariadb {"MariaDB" mariadb \
mysql=${prefix}/lib/mariadb/bin/mysql_config mysql}
percona {"Percona" percona \
mysql=${prefix}/lib/percona/bin/mysql_config mysql}
- pgsql81 {"PostgreSQL 8.1.x" postgresql81 \
- pgsql=${prefix}/lib/postgresql81/bin/pg_config postgresql}
- pgsql82 {"PostgreSQL 8.2.x" postgresql82 \
- pgsql=${prefix}/lib/postgresql82/bin/pg_config postgresql}
- pgsql83 {"PostgreSQL 8.3.x" postgresql83 \
- pgsql=${prefix}/lib/postgresql83/bin/pg_config postgresql}
pgsql84 {"PostgreSQL 8.4.x" postgresql84 \
- pgsql=${prefix}/lib/postgresql84/bin/pg_config postgresql}
+ postgresql=${prefix}/lib/postgresql84/bin/pg_config postgresql}
+ pgsql95 {"PostgreSQL 9.5.x" postgresql95 \
+ postgresql=${prefix}/lib/postgresql95/bin/pg_config postgresql}
sqlite3 {"SQLite 3.x" sqlite3 \
sqlite3=${prefix} sqlite}
}
@@ -131,12 +148,21 @@
append variant_line { "
set ::ZDB [lindex ${prms} 1]
+ set ::DBFILES [lindex ${prms} 3]
set ::MYSQL_MODE [string equal [lindex ${prms} 3] mysql]
depends_lib-append port:[lindex ${prms} 1]
configure.args-append --with-[lindex ${prms} 2]
- depends_run-append \
- port:php53-[lindex ${prms} 3]
+ if {[variant_isset php56]} {
+ depends_run-append \
+ port:php56-[lindex ${prms} 3]
+ }
+
+ if {[variant_isset php70]} {
+ depends_run-append \
+ port:php70-[lindex ${prms} 3]
+ }
+
if {[string compare ${dbitem} sqlite3] && \
[variant_isset full_server]} {
depends_run-append \
@@ -147,28 +173,16 @@
eval $variant_line
}
- if {![variant_isset mysql51] &&
- ![variant_isset mysql55] &&
+ if {![variant_isset mysql5] &&
![variant_isset mysql56] &&
![variant_isset mariadb] &&
![variant_isset percona] &&
- ![variant_isset pgsql81] &&
- ![variant_isset pgsql82] &&
- ![variant_isset pgsql83] &&
![variant_isset pgsql84] &&
+ ![variant_isset pgsql95] &&
![variant_isset sqlite3]} {
default_variants +mysql5
}
-# Notify anyone with +agent_only installed of new zabbix2-agent port
- variant agent_only description {Old variant -- install zabbix2-agent} {
- pre-fetch {
- ui_error \
- "Variant 'zabbix2 +agent_only' replaced by port zabbix2-agent"
- return -code error "+agent_only variant replaced by zabbix2-agent"
- }
- }
-
variant date_slash description {
Draw month/day rather than day.month on line graphs.
} {}
@@ -193,41 +207,44 @@
reinplace ${repstr} ${worksrcpath}/conf/zabbix_server.conf
}
+post-patch {
+ reinplace "s|%%PREFIX%%|${prefix}|" \
+ conf/zabbix_agentd.conf conf/zabbix_server.conf
+ reinplace "s|/usr/local/etc|${prefix}/etc/zabbix3|" \
+ conf/zabbix_agentd.conf conf/zabbix_server.conf
+}
+
add_users zabbix group=zabbix
post-destroot {
if { ${name} ne ${subport} } {
####### AGENT #######
# Copy sample agent .conf files
- xinstall -d -m 755 -d ${destroot}${prefix}/etc/zabbix
- xinstall -m 755 ${worksrcpath}/conf/zabbix_agent.conf \
- ${destroot}${prefix}/etc/zabbix/zabbix_agent.conf.sample
+ move ${destroot}${prefix}/etc/zabbix ${destroot}${prefix}/etc/zabbix3
xinstall -m 755 ${worksrcpath}/conf/zabbix_agentd.conf \
- ${destroot}${prefix}/etc/zabbix/zabbix_agentd.conf.sample
+ ${destroot}${prefix}/etc/zabbix3/zabbix_agentd.conf.sample
# Don't overwrite user settings on each install
- delete ${destroot}${prefix}/etc/zabbix/zabbix_agentd.conf
- delete ${destroot}${prefix}/etc/zabbix/zabbix_agent.conf
+ delete ${destroot}${prefix}/etc/zabbix3/zabbix_agentd.conf
} else {
####### SERVER #######
# Copy sample server and agent .conf files
- xinstall -d -m 755 -d ${destroot}${prefix}/etc/zabbix
+ move ${destroot}${prefix}/etc/zabbix ${destroot}${prefix}/etc/zabbix3
+ xinstall -m 755 -d \
+ ${destroot}${prefix}/share/zabbix3/zabbix_server.conf.d
+
xinstall -m 755 ${worksrcpath}/conf/zabbix_server.conf \
- ${destroot}${prefix}/etc/zabbix/zabbix_server.conf.sample
+ ${destroot}${prefix}/etc/zabbix3/zabbix_server.conf.sample
# Don't overwrite user settings on each install
- delete ${destroot}${prefix}/etc/zabbix/zabbix_server.conf
+ delete ${destroot}${prefix}/etc/zabbix3/zabbix_server.conf
# Copy database data and schemas
- xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/data
- xinstall -d -m 755 -d ${destroot}${prefix}/share/zabbix/schema
+ xinstall -m 755 -d ${destroot}${prefix}/share/zabbix/scripts
- eval xinstall -m 755 ${worksrcpath}/database/mysql/data.sql \
- ${destroot}${prefix}/share/zabbix/data
- eval xinstall -m 755 ${worksrcpath}/database/mysql/images.sql \
- ${destroot}${prefix}/share/zabbix/data
- eval xinstall -m 755 ${worksrcpath}/database/mysql/schema.sql \
- ${destroot}${prefix}/share/zabbix/schema
+ eval xinstall -m 755 -W ${worksrcpath}/database/${DBFILES} \
+ data.sql images.sql schema.sql \
+ ${destroot}${prefix}/share/zabbix/scripts
file copy ${worksrcpath}/upgrades \
${destroot}${prefix}/share/zabbix/
@@ -237,28 +254,8 @@
file copy ${worksrcpath}/frontends/php/ \
${destroot}${prefix}/share/zabbix/frontends/
-# Create a startup script for the server
-# This script has a delay built into it (waiting for DB to start) so we
-# don't use a simple startupitem.executable approach
- if { ${MYSQL_MODE} == 1 } {
- xinstall -m 755 ${portpath}/${filesdir}/zabbix_server.init.mysql \
- ${destroot}${prefix}/share/zabbix/zabbix_server.init
- reinplace "s|__VER__|${ZDB}|g" \
- ${destroot}${prefix}/share/zabbix/zabbix_server.init
- if {[variant_isset full_server]} {
- reinplace "s/^#%#//" \
- ${destroot}${prefix}/share/zabbix/zabbix_server.init
- }
- } else {
- xinstall -m 755 ${portpath}/${filesdir}/zabbix_server.init \
- ${destroot}${prefix}/share/zabbix
- }
- reinplace "s|__PREFIX__|${prefix}|g" \
- ${destroot}${prefix}/share/zabbix/zabbix_server.init
-
# Set permissions for etc (protect passwords) and the frontend
- system "chmod 660 ${destroot}${prefix}/etc/zabbix/*"
- system "chown zabbix:zabbix ${destroot}${prefix}/etc/zabbix/*"
+ system "chmod 660 ${destroot}${prefix}/etc/zabbix3/*"
system "chown -R www:www ${destroot}${prefix}/share/zabbix/frontends/*"
xinstall -d -m 755 -d \
@@ -266,14 +263,22 @@
xinstall -m 755 ${worksrcpath}/bin/win32/zabbix_agentd.exe \
${destroot}${prefix}/share/zabbix/zabbix_agent_win32
}
+
+ foreach dname {run log} {
+ xinstall -d -m 755 ${destroot}${prefix}/var/${dname}/zabbix
+ system "chown -R zabbix:zabbix ${destroot}${prefix}/var/${dname}/zabbix"
+ touch ${destroot}${prefix}/var/${dname}/zabbix/.dropping.${subport}
+ }
+
+ system "chown -R zabbix:zabbix ${destroot}${prefix}/etc/zabbix3"
}
if { ${name} ne ${subport} } {
notes "
#### ####
-#### ZABBIX2 agent installation section ####
+#### ZABBIX3 agent installation section ####
-1) Edit the sample .conf file ${prefix}/etc/zabbix/zabbix_agentd.conf.sample
+1) Edit the sample .conf file ${prefix}/etc/zabbix3/zabbix_agentd.conf.sample
(rename & omit .sample)
Set the following variable to the ip address of your ZABBIX server to\
@@ -284,18 +289,18 @@
2) Set zabbix_agentd to run at system boot
- sudo port load zabbix2-agent
+ sudo port load zabbix3-agent
3) A Win32 agent is in ${prefix}/share/zabbix/zabbix_agent_win32 for\
installation on Windows NT 4.0, Windows 2000, and Windows XP.
-#### End ZABBIX2 agent installation section ####
+#### End ZABBIX3 agent installation section ####
#### ####
"
} else {
notes "
#### ####
-#### Begin ZABBIX2 local server installation section ####
+#### Begin ZABBIX3 local server installation section ####
(Installing with +full_server will add all of the dependants; configuration
will still be required.)
@@ -305,31 +310,17 @@
sudo port install mysql5-server
-2) Setup the ZABBIX MySQL database
+2) Setup the ZABBIX database
- For other databases, follow documentation from
- https://www.zabbix.com/documentation/2.4/manual/appendix/install/db_scripts
+ Follow the directions at :
--Create the ZABBIX database
- mysql5 -u root -p (enter password at prompt)
- mysql> create database zabbix character set utf8;
- mysql> quit;
+ https://www.zabbix.com/documentation/3.0/manual/appendix/install/db_scripts
--Import the ZABBIX Schema
- cd ${prefix}/share/zabbix/schema
- cat mysql.sql | mysql5 -u root -p zabbix
- cd ${prefix}/share/zabbix/data
- cat images.sql | mysql5 -u root -p zabbix
- cat data.sql | mysql5 -u root -p zabbix
+ The *.sql files it refers to are in ${prefix}/share/zabbix/scripts/
+ ** NOTE THAT THESE ARE FOR YOUR SELECTED DATABASE VARIANT!!! **
--Create a MySQL 'zabbix' user and password
- mysql5 -u root -p
- mysql> grant all privileges on zabbix.* to zabbix at localhost identified by '<zabbix-mysql-password>';
- mysql> grant all privileges on zabbix.* to zabbix identified by '<zabbix-mysql-password>';
- mysql> quit;
-
-3) Edit the sample .conf file ${prefix}/etc/zabbix/zabbix_server.conf
+3) Edit the sample .conf file ${prefix}/etc/zabbix3/zabbix_server.conf
(rename & omit .sample)
Modify these variables at the very least:
@@ -347,13 +338,10 @@
sudo ln -s ${prefix}/share/zabbix/frontends/php <Apache-docroot>/zabbix
-5) Set zabbix_server to run at system boot, then start it
+5) Set zabbix_server to run at system boot, then start it:
- sudo port load zabbix2
+ sudo port load zabbix3
- To start Zabbix manually, use:
- ${prefix}/share/zabbix/zabbix_server.init start (stop|status)
-
!! Note: Your shared memory will likely need to be increased !!
!! (see http://support.apple.com/kb/HT4022) !!
@@ -363,32 +351,46 @@
the ReadMe.txt for instructions.
-7) Open http://localhost/zabbix/ in your browser and walk through the setup,
+7) Enable your desired php version in httpd.conf and make sure the following
+ are set in the associated php.ini:
+
+ max_execution_time = 300
+ max_input_time = 300
+ post_max_size = 16M
+ date.timezone = < Your TZ; see http://php.net/manual/en/timezones.php >
+
+ And for php56:
+ always_populate_raw_post_data = -1
+
+
+8) Open http://localhost/zabbix/ in your browser and walk through the setup,
then login with default user 'Admin' and password 'zabbix'.
-8) Read the fine manual at http://www.zabbix.com/documentation/
+9) Read the fine manual at http://www.zabbix.com/documentation/
-#### End ZABBIX2 local server installation section ####
+#### End ZABBIX3 local server installation section ####
#### ####
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! ZABBIX -> ZABBIX2 Server Upgrade process !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!! ZABBIX2 -> ZABBIX3 Server Upgrade process !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 0) BACK UP YOUR DATABASE !!
!! !!
-!! 1) Be sure to use 'sudo port unload zabbix' to stop the background !!
-!! server before deactivating zabbix, and then use !!
-!! 'sudo port load zabbix2' **AFTER UPGRADING THE DATABASE** as !!
-!! described below. !!
+!! 1) Be sure to use 'sudo port unload zabbix2' to stop the background !!
+!! server before deactivating zabbix2. !!
!! !!
-!! 2) For upgrading from 1.8 (zabbix -> zabbix2), upgrade scripts are !!
-!! located in ${prefix}/share/zabbix/upgrades !!
+!! 2) Create ${prefix}/etc/zabbix3/zabbix_server.conf !!
+!! zabbix_server.conf.sample is available for reference. !!
+!! There are new features to consider. !!
+!! ** NOTE conf dir is etc/zabbix3 ** !!
!! !!
+!! 3) 'sudo port load zabbix3' after installing. !!
+!! !!
!! For upgrade procedure, please see !!
-!! http://www.zabbix.com/documentation/2.0/manual/installation/upgrade !!
+!! http://www.zabbix.com/documentation/3.0/manual/installation/upgrade !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
"
Modified: trunk/dports/net/zabbix3/files/zabbix_server.init.mysql
===================================================================
--- trunk/dports/net/zabbix2/files/zabbix_server.init.mysql 2016-02-12 20:11:33 UTC (rev 145673)
+++ trunk/dports/net/zabbix3/files/zabbix_server.init.mysql 2016-09-09 04:28:04 UTC (rev 152440)
@@ -22,7 +22,7 @@
stop)
echo "Shutting down zabbix_server"
pid=`ps -U zabbix | grep 'zabbix_server[^:]' | awk '{print $1}'`
- bin/kill $pid
+ /bin/kill $pid
MAX_WAIT=10
while [ `netstat -an | grep -q '\.10051. *LISTEN' && echo 1 || echo 0` \
== "1" ]; do
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160908/1ab49971/attachment-0001.html>
More information about the macports-changes
mailing list