summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2012-12-12 09:45:08 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2012-12-12 09:45:08 +0000
commit40e6cfbd11e32a993a52ed85601207eeecdb0fc9 (patch)
tree627efb1cee3fbb59066de2c1329ab0fbacdd2b4c /net-analyzer
parentNon-maintainer commit. Switch to tarball provided by Debian; the original one... (diff)
downloadgentoo-2-40e6cfbd11e32a993a52ed85601207eeecdb0fc9.tar.gz
gentoo-2-40e6cfbd11e32a993a52ed85601207eeecdb0fc9.tar.bz2
gentoo-2-40e6cfbd11e32a993a52ed85601207eeecdb0fc9.zip
Remove old version; bump to 2.0.9, adding missing test dependencies and avoiding install of /var/run; restrict tests on the current stable as some dependencies are missing.
(Portage version: 2.2.0_alpha148/cvs/Linux x86_64, signed Manifest commit with key 1CD13C8AD4301342)
Diffstat (limited to 'net-analyzer')
-rw-r--r--net-analyzer/munin/ChangeLog10
-rw-r--r--net-analyzer/munin/munin-2.0.8-r2.ebuild5
-rw-r--r--net-analyzer/munin/munin-2.0.9.ebuild (renamed from net-analyzer/munin/munin-2.0.5-r1.ebuild)181
3 files changed, 160 insertions, 36 deletions
diff --git a/net-analyzer/munin/ChangeLog b/net-analyzer/munin/ChangeLog
index 869fbb78d7c7..7a51eedf781e 100644
--- a/net-analyzer/munin/ChangeLog
+++ b/net-analyzer/munin/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-analyzer/munin
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/ChangeLog,v 1.124 2012/12/06 04:17:50 phajdan.jr Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/ChangeLog,v 1.125 2012/12/12 09:45:08 flameeyes Exp $
+
+*munin-2.0.9 (12 Dec 2012)
+
+ 12 Dec 2012; Diego E. Pettenò <flameeyes@gentoo.org> +munin-2.0.9.ebuild,
+ -munin-2.0.5-r1.ebuild, munin-2.0.8-r2.ebuild:
+ Remove old version; bump to 2.0.9, adding missing test dependencies and
+ avoiding install of /var/run; restrict tests on the current stable as some
+ dependencies are missing.
06 Dec 2012; Pawel Hajdan jr <phajdan.jr@gentoo.org> munin-2.0.8-r2.ebuild:
x86 stable wrt bug #445250
diff --git a/net-analyzer/munin/munin-2.0.8-r2.ebuild b/net-analyzer/munin/munin-2.0.8-r2.ebuild
index 046c733245ca..1274347a2ef9 100644
--- a/net-analyzer/munin/munin-2.0.8-r2.ebuild
+++ b/net-analyzer/munin/munin-2.0.8-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/munin-2.0.8-r2.ebuild,v 1.4 2012/12/06 04:17:50 phajdan.jr Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/munin-2.0.8-r2.ebuild,v 1.5 2012/12/12 09:45:08 flameeyes Exp $
EAPI=4
@@ -21,6 +21,9 @@ KEYWORDS="amd64 ~arm ~mips ~ppc x86"
IUSE="asterisk irc java memcached minimal mysql postgres ssl test cgi ipv6 syslog ipmi http dhcpd doc apache"
REQUIRED_USE="cgi? ( !minimal ) apache? ( cgi )"
+# Missing deps, now stabled, ignore tests for now, not a regression.
+RESTRICT=test
+
# Upstream's listing of required modules is NOT correct!
# Some of the postgres plugins use DBD::Pg, while others call psql directly.
# Some of the mysql plugins use DBD::mysql, while others call mysqladmin directly.
diff --git a/net-analyzer/munin/munin-2.0.5-r1.ebuild b/net-analyzer/munin/munin-2.0.9.ebuild
index 611554e7239c..823c9ee1205c 100644
--- a/net-analyzer/munin/munin-2.0.5-r1.ebuild
+++ b/net-analyzer/munin/munin-2.0.9.ebuild
@@ -1,10 +1,10 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/munin-2.0.5-r1.ebuild,v 1.5 2012/10/02 21:04:14 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/munin/munin-2.0.9.ebuild,v 1.1 2012/12/12 09:45:08 flameeyes Exp $
-EAPI=4
+EAPI=5
-PATCHSET=2
+PATCHSET=1
inherit eutils user java-pkg-opt-2
@@ -17,16 +17,17 @@ SRC_URI="mirror://sourceforge/munin/${MY_P}.tar.gz
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="amd64 ~mips ~ppc x86"
-IUSE="asterisk irc java memcached minimal mysql postgres ssl test cgi ipv6 syslog ipmi http"
-REQUIRED_USE="cgi? ( !minimal )"
+KEYWORDS="~amd64 ~mips ~x86"
+IUSE="asterisk irc java memcached minimal mysql postgres ssl test cgi ipv6 syslog ipmi http dhcpd doc apache"
+REQUIRED_USE="cgi? ( !minimal ) apache? ( cgi )"
# Upstream's listing of required modules is NOT correct!
# Some of the postgres plugins use DBD::Pg, while others call psql directly.
# Some of the mysql plugins use DBD::mysql, while others call mysqladmin directly.
# We replace the original ipmi plugins with the freeipmi_ plugin which at least works.
-DEPEND_COM="dev-lang/perl
+DEPEND_COM="dev-lang/perl[berkdb]
sys-process/procps
+ doc? ( dev-python/sphinx )
asterisk? ( dev-perl/Net-Telnet )
irc? ( dev-perl/Net-IRC )
mysql? ( virtual/mysql
@@ -36,12 +37,14 @@ DEPEND_COM="dev-lang/perl
postgres? ( dev-perl/DBD-Pg dev-db/postgresql-base )
memcached? ( dev-perl/Cache-Memcached )
cgi? ( dev-perl/FCGI )
+ apache? ( www-servers/apache[apache2_modules_cgi,apache2_modules_cgid,apache2_modules_rewrite] )
syslog? ( virtual/perl-Sys-Syslog )
- ipmi? (
- >=sys-libs/freeipmi-1.1.6-r1
- virtual/awk
- )
http? ( dev-perl/libwww-perl )
+ dhcpd? (
+ >=net-misc/dhcp-3[server]
+ dev-perl/Net-IP
+ dev-perl/HTTP-Date
+ )
dev-perl/DBI
dev-perl/DateManip
dev-perl/File-Copy-Recursive
@@ -61,6 +64,7 @@ DEPEND_COM="dev-lang/perl
dev-perl/IO-Socket-INET6
dev-perl/URI
>=net-analyzer/rrdtool-1.3[perl]
+ virtual/ssh
)"
# Keep this seperate, as previous versions have had other deps here
@@ -68,14 +72,18 @@ DEPEND="${DEPEND_COM}
virtual/perl-Module-Build
java? ( >=virtual/jdk-1.5 )
test? (
+ dev-perl/Test-Deep
dev-perl/Test-LongString
dev-perl/Test-Differences
dev-perl/Test-MockModule
+ dev-perl/Test-MockObject
dev-perl/File-Slurp
dev-perl/IO-stringy
dev-perl/IO-Socket-INET6
)"
RDEPEND="${DEPEND_COM}
+ virtual/awk
+ ipmi? ( >=sys-libs/freeipmi-1.1.6-r1 )
java? (
>=virtual/jre-1.5
|| ( net-analyzer/netcat6 net-analyzer/netcat )
@@ -90,6 +98,8 @@ S="${WORKDIR}/${MY_P}"
pkg_setup() {
enewgroup munin
enewuser munin 177 -1 /var/lib/munin munin
+ enewuser munin-async -1 /bin/sh /var/spool/munin-async
+ esethome munin-async /var/spool/munin-async
java-pkg-opt-2_pkg_setup
}
@@ -100,9 +110,11 @@ src_prepare() {
}
src_configure() {
- local cgidir='$(DESTDIR)/var/www/localhost/cgi-bin'
+ local cgidir='$(DESTDIR)/usr/libexec/munin/cgi'
use cgi || cgidir="${T}/useless/cgi-bin"
+ local cgiuser=$(usex apache apache munin)
+
cat - >> "${S}"/Makefile.config <<EOF
PREFIX=\$(DESTDIR)/usr
CONFDIR=\$(DESTDIR)/etc/munin
@@ -111,8 +123,11 @@ MANDIR=\$(PREFIX)/share/man
LIBDIR=\$(PREFIX)/libexec/munin
HTMLDIR=\$(DESTDIR)/var/www/localhost/htdocs/munin
CGIDIR=${cgidir}
+CGITMPDIR=\$(DESTDIR)/var/cache/munin-cgi
+CGIUSER=${cgiuser}
DBDIR=\$(DESTDIR)/var/lib/munin
-SPOOLDIR=\$(DESTDIR)/var/spool/munin
+DBDIRNODE=\$(DESTDIR)/var/lib/munin-node
+SPOOLDIR=\$(DESTDIR)/var/spool/munin-async
LOGDIR=\$(DESTDIR)/var/log/munin
PERLSITELIB=$(perl -V:vendorlib | cut -d"'" -f2)
JCVALID=$(usex java yes no)
@@ -123,27 +138,42 @@ EOF
# gotten around to do so yet.
src_compile() {
emake -j1
+ if use doc; then
+ emake -C doc html
+ fi
+}
+
+src_test() {
+ if [[ ${EUID} == 0 ]]; then
+ eerror "You cannot run tests as root."
+ eerror "Please enable FEATURES=userpriv before proceeding."
+ return 1
+ fi
+
+ local testtargets="test-common test-node test-plugins"
+ use minimal || testtargets+=" test-master"
+
+ LC_ALL=C emake -j1 ${testtargets}
}
src_install() {
local dirs="
- /var/log/munin/
- /var/lib/munin/plugin-state/
- /var/spool/munin/
- /etc/munin/plugin-conf.d/
- /etc/munin/plugins/"
+ /var/log/munin
+ /var/lib/munin/plugin-state
+ /etc/munin/plugin-conf.d
+ /etc/munin/plugins"
+ use minimal || dirs+=" /etc/munin/munin-conf.d/"
+
keepdir ${dirs}
fowners munin:munin ${dirs}
- local install_targets="install-common-prime install-node-prime install-plugins-prime"
- use java && install_targets+=" install-plugins-java"
-
- use minimal || install_targets=install
- use minimal || dirs+=" /etc/munin/munin-conf.d/"
-
# parallel install doesn't work and it's also pointless to have this
# run in parallel for now (because it uses internal loops).
- emake -j1 DESTDIR="${D}" ${install_targets}
+ emake -j1 DESTDIR="${D}" $(usex minimal install-minimal install)
+
+ # we remove /var/run from the install as that stops Portage from
+ # having to check it for symlinks when the new /run is used.
+ rm -rf "${D}"/var/run
# remove the plugins for non-Gentoo package managers
rm "${D}"/usr/libexec/munin/plugins/{apt{,_all},yum} || die
@@ -151,16 +181,26 @@ src_install() {
insinto /etc/munin/plugin-conf.d/
newins "${FILESDIR}"/${PN}-1.3.2-plugins.conf munin-node
- newinitd "${FILESDIR}"/munin-node_init.d_2.0.2 munin-node
+ newinitd "${FILESDIR}"/munin-node_init.d_2.0.7 munin-node
newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node
- newinitd "${FILESDIR}"/munin-asyncd.init munin-asyncd
+ newinitd "${FILESDIR}"/munin-asyncd.init.2 munin-asyncd
- dodoc README ChangeLog INSTALL build/resources/apache*
+ cat - >> "${T}"/munin.env <<EOF
+CONFIG_PROTECT=/var/spool/munin-async/.ssh
+EOF
+ newenvd "${T}"/munin.env 50munin
- # bug 254968
- insinto /etc/logrotate.d/
- newins "${FILESDIR}"/logrotate.d-munin munin
+ dodoc README ChangeLog INSTALL
+ if use doc; then
+ cd "${S}"/doc/_build/html
+ dohtml -r *
+ cd "${S}"
+ fi
+
+ dodir /etc/logrotate.d/
+ sed -e "s:@CGIUSER@:$(usex apache apache munin):g" \
+ "${FILESDIR}"/logrotate.d-munin.2 > "${D}"/etc/logrotate.d/munin
dosym ipmi_ /usr/libexec/munin/plugins/ipmi_sensor_
@@ -169,6 +209,18 @@ src_install() {
"${D}"/etc/munin/munin-node.conf || die
fi
+ # Use a simpler pid file to avoid trouble with /run in tmpfs. The
+ # munin-node service is ran as user root, and only later drops
+ # privileges.
+ sed -i -e 's:/var/run/munin/munin-node.pid:/var/run/munin-node.pid:' \
+ "${D}"/etc/munin/munin-node.conf || die
+
+ keepdir /var/spool/munin-async/.ssh
+ touch "${D}"/var/spool/munin-async/.ssh/authorized_keys
+ fowners munin-async:munin /var/spool/munin-async{,/.ssh/{,authorized_keys}}
+ fperms 0750 /var/spool/munin-async{,/.ssh}
+ fperms 0600 /var/spool/munin-async/.ssh/authorized_keys
+
if use minimal; then
# This requires the presence of munin-update, which is part of
# the non-minimal install...
@@ -182,10 +234,31 @@ src_install() {
if use cgi; then
sed -i -e '/#graph_strategy cgi/s:^#::' "${D}"/etc/munin/munin.conf || die
+
+ keepdir /var/cache/munin-cgi
+ touch "${D}"/var/log/munin/munin-cgi-{graph,html}.log
+ fowners $(usex apache apache munin) \
+ /var/cache/munin-cgi \
+ /var/log/munin/munin-cgi-{graph,html}.log
+
+ if use apache; then
+ insinto /etc/apache2/vhosts.d
+ newins "${FILESDIR}"/munin.apache.include munin.include
+ newins "${FILESDIR}"/munin.apache.include-2.4 munin-2.4.include
+ fi
else
sed -i -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' "${D}"/etc/munin/munin.conf || die
fi
+ keepdir /var/lib/munin/.ssh
+ cat - >> "${D}"/var/lib/munin/.ssh/config <<EOF
+IdentityFile /var/lib/munin/.ssh/id_ecdsa
+IdentityFile /var/lib/munin/.ssh/id_rsa
+EOF
+
+ fowners munin:munin /var/lib/munin/.ssh/{,config}
+ fperms go-rwx /var/lib/munin/.ssh/{,config}
+
dodir /usr/share/${PN}
cat - >> "${D}"/usr/share/${PN}/crontab <<EOF
# Force the shell to bash
@@ -241,6 +314,7 @@ pkg_config() {
einfo "If you have a large site, you may wish to customize it."
read
+ ebegin "Setting up cron ..."
if has_version sys-process/fcron; then
fcrontab - -u munin < /usr/share/${PN}/fcrontab
else
@@ -248,17 +322,56 @@ pkg_config() {
# the following is the only form that works in BOTH dcron and vixie-cron
crontab - -u munin < /usr/share/${PN}/crontab
fi
+ eend $?
+
+ einfo "Press enter to set up the SSH keys used for SSH transport"
+ read
+
+ # generate one rsa (for legacy) and one ecdsa (for new systems)
+ ssh-keygen -t rsa -f /var/lib/munin/.ssh/id_rsa -N '' -C "created by portage for ${CATEGORY}/${PN}" || die
+ ssh-keygen -t ecdsa -f /var/lib/munin/.ssh/id_ecdsa -N '' -C "created by portage for ${CATEGORY}/${PN}" || die
+ chown -R munin:munin /var/lib/munin/.ssh || die
+ chmod 0600 /var/lib/munin/.ssh/id_{rsa,ecdsa} || die
+
+ einfo "Your public keys are available in "
+ einfo " /var/lib/munin/.ssh/id_rsa.pub"
+ einfo " /var/lib/munin/.ssh/id_ecdsa.pub"
+ einfo "and follows for convenience"
+ echo
+ cat /var/lib/munin/.ssh/id_*.pub
}
pkg_postinst() {
elog "Please follow the munin documentation to set up the plugins you"
elog "need, afterwards start munin-node via /etc/init.d/munin-node."
+ elog ""
+ elog "To make use of munin-async, make sure to set up the corresponding"
+ elog "SSH key in /var/lib/munin-async/.ssh/authorized_keys"
+ elog ""
if ! use minimal; then
- elog "To have munin's cronjob automatically configured for you if this is"
- elog "your munin master installation, please:"
- elog "emerge --config net-analyzer/munin"
+ elog "Please run"
+ elog " emerge --config net-analyzer/munin"
+ elog "to automatically configure munin's cronjobs as well as generate"
+ elog "passwordless SSH keys to be used with munin-async."
fi
elog ""
elog "Further information about setting up Munin in Gentoo can be found"
elog "in the Gentoo Wiki: https://wiki.gentoo.org/wiki/Munin"
+
+ if use cgi; then
+ chown $(usex apache apache munin) \
+ "${ROOT}"/var/cache/munin-cgi \
+ "${ROOT}"/var/log/munin-cgi-{graph,html}.log
+
+ if use apache; then
+ elog "To use Munin with CGI you should include /etc/apache2/vhosts.d/munin.include"
+ elog "or /etc/apache2/vhosts.d/munin-2.4.include (for Apache 2.4) from the virtual"
+ elog "host you want it to be served."
+ elog "If you want to enable CGI-based HTML as well, you have to add to"
+ elog "/etc/conf.d/apache2 the option -D MUNIN_HTML_CGI."
+ else
+ elog "Effective CGI support has just been added in 2.0.7-r6."
+ elog "Documentation on how to use it is still sparse."
+ fi
+ fi
}