Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 271339 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/local/portage/empty/icinga/Manifest (+1 lines)
Line 0 Link Here
1
EBUILD icinga-1.0.2.ebuild 1710 RMD160 f7af3482e7740a8394c720a652234552d42ae50f SHA1 ce2d2fea1a54b152ff30323a3c0dc86f60e4e7a1 SHA256 a9ae5b1cdab9056ab600dd6cadd32f8bf91e26eb0a0ba5d359e066183dc1175e
(-)/usr/local/portage/empty/icinga/icinga-1.0.2.ebuild (+53 lines)
Line 0 Link Here
1
# Copyright 1999-2010 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: $
4
5
inherit multilib
6
7
DESCRIPTION="The Icinga metapackage - merge this to pull install all of the icinga packages"
8
HOMEPAGE="http://www.icinga.org"
9
10
LICENSE="GPL-2"
11
SLOT="0"
12
KEYWORDS="alpha amd64 ~ppc ~ppc64 ~sparc x86"
13
IUSE=""
14
15
RDEPEND="~net-analyzer/icinga-core-${PV}
16
	>=net-analyzer/nagios-plugins-1.4.13-r1
17
	>=net-analyzer/nagios-imagepack-1.0-r100"
18
19
pkg_setup() {
20
	# Avoid upgrading from Nagios <3 as the directory structure has changed
21
	if has_version '<net-analyzer/nagios-3.0' ; then
22
		if [[ "${FORCE_UPGRADE}" ]] ; then
23
			echo
24
			ewarn "you are upgrading from an incompatible version and have"
25
			ewarn "FORCE_UPGRADE set, will build this package while Nagios is running."
26
			echo
27
		else
28
			echo
29
			eerror "You are upgrading from an incompatible version."
30
			eerror "Please be advised that installation paths have changed to a more FHS"
31
			eerror "compliant structure and you won't be able to easily upgrade to"
32
			eerror "Icinga therefore. You will have to change your configuration"
33
			eerror "to reflect this change, for example Nagios plugins are now installed"
34
			eerror "into /usr/$(get_libdir)/icinga/plugins/ instead of /usr/icinga/libexec."
35
			echo
36
			eerror "If you want to upgrade now, emerge icinga with:"
37
			eerror "    FORCE_UPGRADE=1 emerge icinga"
38
			die "Upgrading from an incompatible version!"
39
			echo
40
		fi
41
	fi
42
}
43
44
pkg_postrm() {
45
	elog "Note: this is a META ebuild for ${P}."
46
	elog "to remove it completely or before re-emerging"
47
	elog "either use 'depclean', or remove/re-emerge these packages:"
48
	elog
49
	for dep in ${RDEPEND}; do
50
		elog "     ${dep}"
51
	done
52
	echo
53
}
(-)/usr/local/portage/empty/icinga-core/Manifest (+6 lines)
Line 0 Link Here
1
AUX conf.d 311 RMD160 ced41a73c2723be681ff14c44a1b955a0576991e SHA1 8ba6782cf214cccdbce7900c335541e37058c3ab SHA256 22b4424364858a49eeefc1cd0cbf0ad98e7f3f36491dd63d3a18af491efdbdf5
2
AUX icinga 1230 RMD160 cad3f9380d9bb493bafbfa565c5c0e052aebed41 SHA1 92fb2db7f08ecd109e501140660bc1f79bd119e6 SHA256 3366f2fad0b071e43129f4bb17d649281bcdccdd218498bd76b1f5a7ebfbb4c8
3
AUX ido2db 608 RMD160 29a0bd31c3e8454d18ebbd582007373fb792b1b8 SHA1 2a4256843c184ed4d21a8d71903136519d09d336 SHA256 26c1a60df41fdba7c0bbd68f224fc1a1bbd7714e00e948775d1fb2d336cf63aa
4
AUX lighttpd_icinga-r1.conf 457 RMD160 dd93027b56420cd4416661f545addb4b1e6e1247 SHA1 ac7d243ca659a9086b15940081ed58c1b2d395f3 SHA256 c6fb30df29fd10127c98ad53ecae2d831158103cde6a48fb3253f709d25f9b00
5
DIST icinga-1.0.2.tar.gz 8446607 RMD160 782ebbad8ce4e88a3e214ba12802fe7d968ce851 SHA1 d4325b87369d9bbfc1d52da071e8cc24bdc3d2dd SHA256 3e827712cef7afd074048e5bf48140744c2bdd9607235997e947d1eb8c7665c4
6
EBUILD icinga-core-1.0.2.ebuild 7301 RMD160 aacdb0b9b927d6d245e9b0c9e0ece96d2c695cb9 SHA1 d61e034a8885aa2e6775dcfeb87cc9c5ad9c4ee2 SHA256 8dfcce1105bcaa7ddddad23bae43ded79ae7953a0c7a70ef63244276edd5425e
(-)/usr/local/portage/empty/icinga-core/files/conf.d (+10 lines)
Line 0 Link Here
1
# Copyright 1999-2010 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2         
3
# $Header: $
4
5
# Distributed monitoring users will want to configure here the ip/hostname of the central server.
6
# It will be used by submit_check_result_via_nsca.
7
ICINGA_NSCA_HOST="localhost"
8
9
10
(-)/usr/local/portage/empty/icinga-core/files/icinga (+55 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2004 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/icinga-core/files/icinga3,v 1.1 2008/04/27 18:41:25 dertobi123 Exp $
5
6
opts="${opts} reload checkconfig"
7
8
depend() {
9
	need net
10
	after npcd
11
	use dns logger firewall
12
}
13
14
reload() {
15
	checkconfig || return 1
16
	ebegin "Reloading configuration"
17
	killall -HUP <BINDIR>/icinga &>/dev/null
18
	eend $?
19
}
20
21
22
checkconfig() {
23
	# Silent Check
24
	<BINDIR>/icinga -v <SYSCONFDIR>/icinga.cfg &>/dev/null && return 0
25
26
	# Now we know there's problem - run again and display errors
27
	<BINDIR>/icinga -v <SYSCONFDIR>/icinga.cfg
28
	eend $? "Configuration Error. Please fix your configfile"
29
}
30
31
start() {
32
	checkconfig || return 1
33
	ebegin "Starting icinga"
34
	rm -f <LOCALSTATEDIR>/rw/icinga.cmd
35
	start-stop-daemon --quiet --start --startas <BINDIR>/icinga \
36
		-e HOME="<HOMEDIR>" --pidfile <LOCALSTATEDIR>/icinga.lock \
37
		-- -d <SYSCONFDIR>/icinga.cfg
38
	eend $?
39
}
40
41
stop() {
42
	ebegin "Stopping icinga"
43
	start-stop-daemon --quiet --stop --pidfile <LOCALSTATEDIR>/icinga.lock
44
	eend $?
45
}
46
47
svc_restart() {
48
	checkconfig || return 1
49
	ebegin "Restarting icinga"
50
	svc_stop
51
	sleep 1
52
	svc_start
53
	eend $?
54
}
55
(-)/usr/local/portage/empty/icinga-core/files/ido2db (+23 lines)
Line 0 Link Here
1
#!/sbin/runscript
2
# Copyright 1999-2007 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/ndoutils/files/ndo2db.init-nagios3,v 1.2 2008/07/19 15:08:25 dertobi123 Exp $
5
6
depends() {
7
	before icinga
8
}
9
10
start() {
11
	ebegin "Starting ido2db"
12
	start-stop-daemon --start --quiet --exec <BINDIR>/ido2db \
13
	-- -c <SYSCONFDIR>/ido2db.cfg
14
	eend $?
15
}
16
17
stop() {
18
	ebegin "Stopping ido2db"
19
	start-stop-daemon --stop --quiet --exec <BINDIR>/ido2db
20
	return=$?
21
	[ -f <LOCALSTATEDIR>/ido.sock ] && rm -rf <LOCALSTATEDIR>/ido.sock
22
	eend $return
23
}
(-)/usr/local/portage/empty/icinga-core/files/lighttpd_icinga-r1.conf (+24 lines)
Line 0 Link Here
1
server.modules += ("mod_cgi")
2
server.modules += ("mod_auth")
3
server.modules += ("mod_alias")
4
5
auth.require += ( "/icinga" =>
6
  (
7
    "method"  => "digest",
8
    "realm"   => "icinga",
9
    "require" => "valid-user"
10
  )
11
)
12
13
$HTTP["url"] =~ "^/icinga/cgi-bin/" {
14
  dir-listing.activate = "disable"
15
  cgi.assign = (
16
    ".pl"  => "/usr/bin/perl",
17
    ".cgi" => ""
18
  )
19
}
20
21
alias.url += (
22
  "/icinga/cgi-bin" => "<SBINDIR>",
23
  "/icinga"         => "<DATAROOTDIR>"
24
)
(-)/usr/local/portage/empty/icinga-core/icinga-core-1.0.2.ebuild (+258 lines)
Line 0 Link Here
1
# Copyright 1999-2010 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: $
4
5
EAPI="2"
6
7
inherit eutils depend.apache toolchain-funcs
8
9
MY_P=${PN/-core}-${PV}
10
DESCRIPTION="A monitoring system based on Nagios"
11
HOMEPAGE="http://www.icinga.org/"
12
#SRC_URI="mirror://sourceforge/${PN/-core}/${MY_P}.tar.gz"
13
SRC_URI="http://ovh.dl.sourceforge.net/project/icinga/icinga/${PV}/icinga-${PV}.tar.gz"
14
15
LICENSE="GPL-2"
16
SLOT="0"
17
KEYWORDS="amd64 x86"
18
# USE oracle gets added when ocilib made it in the repository
19
IUSE="lighttpd perl cgi mysql apache2 vim-syntax ssl postgres"
20
DEPEND="virtual/mailx
21
	cgi? ( 	>=media-libs/gd-1.8.3-r5[jpeg,png]
22
		lighttpd? ( www-servers/lighttpd )
23
		apache2? ( www-servers/apache )
24
	)
25
	perl? ( >=dev-lang/perl-5.6.1-r7 )
26
	postgres? ( 
27
		dev-db/postgresql-base 
28
		dev-db/libdbi-drivers[postgres]
29
	)
30
	mysql? ( 
31
		dev-db/mysql
32
		dev-db/libdbi-drivers[mysql]
33
	)
34
	ssl? ( dev-libs/openssl )
35
	vim-syntax? ( app-vim/nagios-syntax )
36
	"
37
#	oracle? ( 
38
#		>=dev-db/ocilib-3.7.0
39
#	)
40
41
RDEPEND="${DEPEND}"
42
43
want_apache2
44
45
S="${WORKDIR}/${MY_P}"
46
47
SELF_BINDIR=/usr/bin
48
SELF_SBINDIR=/usr/$(get_libdir)/icinga/cgi-bin
49
SELF_DATAROOTDIR=/usr/share/icinga/htdocs
50
SELF_LOCALSTATEDIR=/var/icinga
51
SELF_SYSCONFDIR=/etc/icinga
52
SELF_LIBEXECDIR=/usr/$(get_libdir)/icinga/plugins
53
54
pkg_setup() {
55
	depend.apache_pkg_setup
56
57
	enewgroup icinga
58
	enewuser icinga -1 /bin/bash /var/icinga/home icinga
59
}
60
61
src_prepare() {
62
	local strip="$(echo '$(MAKE) strip-post-install')"
63
	sed -i -e "s:${strip}::" {cgi,base}/Makefile.in || die "sed failed in Makefile.in"
64
}
65
66
src_configure() {
67
	local myconf
68
69
	if use perl ; then
70
		myconf="${myconf} --enable-embedded-perl --with-perlcache"
71
	fi
72
73
	if use !apache2 && use !lighttpd ; then
74
		myconf="${myconf} --with-command-group=icinga"
75
	else
76
		if use apache2 ; then
77
			myconf="${myconf} --with-command-group=apache"
78
			myconf="${myconf} --with-httpd-conf=/etc/apache2/modules.d"
79
		elif use lighttpd ; then
80
			myconf="${myconf} --with-command-group=lighttpd"
81
		fi
82
	fi
83
84
	if use ssl; then
85
		myconf="${myconf} --enable-ssl"
86
	fi
87
88
	if use oracle; then
89
		myconf="${myconf} --enable-oracle"
90
	fi
91
92
	if use postgres; then
93
		myconf="${myconf} --enable-pgsql"
94
	fi
95
96
	if use mysql || use postgres || use oracle; then
97
		myconf="${myconf} --enable-idoutils"
98
	fi
99
100
	econf ${myconf} \
101
		--prefix=/usr \
102
		--bindir=$SELF_BINDIR \
103
		--sbindir=$SELF_SBINDIR \
104
		--datarootdir=$SELF_DATAROOTDIR \
105
		--localstatedir=$SELF_LOCALSTATEDIR \
106
		--sysconfdir=$SELF_SYSCONFDIR \
107
		--libexecdir=$SELF_LIBEXECDIR \
108
		--enable-event-broker \
109
		|| die "./configure failed"
110
}
111
112
src_compile() {
113
	emake CC=$(tc-getCC) icinga || die "make failed"
114
115
	if use mysql || use postgres || use oracle; then
116
		# Only compile the idoutils if one database is set.
117
		emake CC=$(tc-getCC) DESTDIR="${D}" idoutils || die "make failed"
118
	fi
119
	if use cgi; then
120
		# Only compile the idoutils if one database is set.
121
		emake CC=$(tc-getCC) DESTDIR="${D}" cgis html || die "make failed"
122
	fi
123
	
124
}
125
126
src_install() {
127
	local DBMODEL
128
	
129
	dodoc Changelog INSTALLING LEGAL README UPGRADING
130
131
	emake DESTDIR="${D}" install
132
	emake DESTDIR="${D}" install-config
133
	emake DESTDIR="${D}" install-commandmode
134
		    
135
	TEMP_INSTALL_FILES=${T}/gentoo_install_files
136
	mkdir $TEMP_INSTALL_FILES
137
	cp ${FILESDIR}/* $TEMP_INSTALL_FILES/
138
139
	# substitude dirs
140
	sed -i -e "s:<BINDIR>:${SELF_BINDIR}:g" \
141
		-e "s:<SBINDIR>:$SELF_SBINDIR:g" \
142
		-e "s:<DATAROOTDIR>:$SELF_DATAROOTDIR:g" \
143
		-e "s:<LOCALSTATEDIR>:$SELF_LOCALSTATEDIR:g" \
144
		-e "s:<SYSCONFDIR>:$SELF_SYSCONFDIR:g" \
145
		${TEMP_INSTALL_FILES}/*
146
147
	newinitd "${TEMP_INSTALL_FILES}"/icinga icinga
148
	newconfd "${TEMP_INSTALL_FILES}"/conf.d icinga
149
150
	if use mysql || use postgres || use oracle; then
151
	    emake DESTDIR="${D}" install-idoutils
152
	    newinitd "${TEMP_INSTALL_FILES}"/ido2db ido2db
153
	fi 
154
155
	# Apache Module
156
	if use cgi ; then
157
	    emake DESTDIR="${D}" install-cgis
158
	    touch ${D}/etc/icinga/htpasswd.users
159
		if use apache2 ; then
160
			sed -i -e 's|$(HTTPD_CONF)/\(icinga.conf\)$|$(HTTPD_CONF)/99_\1|' Makefile 
161
			emake DESTDIR="${D}" install-webconf
162
	    elif use lighttpd ; then
163
			insinto /etc/lighttpd
164
			newins "${FILESDIR}/lighttpd_icinga-r1.conf" icinga.conf
165
		else
166
			ewarn "${CATEGORY}/${PF} only supports Apache-2.x or Lighttpd webserver"
167
			ewarn "out-of-the-box. Since you are not using one of them, you"
168
			ewarn "have to configure your webserver accordingly yourself."
169
		fi
170
171
	fi
172
173
	for dir in etc/icinga var/icinga ; do
174
		chown -R icinga:icinga "${D}/${dir}" || die "Failed chown of ${D}/${dir}"
175
	done
176
177
	chown -R root:root "${D}"/usr/$(get_libdir)/icinga
178
	find "${D}"/usr/$(get_libdir)/icinga -type d -print0 | xargs -0 chmod 755
179
	find "${D}"/usr/$(get_libdir)/icinga/cgi-bin -type f -print0 | xargs -0 chmod 755
180
181
	keepdir /etc/icinga
182
	keepdir /var/icinga
183
	keepdir /var/icinga/archives
184
	keepdir /var/icinga/rw
185
	keepdir /var/icinga/spool/checkresults
186
187
	if use !apache2 && use !lighttpd; then
188
		chown -R icinga:icinga "${D}"/var/icinga/rw || die "Failed chown of ${D}/var/icinga/rw"
189
	else
190
		if use apache2 ; then
191
			chown -R icinga:apache "${D}"/var/icinga/rw || die "Failed chown of ${D}/var/icinga/rw"
192
		elif use lighttpd ; then
193
			chown -R icinga:lighttpd "${D}"/var/icinga/rw || die "Failed chown of ${D}/var/icinga/rw"
194
		fi
195
	fi
196
197
	chmod ug+s "${D}"/var/icinga/rw || die "Failed chmod of ${D}/var/icinga/rw"
198
	chmod 0755 "${D}"/etc/icinga || die "Failed chmod of ${D}/etc/icinga"
199
}
200
201
pkg_postinst() {
202
	einfo "Fixing permissions"
203
	chown icinga:icinga "${ROOT}"var/icinga
204
205
206
	elog "If you want icinga to start at boot time"
207
	elog "remember to execute:"
208
	elog "  rc-update add icinga default"
209
	elog
210
211
	if use mysql || use postgres || use oracle; then
212
	    elog "remember to execute:"
213
	    elog "  rc-update add ido2db default"
214
	    elog "to activate idoutils"
215
	    elog
216
	fi
217
218
	if use cgi ; then
219
		elog "This does not include cgis that are perl-dependent"
220
		elog "Note that the user your webserver is running at needs"
221
		elog "read-access to /etc/icinga."
222
		elog
223
224
		if use apache2 || use lighttpd ; then
225
			elog "There are several possible solutions to accomplish this,"
226
			elog "choose the one you are most comfortable with:"
227
			elog
228
			if use apache2 ; then
229
				elog "	usermod -G icinga apache"
230
				elog "or"
231
				elog "	chown icinga:apache /etc/icinga"
232
			elif use lighttpd ; then
233
				elog "  usermod -G icinga lighttpd "
234
				elog "or"
235
				elog "  chown icinga:lighttpd /etc/icinga"
236
			fi
237
			elog
238
			elog "That will make icinga's web front end visable via"
239
			elog "http://localhost/icinga/"
240
			elog
241
		else
242
			elog "IMPORTANT: Do not forget to add the user your webserver"
243
			elog "is running as to the icinga group!"
244
		fi
245
246
	else
247
		elog "Please note that you have installed Icinga without web interface."
248
		elog "Please don't file any bugs about having no web interface when you do this."
249
		elog "Thank you!"
250
	fi
251
252
	elog
253
	elog "If your kernel has /proc protection, icinga"
254
	elog "will not be happy as it relies on accessing the proc"
255
	elog "filesystem. You can fix this by adding icinga into"
256
	elog "the group wheel, but this is not recomended."
257
	elog
258
}

Return to bug 271339