Gentoo Archives: gentoo-commits

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