]> Pileus Git - ~andy/sunrise/blob - www-misc/monitorix/monitorix-1.5.1.ebuild
dev-libs/libserial: Adding ~amd64 keyword
[~andy/sunrise] / www-misc / monitorix / monitorix-1.5.1.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="2"
6
7 inherit eutils webapp
8
9 DESCRIPTION="A lighweight system monitoring tool"
10 HOMEPAGE="http://www.monitorix.org/"
11 SRC_URI="http://www.monitorix.org/${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="evms hddtemp lm_sensors"
16
17 DEPEND="sys-apps/sed"
18 RDEPEND="net-analyzer/rrdtool[perl]
19         net-mail/metamail
20         dev-perl/libwww-perl
21         evms? ( sys-fs/evms )
22         hddtemp? ( app-admin/hddtemp )
23         lm_sensors? ( sys-apps/lm_sensors )
24         || ( sys-process/bcron
25                 sys-process/cronie
26                 sys-process/dcron
27                 sys-process/fcron
28                 sys-process/vixie-cron )"
29
30 need_httpd_cgi
31
32 src_prepare() {
33         sed -i -e "s|\(our \$OSTYPE = \"Linux-\)RHFC|\1Gentoo|" ${PN}.conf \
34                    || die "sed failed"
35 }
36
37 src_install() {
38         webapp_src_preinst
39
40         dosbin ${PN}.pl || die "dosbin failed"
41
42         newinitd ports/Linux-Gentoo/${PN}.init ${PN} || die "newinitd failed"
43
44         insinto /etc
45         doins ${PN}.conf || die "doins failed"
46
47         dodoc Changes ${PN}-apache.conf README{,.nginx} TODO \
48                 ${PN}-alert.sh || die "dodoc failed"
49         doman man/man5/${PN}.conf.5 || die "doman failed"
50
51         insinto "${MY_HTDOCSDIR}"
52         doins logo_bot.png logo_top.png monitorixico.png || die "doins failed"
53         dodir "${MY_HTDOCSDIR}/imgs" || die "dodir failed"
54         webapp_serverowned "${MY_HTDOCSDIR}/imgs"
55
56         exeinto ${MY_CGIBINDIR}
57         doexe ${PN}.cgi || die "doexe failed"
58
59         dodir /var/lib/${PN}/usage || die "dodir failed"
60         insinto /var/lib/${PN}/reports
61         doins -r reports/* || die "doins failed"
62         webapp_src_install
63 }
64
65 pkg_postinst() {
66         elog "Before starting the ${PN} init script make sure you edited the "
67         elog "config file. After that you can start ${PN} by running"
68         elog "\t/etc/init.d/${PN} start"
69         elog "If you want to start it automatically on boot run"
70         elog "\trc-update add ${PN} default"
71         elog
72         elog "This package is run via /etc/cron.d and therefore uses root "
73         elog "privileges to collect the informations. The graphs are created "
74         elog "at runtime directly to the imgs/ directory inside the dir you "
75         elog "installed the app to with webapp-config. These are created "
76         elog "with the privileges of the webserver user account."
77         elog
78         elog "If you want to use the alert function (introduced in ${PN}-1.4.0), you "
79         elog "need to enable it in the config and provide a path to a script "
80         elog "which should be run in an alert case. An example script is provided "
81         elog "with this package."
82         elog
83         elog "If you don't use sendmail be sure to set 'ENABLE_MAIL' to 'N' in the"
84         elog "config file."
85
86         webapp_pkg_postinst
87 }