diff options
author | Wolfram Schlich <wschlich@gentoo.org> | 2006-06-07 10:10:46 +0000 |
---|---|---|
committer | Wolfram Schlich <wschlich@gentoo.org> | 2006-06-07 10:10:46 +0000 |
commit | 6fdd08269c0a0086d3349197ae6038d4b66e8fc8 (patch) | |
tree | ce4e971d1af735ad90d98c5bc72d1ed8a1614059 /net-analyzer | |
parent | Added to ~ppc64. (diff) | |
download | gentoo-2-6fdd08269c0a0086d3349197ae6038d4b66e8fc8.tar.gz gentoo-2-6fdd08269c0a0086d3349197ae6038d4b66e8fc8.tar.bz2 gentoo-2-6fdd08269c0a0086d3349197ae6038d4b66e8fc8.zip |
Fix handling of postgres and oracle USE flags
(Portage version: 2.1_rc4-r1)
Diffstat (limited to 'net-analyzer')
-rw-r--r-- | net-analyzer/zabbix-server/ChangeLog | 6 | ||||
-rw-r--r-- | net-analyzer/zabbix-server/zabbix-server-1.1.ebuild | 76 |
2 files changed, 60 insertions, 22 deletions
diff --git a/net-analyzer/zabbix-server/ChangeLog b/net-analyzer/zabbix-server/ChangeLog index 8466126fef6f..66171aa300a8 100644 --- a/net-analyzer/zabbix-server/ChangeLog +++ b/net-analyzer/zabbix-server/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for net-analyzer/zabbix-server # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix-server/ChangeLog,v 1.6 2006/06/06 13:47:10 wschlich Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix-server/ChangeLog,v 1.7 2006/06/07 10:10:46 wschlich Exp $ + + 07 Jun 2006; Wolfram Schlich <wschlich@gentoo.org> + zabbix-server-1.1.ebuild: + Fix handling of postgres and oracle USE flags *zabbix-server-1.1 (06 Jun 2006) diff --git a/net-analyzer/zabbix-server/zabbix-server-1.1.ebuild b/net-analyzer/zabbix-server/zabbix-server-1.1.ebuild index cc7e16e8ca62..95e266b04f88 100644 --- a/net-analyzer/zabbix-server/zabbix-server-1.1.ebuild +++ b/net-analyzer/zabbix-server/zabbix-server-1.1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix-server/zabbix-server-1.1.ebuild,v 1.1 2006/06/06 13:47:10 wschlich Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix-server/zabbix-server-1.1.ebuild,v 1.2 2006/06/07 10:10:46 wschlich Exp $ inherit eutils @@ -22,52 +22,86 @@ RDEPEND="${RDEPEND} net-analyzer/fping" S=${WORKDIR}/${MY_P}-${MY_PV} +pkg_setup() { + if useq postgres; then + eerror "" + eerror "PostgreSQL support is broken/missing in 1.1." + eerror "Please use MySQL or Oracle until this is resolved." + eerror "Turn the postgres USE flag off for zabbix-server and select your database." + eerror "For MySQL:" + eerror " echo 'net-analyzer/zabbix-server -postgres mysql' >>/etc/portage/package.use" + eerror "" + die "USE flag 'postgres' unsupported in this version :-(" + fi + if useq 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 +} + pkg_preinst() { enewgroup zabbix enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix } pkg_postinst() { - einfo "" - if useq mysql; then - einfo "You need to configure MySQL for Zabbix." - elif useq postgres; then - einfo "You need to configure PostgreSQL for Zabbix." - fi - einfo "" + einfo + einfo "You need to configure your database for Zabbix." + einfo einfo "Have a look at /usr/share/zabbix/database for" einfo "database creation and upgrades." - einfo "" + einfo einfo "For more info read the Zabbix manual at" einfo "http://www.zabbix.com/manual/v1.1/" - einfo "" + einfo zabbix_homedir="$(egetent passwd zabbix | cut -d : -f 6 )" if [ -n "${zabbix_homedir}" ] && \ [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then - ewarn "" + 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 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 ewarn "To change the homedir use:" ewarn " usermod -d /var/lib/zabbix/home zabbix" - ewarn "" + ewarn fi } src_unpack() { - # This needs do be fixed! :-( - if useq mysql && useq postgres; then - eerror "You can't use both MySQL and PostgreSQL in Zabbix. Select one database." - die "Both database types selected" - elif ! ( useq mysql || useq postgres || useq oracle ); then - eerror "Select MySQL, PostgreSQL or Oracle database" - die "No database selected" + local dbnum dbtypes="mysql postgres oracle" dbtype + declare -i dbnum=0 + for dbtype in ${dbtypes}; do + useq ${dbtype} && let dbnum++ + done + if [ ${dbnum} -gt 1 ]; then + eerror + eerror "You can't use more than one database type in Zabbix." + eerror "Select exactly one database type out of these: ${dbtypes}" + eerror + die "Multiple database types selected." + elif [ ${dbnum} -lt 1 ]; then + eerror + eerror "Select exactly one database type out of these: ${dbtypes}" + eerror + die "No database type selected." fi unpack ${A} } |