# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="2" #3.0.0 removes the 'webapp' requirement. inherit eutils DESCRIPTION="A lighweight system monitoring tool" HOMEPAGE="http://www.monitorix.org/" SRC_URI="http://www.monitorix.org/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="amd64 x86" IUSE="evms hddtemp httpd lm_sensors postfix" RESTRICT="primaryuri" DEPEND="sys-apps/sed" RDEPEND="net-analyzer/rrdtool[perl] dev-perl/DBI dev-perl/libwww-perl dev-perl/XML-Simple dev-perl/config-general dev-perl/HTTP-Server-Simple evms? ( sys-fs/evms ) hddtemp? ( app-admin/hddtemp ) httpd? ( virtual/httpd-cgi ) lm_sensors? ( sys-apps/lm_sensors ) postfix? ( net-mail/pflogsumm )" src_install() { dosbin ${PN} || die "dosbin failed" newinitd "${FILESDIR}"/${PN}.init.d ${PN} || die "newinitd failed" sed -i "s|\(base_dir.*\)/usr/share/monitorix|\1/usr/share/monitorix/htdocs|" ${PN}.conf sed -i "s|\(secure_log.*\)/var/log/secure|\1/var/log/auth.log|" ${PN}.conf insinto /etc doins ${PN}.conf || die "newins failed" insinto /etc/logrotate.d newins docs/${PN}.logrotate ${PN} || die "newins failed" dodoc Changes COPYING README{,.nginx} docs/${PN}.service docs/${PN}-{alert.sh,apache.conf,lighttpd.conf} || die "dodoc failed" doman man/man5/${PN}.conf.5 || die "doman failed" doman man/man8/${PN}.8 || die "doman failed" dodir "/usr/share/monitorix" || die "dodir failed" dodir "/usr/share/monitorix/htdocs" || die "dodir failed" insinto "/usr/share/monitorix/htdocs" doins logo_bot.png logo_top.png monitorixico.png || die "doins failed" dodir "/usr/share/monitorix/htdocs/imgs" || die "dodir failed" dodir "/usr/share/monitorix/htdocs/cgi" || die "dodir failed" exeinto "/usr/share/monitorix/htdocs/cgi" doexe ${PN}.cgi || die "doexe failed" dodir /usr/lib/${PN} || die "dodir failed" exeinto /usr/lib/${PN} doexe lib/*.pm || die "doexe failed" dodir /var/lib/${PN} || die "dodir failed" dodir /var/lib/${PN}/usage || die "dodir failed" insinto /var/lib/${PN}/reports doins -r reports/* || die "doins failed" } pkg_postinst() { elog "WARNING: ${PN} version 3.0.0 includes a brand new config" elog "format, that may be incompatible with your existing config" elog "file. Please take care if upgrading from an old version." elog "" elog "${PN} includes its own web server as of version 3.0.0." elog "For this reason, the dependency on the webapp framework" elog "has been removed. If you wish to use your own web server," elog "the monitorix web data can be found at:" elog "/usr/share/monitorix/htdocs/" }