/[gentoo-x86]/net-analyzer/symon/symon-2.85.ebuild
Gentoo

Contents of /net-analyzer/symon/symon-2.85.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Tue Apr 17 16:39:50 2012 UTC (13 months ago) by jer
Branch: MAIN
CVS Tags: HEAD
Version bump.

(Portage version: 2.2.0_alpha100/cvs/Linux x86_64)

1 jer 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: /var/cvsroot/gentoo-x86/net-analyzer/symon/symon-2.84.ebuild,v 1.1 2012/02/15 15:49:30 jer Exp $
4    
5     EAPI=4
6    
7     inherit perl-module toolchain-funcs
8    
9     DESCRIPTION="Performance and information monitoring tool"
10     HOMEPAGE="http://www.xs4all.nl/~wpd/symon/"
11     SRC_URI="http://www.xs4all.nl/~wpd/symon/philes/${P}.tar.gz"
12    
13     LICENSE="BSD-2"
14     SLOT="0"
15     KEYWORDS="~amd64 ~sparc ~x86"
16     IUSE="perl +symon symux"
17    
18     RDEPEND="perl? ( dev-lang/perl )
19     symux? ( net-analyzer/rrdtool )"
20     DEPEND="${RDEPEND}
21     virtual/pmake"
22    
23     S=${WORKDIR}/${PN}
24    
25     # Deletes the directory passed as an argument from the internal pmake
26     # variable SUBDIR.
27     zap_subdir() {
28     sed -i "/^SUBDIR/s/$1//" Makefile || die
29     }
30    
31     pkg_setup() {
32     use symon && USE_SYMON=1 && return
33    
34     if ! use perl && ! use symon && ! use symux; then
35     ewarn "You have all available USE flags disabled. Therefore, only the"
36     ewarn "system monitor will be emerged. Please, enable at least one USE"
37     ewarn "flag to avoid this message."
38     USE_SYMON=1
39     fi
40     }
41    
42     src_prepare() {
43     # Respect LDFLAGS.
44     sed -i "/^[ \t]*\${CC}.*\${LIBS}/s/\${CC}/& \${LDFLAGS}/" sym*/Makefile \
45     || die "sed ldflags failed"
46    
47     # Do some sed magic in accordance with the USE flags.
48     use perl && [[ -z ${USE_SYMON} ]] && ! use symux && zap_subdir lib
49     ! use perl && zap_subdir client
50     ! use symux && zap_subdir symux
51     [[ -z ${USE_SYMON} ]] && zap_subdir symon
52     }
53    
54     src_compile() {
55     pmake CC="$(tc-getCC)" CFLAGS+="${CFLAGS}" STRIP=true || die "pmake failed"
56     }
57    
58     src_install() {
59     if [[ -n ${USE_SYMON} ]]; then
60     insinto /etc
61     doins "${FILESDIR}"/symon.conf
62    
63     newinitd "${FILESDIR}"/symon-init.d symon
64    
65     dodoc CHANGELOG HACKERS TODO
66    
67     doman symon/symon.8
68     dosbin symon/symon
69     fi
70    
71     if use perl; then
72     dobin client/getsymonitem.pl
73    
74     perlinfo
75     insinto ${VENDOR_LIB}
76     doins client/SymuxClient.pm
77     fi
78    
79     if use symux; then
80     insinto /etc
81     doins "${FILESDIR}"/symux.conf
82    
83     newinitd "${FILESDIR}"/symux-init.d symux
84    
85     doman symux/symux.8
86     dosbin symux/symux
87    
88     dodir /usr/share/symon
89     insinto /usr/share/symon
90     doins symux/c_smrrds.sh
91     fperms a+x /usr/share/symon/c_smrrds.sh
92    
93     dodir /var/lib/symon/rrds/localhost
94     fi
95     }
96    
97     pkg_postinst() {
98     use perl && perl-module_pkg_postinst
99    
100     if use symux; then
101     elog "The RRDs files can be obtained by running"
102     elog "/usr/share/symon/c_smrrds.sh all."
103     elog "For information about migrating RRDs from a previous"
104     elog "symux version read the LEGACY FORMATS section of symux(8)."
105     elog "To view the rrdtool pictures of the stored data, emerge"
106     elog "net-analyzer/syweb."
107     fi
108     }

  ViewVC Help
Powered by ViewVC 1.1.13