+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit multilib user
+
+MY_PN="${PN#nagios-}"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="A nagios plugin for checking MySQL server health"
+HOMEPAGE="http://labs.consol.de/lang/de/nagios/${MY_PN}/"
+SRC_URI="http://labs.consol.de/download/shinken-nagios-plugins/${MY_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+# Found by grepping for "use " in the built
+# plugins-scripts/check_mysql_health.
+RDEPEND="dev-perl/DBD-mysql
+ dev-perl/DBI
+ virtual/perl-Data-Dumper
+ virtual/perl-File-Temp
+ virtual/perl-Net-Ping
+ virtual/perl-Time-HiRes"
+
+S="${WORKDIR}/${MY_P}"
+
+src_configure(){
+ # Should match net-analyzer/{monitoring,nagios}-plugins.
+ econf --libexecdir="/usr/$(get_libdir)/nagios/plugins"
+}
+
+pkg_preinst() {
+ # These should match net-analyzer/{monitoring,nagios}-plugins.
+ enewgroup nagios
+ enewuser nagios -1 /bin/bash /var/nagios/home nagios
+}