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-web/
Date: Tue, 11 Oct 2016 18:14:59
Message-Id: 1476209657.9cfe53935dec1ba1efc53eeb2eab7456234158c1.prometheanfire@gentoo
1 commit: 9cfe53935dec1ba1efc53eeb2eab7456234158c1
2 Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 11 18:12:22 2016 +0000
4 Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 11 18:14:17 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cfe5393
7
8 net-analyzer/icinga-web: bup
9
10 Package-Manager: portage-2.3.0
11
12 net-analyzer/icinga-web/Manifest | 1 +
13 net-analyzer/icinga-web/icinga-web-1.12.0.ebuild | 206 +++++++++++++++++++++++
14 2 files changed, 207 insertions(+)
15
16 diff --git a/net-analyzer/icinga-web/Manifest b/net-analyzer/icinga-web/Manifest
17 index 3422e1d..935b9fd 100644
18 --- a/net-analyzer/icinga-web/Manifest
19 +++ b/net-analyzer/icinga-web/Manifest
20 @@ -1,4 +1,5 @@
21 DIST icinga-web-1.10.0.tar.gz 14245635 SHA256 fe1b43448bcb6a9e8f565f079122e51283539eb6be214e7001c65653686b7f56 SHA512 90537ea710dd6408349b734b0901918db595d2d7a281e9245a63ba0150a4b7df4fabbb71755966361440ca6096391470d7399ddd5f4b245d1203000b89d8b368 WHIRLPOOL c72004edb2a76efa4ccbea6363fddfa4c6d30c8c368fa57ee0f865d27927bdc5aea691b42c4415b5fe75a12d946768296feffbeb101ff8945377d92da20059bc
22 DIST icinga-web-1.10.1.tar.gz 14247394 SHA256 b334c063cf4f53fcc1922d99161b5ea5c32c04749c0f9dfe091f376158273664 SHA512 e155c4c00fde20680ed3286fbf7af4db13dd566693ec677a61c719cf8a0b36862bc51741180aceba204e6f768000d8a6dc4548bfbf7165f28f8bbc81c79bc63c WHIRLPOOL d4cf2ea128c0e46bf07ce1ae677a4e718405b926250f4972790388d2b45cef5996e16ca5b83dcdd8f8c9a84831a76cb88b76d0839bdce87e222d6712463b6de9
23 DIST icinga-web-1.11.2.tar.gz 14133733 SHA256 726ffb261d3cd5a864b689f96837ff9cc138e9c5d97c19a2c82b110a802eb772 SHA512 ecfbc6534a87ae52b508b2ca663109bdc201fbfc143ce399fff0fdd4eec456524c5bb86afe0e29c58dc3dfeaccc959817e77af5b0257db6eced2f27592caf5b1 WHIRLPOOL bb1ad4ae5d921a0454afd9e11780d469f89b5414f6edf13db8c1292e72c5da8a0dc66991d45fac36607ead57934331414017fcc716b8eac351a56c43b8780cf5
24 +DIST icinga-web-1.12.0.tar.gz 14517225 SHA256 3e802ae0cbcabb9555908bf91b9c40d9c07eb80a8acc70f0c9cbd426e3feb675 SHA512 07831c62479e2c83929bd86dc8d7e57558d8e3b3dac2952d64e5170dc508d836cfb2e7446019d2ec9bea03740fc1c55e5857d2fd88fe67ea2726375f77246898 WHIRLPOOL 85ca6ad8423b72dcf77de6243b29fc9c5fadb09f68b56ae57380637014deea60749ff7c942b43d4965ab23efb2d4d79b9cffb194ed6d21e5262373b856ae9b1a
25 DIST icinga-web-1.9.1.tar.gz 14635896 SHA256 aa5b1aa6962a727a6760f89ef19845a878b7e06ee723b8f1fd7821b6a6b578aa SHA512 42a3edddae5a287b87fd6d077ac303e7caa0b430af86e9046413e7d04d703cd3de7df881463eebb1e5216315056e06ce9f6dccbef93b6e55d1c3f5fe002447b9 WHIRLPOOL 8b5a6bf78794f722952566c82ae238640a716e61022fead31145bbc6fa40ca3bbf439aa593c5839b09873f7d43469cff28422ecd9b93e51cc7124859d1ae8257
26
27 diff --git a/net-analyzer/icinga-web/icinga-web-1.12.0.ebuild b/net-analyzer/icinga-web/icinga-web-1.12.0.ebuild
28 new file mode 100644
29 index 00000000..ae6a04b
30 --- /dev/null
31 +++ b/net-analyzer/icinga-web/icinga-web-1.12.0.ebuild
32 @@ -0,0 +1,206 @@
33 +# Copyright 1999-2016 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +# $Id$
36 +
37 +EAPI="5"
38 +
39 +inherit depend.apache eutils user multilib
40 +
41 +DESCRIPTION="Icinga Web - new Web Interface"
42 +HOMEPAGE="http://www.icinga.org/"
43 +SRC_URI="https://github.com/icinga/${PN}/releases/download/v${PV}/${P}.tar.gz"
44 +LICENSE="GPL-2"
45 +SLOT="0"
46 +KEYWORDS="~x86 ~amd64"
47 +IUSE="apache2 mysql pnp postgres"
48 +DEPEND="dev-php/phing
49 + dev-db/libdbi-drivers[mysql?,postgres?]
50 + || ( >=net-analyzer/icinga-1.10.0 >=net-analyzer/icinga2-2.1.1 )
51 + dev-lang/php:=[apache2?,cli,json,mysql?,pdo,postgres?,sockets,xslt,xml]
52 + pnp? ( net-analyzer/pnp4nagios )"
53 +RDEPEND="${DEPEND}"
54 +
55 +want_apache2
56 +
57 +pkg_setup() {
58 + if use apache2 ; then
59 + depend.apache_pkg_setup
60 + fi
61 + enewgroup icinga
62 + enewgroup nagios
63 + enewuser icinga -1 -1 /var/lib/icinga "icinga,nagios"
64 +}
65 +
66 +src_prepare() {
67 + #removed checks for some php stuff since we have these things called use flags
68 + sed -i 's/ACICINGA_CHECK_PHP_MODULE/\#ACICINGA_CHECK_PHP_MODULE/g' configure.ac
69 + sed -i 's/make\ /make\ \-j1\ /g' lib/Makefile.in
70 + autoreconf
71 +}
72 +
73 +src_configure() {
74 + local myconf
75 +
76 + myconf="--prefix=/usr/share/icinga/icinga-web
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 + --libexecdir=/usr/$(get_libdir)/icinga/plugins
83 + --with-bin-user=icinga
84 + --with-bin-group=nagios
85 + --with-api-cmd-file=/var/lib/icinga/rw/icinga.cmd
86 + --with-conf-dir=/etc/icinga-web
87 + --with-log-dir=/var/log/icinga-web
88 + --with-icinga-objects-dir=/etc/icinga/objects
89 + --with-icinga-bin=/usr/sbin/icinga
90 + --with-icinga-cfg=/etc/icinga/icinga.cfg"
91 +
92 + if use apache2 ; then
93 + myconf+=" --with-web-user=apache
94 + --with-web-group=apache
95 + --with-web-apache-path=${APACHE_MODULES_CONFDIR}"
96 + else
97 + myconf+=" --with-web-user=root
98 + --with-web-group=root"
99 + fi
100 +
101 + if use postgres ; then
102 + myconf+=" --with-db-type=pgsql
103 + --with-db-port=5432
104 + --with-api-subtype=pgsql
105 + --with-api-port=5432"
106 + fi
107 +
108 + econf ${myconf}
109 +}
110 +
111 +src_install() {
112 + dodoc README
113 + rm -f README
114 +
115 + emake -j1 DESTDIR="${D}" install
116 +
117 + emake DESTDIR="${D}" install-javascript
118 +
119 + if use apache2 ; then
120 + dodir ${APACHE_MODULES_CONFDIR}
121 + emake DESTDIR="${D}" install-apache-config
122 + echo '<IfDefine ICINGA_WEB>' > "${D}/${APACHE_MODULES_CONFDIR}/99_icinga-web.conf"
123 + cat "${WORKDIR}/${P}/etc/apache2/icinga-web.conf" >> "${D}/${APACHE_MODULES_CONFDIR}/99_icinga-web.conf"
124 + rm "${D}/${APACHE_MODULES_CONFDIR}/icinga-web.conf" || die "rm failed"
125 + echo '</IfDefine>' >> "${D}/${APACHE_MODULES_CONFDIR}/99_icinga-web.conf"
126 + fi
127 +
128 + insinto /usr/share/icinga/icinga-web/contrib
129 + doins -r etc/schema/*
130 +
131 + if use apache2 ; then
132 + sed -i 's/%%USER%%/apache/g' etc/scheduler/icingaCron
133 + else
134 + sed -i 's/%%USER%%/root/g' etc/scheduler/icingaCron
135 + fi
136 + sed -i 's/%%PATH%%/\/usr\/share\/icinga\/icinga-web/g' etc/scheduler/icingaCron
137 +
138 + dodir /usr/share/icinga/icinga-web/cron/
139 + cat - >> "${D}"/usr/share/icinga/icinga-web/cron/crontab <<EOF
140 +# Force the shell to bash
141 +SHELL=/bin/bash
142 +#mail to root
143 +MAILTO=root
144 +
145 +#runs every minute
146 +* * * * * /usr/bin/php /usr/share/icinga/icinga-web/lib/icingaScheduler/icingaCron.php --useAgavi --exec >> /var/log/icinga-web/cron_error.log
147 +EOF
148 +
149 + cat - >> "${D}"/usr/share/icinga/icinga-web/cron/fcrontab <<EOF
150 +# Mail reports to root
151 +!mailto(root)
152 +
153 +#runs every minute
154 +@ 1 /usr/bin/php /usr/share/icinga/icinga-web/lib/icingaScheduler/icingaCron.php --useAgavi --exec >> /var/log/icinga-web/cron_error.log
155 +EOF
156 +
157 + if use apache2 ; then
158 + diropts -o apache -g apache
159 + else
160 + diropts -o root -g root
161 + fi
162 + dodir /var/log/icinga-web
163 +
164 + if use apache2 ; then
165 + fowners apache:apache /usr/share/icinga/icinga-web/lib/icingaScheduler/res/storage.dat
166 + else
167 + fowners root:root /usr/share/icinga/icinga-web/lib/icingaScheduler/res/storage.dat
168 + fi
169 +
170 + if use pnp ; then
171 + insinto /usr/share/icinga/icinga-web/app/modules/Cronks/data/xml/extensions/
172 + doins contrib/PNP_Integration/templateExtensions/pnp-host-extension.xml
173 + doins contrib/PNP_Integration/templateExtensions/pnp-service-extension.xml
174 + fi
175 +}
176 +
177 +pkg_config() {
178 + einfo "press enter to install the icinga-web crontab"
179 + einfo "installation from /usr/share/icinga/icinga-web/cron/icingaCron"
180 + einfo
181 + read
182 +
183 + if has_version sys-process/fcron; then
184 + fcrontab - -u root < /usr/share/icinga/icinga-web/cron/fcrontab
185 + else
186 + crontab - -u root < /usr/share/icinga/icinga-web/cron/crontab
187 + fi
188 +}
189 +
190 +pkg_postinst() {
191 + einfo
192 + einfo "If this is a new install, you must create a new database for it, e.g. icinga_web."
193 + einfo "You can find the database scripts in /usr/share/icinga/icinga-web/contrib/."
194 + einfo
195 + einfo "Additionally, you need to setup a database user."
196 + einfo "The user must have default data privileges like SELECT, UPDATE, INSERT, DELETE."
197 + einfo
198 + einfo "Example for a MySQL database:"
199 + einfo " echo \"CREATE DATABASE icinga_web;\" | mysql"
200 + einfo " echo \"GRANT SELECT,UPDATE,INSERT,DELETE ON icinga_web.* TO 'icinga_web'@'localhost' IDENTIFIED BY 'xxxxxx';\" | mysql"
201 + einfo " echo \"FLUSH PRIVILEGES;\" | mysql"
202 + einfo
203 + einfo " cat /usr/share/icinga/icinga-web/contrib/mysql.sql | mysql icinga_web"
204 + einfo
205 +
206 + ewarn
207 + ewarn "If you're upgrading from a previous release, you must upgrade your database schema."
208 + ewarn "You can find upgrade scripts in /usr/share/icinga/icinga-web/contrib/updates/."
209 + ewarn
210 + ewarn "IMPORTANT: If you are upgrading from an older version and there are other versions in between,"
211 + ewarn " be advised that you need to apply those upgrade files with incremental steps!"
212 + ewarn
213 + ewarn "Example to upgrade a MySQL database:"
214 + ewarn " cat /usr/share/icinga/icinga-web/contrib/updates/mysql_<oldversion>_to_<newversion>.sql | mysql icinga_web"
215 + ewarn
216 + ewarn "Don't forget to clear the config cache."
217 + ewarn " /usr/share/icinga/icinga-web/bin/clearcache.sh"
218 + ewarn
219 +
220 + einfo
221 + einfo "Please note that the magic_quotes_gpc setting must be disabled (in both apache and cli php.ini)."
222 + einfo
223 +
224 + if use apache2 ; then
225 + einfo
226 + einfo "apache config was installed into"
227 + einfo "/etc/apache2/modules.d/99_icinga-web.conf"
228 + einfo
229 + einfo "The apache config value for \'ServerTokens\' must be set to at"
230 + einfo "least \'Min\'."
231 + einfo
232 + else
233 + einfo
234 + einfo "If you are not using apache you may need to change some"
235 + einfo "permissions, so that your web server can access files and logs"
236 + einfo
237 + fi
238 +}