diff options
author | leeym <leeym@FreeBSD.org> | 2003-10-26 07:36:31 +0800 |
---|---|---|
committer | leeym <leeym@FreeBSD.org> | 2003-10-26 07:36:31 +0800 |
commit | c9b980e00ce2bf513c6001254bc52a2686c7a275 (patch) | |
tree | 7946b0e772986f7775d50e8db932b15e4b5782af /net | |
parent | b8e740cb3d244f984271e763e87dd0a720b744df (diff) | |
download | freebsd-ports-gnome-c9b980e00ce2bf513c6001254bc52a2686c7a275.tar.gz freebsd-ports-gnome-c9b980e00ce2bf513c6001254bc52a2686c7a275.tar.zst freebsd-ports-gnome-c9b980e00ce2bf513c6001254bc52a2686c7a275.zip |
Fixed issues:
* Make use of USE_MYSQL
* Convert scripts to rc.subr
* Fix plist
* Fix pkg-message not displayed during 'make install'
* Depend on net/php4-nms
* Allow to connect to remote MySQL DB
* Even more...
PR: 58061
Submitted by: Sergey Akifyev <asa@gascom.ru>
Diffstat (limited to 'net')
-rw-r--r-- | net/zabbix/Makefile | 28 | ||||
-rw-r--r-- | net/zabbix/pkg-message | 10 | ||||
-rw-r--r-- | net/zabbix/pkg-plist | 1 | ||||
-rw-r--r-- | net/zabbix/pkg-plist.agent | 2 | ||||
-rw-r--r-- | net/zabbix/scripts/dbsetup.sh | 7 | ||||
-rw-r--r-- | net/zabbix/scripts/zabbix-agent.sh.sample | 24 | ||||
-rw-r--r-- | net/zabbix/scripts/zabbix.sh.sample | 26 |
7 files changed, 56 insertions, 42 deletions
diff --git a/net/zabbix/Makefile b/net/zabbix/Makefile index c9b833ac1abf..5a544ab50cb7 100644 --- a/net/zabbix/Makefile +++ b/net/zabbix/Makefile @@ -7,6 +7,7 @@ PORTNAME= zabbix PORTVERSION= 1.0b10 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR=${PORTNAME} @@ -20,14 +21,15 @@ PKGNAMESUFFIX= -agent PLIST= ${MASTERDIR}/pkg-plist.agent PKGMESSAGE= nonexistent .else -CONFIGURE_ARGS= --with-mysql --with-net-snmp +LIB_DEPENDS= netsnmp.5:${PORTSDIR}/net/net-snmp +RUN_DEPENDS= php:${PORTSDIR}/lang/php4-nms -LIB_DEPENDS= netsnmp.5:${PORTSDIR}/net/net-snmp \ - mysqlclient.10:${PORTSDIR}/databases/mysql323-client -BUILD_DEPENDS= mysql:${PORTSDIR}/databases/mysql323-client -RUN_DEPENDS= safe_mysqld:${PORTSDIR}/databases/mysql323-server +USE_MYSQL= yes +CONFIGURE_ARGS= --with-mysql --with-net-snmp +PKGMESSAGE= ${WRKDIR}/pkg-message .endif +USE_RC_SUBR= yes GNU_CONFIGURE= yes CONFIGURE_ENV= CPPFLAGS=-I${LOCALBASE}/include @@ -38,6 +40,17 @@ ZABBIX_BINARIES+=zabbix_suckerd zabbix_trapper zabbix_trapperd ZABBIX_CONFIGS+=zabbix_suckerd.conf zabbix_trapper.conf zabbix_trapperd.conf .endif +SCRIPT_REGEX= -e 's|%PREFIX%|${PREFIX}|g' -e 's|%LOCALBASE%|${LOCALBASE}|g' + +pre-patch: +.if !defined(ZABBIX_AGENT_ONLY) + @${SED} ${SCRIPT_REGEX} ${PKGDIR}/pkg-message > ${PKGMESSAGE} + @${SED} ${SCRIPT_REGEX} ${PKGDIR}/scripts/zabbix.sh.sample > \ + ${WRKDIR}/zabbix.sh.sample +.endif + @${SED} ${SCRIPT_REGEX} ${PKGDIR}/scripts/zabbix-agent.sh.sample > \ + ${WRKDIR}/zabbix-agent.sh.sample + do-install: .for FILE in ${ZABBIX_BINARIES} ${INSTALL_PROGRAM} ${WRKSRC}/bin/${FILE} ${PREFIX}/bin @@ -63,6 +76,9 @@ do-install: .endif ${INSTALL_SCRIPT} ${MASTERDIR}/scripts/zabbix-agent.sh.sample \ ${PREFIX}/etc/rc.d - ${SH} ${PKGINSTALL} + ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL +.ifndef(ZABBIX_AGENT_ONLY) + ${CAT} ${PKGMESSAGE} +.endif .include <bsd.port.mk> diff --git a/net/zabbix/pkg-message b/net/zabbix/pkg-message index 9e3c2a8e3e21..13c338ed4d4d 100644 --- a/net/zabbix/pkg-message +++ b/net/zabbix/pkg-message @@ -1,10 +1,8 @@ ==================================================== ACHTUNG!!! -1) Run dbsetup.sh from ${PREFIX}/share/zabbix/create -to setup database tables - -2) Install apache with mod_php (it should be -GD-enabled for graphs to work) and point it -to serve from ${PREFIX}/share/zabbix/php +Run dbsetup.sh from %PREFIX%/share/zabbix/create +to setup database tables. Arguments, given to +it will be passed to mysql client, allowing +connection do non-local MySQL server ==================================================== diff --git a/net/zabbix/pkg-plist b/net/zabbix/pkg-plist index 12adb76a47ca..87768f013212 100644 --- a/net/zabbix/pkg-plist +++ b/net/zabbix/pkg-plist @@ -65,6 +65,7 @@ bin/zabbix_trapperd %%DATADIR%%/php/images/sysmaps/Server.png %%DATADIR%%/php/images/sysmaps/Workstation.png %%DATADIR%%/php/include/.htaccess +%%DATADIR%%/php/include/classes.inc.php %%DATADIR%%/php/include/config.inc.php %%DATADIR%%/php/include/db.inc.php %%DATADIR%%/php/include/defines.inc.php diff --git a/net/zabbix/pkg-plist.agent b/net/zabbix/pkg-plist.agent index d24cc6db18d4..2e5a1980939c 100644 --- a/net/zabbix/pkg-plist.agent +++ b/net/zabbix/pkg-plist.agent @@ -3,6 +3,6 @@ bin/zabbix_agentd bin/zabbix_sender etc/zabbix/zabbix_agent.conf.sample etc/zabbix/zabbix_agentd.conf.sample -@dirrm /etc/zabbix +@dirrm etc/zabbix @exec ln -sf %D/etc/zabbix /etc/zabbix @unexec rm /etc/zabbix diff --git a/net/zabbix/scripts/dbsetup.sh b/net/zabbix/scripts/dbsetup.sh index 4ae8e4381893..240f46157640 100644 --- a/net/zabbix/scripts/dbsetup.sh +++ b/net/zabbix/scripts/dbsetup.sh @@ -1,5 +1,6 @@ #!/bin/sh -echo "create database zabbix;" | mysql -cat mysql/schema.sql | mysql zabbix -cat data/data.sql | mysql zabbix +{ + echo "create database zabbix; use zabbix;" + cat mysql/schema.sql data/data.sql +} | mysql ${*} diff --git a/net/zabbix/scripts/zabbix-agent.sh.sample b/net/zabbix/scripts/zabbix-agent.sh.sample index e5728bd24051..1001c6cb694f 100644 --- a/net/zabbix/scripts/zabbix-agent.sh.sample +++ b/net/zabbix/scripts/zabbix-agent.sh.sample @@ -1,14 +1,14 @@ #!/bin/sh -case "${1}" in - start) - echo -n "zabbix-agent " - zabbix_agentd - ;; - stop) - killall zabbix_agentd - ;; - *) - echo Usage: `basename ${0}` "{start|stop}" - ;; -esac +prefix=%PREFIX% + +zabbix_agentd_enable="YES" + +. %LOCALBASE%/etc/rc.subr + +name="zabbix_agentd" +rcvar=`set_rcvar` +command="${prefix}/bin/${name}" +required_files="/etc/zabbix/${name}.conf" + +run_rc_command "$1" diff --git a/net/zabbix/scripts/zabbix.sh.sample b/net/zabbix/scripts/zabbix.sh.sample index 58c0529b4099..01a0fbce27ef 100644 --- a/net/zabbix/scripts/zabbix.sh.sample +++ b/net/zabbix/scripts/zabbix.sh.sample @@ -1,16 +1,14 @@ #!/bin/sh -case "${1}" in - start) - echo -n "zabbix " - zabbix_suckerd - zabbix_trapperd - ;; - stop) - killall zabbix_suckerd - killall zabbix_trapperd - ;; - *) - echo Usage: `basename ${0}` "{start|stop}" - ;; -esac +prefix=%PREFIX% + +zabbix_suckerd_enable="YES" + +. %LOCALBASE%/etc/rc.subr + +name="zabbix_suckerd" +rcvar=`set_rcvar` +command="${prefix}/bin/${name}" +required_files="/etc/zabbix/${name}.conf" + +run_rc_command "$1" |