]> Pileus Git - ~andy/sunrise/blob - net-analyzer/symon/symon-2.78.ebuild
7d7c5d05e5ac84f63e30ff08c4aa1c59a43f7e3f
[~andy/sunrise] / net-analyzer / symon / symon-2.78.ebuild
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit depend.php eutils webapp
6
7 DESCRIPTION="A system monitor that can be used to obtain accurate and up to date information on the performance of a number of systems"
8 HOMEPAGE="http://www.xs4all.nl/~wpd/symon/"
9 SRC_URI="http://www.xs4all.nl/~wpd/symon/philes/${P}.tar.gz
10         syweb? ( http://www.xs4all.nl/~wpd/symon/philes/syweb-0.57.tar.gz )"
11
12 LICENSE="BSD-2"
13 SLOT="0"
14 KEYWORDS="~amd64 ~sparc ~x86"
15 IUSE="syweb"
16
17 DEPEND="net-analyzer/rrdtool
18         sys-devel/pmake"
19 RDEPEND="net-analyzer/rrdtool
20         syweb? ( virtual/httpd-php )"
21
22 S=${WORKDIR}/${PN}
23 WEBAPP_MANUAL_SLOT="yes"
24
25 pkg_setup() {
26         require_php_with_use gd
27         webapp_pkg_setup
28 }
29
30 src_unpack() {
31         unpack ${A}
32
33         epatch "${FILESDIR}"/${PN}-symon.conf.patch
34         epatch "${FILESDIR}"/${PN}-symux.conf.patch
35
36         # the default user will be symon, not _symon
37         # not really used atm, but probably will if chroot will ever be implemented
38         sed -i -e 's|_symon|symon|g' symon/symon/symon.8
39
40         if use syweb ; then
41                 epatch "${FILESDIR}"/${PN}-syweb-class_lexer.inc.patch
42                 epatch "${FILESDIR}"/${PN}-syweb-setup.inc.patch
43                 epatch "${FILESDIR}"/${PN}-syweb-total_firewall.layout.patch
44         fi
45 }
46
47 src_compile() {
48         MAKE=pmake emake || die "emake failed."
49 }
50
51 src_install() {
52         insinto /etc
53         doins symon/symon.conf symux/symux.conf
54
55         newinitd "${FILESDIR}"/${PN}-init.d ${PN} || die "newinitd failed."
56
57         dodoc CHANGELOG HACKERS TODO
58
59         doman symon/symon.8 symux/symux.8
60
61         dosbin symon/symon
62         dosbin symux/symux
63
64         dodir /usr/share/symon
65         insinto /usr/share/symon
66         doins symon/c_config.sh symux/c_smrrds.sh
67         fperms a+x,u-w /usr/share/symon/c_config.sh
68         fperms u-w,u+x /usr/share/symon/c_smrrds.sh
69
70         dodir /var/lib/symon/rrds/localhost
71
72         if use syweb ; then
73                 docinto /layouts
74                 dodoc "${WORKDIR}"/syweb/symon/total_firewall.layout
75
76                 webapp_src_preinst
77
78                 dodir "${MY_HTDOCSDIR}"/cache
79                 dodir "${MY_HTDOCSDIR}"/layouts
80                 webapp_serverowned "${MY_HTDOCSDIR}"/cache
81                 insinto "${MY_HTDOCSDIR}"
82                 doins -r "${WORKDIR}"/syweb/htdocs/syweb/*
83                 webapp_configfile "${MY_HTDOCSDIR}"/setup.inc
84
85                 webapp_src_install
86         fi
87 }
88
89 pkg_postinst() {
90         if use syweb ; then
91                 elog "Test your syweb configuration by pointing your browser at:"
92                 elog "http://${VHOST_HOSTNAME}/${PN}/configtest.php"
93                 webapp_pkg_postinst
94         fi
95
96         elog "You'll need to setup your ${ROOT}/etc/symon.conf and "
97         elog "${ROOT}/etc/symux.conf before running these daemons for "
98         elog "the first time."
99         elog "For an example configuration run ${ROOT}/usr/share/symon/c_config.sh"
100         elog "Then, you may run ${ROOT}/usr/share/symon/c_smrrds.sh all"
101         elog "To test the configuration run sym{on,ux} -t"
102         elog "For details, please see their manpages."
103         elog "NOTE that symon won't chroot by default."
104 }