/[gentoo-x86]/net-analyzer/nagios-plugins/nagios-plugins-1.4.16.ebuild
Gentoo

Contents of /net-analyzer/nagios-plugins/nagios-plugins-1.4.16.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Tue Jul 31 21:53:01 2012 UTC (2 years, 3 months ago) by idl0r
Branch: MAIN
Non-maitainer bump, fixes bug 428560, bug 411497 and bug 366403.

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

1 idl0r 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/nagios-plugins/nagios-plugins-1.4.15.ebuild,v 1.4 2012/06/12 02:44:29 zmedico Exp $
4    
5     EAPI=4
6    
7     inherit autotools eutils multilib user
8    
9     DESCRIPTION="Nagios $PV plugins - Pack of plugins to make Nagios work properly"
10     HOMEPAGE="http://www.nagios.org/"
11     SRC_URI="mirror://sourceforge/nagiosplug/${P}.tar.gz"
12    
13     LICENSE="GPL-2"
14     SLOT="0"
15     KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
16     IUSE="+ssl samba mysql postgres ldap snmp nagios-dns nagios-ntp nagios-ping nagios-ssh nagios-game ups ipv6 radius +suid jabber"
17    
18     DEPEND="ldap? ( >=net-nds/openldap-2.0.25 )
19     mysql? ( virtual/mysql )
20     postgres? ( dev-db/postgresql-base )
21     ssl? ( >=dev-libs/openssl-0.9.6g )
22     radius? ( >=net-dialup/radiusclient-0.3.2 )"
23    
24     RESTRICT="test"
25    
26     RDEPEND="${DEPEND}
27     >=dev-lang/perl-5.6.1-r7
28     samba? ( >=net-fs/samba-2.2.5-r1 )
29     snmp? ( >=dev-perl/Net-SNMP-4.0.1-r1
30     >=net-analyzer/net-snmp-5.0.6
31     )
32     mysql? ( dev-perl/DBI
33     dev-perl/DBD-mysql )
34     nagios-dns? ( >=net-dns/bind-tools-9.2.2_rc1 )
35     nagios-ntp? ( >=net-misc/ntp-4.1.1a )
36     nagios-ping? ( >=net-analyzer/fping-2.4_beta2-r1 )
37     nagios-ssh? ( >=net-misc/openssh-3.5_p1 )
38     ups? ( >=sys-power/nut-1.4 )
39     !sparc? ( nagios-game? ( >=games-util/qstat-2.6 ) )
40     jabber? ( >=dev-perl/Net-Jabber-2.0 )"
41    
42     pkg_setup() {
43     enewgroup nagios
44     enewuser nagios -1 /bin/bash /var/nagios/home nagios
45     }
46    
47     src_prepare() {
48     if ! use radius; then
49     EPATCH_OPTS="-p1 -d ${S}" epatch \
50     "${FILESDIR}"/nagios-plugins-1.4.10-noradius.patch
51     fi
52    
53     # bug 366403
54     epatch "${FILESDIR}"/${P}-contrib.patch
55    
56     epatch "${FILESDIR}"/${PN}-1.4.12-pgsqlconfigure.patch
57     epatch "${FILESDIR}"/${PN}-1.4.15-vserver.patch
58     epatch "${FILESDIR}"/${PN}-1.4.15-openldap.patch
59    
60     eautoreconf
61     }
62    
63     src_configure() {
64     local conf
65     if use ssl; then
66     conf="${conf} --with-openssl=/usr"
67     else
68     conf="${conf} --without-openssl"
69     fi
70    
71     if use postgres; then
72     conf="${conf} --with-pgsql=/usr"
73     fi
74    
75     econf \
76     $(use_with mysql) \
77     $(use_with ipv6) \
78     $(use_with ldap) \
79     ${conf} \
80     --host=${CHOST} \
81     --prefix=/usr \
82     --libexecdir=/usr/$(get_libdir)/nagios/plugins \
83     --sysconfdir=/etc/nagios || die "econf failed"
84    
85     # fix problem with additional -
86     sed -i -e 's:/bin/ps -axwo:/bin/ps axwo:g' config.h || die "sed failed"
87     }
88    
89     src_install() {
90     mv "${S}"/contrib/check_compaq_insight.pl "${S}"/contrib/check_compaq_insight.pl.msg
91     chmod +x "${S}"/contrib/*.pl
92    
93     sed -i -e '1s;#!.*;#!/usr/bin/perl -w;' "${S}"/contrib/*.pl || die "sed failed"
94     sed -i -e s#/usr/nagios/libexec#/usr/$(get_libdir)/nagios/plugins#g "${S}"/contrib/*.pl || die "sed failed"
95     sed -i -e '30s/use lib utils.pm;/use utils;/' \
96     "${S}"/plugins-scripts/check_file_age.pl || die "sed failed"
97    
98     dodoc ACKNOWLEDGEMENTS AUTHORS BUGS CODING \
99     ChangeLog FAQ NEWS README REQUIREMENTS SUPPORT THANKS
100    
101     emake DESTDIR="${D}" install || die "make install failed"
102    
103     if use mysql || use postgres; then
104     dodir /usr/$(get_libdir)/nagios/plugins
105     exeinto /usr/$(get_libdir)/nagios/plugins
106     doexe "${S}"/contrib/check_nagios_db.pl
107     fi
108    
109     if ! use snmp; then
110     rm "${D}"/usr/$(get_libdir)/nagios/plugins/check_if{operstatus,status} \
111     || die "Failed to remove SNMP check plugins"
112     fi
113    
114     mv "${S}"/contrib "${D}"/usr/$(get_libdir)/nagios/plugins/contrib
115    
116     if ! use jabber; then
117     rm "${D}"usr/$(get_libdir)/nagios/plugins/contrib/nagios_sendim.pl \
118     || die "Failed to remove XMPP notification addon"
119     fi
120    
121     chown -R root:nagios "${D}"/usr/$(get_libdir)/nagios/plugins \
122     || die "Failed chown of ${D}usr/$(get_libdir)/nagios/plugins"
123    
124     chmod -R o-rwx "${D}"/usr/$(get_libdir)/nagios/plugins \
125     || die "Failed chmod of ${D}usr/$(get_libdir)/nagios/plugins"
126    
127     if use suid ; then
128    
129     chmod 04710 "${D}"/usr/$(get_libdir)/nagios/plugins/{check_icmp,check_ide_smart,check_dhcp} \
130     || die "Failed setting the suid bit for various plugins"
131     fi
132    
133     dosym /usr/$(get_libdir)/nagios/plugins/utils.sh /usr/$(get_libdir)/nagios/plugins/contrib/utils.sh
134     dosym /usr/$(get_libdir)/nagios/plugins/utils.pm /usr/$(get_libdir)/nagios/plugins/contrib/utils.pm
135     }
136    
137     pkg_postinst() {
138     einfo "This ebuild has a number of USE flags which determines what nagios is able to monitor."
139     einfo "Depending on what you want to monitor with nagios, some or all of these USE"
140     einfo "flags need to be set for nagios to function correctly."
141     echo
142     einfo "contrib plugins are installed into /usr/$(get_libdir)/nagios/plugins/contrib"
143     }

  ViewVC Help
Powered by ViewVC 1.1.20