From 590b9b7b03bf4651e099949e318755af7cfa81b8 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 1 Aug 2021 22:03:23 +0100 Subject: gentoo resync : 01.08.2021 --- net-analyzer/munin/Manifest | 8 +- net-analyzer/munin/files/logrotate.d-munin.3 | 1 - net-analyzer/munin/munin-2.0.66-r1.ebuild | 417 -------------------------- net-analyzer/munin/munin-2.0.66-r3.ebuild | 418 +++++++++++++++++++++++++++ net-analyzer/munin/munin-2.0.67-r2.ebuild | 417 -------------------------- net-analyzer/munin/munin-2.0.67-r3.ebuild | 414 -------------------------- net-analyzer/munin/munin-2.0.67-r6.ebuild | 418 +++++++++++++++++++++++++++ net-analyzer/munin/munin-2.0.67-r7.ebuild | 415 ++++++++++++++++++++++++++ 8 files changed, 1255 insertions(+), 1253 deletions(-) delete mode 100644 net-analyzer/munin/munin-2.0.66-r1.ebuild create mode 100644 net-analyzer/munin/munin-2.0.66-r3.ebuild delete mode 100644 net-analyzer/munin/munin-2.0.67-r2.ebuild delete mode 100644 net-analyzer/munin/munin-2.0.67-r3.ebuild create mode 100644 net-analyzer/munin/munin-2.0.67-r6.ebuild create mode 100644 net-analyzer/munin/munin-2.0.67-r7.ebuild (limited to 'net-analyzer/munin') diff --git a/net-analyzer/munin/Manifest b/net-analyzer/munin/Manifest index 58af597705d1..7e558fd8dc45 100644 --- a/net-analyzer/munin/Manifest +++ b/net-analyzer/munin/Manifest @@ -1,4 +1,4 @@ -AUX logrotate.d-munin.3 692 BLAKE2B 914766875ea00212043c3d23fc4bd7f36b8974f956210319a8d5565c15e78eaae73a9c8d8dee3cb68f21f59d7d568ef07db3b4f708dd5ce4145a9e2f1170aa24 SHA512 c67a173f77f94725e9aafb47470b816cd013d5363ca59b2d0453ff5d032b0b3ca7e5f60e96d430c2aec69bd8979157da09bf7d34969bd6b55183fca7a0381b03 +AUX logrotate.d-munin.3 678 BLAKE2B 56c5e73e775c51898290707f324a305aa024ac732994b7e8ac2213a29740f481012d6433a6e72879524fbb3f958420919441265b0b5943b022267d47ca847640 SHA512 77853b9f0465da10e1844e25225350b7351126b19ee4caaad168b7b27003bca65bf34176293c610d5a4cb790a4a5d380fab482844ab23d6063208b2ce0fe1349 AUX munin-1.3.2-plugins.conf 1760 BLAKE2B 97d853698470c35dd4bc305a559be6b1160a6877e557f6146eeddaf7d91f72c7ade36e1f5571c5ad742560a2f5f400fc51b481ee7ce305db9546af6b211046ac SHA512 c3498c4364cedd27016562568f918995be92dd6b3c2735ddd008190de0a729f8ea59e61f8517f6f48beaad14edb349af7476a39f55d246ab06d6cbe91679565f AUX munin-async.service 201 BLAKE2B 2de35c4577d097525b75fb812042627702e846daf908b8deeaf9980c76b31135d5ea906b0932dfe3b4d589e3c635e37e8198cf2b6e9d60cdc305eb499815266f SHA512 55a99866cb9ff50723a223b8a45b418f13ed754b6ca919260af8312a323aad432aca047724a5e32f6aee2f8f541ae829bf6bfdf19d22e7543ef2e5a7b9cd9d6a AUX munin-asyncd.init.2 452 BLAKE2B 3f368195aa6896a726068b9db0ce0d1fc5750fee69a4ca5b60bfc2897486625cb83dab1ceec5cd6c1cf4d4aa0fc517eb0e41548004254abc8ad25657b0bfd422 SHA512 5d2ca928ea953e5fec8451dca218165f2c058c6d57519fea65e94148c0dff5ca0a06a2a22b09f416e375e825463d4d2a7c1a424c60051fdb4fa0d79af9463c26 @@ -15,7 +15,7 @@ DIST munin-2.0.66-gentoo-1.tar.xz 3980 BLAKE2B 5aae9c29befa761f797d362c90d810051 DIST munin-2.0.66.tar.gz 2257034 BLAKE2B b0c5412f32a54857acbe4baa5cf1447c7cf7053cad79ac09216ddc1aa8696ced813c3ad373517a8a48c5a08fae76154a0dda069efc036b7773e0557f078f8ff2 SHA512 928f727c558db6699524f3f3c2822404638e10e95678f4f211ec445ad6fbbdb7685a3d28343dbce616f60ced3cabff3b44e21a0a0e84b1d05032d295b81afab0 DIST munin-2.0.67-gentoo-1.tar.xz 3980 BLAKE2B 5aae9c29befa761f797d362c90d810051a7f3a5dc8250776ab6ae1659197d795dfb87274db66ff0a3deb4e10e14ced5b3765551a3f29357c436968a848f450ea SHA512 b21d6590bb9e1da127066a06818f1f3157362762f80526e2231b926956959e62af575f38235f72326376dc21bba63f9767efa379f1f2558ca9b20ddf5395e851 DIST munin-2.0.67.tar.gz 2258670 BLAKE2B 374b336403433d612b7998c77e6eb4f0eb68ffda4204ae6bc3c303f7667154c2ce606ffa27226c5644f3e6f71655c939b749da925136f59be4762891af49e2b1 SHA512 a8381491dfa15572438d9acda7a09feb0c3918ebe49e7bcfce5c172b36b4a5a0472bd6d06f5fad41270af0510b3fe115509d146f372df7fa47ed4aa1ec5f95d4 -EBUILD munin-2.0.66-r1.ebuild 12267 BLAKE2B 05ee840753229d97e2b1d5914191950bece83b6575cffa2a7ee50de4dfc3a16f892d8f660288315faccc570166e58fd391795a90fa3aa24531a5fd13752636e1 SHA512 b5ad10e6752dce09b925e05d42db944b5a8f25820b9fbfbfd0272b053539f2b70655ffaf745395f920f5d601ab65d1c0efeb27a3dc353f60b3d8c617f5949b2b -EBUILD munin-2.0.67-r2.ebuild 12270 BLAKE2B efd09dd6739e73d4fe3b76dea649cdbc6b89f7fb631e01032e64b61fc5a83d0cd74e74c8c991e50a85a30bf485d97b8462a8690244a3a6f07f8cd8aefc590d6a SHA512 0fdff012ebd0dcbba79ae4595210759f4fe1b88181cfea8f3321d78e6941a0752e366aeb7931628c6d33e81c6b217b8e3dbd3e882dde76c868aba94a6365294d -EBUILD munin-2.0.67-r3.ebuild 12179 BLAKE2B 9c9bd8113ccb2378a46b426e03717a9d331e337053742e09a113890b86551686c555240a83fe9ff65ffd1db99d6ac0444e2f802cd2bb35e4d9e8b4ecbc417906 SHA512 04fdf2ced3ed7f85de597e6590f8bb08400e98898c9acb669cd811de8195bd8d30446739432cd3702ed5d493e21f6785d911e09221d790fa081b6509660b0131 +EBUILD munin-2.0.66-r3.ebuild 12294 BLAKE2B 38acab7fb05b587bde64f914c8b0260297bbda56101fbca4dde767b4f7c5c7a9218d7aa5201294c1ab993215fbd0d67241099fcc2b3210f1f2a296dc3724ee7b SHA512 95a026d0ad372c7e77fa05c236af93e4d6563a586dda018929fdee212023d24f137fcbb33ef46344905e4d3b6cee5a2cc19931bea259576794f6371434905aa0 +EBUILD munin-2.0.67-r6.ebuild 12297 BLAKE2B d06b44129fdf229231a8b528f87f5868d2a1a456c5c36d657d03e691aa0dc84dc42f7a776f64575e5c0c38d167d6c241b51b1ec361e534dff916fa534ac87f9e SHA512 d3db57073670e6f151d9052b4dc9a193a22c5e42468f8be99b4f1c3da379c880c631097e254ccbb32db810d7225aadc3c642cf1700eb3d3b3029a63d7867975e +EBUILD munin-2.0.67-r7.ebuild 12206 BLAKE2B c5acf7bba358087ff1063db553b6583954339f610caf272cb4f5378c6be138ecc94b6cb6150c0ed600e86a5d898749b7a1b64d4f05ecc351c62bf6b3c90cf52b SHA512 156281bb0393c3316bb5a6cefd2354635caab1b028aa51e2569dda9ec475271a26bc22941b8ea396812535383dbad3965c3a49805d326a303ed3cd2d71fca8cd MISC metadata.xml 3932 BLAKE2B 3f5a88c85ae9be35c1ef8c9b4f6ac99d8ced0974e3306c691a4c5fed87139c8514732fb0418d4f34e6be26786252df5d3876aaf2a895fb03dea08787488ccb04 SHA512 c066c14c28804c4f5f11b15046f4fe43e7b34f0befc98fb03d4cd3e222664806e03509196054076433596dfb3bc2b1369f69047bf15a6c5c4981d354280033ef diff --git a/net-analyzer/munin/files/logrotate.d-munin.3 b/net-analyzer/munin/files/logrotate.d-munin.3 index 2d3b6829762b..5133c47e8ba1 100644 --- a/net-analyzer/munin/files/logrotate.d-munin.3 +++ b/net-analyzer/munin/files/logrotate.d-munin.3 @@ -4,7 +4,6 @@ rotate 7 compress delaycompress - copytruncate notifempty create 640 root root postrotate diff --git a/net-analyzer/munin/munin-2.0.66-r1.ebuild b/net-analyzer/munin/munin-2.0.66-r1.ebuild deleted file mode 100644 index 7a5621b5deb7..000000000000 --- a/net-analyzer/munin/munin-2.0.66-r1.ebuild +++ /dev/null @@ -1,417 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PATCHSET=1 - -inherit java-pkg-opt-2 systemd - -MY_P=${P/_/-} - -DESCRIPTION="Munin Server Monitoring Tool" -HOMEPAGE="http://munin-monitoring.org/" -SRC_URI=" - https://github.com/munin-monitoring/munin/archive/${PV}.tar.gz -> ${P}.tar.gz - https://dev.gentoo.org/~graaff/munin/${P}-gentoo-${PATCHSET}.tar.xz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 ~arm ~arm64 ppc ~ppc64 x86" -IUSE="asterisk irc java ldap memcached minimal mysql postgres selinux ssl test cgi ipv6 syslog ipmi http dhcpd doc apache2" -REQUIRED_USE="cgi? ( !minimal ) apache2? ( cgi )" -RESTRICT="!test? ( 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. -# We replace the original ipmi plugins with the freeipmi_ plugin which at least works. -DEPEND_COM=" - acct-user/munin - acct-user/munin-async - acct-group/munin - dev-lang/perl:=[berkdb] - dev-perl/DBI - dev-perl/Date-Manip - dev-perl/File-Copy-Recursive - dev-perl/List-MoreUtils - dev-perl/Log-Log4perl - dev-perl/Net-CIDR - dev-perl/Net-DNS - dev-perl/Net-Netmask - dev-perl/Net-SNMP - dev-perl/Net-Server[ipv6(-)?] - virtual/perl-Digest-MD5 - virtual/perl-Getopt-Long - virtual/perl-MIME-Base64 - virtual/perl-Storable - virtual/perl-Text-Balanced - virtual/perl-Time-HiRes - apache2? ( www-servers/apache[apache2_modules_cgi,apache2_modules_cgid,apache2_modules_rewrite] ) - asterisk? ( dev-perl/Net-Telnet ) - cgi? ( - dev-perl/FCGI - dev-perl/CGI-Fast - ) - dhcpd? ( - >=net-misc/dhcp-3[server] - dev-perl/Net-IP - dev-perl/HTTP-Date - ) - doc? ( dev-python/sphinx ) - http? ( dev-perl/libwww-perl ) - irc? ( dev-perl/Net-IRC ) - ldap? ( dev-perl/perl-ldap ) - kernel_linux? ( sys-process/procps ) - memcached? ( dev-perl/Cache-Memcached ) - mysql? ( - virtual/mysql - dev-perl/Cache-Cache - dev-perl/DBD-mysql - ) - postgres? ( dev-perl/DBD-Pg dev-db/postgresql:* ) - ssl? ( dev-perl/Net-SSLeay ) - syslog? ( virtual/perl-Sys-Syslog ) - !minimal? ( - dev-perl/HTML-Template - dev-perl/IO-Socket-INET6 - dev-perl/URI - >=net-analyzer/rrdtool-1.3[graph,perl] - virtual/ssh - ) - " - -# Keep this seperate, as previous versions have had other deps here -DEPEND="${DEPEND_COM} - dev-perl/Module-Build - java? ( >=virtual/jdk-1.5 ) - test? ( - dev-perl/Test-Deep - dev-perl/Test-Exception - 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/netcat net-analyzer/openbsd-netcat ) - ) - !minimal? ( - virtual/cron - media-fonts/dejavu - ) - selinux? ( sec-policy/selinux-munin )" - -S="${WORKDIR}/${MY_P}" - -pkg_setup() { - java-pkg-opt-2_pkg_setup -} - -src_prepare() { - echo ${PV} > RELEASE || die - - eapply "${WORKDIR}"/patches/*.patch - - eapply_user - - java-pkg-opt-2_src_prepare -} - -src_configure() { - local cgidir='$(DESTDIR)/usr/libexec/munin/cgi' - use cgi || cgidir="${T}/useless/cgi-bin" - - local cgiuser=$(usex apache2 apache munin) - - cat >> "${S}"/Makefile.config <<- EOF - PREFIX=\$(DESTDIR)/usr - CONFDIR=\$(DESTDIR)/etc/munin - DOCDIR=${T}/useless/doc - 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 - DBDIRNODE=\$(DESTDIR)/var/lib/munin-node - SPOOLDIR=\$(DESTDIR)/var/spool/munin-async - LOGDIR=\$(DESTDIR)/var/log/munin - PERLLIB=\$(DESTDIR)$(perl -V:vendorlib | cut -d"'" -f2) - JCVALID=$(usex java yes no) - STATEDIR=\$(DESTDIR)/run/munin - EOF -} - -# parallel make and install need to be fixed before, and I haven't -# gotten around to do so yet. -src_compile() { - emake -j1 - use doc && emake -C doc html -} - -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/lib/munin-node/plugin-state - /var/www/localhost/htdocs/munin - /etc/munin/plugin-conf.d - /etc/munin/plugins" - use minimal || dirs+=" /etc/munin/munin-conf.d/" - - keepdir ${dirs} - fowners munin:munin ${dirs} - - # 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 CHOWN=true DESTDIR="${D}" $(usex minimal "install-minimal install-man" install) - - # we remove /run from the install, as it's not the package's to deal - # with. - rm -rf "${D}"/run || die - - # remove the plugins for non-Gentoo package managers; use -f so that - # it doesn't fail when installing on non-Linux platforms. - rm -f "${D}"/usr/libexec/munin/plugins/{apt{,_all},yum} || die - - insinto /etc/munin/plugin-conf.d/ - newins "${FILESDIR}"/${PN}-1.3.2-plugins.conf munin-node - - newinitd "${FILESDIR}"/munin-node_init.d_2.0.19 munin-node - newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node - - newinitd "${FILESDIR}"/munin-asyncd.init.2 munin-asyncd - - dodir /usr/lib/tmpfiles.d - cat > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<- EOF - d /run/munin 0700 munin munin - - - EOF - - systemd_dounit "${FILESDIR}"/munin-async.service - systemd_dounit "${FILESDIR}"/munin-graph.{service,socket} - systemd_dounit "${FILESDIR}"/munin-html.{service,socket} - systemd_dounit "${FILESDIR}"/munin-node.service - - cat >> "${T}"/munin.env <<- EOF - CONFIG_PROTECT=/var/spool/munin-async/.ssh - EOF - newenvd "${T}"/munin.env 50munin - - dodoc README ChangeLog INSTALL - if use doc; then - cd "${S}"/doc/_build/html || die - docinto html - dodoc -r * - cd "${S}" || die - fi - - dodir /etc/logrotate.d/ - sed -e "s:@CGIUSER@:$(usex apache2 apache munin):g" \ - "${FILESDIR}"/logrotate.d-munin.3 > "${D}"/etc/logrotate.d/munin - - dosym ipmi_ /usr/libexec/munin/plugins/ipmi_sensor_ - - if use syslog; then - sed -i -e '/log_file/s| .*| Sys::Syslog|' \ - "${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:/run/munin/munin-node.pid:/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... - rm "${D}"/usr/libexec/munin/plugins/munin_stats - else - # remove font files so that we don't have to keep them around - rm "${D}"/usr/libexec/${PN}/*.ttf || die - - 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 apache2 apache munin) \ - /var/cache/munin-cgi \ - /var/log/munin/munin-cgi-{graph,html}.log - - if use apache2; 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 \ - -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' \ - -i "${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 - SHELL=/bin/bash - # Mail reports to root@, not munin@ - MAILTO=root - - # This runs the munin task every 5 minutes. - */5 * * * * /usr/bin/munin-cron - - # Alternatively, this route works differently - # Update once a minute (for busy sites) - #*/1 * * * * /usr/libexec/munin/munin-update - ## Check for limit excess every 2 minutes - #*/2 * * * * /usr/libexec/munin/munin-limits - ## Update graphs every 5 minutes - #*/5 * * * * nice /usr/libexec/munin/munin-graph - ## Update HTML pages every 15 minutes - #*/15 * * * * nice /usr/libexec/munin/munin-html - EOF - - cat >> "${D}"/usr/share/${PN}/fcrontab <<- EOF - # Mail reports to root@, not munin@, only execute one at a time - !mailto(root),serial(true) - - # This runs the munin task every 5 minutes. - @ 5 /usr/bin/munin-cron - - # Alternatively, this route works differently - # Update once a minute (for busy sites) - #@ 1 /usr/libexec/munin/munin-update - ## Check for limit excess every 2 minutes - #@ 2 /usr/libexec/munin/munin-limits - ## Update graphs every 5 minutes - #@ 5 nice /usr/libexec/munin/munin-graph - ## Update HTML pages every 15 minutes - #@ 15 nice /usr/libexec/munin/munin-html - EOF - - # remove .htaccess file - find "${D}" -name .htaccess -delete || die - fi -} - -pkg_config() { - if use minimal; then - einfo "Nothing to do." - return 0 - fi - - einfo "Press enter to install the default crontab for the munin master" - einfo "installation from /usr/share/${PN}/f?crontab" - 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 - # dcron is very fussy about syntax - # 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." - 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 "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 apache2 apache munin) \ - "${ROOT}"/var/cache/munin-cgi \ - "${ROOT}"/var/log/munin/munin-cgi-{graph,html}.log - - if use apache2; 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 - - # we create this here as we don't want Portage to check /run - # symlinks but we still need this to be present before the reboot. - if ! use minimal && ! [[ -d "${ROOT}"/run/munin ]]; then - mkdir "${ROOT}"/run/munin - chown munin:munin "${ROOT}"/run/munin - chmod 0700 "${ROOT}"/run/munin - fi -} diff --git a/net-analyzer/munin/munin-2.0.66-r3.ebuild b/net-analyzer/munin/munin-2.0.66-r3.ebuild new file mode 100644 index 000000000000..4d6837047b53 --- /dev/null +++ b/net-analyzer/munin/munin-2.0.66-r3.ebuild @@ -0,0 +1,418 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PATCHSET=1 + +inherit java-pkg-opt-2 systemd tmpfiles + +MY_P=${P/_/-} + +DESCRIPTION="Munin Server Monitoring Tool" +HOMEPAGE="http://munin-monitoring.org/" +SRC_URI=" + https://github.com/munin-monitoring/munin/archive/${PV}.tar.gz -> ${P}.tar.gz + https://dev.gentoo.org/~graaff/munin/${P}-gentoo-${PATCHSET}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ~arm ~arm64 ppc ~ppc64 x86" +IUSE="asterisk irc java ldap memcached minimal mysql postgres selinux ssl test cgi ipv6 syslog ipmi http dhcpd doc apache2" +REQUIRED_USE="cgi? ( !minimal ) apache2? ( cgi )" +RESTRICT="!test? ( 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. +# We replace the original ipmi plugins with the freeipmi_ plugin which at least works. +DEPEND_COM=" + acct-user/munin + acct-user/munin-async + acct-group/munin + dev-lang/perl:=[berkdb] + dev-perl/DBI + dev-perl/Date-Manip + dev-perl/File-Copy-Recursive + dev-perl/List-MoreUtils + dev-perl/Log-Log4perl + dev-perl/Net-CIDR + dev-perl/Net-DNS + dev-perl/Net-Netmask + dev-perl/Net-SNMP + dev-perl/Net-Server[ipv6(-)?] + virtual/perl-Digest-MD5 + virtual/perl-Getopt-Long + virtual/perl-MIME-Base64 + virtual/perl-Storable + virtual/perl-Text-Balanced + virtual/perl-Time-HiRes + apache2? ( www-servers/apache[apache2_modules_cgi,apache2_modules_cgid,apache2_modules_rewrite] ) + asterisk? ( dev-perl/Net-Telnet ) + cgi? ( + dev-perl/FCGI + dev-perl/CGI-Fast + ) + dhcpd? ( + >=net-misc/dhcp-3[server] + dev-perl/Net-IP + dev-perl/HTTP-Date + ) + doc? ( dev-python/sphinx ) + http? ( dev-perl/libwww-perl ) + irc? ( dev-perl/Net-IRC ) + ldap? ( dev-perl/perl-ldap ) + kernel_linux? ( sys-process/procps ) + memcached? ( dev-perl/Cache-Memcached ) + mysql? ( + virtual/mysql + dev-perl/Cache-Cache + dev-perl/DBD-mysql + ) + postgres? ( dev-perl/DBD-Pg dev-db/postgresql:* ) + ssl? ( dev-perl/Net-SSLeay ) + syslog? ( virtual/perl-Sys-Syslog ) + !minimal? ( + dev-perl/HTML-Template + dev-perl/IO-Socket-INET6 + dev-perl/URI + >=net-analyzer/rrdtool-1.3[graph,perl] + virtual/ssh + ) + " + +# Keep this seperate, as previous versions have had other deps here +DEPEND="${DEPEND_COM} + dev-perl/Module-Build + java? ( >=virtual/jdk-1.5 ) + test? ( + dev-perl/Test-Deep + dev-perl/Test-Exception + 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/netcat net-analyzer/openbsd-netcat ) + ) + !minimal? ( + virtual/cron + media-fonts/dejavu + ) + selinux? ( sec-policy/selinux-munin )" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + java-pkg-opt-2_pkg_setup +} + +src_prepare() { + echo ${PV} > RELEASE || die + + eapply "${WORKDIR}"/patches/*.patch + + eapply_user + + java-pkg-opt-2_src_prepare +} + +src_configure() { + local cgidir='$(DESTDIR)/usr/libexec/munin/cgi' + use cgi || cgidir="${T}/useless/cgi-bin" + + local cgiuser=$(usex apache2 apache munin) + + cat >> "${S}"/Makefile.config <<- EOF || die + PREFIX=\$(DESTDIR)/usr + CONFDIR=\$(DESTDIR)/etc/munin + DOCDIR=${T}/useless/doc + 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 + DBDIRNODE=\$(DESTDIR)/var/lib/munin-node + SPOOLDIR=\$(DESTDIR)/var/spool/munin-async + LOGDIR=\$(DESTDIR)/var/log/munin + PERLLIB=\$(DESTDIR)$(perl -V:vendorlib | cut -d"'" -f2) + JCVALID=$(usex java yes no) + STATEDIR=\$(DESTDIR)/run/munin + EOF +} + +# parallel make and install need to be fixed before, and I haven't +# gotten around to do so yet. +src_compile() { + emake -j1 + use doc && emake -C doc html +} + +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/lib/munin-node/plugin-state + /var/www/localhost/htdocs/munin + /etc/munin/plugin-conf.d + /etc/munin/plugins" + use minimal || dirs+=" /etc/munin/munin-conf.d/" + + keepdir ${dirs} + fowners munin:munin ${dirs} + + # 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 CHOWN=true DESTDIR="${D}" $(usex minimal "install-minimal install-man" install) + + # we remove /run from the install, as it's not the package's to deal + # with. + rm -rf "${D}"/run || die + + # remove the plugins for non-Gentoo package managers; use -f so that + # it doesn't fail when installing on non-Linux platforms. + rm -f "${D}"/usr/libexec/munin/plugins/{apt{,_all},yum} || die + + insinto /etc/munin/plugin-conf.d/ + newins "${FILESDIR}"/${PN}-1.3.2-plugins.conf munin-node + + newinitd "${FILESDIR}"/munin-node_init.d_2.0.19 munin-node + newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node + + newinitd "${FILESDIR}"/munin-asyncd.init.2 munin-asyncd + + newtmpfiles - ${CATEGORY}:${PN}:${SLOT}.conf <<-EOF || die + d /run/munin 0700 munin munin - - + EOF + + systemd_dounit "${FILESDIR}"/munin-async.service + systemd_dounit "${FILESDIR}"/munin-graph.{service,socket} + systemd_dounit "${FILESDIR}"/munin-html.{service,socket} + systemd_dounit "${FILESDIR}"/munin-node.service + + cat >> "${T}"/munin.env <<- EOF + CONFIG_PROTECT=/var/spool/munin-async/.ssh + EOF + newenvd "${T}"/munin.env 50munin + + dodoc README ChangeLog INSTALL + if use doc; then + cd "${S}"/doc/_build/html || die + docinto html + dodoc -r * + cd "${S}" || die + fi + + dodir /etc/logrotate.d/ + sed -e "s:@CGIUSER@:$(usex apache2 apache munin):g" \ + "${FILESDIR}"/logrotate.d-munin.3 > "${D}"/etc/logrotate.d/munin + + dosym ipmi_ /usr/libexec/munin/plugins/ipmi_sensor_ + + if use syslog; then + sed -i -e '/log_file/s| .*| Sys::Syslog|' \ + "${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:/run/munin/munin-node.pid:/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... + rm "${D}"/usr/libexec/munin/plugins/munin_stats + else + # remove font files so that we don't have to keep them around + rm "${D}"/usr/libexec/${PN}/*.ttf || die + + 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 apache2 apache munin) \ + /var/cache/munin-cgi \ + /var/log/munin/munin-cgi-{graph,html}.log + + if use apache2; 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 \ + -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' \ + -i "${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 + SHELL=/bin/bash + # Mail reports to root@, not munin@ + MAILTO=root + + # This runs the munin task every 5 minutes. + */5 * * * * /usr/bin/munin-cron + + # Alternatively, this route works differently + # Update once a minute (for busy sites) + #*/1 * * * * /usr/libexec/munin/munin-update + ## Check for limit excess every 2 minutes + #*/2 * * * * /usr/libexec/munin/munin-limits + ## Update graphs every 5 minutes + #*/5 * * * * nice /usr/libexec/munin/munin-graph + ## Update HTML pages every 15 minutes + #*/15 * * * * nice /usr/libexec/munin/munin-html + EOF + + cat >> "${D}"/usr/share/${PN}/fcrontab <<- EOF + # Mail reports to root@, not munin@, only execute one at a time + !mailto(root),serial(true) + + # This runs the munin task every 5 minutes. + @ 5 /usr/bin/munin-cron + + # Alternatively, this route works differently + # Update once a minute (for busy sites) + #@ 1 /usr/libexec/munin/munin-update + ## Check for limit excess every 2 minutes + #@ 2 /usr/libexec/munin/munin-limits + ## Update graphs every 5 minutes + #@ 5 nice /usr/libexec/munin/munin-graph + ## Update HTML pages every 15 minutes + #@ 15 nice /usr/libexec/munin/munin-html + EOF + + # remove .htaccess file + find "${D}" -name .htaccess -delete || die + fi +} + +pkg_config() { + if use minimal; then + einfo "Nothing to do." + return 0 + fi + + einfo "Press enter to install the default crontab for the munin master" + einfo "installation from /usr/share/${PN}/f?crontab" + 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 + # dcron is very fussy about syntax + # 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() { + tmpfiles_process ${CATEGORY}:${PN}:${SLOT}.conf + + elog "Please follow the munin documentation to set up the plugins you" + elog "need, afterwards start 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 "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 apache2 apache munin) \ + "${ROOT}"/var/cache/munin-cgi \ + "${ROOT}"/var/log/munin/munin-cgi-{graph,html}.log + + if use apache2; 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 + + # we create this here as we don't want Portage to check /run + # symlinks but we still need this to be present before the reboot. + if ! use minimal && ! [[ -d "${ROOT}"/run/munin ]]; then + mkdir "${ROOT}"/run/munin + chown munin:munin "${ROOT}"/run/munin + chmod 0700 "${ROOT}"/run/munin + fi +} diff --git a/net-analyzer/munin/munin-2.0.67-r2.ebuild b/net-analyzer/munin/munin-2.0.67-r2.ebuild deleted file mode 100644 index 9f666d4ad680..000000000000 --- a/net-analyzer/munin/munin-2.0.67-r2.ebuild +++ /dev/null @@ -1,417 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PATCHSET=1 - -inherit java-pkg-opt-2 systemd - -MY_P=${P/_/-} - -DESCRIPTION="Munin Server Monitoring Tool" -HOMEPAGE="http://munin-monitoring.org/" -SRC_URI=" - https://github.com/munin-monitoring/munin/archive/${PV}.tar.gz -> ${P}.tar.gz - https://dev.gentoo.org/~graaff/munin/${P}-gentoo-${PATCHSET}.tar.xz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 ~arm ~arm64 ppc ~ppc64 ~x86" -IUSE="asterisk irc java ldap memcached minimal mysql postgres selinux ssl test cgi ipv6 syslog ipmi http dhcpd doc apache2" -REQUIRED_USE="cgi? ( !minimal ) apache2? ( cgi )" -RESTRICT="!test? ( 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. -# We replace the original ipmi plugins with the freeipmi_ plugin which at least works. -DEPEND_COM=" - acct-user/munin - acct-user/munin-async - acct-group/munin - dev-lang/perl:=[berkdb] - dev-perl/DBI - dev-perl/Date-Manip - dev-perl/File-Copy-Recursive - dev-perl/List-MoreUtils - dev-perl/Log-Log4perl - dev-perl/Net-CIDR - dev-perl/Net-DNS - dev-perl/Net-Netmask - dev-perl/Net-SNMP - dev-perl/Net-Server[ipv6(-)?] - virtual/perl-Digest-MD5 - virtual/perl-Getopt-Long - virtual/perl-MIME-Base64 - virtual/perl-Storable - virtual/perl-Text-Balanced - virtual/perl-Time-HiRes - apache2? ( www-servers/apache[apache2_modules_cgi,apache2_modules_cgid,apache2_modules_rewrite] ) - asterisk? ( dev-perl/Net-Telnet ) - cgi? ( - dev-perl/FCGI - dev-perl/CGI-Fast - ) - dhcpd? ( - >=net-misc/dhcp-3[server] - dev-perl/Net-IP - dev-perl/HTTP-Date - ) - doc? ( dev-python/sphinx ) - http? ( dev-perl/libwww-perl ) - irc? ( dev-perl/Net-IRC ) - ldap? ( dev-perl/perl-ldap ) - kernel_linux? ( sys-process/procps ) - memcached? ( dev-perl/Cache-Memcached ) - mysql? ( - virtual/mysql - dev-perl/Cache-Cache - dev-perl/DBD-mysql - ) - postgres? ( dev-perl/DBD-Pg dev-db/postgresql:* ) - ssl? ( dev-perl/Net-SSLeay ) - syslog? ( virtual/perl-Sys-Syslog ) - !minimal? ( - dev-perl/HTML-Template - dev-perl/IO-Socket-INET6 - dev-perl/URI - >=net-analyzer/rrdtool-1.3[graph,perl] - virtual/ssh - ) - " - -# Keep this seperate, as previous versions have had other deps here -DEPEND="${DEPEND_COM} - dev-perl/Module-Build - java? ( >=virtual/jdk-1.8 ) - test? ( - dev-perl/Test-Deep - dev-perl/Test-Exception - 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.8:* - || ( net-analyzer/netcat net-analyzer/openbsd-netcat ) - ) - !minimal? ( - virtual/cron - media-fonts/dejavu - ) - selinux? ( sec-policy/selinux-munin )" - -S="${WORKDIR}/${MY_P}" - -pkg_setup() { - java-pkg-opt-2_pkg_setup -} - -src_prepare() { - echo ${PV} > RELEASE || die - - eapply "${WORKDIR}"/patches/*.patch - - eapply_user - - java-pkg-opt-2_src_prepare -} - -src_configure() { - local cgidir='$(DESTDIR)/usr/libexec/munin/cgi' - use cgi || cgidir="${T}/useless/cgi-bin" - - local cgiuser=$(usex apache2 apache munin) - - cat >> "${S}"/Makefile.config <<- EOF - PREFIX=\$(DESTDIR)/usr - CONFDIR=\$(DESTDIR)/etc/munin - DOCDIR=${T}/useless/doc - 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 - DBDIRNODE=\$(DESTDIR)/var/lib/munin-node - SPOOLDIR=\$(DESTDIR)/var/spool/munin-async - LOGDIR=\$(DESTDIR)/var/log/munin - PERLLIB=\$(DESTDIR)$(perl -V:vendorlib | cut -d"'" -f2) - JCVALID=$(usex java yes no) - STATEDIR=\$(DESTDIR)/run/munin - EOF -} - -# parallel make and install need to be fixed before, and I haven't -# gotten around to do so yet. -src_compile() { - emake -j1 - use doc && emake -C doc html -} - -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/lib/munin-node/plugin-state - /var/www/localhost/htdocs/munin - /etc/munin/plugin-conf.d - /etc/munin/plugins" - use minimal || dirs+=" /etc/munin/munin-conf.d/" - - keepdir ${dirs} - fowners munin:munin ${dirs} - - # 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 CHOWN=true DESTDIR="${D}" $(usex minimal "install-minimal install-man" install) - - # we remove /run from the install, as it's not the package's to deal - # with. - rm -rf "${D}"/run || die - - # remove the plugins for non-Gentoo package managers; use -f so that - # it doesn't fail when installing on non-Linux platforms. - rm -f "${D}"/usr/libexec/munin/plugins/{apt{,_all},yum} || die - - insinto /etc/munin/plugin-conf.d/ - newins "${FILESDIR}"/${PN}-1.3.2-plugins.conf munin-node - - newinitd "${FILESDIR}"/munin-node_init.d_2.0.19 munin-node - newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node - - newinitd "${FILESDIR}"/munin-asyncd.init.2 munin-asyncd - - dodir /usr/lib/tmpfiles.d - cat > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<- EOF - d /run/munin 0700 munin munin - - - EOF - - systemd_dounit "${FILESDIR}"/munin-async.service - systemd_dounit "${FILESDIR}"/munin-graph.{service,socket} - systemd_dounit "${FILESDIR}"/munin-html.{service,socket} - systemd_dounit "${FILESDIR}"/munin-node.service - - cat >> "${T}"/munin.env <<- EOF - CONFIG_PROTECT=/var/spool/munin-async/.ssh - EOF - newenvd "${T}"/munin.env 50munin - - dodoc README ChangeLog INSTALL - if use doc; then - cd "${S}"/doc/_build/html || die - docinto html - dodoc -r * - cd "${S}" || die - fi - - dodir /etc/logrotate.d/ - sed -e "s:@CGIUSER@:$(usex apache2 apache munin):g" \ - "${FILESDIR}"/logrotate.d-munin.3 > "${D}"/etc/logrotate.d/munin - - dosym ipmi_ /usr/libexec/munin/plugins/ipmi_sensor_ - - if use syslog; then - sed -i -e '/log_file/s| .*| Sys::Syslog|' \ - "${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:/run/munin/munin-node.pid:/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... - rm "${D}"/usr/libexec/munin/plugins/munin_stats - else - # remove font files so that we don't have to keep them around - rm "${D}"/usr/libexec/${PN}/*.ttf || die - - 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 apache2 apache munin) \ - /var/cache/munin-cgi \ - /var/log/munin/munin-cgi-{graph,html}.log - - if use apache2; 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 \ - -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' \ - -i "${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 - SHELL=/bin/bash - # Mail reports to root@, not munin@ - MAILTO=root - - # This runs the munin task every 5 minutes. - */5 * * * * /usr/bin/munin-cron - - # Alternatively, this route works differently - # Update once a minute (for busy sites) - #*/1 * * * * /usr/libexec/munin/munin-update - ## Check for limit excess every 2 minutes - #*/2 * * * * /usr/libexec/munin/munin-limits - ## Update graphs every 5 minutes - #*/5 * * * * nice /usr/libexec/munin/munin-graph - ## Update HTML pages every 15 minutes - #*/15 * * * * nice /usr/libexec/munin/munin-html - EOF - - cat >> "${D}"/usr/share/${PN}/fcrontab <<- EOF - # Mail reports to root@, not munin@, only execute one at a time - !mailto(root),serial(true) - - # This runs the munin task every 5 minutes. - @ 5 /usr/bin/munin-cron - - # Alternatively, this route works differently - # Update once a minute (for busy sites) - #@ 1 /usr/libexec/munin/munin-update - ## Check for limit excess every 2 minutes - #@ 2 /usr/libexec/munin/munin-limits - ## Update graphs every 5 minutes - #@ 5 nice /usr/libexec/munin/munin-graph - ## Update HTML pages every 15 minutes - #@ 15 nice /usr/libexec/munin/munin-html - EOF - - # remove .htaccess file - find "${D}" -name .htaccess -delete || die - fi -} - -pkg_config() { - if use minimal; then - einfo "Nothing to do." - return 0 - fi - - einfo "Press enter to install the default crontab for the munin master" - einfo "installation from /usr/share/${PN}/f?crontab" - 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 - # dcron is very fussy about syntax - # 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." - 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 "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 apache2 apache munin) \ - "${ROOT}"/var/cache/munin-cgi \ - "${ROOT}"/var/log/munin/munin-cgi-{graph,html}.log - - if use apache2; 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 - - # we create this here as we don't want Portage to check /run - # symlinks but we still need this to be present before the reboot. - if ! use minimal && ! [[ -d "${ROOT}"/run/munin ]]; then - mkdir "${ROOT}"/run/munin - chown munin:munin "${ROOT}"/run/munin - chmod 0700 "${ROOT}"/run/munin - fi -} diff --git a/net-analyzer/munin/munin-2.0.67-r3.ebuild b/net-analyzer/munin/munin-2.0.67-r3.ebuild deleted file mode 100644 index a0ed5615dc54..000000000000 --- a/net-analyzer/munin/munin-2.0.67-r3.ebuild +++ /dev/null @@ -1,414 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PATCHSET=1 - -inherit java-pkg-opt-2 systemd - -MY_P=${P/_/-} - -DESCRIPTION="Munin Server Monitoring Tool" -HOMEPAGE="https://munin-monitoring.org/" -SRC_URI=" - https://github.com/munin-monitoring/munin/archive/${PV}.tar.gz -> ${P}.tar.gz - https://dev.gentoo.org/~graaff/munin/${P}-gentoo-${PATCHSET}.tar.xz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" -IUSE="asterisk irc java ldap memcached minimal mysql postgres selinux ssl test cgi ipv6 syslog ipmi http dhcpd doc apache2" -REQUIRED_USE="cgi? ( !minimal ) apache2? ( cgi )" -RESTRICT="!test? ( 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. -# We replace the original ipmi plugins with the freeipmi_ plugin which at least works. -DEPEND_COM=" - acct-user/munin - acct-user/munin-async - acct-group/munin - dev-lang/perl:=[berkdb] - dev-perl/DBI - dev-perl/Date-Manip - dev-perl/File-Copy-Recursive - dev-perl/List-MoreUtils - dev-perl/Log-Log4perl - dev-perl/Net-CIDR - dev-perl/Net-DNS - dev-perl/Net-Netmask - dev-perl/Net-SNMP - dev-perl/Net-Server[ipv6(-)?] - virtual/perl-Digest-MD5 - virtual/perl-Getopt-Long - virtual/perl-MIME-Base64 - virtual/perl-Storable - virtual/perl-Text-Balanced - virtual/perl-Time-HiRes - apache2? ( www-servers/apache[apache2_modules_cgi,apache2_modules_cgid,apache2_modules_rewrite] ) - asterisk? ( dev-perl/Net-Telnet ) - cgi? ( - dev-perl/FCGI - dev-perl/CGI-Fast - ) - dhcpd? ( - >=net-misc/dhcp-3[server] - dev-perl/Net-IP - dev-perl/HTTP-Date - ) - doc? ( dev-python/sphinx ) - http? ( dev-perl/libwww-perl ) - irc? ( dev-perl/Net-IRC ) - ldap? ( dev-perl/perl-ldap ) - kernel_linux? ( sys-process/procps ) - memcached? ( dev-perl/Cache-Memcached ) - mysql? ( - virtual/mysql - dev-perl/Cache-Cache - dev-perl/DBD-mysql - ) - postgres? ( dev-perl/DBD-Pg dev-db/postgresql:* ) - ssl? ( dev-perl/Net-SSLeay ) - syslog? ( virtual/perl-Sys-Syslog ) - !minimal? ( - dev-perl/HTML-Template - dev-perl/IO-Socket-INET6 - dev-perl/URI - >=net-analyzer/rrdtool-1.3[graph,perl] - virtual/ssh - ) - " - -# Keep this seperate, as previous versions have had other deps here -DEPEND="${DEPEND_COM} - dev-perl/Module-Build - java? ( >=virtual/jdk-1.8 ) - test? ( - dev-perl/Test-Deep - dev-perl/Test-Exception - 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.8:* - || ( net-analyzer/netcat net-analyzer/openbsd-netcat ) - ) - !minimal? ( - virtual/cron - media-fonts/dejavu - ) - selinux? ( sec-policy/selinux-munin )" - -S="${WORKDIR}/${MY_P}" - -pkg_setup() { - java-pkg-opt-2_pkg_setup -} - -src_prepare() { - echo ${PV} > RELEASE || die - - eapply "${WORKDIR}"/patches/*.patch - - eapply_user - - java-pkg-opt-2_src_prepare -} - -src_configure() { - local cgidir='$(DESTDIR)/usr/libexec/munin/cgi' - use cgi || cgidir="${T}/useless/cgi-bin" - - local cgiuser=$(usex apache2 apache munin) - - cat >> "${S}"/Makefile.config <<- EOF - PREFIX=\$(DESTDIR)/usr - CONFDIR=\$(DESTDIR)/etc/munin - DOCDIR=${T}/useless/doc - 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 - DBDIRNODE=\$(DESTDIR)/var/lib/munin-node - SPOOLDIR=\$(DESTDIR)/var/spool/munin-async - LOGDIR=\$(DESTDIR)/var/log/munin - PERLLIB=\$(DESTDIR)$(perl -V:vendorlib | cut -d"'" -f2) - JCVALID=$(usex java yes no) - STATEDIR=\$(DESTDIR)/run/munin - EOF -} - -# parallel make and install need to be fixed before, and I haven't -# gotten around to do so yet. -src_compile() { - emake -j1 - use doc && emake -C doc html -} - -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/lib/munin-node/plugin-state - /var/www/localhost/htdocs/munin - /etc/munin/plugin-conf.d - /etc/munin/plugins" - use minimal || dirs+=" /etc/munin/munin-conf.d/" - - keepdir ${dirs} - fowners munin:munin ${dirs} - - # 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 CHOWN=true DESTDIR="${D}" $(usex minimal "install-minimal install-man" install) - - # we remove /run from the install, as it's not the package's to deal - # with. - rm -rf "${D}"/run || die - - # remove the plugins for non-Gentoo package managers; use -f so that - # it doesn't fail when installing on non-Linux platforms. - rm -f "${D}"/usr/libexec/munin/plugins/{apt{,_all},yum} || die - - insinto /etc/munin/plugin-conf.d/ - newins "${FILESDIR}"/${PN}-1.3.2-plugins.conf munin-node - - newinitd "${FILESDIR}"/munin-node_init.d_2.0.19 munin-node - newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node - - newinitd "${FILESDIR}"/munin-asyncd.init.2 munin-asyncd - - dodir /usr/lib/tmpfiles.d - cat > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<- EOF - d /run/munin 0700 munin munin - - - EOF - - systemd_dounit "${FILESDIR}"/munin-async.service - systemd_dounit "${FILESDIR}"/munin-graph.{service,socket} - systemd_dounit "${FILESDIR}"/munin-html.{service,socket} - systemd_dounit "${FILESDIR}"/munin-node.service - - cat >> "${T}"/munin.env <<- EOF - CONFIG_PROTECT=/var/spool/munin-async/.ssh - EOF - newenvd "${T}"/munin.env 50munin - - dodoc README ChangeLog INSTALL - if use doc; then - cd "${S}"/doc/_build/html || die - docinto html - dodoc -r * - cd "${S}" || die - fi - - dodir /etc/logrotate.d/ - sed -e "s:@CGIUSER@:$(usex apache2 apache munin):g" \ - "${FILESDIR}"/logrotate.d-munin.3 > "${D}"/etc/logrotate.d/munin - - dosym ipmi_ /usr/libexec/munin/plugins/ipmi_sensor_ - - if use syslog; then - sed -i -e '/log_file/s| .*| Sys::Syslog|' \ - "${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:/run/munin/munin-node.pid:/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... - rm "${D}"/usr/libexec/munin/plugins/munin_stats - else - # remove font files so that we don't have to keep them around - rm "${D}"/usr/libexec/${PN}/*.ttf || die - - if use cgi; then - sed -i -e '/#graph_strategy cgi/s:^#::' "${D}"/etc/munin/munin.conf || die - - touch "${D}"/var/log/munin/munin-cgi-{graph,html}.log - fowners $(usex apache2 apache munin) \ - /var/log/munin/munin-cgi-{graph,html}.log - - if use apache2; 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 \ - -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' \ - -i "${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 - SHELL=/bin/bash - # Mail reports to root@, not munin@ - MAILTO=root - - # This runs the munin task every 5 minutes. - */5 * * * * /usr/bin/munin-cron - - # Alternatively, this route works differently - # Update once a minute (for busy sites) - #*/1 * * * * /usr/libexec/munin/munin-update - ## Check for limit excess every 2 minutes - #*/2 * * * * /usr/libexec/munin/munin-limits - ## Update graphs every 5 minutes - #*/5 * * * * nice /usr/libexec/munin/munin-graph - ## Update HTML pages every 15 minutes - #*/15 * * * * nice /usr/libexec/munin/munin-html - EOF - - cat >> "${D}"/usr/share/${PN}/fcrontab <<- EOF - # Mail reports to root@, not munin@, only execute one at a time - !mailto(root),serial(true) - - # This runs the munin task every 5 minutes. - @ 5 /usr/bin/munin-cron - - # Alternatively, this route works differently - # Update once a minute (for busy sites) - #@ 1 /usr/libexec/munin/munin-update - ## Check for limit excess every 2 minutes - #@ 2 /usr/libexec/munin/munin-limits - ## Update graphs every 5 minutes - #@ 5 nice /usr/libexec/munin/munin-graph - ## Update HTML pages every 15 minutes - #@ 15 nice /usr/libexec/munin/munin-html - EOF - - # remove .htaccess file - find "${D}" -name .htaccess -delete || die - fi -} - -pkg_config() { - if use minimal; then - einfo "Nothing to do." - return 0 - fi - - einfo "Press enter to install the default crontab for the munin master" - einfo "installation from /usr/share/${PN}/f?crontab" - 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 - # dcron is very fussy about syntax - # 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." - 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 "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 apache2 apache munin) \ - "${ROOT}"/var/log/munin/munin-cgi-{graph,html}.log - - if use apache2; 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 - - # we create this here as we don't want Portage to check /run - # symlinks but we still need this to be present before the reboot. - if ! use minimal && ! [[ -d "${ROOT}"/run/munin ]]; then - mkdir "${ROOT}"/run/munin - chown munin:munin "${ROOT}"/run/munin - chmod 0700 "${ROOT}"/run/munin - fi -} diff --git a/net-analyzer/munin/munin-2.0.67-r6.ebuild b/net-analyzer/munin/munin-2.0.67-r6.ebuild new file mode 100644 index 000000000000..b4ad2481fd45 --- /dev/null +++ b/net-analyzer/munin/munin-2.0.67-r6.ebuild @@ -0,0 +1,418 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PATCHSET=1 + +inherit java-pkg-opt-2 systemd tmpfiles + +MY_P=${P/_/-} + +DESCRIPTION="Munin Server Monitoring Tool" +HOMEPAGE="http://munin-monitoring.org/" +SRC_URI=" + https://github.com/munin-monitoring/munin/archive/${PV}.tar.gz -> ${P}.tar.gz + https://dev.gentoo.org/~graaff/munin/${P}-gentoo-${PATCHSET}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ~arm ~arm64 ppc ~ppc64 ~x86" +IUSE="asterisk irc java ldap memcached minimal mysql postgres selinux ssl test cgi ipv6 syslog ipmi http dhcpd doc apache2" +REQUIRED_USE="cgi? ( !minimal ) apache2? ( cgi )" +RESTRICT="!test? ( 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. +# We replace the original ipmi plugins with the freeipmi_ plugin which at least works. +DEPEND_COM=" + acct-user/munin + acct-user/munin-async + acct-group/munin + dev-lang/perl:=[berkdb] + dev-perl/DBI + dev-perl/Date-Manip + dev-perl/File-Copy-Recursive + dev-perl/List-MoreUtils + dev-perl/Log-Log4perl + dev-perl/Net-CIDR + dev-perl/Net-DNS + dev-perl/Net-Netmask + dev-perl/Net-SNMP + dev-perl/Net-Server[ipv6(-)?] + virtual/perl-Digest-MD5 + virtual/perl-Getopt-Long + virtual/perl-MIME-Base64 + virtual/perl-Storable + virtual/perl-Text-Balanced + virtual/perl-Time-HiRes + apache2? ( www-servers/apache[apache2_modules_cgi,apache2_modules_cgid,apache2_modules_rewrite] ) + asterisk? ( dev-perl/Net-Telnet ) + cgi? ( + dev-perl/FCGI + dev-perl/CGI-Fast + ) + dhcpd? ( + >=net-misc/dhcp-3[server] + dev-perl/Net-IP + dev-perl/HTTP-Date + ) + doc? ( dev-python/sphinx ) + http? ( dev-perl/libwww-perl ) + irc? ( dev-perl/Net-IRC ) + ldap? ( dev-perl/perl-ldap ) + kernel_linux? ( sys-process/procps ) + memcached? ( dev-perl/Cache-Memcached ) + mysql? ( + virtual/mysql + dev-perl/Cache-Cache + dev-perl/DBD-mysql + ) + postgres? ( dev-perl/DBD-Pg dev-db/postgresql:* ) + ssl? ( dev-perl/Net-SSLeay ) + syslog? ( virtual/perl-Sys-Syslog ) + !minimal? ( + dev-perl/HTML-Template + dev-perl/IO-Socket-INET6 + dev-perl/URI + >=net-analyzer/rrdtool-1.3[graph,perl] + virtual/ssh + ) + " + +# Keep this seperate, as previous versions have had other deps here +DEPEND="${DEPEND_COM} + dev-perl/Module-Build + java? ( >=virtual/jdk-1.8 ) + test? ( + dev-perl/Test-Deep + dev-perl/Test-Exception + 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.8:* + || ( net-analyzer/netcat net-analyzer/openbsd-netcat ) + ) + !minimal? ( + virtual/cron + media-fonts/dejavu + ) + selinux? ( sec-policy/selinux-munin )" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + java-pkg-opt-2_pkg_setup +} + +src_prepare() { + echo ${PV} > RELEASE || die + + eapply "${WORKDIR}"/patches/*.patch + + eapply_user + + java-pkg-opt-2_src_prepare +} + +src_configure() { + local cgidir='$(DESTDIR)/usr/libexec/munin/cgi' + use cgi || cgidir="${T}/useless/cgi-bin" + + local cgiuser=$(usex apache2 apache munin) + + cat >> "${S}"/Makefile.config <<- EOF || die + PREFIX=\$(DESTDIR)/usr + CONFDIR=\$(DESTDIR)/etc/munin + DOCDIR=${T}/useless/doc + 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 + DBDIRNODE=\$(DESTDIR)/var/lib/munin-node + SPOOLDIR=\$(DESTDIR)/var/spool/munin-async + LOGDIR=\$(DESTDIR)/var/log/munin + PERLLIB=\$(DESTDIR)$(perl -V:vendorlib | cut -d"'" -f2) + JCVALID=$(usex java yes no) + STATEDIR=\$(DESTDIR)/run/munin + EOF +} + +# parallel make and install need to be fixed before, and I haven't +# gotten around to do so yet. +src_compile() { + emake -j1 + use doc && emake -C doc html +} + +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/lib/munin-node/plugin-state + /var/www/localhost/htdocs/munin + /etc/munin/plugin-conf.d + /etc/munin/plugins" + use minimal || dirs+=" /etc/munin/munin-conf.d/" + + keepdir ${dirs} + fowners munin:munin ${dirs} + + # 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 CHOWN=true DESTDIR="${D}" $(usex minimal "install-minimal install-man" install) + + # we remove /run from the install, as it's not the package's to deal + # with. + rm -rf "${D}"/run || die + + # remove the plugins for non-Gentoo package managers; use -f so that + # it doesn't fail when installing on non-Linux platforms. + rm -f "${D}"/usr/libexec/munin/plugins/{apt{,_all},yum} || die + + insinto /etc/munin/plugin-conf.d/ + newins "${FILESDIR}"/${PN}-1.3.2-plugins.conf munin-node + + newinitd "${FILESDIR}"/munin-node_init.d_2.0.19 munin-node + newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node + + newinitd "${FILESDIR}"/munin-asyncd.init.2 munin-asyncd + + newtmpfiles - ${CATEGORY}:${PN}:${SLOT}.conf <<-EOF || die + d /run/munin 0700 munin munin - - + EOF + + systemd_dounit "${FILESDIR}"/munin-async.service + systemd_dounit "${FILESDIR}"/munin-graph.{service,socket} + systemd_dounit "${FILESDIR}"/munin-html.{service,socket} + systemd_dounit "${FILESDIR}"/munin-node.service + + cat >> "${T}"/munin.env <<- EOF + CONFIG_PROTECT=/var/spool/munin-async/.ssh + EOF + newenvd "${T}"/munin.env 50munin + + dodoc README ChangeLog INSTALL + if use doc; then + cd "${S}"/doc/_build/html || die + docinto html + dodoc -r * + cd "${S}" || die + fi + + dodir /etc/logrotate.d/ + sed -e "s:@CGIUSER@:$(usex apache2 apache munin):g" \ + "${FILESDIR}"/logrotate.d-munin.3 > "${D}"/etc/logrotate.d/munin + + dosym ipmi_ /usr/libexec/munin/plugins/ipmi_sensor_ + + if use syslog; then + sed -i -e '/log_file/s| .*| Sys::Syslog|' \ + "${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:/run/munin/munin-node.pid:/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... + rm "${D}"/usr/libexec/munin/plugins/munin_stats + else + # remove font files so that we don't have to keep them around + rm "${D}"/usr/libexec/${PN}/*.ttf || die + + 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 apache2 apache munin) \ + /var/cache/munin-cgi \ + /var/log/munin/munin-cgi-{graph,html}.log + + if use apache2; 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 \ + -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' \ + -i "${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 + SHELL=/bin/bash + # Mail reports to root@, not munin@ + MAILTO=root + + # This runs the munin task every 5 minutes. + */5 * * * * /usr/bin/munin-cron + + # Alternatively, this route works differently + # Update once a minute (for busy sites) + #*/1 * * * * /usr/libexec/munin/munin-update + ## Check for limit excess every 2 minutes + #*/2 * * * * /usr/libexec/munin/munin-limits + ## Update graphs every 5 minutes + #*/5 * * * * nice /usr/libexec/munin/munin-graph + ## Update HTML pages every 15 minutes + #*/15 * * * * nice /usr/libexec/munin/munin-html + EOF + + cat >> "${D}"/usr/share/${PN}/fcrontab <<- EOF + # Mail reports to root@, not munin@, only execute one at a time + !mailto(root),serial(true) + + # This runs the munin task every 5 minutes. + @ 5 /usr/bin/munin-cron + + # Alternatively, this route works differently + # Update once a minute (for busy sites) + #@ 1 /usr/libexec/munin/munin-update + ## Check for limit excess every 2 minutes + #@ 2 /usr/libexec/munin/munin-limits + ## Update graphs every 5 minutes + #@ 5 nice /usr/libexec/munin/munin-graph + ## Update HTML pages every 15 minutes + #@ 15 nice /usr/libexec/munin/munin-html + EOF + + # remove .htaccess file + find "${D}" -name .htaccess -delete || die + fi +} + +pkg_config() { + if use minimal; then + einfo "Nothing to do." + return 0 + fi + + einfo "Press enter to install the default crontab for the munin master" + einfo "installation from /usr/share/${PN}/f?crontab" + 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 + # dcron is very fussy about syntax + # 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() { + tmpfiles_process ${CATEGORY}:${PN}:${SLOT}.conf + + elog "Please follow the munin documentation to set up the plugins you" + elog "need, afterwards start 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 "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 apache2 apache munin) \ + "${ROOT}"/var/cache/munin-cgi \ + "${ROOT}"/var/log/munin/munin-cgi-{graph,html}.log + + if use apache2; 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 + + # we create this here as we don't want Portage to check /run + # symlinks but we still need this to be present before the reboot. + if ! use minimal && ! [[ -d "${ROOT}"/run/munin ]]; then + mkdir "${ROOT}"/run/munin + chown munin:munin "${ROOT}"/run/munin + chmod 0700 "${ROOT}"/run/munin + fi +} diff --git a/net-analyzer/munin/munin-2.0.67-r7.ebuild b/net-analyzer/munin/munin-2.0.67-r7.ebuild new file mode 100644 index 000000000000..00a940ba1b5f --- /dev/null +++ b/net-analyzer/munin/munin-2.0.67-r7.ebuild @@ -0,0 +1,415 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PATCHSET=1 + +inherit java-pkg-opt-2 systemd tmpfiles + +MY_P=${P/_/-} + +DESCRIPTION="Munin Server Monitoring Tool" +HOMEPAGE="https://munin-monitoring.org/" +SRC_URI=" + https://github.com/munin-monitoring/munin/archive/${PV}.tar.gz -> ${P}.tar.gz + https://dev.gentoo.org/~graaff/munin/${P}-gentoo-${PATCHSET}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" +IUSE="asterisk irc java ldap memcached minimal mysql postgres selinux ssl test cgi ipv6 syslog ipmi http dhcpd doc apache2" +REQUIRED_USE="cgi? ( !minimal ) apache2? ( cgi )" +RESTRICT="!test? ( 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. +# We replace the original ipmi plugins with the freeipmi_ plugin which at least works. +DEPEND_COM=" + acct-user/munin + acct-user/munin-async + acct-group/munin + dev-lang/perl:=[berkdb] + dev-perl/DBI + dev-perl/Date-Manip + dev-perl/File-Copy-Recursive + dev-perl/List-MoreUtils + dev-perl/Log-Log4perl + dev-perl/Net-CIDR + dev-perl/Net-DNS + dev-perl/Net-Netmask + dev-perl/Net-SNMP + dev-perl/Net-Server[ipv6(-)?] + virtual/perl-Digest-MD5 + virtual/perl-Getopt-Long + virtual/perl-MIME-Base64 + virtual/perl-Storable + virtual/perl-Text-Balanced + virtual/perl-Time-HiRes + apache2? ( www-servers/apache[apache2_modules_cgi,apache2_modules_cgid,apache2_modules_rewrite] ) + asterisk? ( dev-perl/Net-Telnet ) + cgi? ( + dev-perl/FCGI + dev-perl/CGI-Fast + ) + dhcpd? ( + >=net-misc/dhcp-3[server] + dev-perl/Net-IP + dev-perl/HTTP-Date + ) + doc? ( dev-python/sphinx ) + http? ( dev-perl/libwww-perl ) + irc? ( dev-perl/Net-IRC ) + ldap? ( dev-perl/perl-ldap ) + kernel_linux? ( sys-process/procps ) + memcached? ( dev-perl/Cache-Memcached ) + mysql? ( + virtual/mysql + dev-perl/Cache-Cache + dev-perl/DBD-mysql + ) + postgres? ( dev-perl/DBD-Pg dev-db/postgresql:* ) + ssl? ( dev-perl/Net-SSLeay ) + syslog? ( virtual/perl-Sys-Syslog ) + !minimal? ( + dev-perl/HTML-Template + dev-perl/IO-Socket-INET6 + dev-perl/URI + >=net-analyzer/rrdtool-1.3[graph,perl] + virtual/ssh + ) + " + +# Keep this seperate, as previous versions have had other deps here +DEPEND="${DEPEND_COM} + dev-perl/Module-Build + java? ( >=virtual/jdk-1.8 ) + test? ( + dev-perl/Test-Deep + dev-perl/Test-Exception + 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.8:* + || ( net-analyzer/netcat net-analyzer/openbsd-netcat ) + ) + !minimal? ( + virtual/cron + media-fonts/dejavu + ) + selinux? ( sec-policy/selinux-munin )" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + java-pkg-opt-2_pkg_setup +} + +src_prepare() { + echo ${PV} > RELEASE || die + + eapply "${WORKDIR}"/patches/*.patch + + eapply_user + + java-pkg-opt-2_src_prepare +} + +src_configure() { + local cgidir='$(DESTDIR)/usr/libexec/munin/cgi' + use cgi || cgidir="${T}/useless/cgi-bin" + + local cgiuser=$(usex apache2 apache munin) + + cat >> "${S}"/Makefile.config <<- EOF || die + PREFIX=\$(DESTDIR)/usr + CONFDIR=\$(DESTDIR)/etc/munin + DOCDIR=${T}/useless/doc + 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 + DBDIRNODE=\$(DESTDIR)/var/lib/munin-node + SPOOLDIR=\$(DESTDIR)/var/spool/munin-async + LOGDIR=\$(DESTDIR)/var/log/munin + PERLLIB=\$(DESTDIR)$(perl -V:vendorlib | cut -d"'" -f2) + JCVALID=$(usex java yes no) + STATEDIR=\$(DESTDIR)/run/munin + EOF +} + +# parallel make and install need to be fixed before, and I haven't +# gotten around to do so yet. +src_compile() { + emake -j1 + use doc && emake -C doc html +} + +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/lib/munin-node/plugin-state + /var/www/localhost/htdocs/munin + /etc/munin/plugin-conf.d + /etc/munin/plugins" + use minimal || dirs+=" /etc/munin/munin-conf.d/" + + keepdir ${dirs} + fowners munin:munin ${dirs} + + # 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 CHOWN=true DESTDIR="${D}" $(usex minimal "install-minimal install-man" install) + + # we remove /run from the install, as it's not the package's to deal + # with. + rm -rf "${D}"/run || die + + # remove the plugins for non-Gentoo package managers; use -f so that + # it doesn't fail when installing on non-Linux platforms. + rm -f "${D}"/usr/libexec/munin/plugins/{apt{,_all},yum} || die + + insinto /etc/munin/plugin-conf.d/ + newins "${FILESDIR}"/${PN}-1.3.2-plugins.conf munin-node + + newinitd "${FILESDIR}"/munin-node_init.d_2.0.19 munin-node + newconfd "${FILESDIR}"/munin-node_conf.d_1.4.6-r2 munin-node + + newinitd "${FILESDIR}"/munin-asyncd.init.2 munin-asyncd + + newtmpfiles - ${CATEGORY}:${PN}:${SLOT}.conf <<-EOF || die + d /run/munin 0700 munin munin - - + EOF + + systemd_dounit "${FILESDIR}"/munin-async.service + systemd_dounit "${FILESDIR}"/munin-graph.{service,socket} + systemd_dounit "${FILESDIR}"/munin-html.{service,socket} + systemd_dounit "${FILESDIR}"/munin-node.service + + cat >> "${T}"/munin.env <<- EOF + CONFIG_PROTECT=/var/spool/munin-async/.ssh + EOF + newenvd "${T}"/munin.env 50munin + + dodoc README ChangeLog INSTALL + if use doc; then + cd "${S}"/doc/_build/html || die + docinto html + dodoc -r * + cd "${S}" || die + fi + + dodir /etc/logrotate.d/ + sed -e "s:@CGIUSER@:$(usex apache2 apache munin):g" \ + "${FILESDIR}"/logrotate.d-munin.3 > "${D}"/etc/logrotate.d/munin + + dosym ipmi_ /usr/libexec/munin/plugins/ipmi_sensor_ + + if use syslog; then + sed -i -e '/log_file/s| .*| Sys::Syslog|' \ + "${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:/run/munin/munin-node.pid:/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... + rm "${D}"/usr/libexec/munin/plugins/munin_stats + else + # remove font files so that we don't have to keep them around + rm "${D}"/usr/libexec/${PN}/*.ttf || die + + if use cgi; then + sed -i -e '/#graph_strategy cgi/s:^#::' "${D}"/etc/munin/munin.conf || die + + touch "${D}"/var/log/munin/munin-cgi-{graph,html}.log + fowners $(usex apache2 apache munin) \ + /var/log/munin/munin-cgi-{graph,html}.log + + if use apache2; 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 \ + -e '/#graph_strategy cgi/s:#graph_strategy cgi:graph_strategy cron:' \ + -i "${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 + SHELL=/bin/bash + # Mail reports to root@, not munin@ + MAILTO=root + + # This runs the munin task every 5 minutes. + */5 * * * * /usr/bin/munin-cron + + # Alternatively, this route works differently + # Update once a minute (for busy sites) + #*/1 * * * * /usr/libexec/munin/munin-update + ## Check for limit excess every 2 minutes + #*/2 * * * * /usr/libexec/munin/munin-limits + ## Update graphs every 5 minutes + #*/5 * * * * nice /usr/libexec/munin/munin-graph + ## Update HTML pages every 15 minutes + #*/15 * * * * nice /usr/libexec/munin/munin-html + EOF + + cat >> "${D}"/usr/share/${PN}/fcrontab <<- EOF + # Mail reports to root@, not munin@, only execute one at a time + !mailto(root),serial(true) + + # This runs the munin task every 5 minutes. + @ 5 /usr/bin/munin-cron + + # Alternatively, this route works differently + # Update once a minute (for busy sites) + #@ 1 /usr/libexec/munin/munin-update + ## Check for limit excess every 2 minutes + #@ 2 /usr/libexec/munin/munin-limits + ## Update graphs every 5 minutes + #@ 5 nice /usr/libexec/munin/munin-graph + ## Update HTML pages every 15 minutes + #@ 15 nice /usr/libexec/munin/munin-html + EOF + + # remove .htaccess file + find "${D}" -name .htaccess -delete || die + fi +} + +pkg_config() { + if use minimal; then + einfo "Nothing to do." + return 0 + fi + + einfo "Press enter to install the default crontab for the munin master" + einfo "installation from /usr/share/${PN}/f?crontab" + 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 + # dcron is very fussy about syntax + # 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() { + tmpfiles_process ${CATEGORY}:${PN}:${SLOT}.conf + + elog "Please follow the munin documentation to set up the plugins you" + elog "need, afterwards start 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 "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 apache2 apache munin) \ + "${ROOT}"/var/log/munin/munin-cgi-{graph,html}.log + + if use apache2; 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 + + # we create this here as we don't want Portage to check /run + # symlinks but we still need this to be present before the reboot. + if ! use minimal && ! [[ -d "${ROOT}"/run/munin ]]; then + mkdir "${ROOT}"/run/munin + chown munin:munin "${ROOT}"/run/munin + chmod 0700 "${ROOT}"/run/munin + fi +} -- cgit v1.2.3