/[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.4 - (show annotations) (download)
Sat Aug 18 02:52:01 2012 UTC (23 months, 1 week ago) by flameeyes
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Cleanup old; revision bump and move patches to git backports instead.

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

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.16.ebuild,v 1.3 2012/08/15 18:29:21 flameeyes 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 epatch "${FILESDIR}"/${P}-parallelmake.patch
60
61 eautoreconf
62 }
63
64 src_configure() {
65 local conf
66 if use ssl; then
67 conf="${conf} --with-openssl=/usr"
68 else
69 conf="${conf} --without-openssl"
70 fi
71
72 if use postgres; then
73 conf="${conf} --with-pgsql=/usr"
74 fi
75
76 econf \
77 $(use_with mysql) \
78 $(use_with ipv6) \
79 $(use_with ldap) \
80 ${conf} \
81 --host=${CHOST} \
82 --prefix=/usr \
83 --libexecdir=/usr/$(get_libdir)/nagios/plugins \
84 --sysconfdir=/etc/nagios || die "econf failed"
85
86 # fix problem with additional -
87 sed -i -e 's:/bin/ps -axwo:/bin/ps axwo:g' config.h || die "sed failed"
88 }
89
90 src_install() {
91 mv "${S}"/contrib/check_compaq_insight.pl "${S}"/contrib/check_compaq_insight.pl.msg
92 chmod +x "${S}"/contrib/*.pl
93
94 sed -i -e '1s;#!.*;#!/usr/bin/perl -w;' "${S}"/contrib/*.pl || die "sed failed"
95 sed -i -e s#/usr/nagios/libexec#/usr/$(get_libdir)/nagios/plugins#g "${S}"/contrib/*.pl || die "sed failed"
96 sed -i -e '30s/use lib utils.pm;/use utils;/' \
97 "${S}"/plugins-scripts/check_file_age.pl || die "sed failed"
98
99 dodoc ACKNOWLEDGEMENTS AUTHORS BUGS CODING \
100 ChangeLog FAQ NEWS README REQUIREMENTS SUPPORT THANKS
101
102 emake DESTDIR="${D}" install || die "make install failed"
103
104 if use mysql || use postgres; then
105 dodir /usr/$(get_libdir)/nagios/plugins
106 exeinto /usr/$(get_libdir)/nagios/plugins
107 doexe "${S}"/contrib/check_nagios_db.pl
108 fi
109
110 if ! use snmp; then
111 rm "${D}"/usr/$(get_libdir)/nagios/plugins/check_if{operstatus,status} \
112 || die "Failed to remove SNMP check plugins"
113 fi
114
115 mv "${S}"/contrib "${D}"/usr/$(get_libdir)/nagios/plugins/contrib
116
117 if ! use jabber; then
118 rm "${D}"usr/$(get_libdir)/nagios/plugins/contrib/nagios_sendim.pl \
119 || die "Failed to remove XMPP notification addon"
120 fi
121
122 chown -R root:nagios "${D}"/usr/$(get_libdir)/nagios/plugins \
123 || die "Failed chown of ${D}usr/$(get_libdir)/nagios/plugins"
124
125 chmod -R o-rwx "${D}"/usr/$(get_libdir)/nagios/plugins \
126 || die "Failed chmod of ${D}usr/$(get_libdir)/nagios/plugins"
127
128 if use suid ; then
129
130 chmod 04710 "${D}"/usr/$(get_libdir)/nagios/plugins/{check_icmp,check_ide_smart,check_dhcp} \
131 || die "Failed setting the suid bit for various plugins"
132 fi
133
134 dosym /usr/$(get_libdir)/nagios/plugins/utils.sh /usr/$(get_libdir)/nagios/plugins/contrib/utils.sh
135 dosym /usr/$(get_libdir)/nagios/plugins/utils.pm /usr/$(get_libdir)/nagios/plugins/contrib/utils.pm
136 }
137
138 pkg_postinst() {
139 einfo "This ebuild has a number of USE flags which determines what nagios is able to monitor."
140 einfo "Depending on what you want to monitor with nagios, some or all of these USE"
141 einfo "flags need to be set for nagios to function correctly."
142 echo
143 einfo "contrib plugins are installed into /usr/$(get_libdir)/nagios/plugins/contrib"
144 }

  ViewVC Help
Powered by ViewVC 1.1.20