Gentoo Archives: gentoo-commits

From: Matt Thode <prometheanfire@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/prometheanfire:master commit in: net-analyzer/icinga/
Date: Mon, 27 Feb 2012 21:20:26
Message-Id: 1330377590.8dfe1667075679f092a52a6566690385a1c50430.prometheanfire@gentoo
1 commit: 8dfe1667075679f092a52a6566690385a1c50430
2 Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
3 AuthorDate: Mon Feb 27 21:19:50 2012 +0000
4 Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 27 21:19:50 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/prometheanfire.git;a=commit;h=8dfe1667
7
8 api should still be removed...
9
10 ---
11 net-analyzer/icinga/icinga-1.6.1-r3.ebuild | 235 ----------------------------
12 1 files changed, 0 insertions(+), 235 deletions(-)
13
14 diff --git a/net-analyzer/icinga/icinga-1.6.1-r3.ebuild b/net-analyzer/icinga/icinga-1.6.1-r3.ebuild
15 deleted file mode 100644
16 index 3ae74dc..0000000
17 --- a/net-analyzer/icinga/icinga-1.6.1-r3.ebuild
18 +++ /dev/null
19 @@ -1,235 +0,0 @@
20 -# Copyright 1999-2012 Gentoo Foundation
21 -# Distributed under the terms of the GNU General Public License v2
22 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/icinga/icinga-1.6.1-r2.ebuild,v 1.1 2011/12/29 15:54:57 prometheanfire Exp $
23 -
24 -EAPI=2
25 -
26 -inherit depend.apache eutils multilib toolchain-funcs
27 -
28 -DESCRIPTION="Nagios Fork - Check daemon, CGIs, docs, IDOutils"
29 -HOMEPAGE="http://www.icinga.org/"
30 -SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
31 -
32 -LICENSE="GPL-2"
33 -SLOT="0"
34 -KEYWORDS="~amd64 ~x86"
35 -IUSE="+apache2 debug +idoutils lighttpd +mysql perl +plugins postgres ssl +vim-syntax +web"
36 -DEPEND="idoutils? ( dev-db/libdbi-drivers[mysql?,postgres?] )
37 - perl? ( dev-lang/perl )
38 - virtual/mailx
39 - web? (
40 - media-libs/gd[jpeg,png]
41 - lighttpd? ( www-servers/lighttpd dev-lang/php[cgi] )
42 - apache2? ( || ( dev-lang/php[apache2] dev-lang/php[cgi] ) )
43 - )
44 - !net-analyzer/nagios-core"
45 -RDEPEND="${DEPEND}
46 - plugins? ( net-analyzer/nagios-plugins )"
47 -
48 -want_apache2
49 -
50 -pkg_setup() {
51 - depend.apache_pkg_setup
52 - enewgroup icinga
53 - enewgroup nagios
54 - enewuser icinga -1 -1 /var/spool/icinga "icinga,nagios"
55 -}
56 -
57 -src_prepare() {
58 - epatch "${FILESDIR}/fix-prestripped-binaries.patch"
59 -}
60 -
61 -src_configure() {
62 - local myconf
63 -
64 - myconf="$(use_enable perl embedded-perl)
65 - $(use_with perl perlcache)
66 - $(use_enable idoutils)
67 - $(use_enable ssl)
68 - $(use_enable debug DEBUG0)
69 - $(use_enable debug DEBUG1)
70 - $(use_enable debug DEBUG2)
71 - $(use_enable debug DEBUG3)
72 - $(use_enable debug DEBUG4)
73 - $(use_enable debug DEBUG5)
74 - --disable-statuswrl
75 - --with-cgiurl=/icinga/cgi-bin
76 - --with-log-dir=/var/log/icinga
77 - --bindir=/usr/sbin
78 - --sbindir=/usr/$(get_libdir)/icinga/cgi-bin
79 - --datarootdir=/usr/share/icinga/htdocs
80 - --localstatedir=/var/lib/icinga
81 - --sysconfdir=/etc/icinga
82 - --with-lockfile=/var/run/icinga/icinga.lock
83 - --with-temp-dir=/tmp/icinga"
84 -
85 - if use plugins ; then
86 - myconf+=" --libexecdir=/usr/$(get_libdir)/nagios/plugins"
87 - else
88 - myconf+=" --libexecdir=/usr/$(get_libdir)/icinga/plugins"
89 - fi
90 -
91 - if use !apache2 && use !lighttpd ; then
92 - myconf+=" --with-command-group=icinga"
93 - else
94 - if use apache2 ; then
95 - myconf+=" --with-httpd-conf=/etc/apache2/conf.d"
96 - myconf+=" --with-command-group=apache"
97 - elif use lighttpd ; then
98 - myconf+=" --with-command-group=lighttpd"
99 - fi
100 - fi
101 -
102 - econf ${myconf}
103 -
104 - cd module/icinga-api || die
105 - econf ${myconf2}
106 -}
107 -
108 -src_compile() {
109 - tc-export CC
110 -
111 - emake icinga || die "make failed"
112 -
113 - if use web ; then
114 - emake DESTDIR="${D}" cgis || die
115 - fi
116 -
117 - if use idoutils ; then
118 - emake DESTDIR="${D}" idoutils || die
119 - fi
120 -}
121 -
122 -src_install() {
123 - dodoc Changelog README UPGRADING || die
124 -
125 - if ! use web ; then
126 - sed -i -e '/cd $(SRC_\(CGI\|HTM\))/d' Makefile || die
127 - fi
128 -
129 - emake DESTDIR="${D}" install{,-config,-commandmode} || die
130 -
131 - sed -i -e 's/var\/lib\/icinga\/icinga.tmp/tmp\/icinga\/icinga.tmp/g' "${D}"/etc/icinga/icinga.cfg || die
132 -
133 - if use idoutils ; then
134 - emake DESTDIR="${D}" install-idoutils || die
135 - fi
136 - emake DESTDIR="${D}" install-api || die
137 -
138 - newinitd "${FILESDIR}"/icinga-init.d-2 icinga || die
139 - newconfd "${FILESDIR}"/icinga-conf.d icinga || die
140 - if use idoutils ; then
141 - newinitd "${FILESDIR}"/ido2db-init.d ido2db || die
142 - newconfd "${FILESDIR}"/ido2db-conf.d ido2db || die
143 - insinto /usr/share/icinga/contrib/db
144 - doins -r module/idoutils/db/* || die
145 - fi
146 - # Apache Module
147 - if use web ; then
148 - if use apache2 ; then
149 - insinto "${APACHE_MODULES_CONFDIR}"
150 - newins "${FILESDIR}"/icinga-apache.conf 99_icinga.conf || die
151 - elif use lighttpd ; then
152 - insinto /etc/lighttpd
153 - newins "${FILESDIR}"/icinga-lighty.conf lighttpd_icinga.conf || die
154 - else
155 - ewarn "${CATEGORY}/${PF} only supports Apache-2.x or Lighttpd webserver"
156 - ewarn "out-of-the-box. Since you are not using one of them, you"
157 - ewarn "have to configure your webserver accordingly yourself."
158 - fi
159 - fi
160 -
161 - fowners -R root:root /usr/$(get_libdir)/icinga || die
162 - cd "${D}" || die
163 - find usr/$(get_libdir)/icinga -type d -exec fperms 755 {} +
164 - find usr/$(get_libdir)/icinga/cgi-bin -type f -exec fperms 755 {} +
165 - dodir /var/run/icinga || die
166 - fowners icinga:icinga /var/run/icinga || die
167 -
168 - keepdir /etc/icinga
169 - keepdir /var/lib/icinga
170 - keepdir /var/lib/icinga/archives
171 - keepdir /var/lib/icinga/rw
172 - keepdir /var/lib/icinga/spool/checkresults
173 -
174 - if use apache2 ; then
175 - webserver=apache
176 - elif use lighttpd ; then
177 - webserver=lighttpd
178 - else
179 - webserver=icinga
180 - fi
181 -
182 - fowners icinga:icinga /var/lib/icinga || die "Failed chown of /var/lib/icinga"
183 - fowners -R icinga:${webserver} /var/lib/icinga/rw || die "Failed chown of /var/lib/icinga/rw"
184 -
185 - fperms 6755 /var/lib/icinga/rw || die "Failed Chmod of ${D}/var/lib/icinga/rw"
186 - fperms 0750 /etc/icinga || die "Failed chmod of ${D}/etc/icinga"
187 -}
188 -
189 -pkg_postinst() {
190 - if use web ; then
191 - elog "This does not include cgis that are perl-dependent"
192 - elog "Currently traceroute.cgi is perl-dependent"
193 - elog "Note that the user your webserver is running as needs"
194 - elog "read-access to /etc/icinga."
195 - elog
196 - if use apache2 || use lighttpd ; then
197 - elog "There are several possible solutions to accomplish this,"
198 - elog "choose the one you are most comfortable with:"
199 - elog
200 - if use apache2 ; then
201 - elog " usermod -G icinga apache"
202 - elog "or"
203 - elog " chown icinga:apache /etc/icinga"
204 - elog
205 - elog "Also edit /etc/conf.d/apache2 and add a line like"
206 - elog "APACHE2_OPTS=\"\$APACHE2_OPTS -D ICINGA\""
207 - elog
208 - elog "Icinga web service needs user authentication. If you"
209 - elog "use the base configuration, you need a password file"
210 - elog "with a password for user \"icingaadmin\""
211 - elog "You can create this file by executing:"
212 - elog "htpasswd -c /etc/icinga/htpasswd.users icingaadmin"
213 - elif use lighttpd ; then
214 - elog " usermod -G icinga lighttpd "
215 - elog "or"
216 - elog " chown icinga:lighttpd /etc/icinga"
217 - elog "Also edit /etc/lighttpd/lighttpd.conf and add 'include \"lighttpd_icinga.conf\"'"
218 - fi
219 - elog
220 - elog "That will make icinga's web front end visable via"
221 - elog "http://localhost/icinga/"
222 - elog
223 - else
224 - elog "IMPORTANT: Do not forget to add the user your webserver"
225 - elog "is running as to the icinga group!"
226 - fi
227 - else
228 - ewarn "Please note that you have installed Icinga without web interface."
229 - ewarn "Please don't file any bugs about having no web interface when you do this."
230 - ewarn "Thank you!"
231 - fi
232 - elog
233 - elog "If you want icinga to start at boot time"
234 - elog "remember to execute:"
235 - elog " rc-update add icinga default"
236 - elog
237 - elog "If your kernel has /proc protection, icinga"
238 - elog "will not be happy as it relies on accessing the proc"
239 - elog "filesystem. You can fix this by adding icinga into"
240 - elog "the group wheel, but this is not recomended."
241 - elog
242 - if [ -d "${ROOT}"/var/icinga ] ; then
243 - ewarn
244 - ewarn "/var/icinga was moved to /var/lib/icinga"
245 - ewarn "please move the files if this was an upgrade"
246 - if use idoutils ; then
247 - ewarn "and edit /etc/ido2db.cfg to change the location of the files"
248 - ewarn "it accesses"
249 - fi
250 - ewarn
251 - ewarn "The \"mv /var/icinga /var/lib/\" command works well to move the files"
252 - ewarn "remove /var/icinga afterwards to make this warning disappear"
253 - fi
254 -}