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