/[gentoo-x86]/net-analyzer/icinga-web/icinga-web-1.7.1.ebuild
Gentoo

Contents of /net-analyzer/icinga-web/icinga-web-1.7.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Jul 22 00:32:19 2012 UTC (10 months ago) by idl0r
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Use apache's IfDefine so that icinga-web is not enabled by default

(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/icinga-web/icinga-web-1.7.1.ebuild,v 1.1 2012/07/16 15:27:26 prometheanfire Exp $
4
5 EAPI="2"
6
7 inherit depend.apache eutils
8
9 DESCRIPTION="Icinga Web - new Web Interface"
10 HOMEPAGE="http://www.icinga.org/"
11 SRC_URI="mirror://sourceforge/icinga/${P}.tar.gz"
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~x86 ~amd64"
15 IUSE="apache2 mysql pnp postgres"
16 DEPEND="dev-php/phing
17 dev-lang/php[apache2?,cli,mysql?,pdo,postgres?,json]
18 pnp? ( net-analyzer/pnp4nagios )"
19 RDEPEND="${DEPEND}"
20
21 want_apache2
22
23 pkg_setup() {
24 if use apache2 ; then
25 depend.apache_pkg_setup
26 fi
27 enewgroup icinga
28 enewgroup nagios
29 enewuser icinga -1 -1 /var/lib/icinga "icinga,nagios"
30 }
31
32 src_prepare() {
33 epatch "${FILESDIR}/${P}-disable-compression.patch"
34 }
35
36 src_configure() {
37 local myconf
38
39 myconf="--prefix=/usr/share/icinga/icinga-web
40 --bindir=/usr/sbin
41 --sbindir=/usr/$(get_libdir)/icinga/cgi-bin
42 --datarootdir=/usr/share/icinga/htdocs
43 --localstatedir=/var/lib/icinga
44 --sysconfdir=/etc/icinga
45 --libexecdir=/usr/$(get_libdir)/icinga/plugins
46 --with-bin-user=icinga
47 --with-bin-group=nagios
48 --with-api-cmd-file=/var/lib/icinga/rw/icinga.cmd
49 --with-conf-dir=/etc/icinga-web
50 --with-log-dir=/var/log/icinga-web
51 --with-icinga-objects-dir=/etc/icinga/objects
52 --with-icinga-bin=/usr/sbin/icinga
53 --with-icinga-cfg=/etc/icinga/icinga.cfg"
54
55 if use apache2 ; then
56 myconf+=" --with-web-user=apache
57 --with-web-group=apache
58 --with-web-apache-path=${APACHE_MODULES_CONFDIR}"
59 else
60 myconf+=" --with-web-user=root
61 --with-web-group=root"
62 fi
63
64 if use postgres ; then
65 myconf+=" --with-db-type=pgsql
66 --with-db-port=5432
67 --with-api-subtype=pgsql
68 --with-api-port=5432"
69 fi
70
71 econf ${myconf}
72 }
73
74 src_install() {
75 dodoc README
76 rm -f README
77
78 emake DESTDIR="${D}" install || die "make failed"
79
80 emake DESTDIR="${D}" install-javascript || die "make failed"
81
82 if use apache2 ; then
83 dodir ${APACHE_MODULES_CONFDIR}
84 emake DESTDIR="${D}" install-apache-config || die "make failed"
85 mv "${D}/${APACHE_MODULES_CONFDIR}/icinga-web.conf" "${D}/${APACHE_MODULES_CONFDIR}/99_icinga-web.conf"
86 fi
87
88 insinto /usr/share/icinga/icinga-web/contrib
89 doins -r etc/schema/* || die
90
91 if use apache2 ; then
92 sed -i 's/%%USER%%/apache/g' etc/scheduler/icingaCron
93 else
94 sed -i 's/%%USER%%/root/g' etc/scheduler/icingaCron
95 fi
96 sed -i 's/%%PATH%%/\/usr\/share\/icinga\/icinga-web/g' etc/scheduler/icingaCron
97
98 insinto /etc/cron.d/
99 doins etc/scheduler/icingaCron || die
100
101 if use apache2 ; then
102 diropts -o apache -g apache
103 else
104 diropts -o root -g root
105 fi
106 dodir /var/log/icinga-web
107
108 if use apache2 ; then
109 fowners apache:apache /usr/share/icinga/icinga-web/lib/icingaScheduler/res/storage.dat
110 else
111 fowners root:root /usr/share/icinga/icinga-web/lib/icingaScheduler/res/storage.dat
112 fi
113
114 if use pnp ; then
115 insinto /usr/share/icinga/icinga-web/app/modules/Cronks/data/xml/extensions/
116 doins contrib/PNP_Integration/templateExtensions/pnp-host-extension.xml
117 doins contrib/PNP_Integration/templateExtensions/pnp-service-extension.xml
118 fi
119 }
120
121 pkg_postinst() {
122 einfo
123 einfo "If this is a new install, you must create a new database for it, e.g. icinga_web."
124 einfo "You can find the database scripts in /usr/share/icinga/icinga-web/contrib/."
125 einfo
126 einfo "Additionally, you need to setup a database user."
127 einfo "The user must have default data privileges like SELECT, UPDATE, INSERT, DELETE."
128 einfo
129 einfo "Example for a MySQL database:"
130 einfo " echo \"CREATE DATABASE icinga_web;\" | mysql"
131 einfo " echo \"GRANT SELECT,UPDATE,INSERT,DELETE ON icinga_web.* TO 'icinga_web'@'localhost' IDENTIFIED BY 'xxxxxx';\" | mysql"
132 einfo " echo \"FLUSH PRIVILEGES;\" | mysql"
133 einfo
134 einfo " cat /usr/share/icinga/icinga-web/contrib/mysql.sql | mysql icinga_web"
135 einfo
136
137 ewarn
138 ewarn "If you're upgrading from a previous release, you must upgrade your database schema."
139 ewarn "You can find upgrade scripts in /usr/share/icinga/icinga-web/contrib/updates/."
140 ewarn
141 ewarn "IMPORTANT: If you are upgrading from an older version and there are other versions in between,"
142 ewarn " be advised that you need to apply those upgrade files with incremental steps!"
143 ewarn
144 ewarn "Example to upgrade a MySQL database:"
145 ewarn " cat /usr/share/icinga/icinga-web/contrib/updates/mysql_<oldversion>_to_<newversion>.sql | mysql icinga_web"
146 ewarn
147 ewarn "Don't forget to clear the config cache."
148 ewarn " /usr/share/icinga/icinga-web/bin/clearcache.sh"
149 ewarn
150
151 einfo
152 einfo "Please note that the magic_quotes_gpc setting must be disabled (in both apache and cli php.ini)."
153 einfo
154
155 if use apache2 ; then
156 einfo
157 einfo "apache config was installed into"
158 einfo "/etc/apache2/modules.d//99_icinga-web.conf"
159 einfo
160 einfo "The apache config value for \'ServerTokens\' must be set to at"
161 einfo "least \'Min\'."
162 einfo
163 else
164 einfo
165 einfo "If you are not using apache you may need to change some"
166 einfo "permissions, so that your web server can access files and logs"
167 einfo
168 fi
169 }

  ViewVC Help
Powered by ViewVC 1.1.13