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-r1.ebuild 7961 RMD160 6554d2285fc415d0e7ee62aeeea426ac4c8bf43e SHA1 b29e1634203ee9bc6f755cd922d95af6a697bd7d SHA256 cf794d39f99720efb1dc77c490c993a38bfa5029d055ad7ab096838ba574ae13
(-)/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-r1.ebuild (+277 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="Icinga - Check daemon, CGIs, docs, IDOutils"
11
HOMEPAGE="http://www.icinga.org/"
12
SRC_URI="mirror://sourceforge/icinga/${MY_P}.tar.gz"
13
14
LICENSE="GPL-2"
15
SLOT="0"
16
KEYWORDS="amd64 ~x86"
17
# USE oracle gets added when ocilib made it in the repository
18
IUSE="lighttpd perl +cgi +mysql +apache2 vim-syntax ssl postgres +api"
19
DEPEND="virtual/mailx
20
	cgi? ( 	>=media-libs/gd-1.8.3-r5[jpeg,png]
21
		lighttpd? ( www-servers/lighttpd )
22
		apache2? ( www-servers/apache )
23
	)
24
	perl? ( >=dev-lang/perl-5.6.1-r7 )
25
	postgres? (
26
		dev-db/postgresql-base 
27
		dev-db/libdbi-drivers[postgres]
28
	)
29
	mysql? (
30
		dev-db/mysql
31
		dev-db/libdbi-drivers[mysql]
32
	)
33
	ssl? ( dev-libs/openssl )
34
	vim-syntax? ( app-vim/nagios-syntax )	
35
	oracle? (
36
		>=dev-db/ocilib-3.7.0
37
	)"
38
RDEPEND="${DEPEND}"
39
40
want_apache2
41
42
S="${WORKDIR}/${MY_P}"
43
44
SELF_BINDIR=/usr/bin
45
SELF_LIBDIR=/usr/$(get_libdir)/icinga
46
SELF_SBINDIR=$SELF_LIBDIR/cgi-bin
47
SELF_DATAROOTDIR=/usr/share/icinga/htdocs
48
SELF_LOCALSTATEDIR=/var/icinga
49
SELF_SYSCONFDIR=/etc/icinga
50
SELF_LIBEXECDIR=$SELF_LIBDIR/plugins
51
52
pkg_setup() {
53
	if use oracle && ( use mysql || use postgres); then
54
	    eerror "You chose oracle and mysql or postgres"
55
	    eerror "At this stage we can only compile with lidbi or ocilib"
56
	    eerror "please select only one RDBMS"
57
	    eerror
58
	    die "Please select only one RDBMS"
59
	fi
60
61
	enewgroup icinga
62
	enewuser  icinga -1 /bin/bash $SELF_LOCALSTATEDIR/home icinga
63
}
64
65
src_prepare() {
66
	local strip="$(echo '$(MAKE) strip-post-install')"
67
	sed -i -e "s:${strip}::" {cgi,base}/Makefile.in || die "sed failed in Makefile.in"
68
	if ! use api ; then
69
	    rm -rf module/icinga-api/*
70
        fi
71
}
72
73
src_configure() {
74
	local myconf
75
76
	if use perl ; then
77
		myconf="${myconf} --enable-embedded-perl --with-perlcache"
78
	fi
79
80
	if use !apache2 && use !lighttpd ; then
81
		myconf="${myconf} --with-command-group=icinga"
82
	else
83
		if use apache2 ; then
84
			myconf="${myconf} --with-command-group=apache"
85
			myconf="${myconf} --with-httpd-conf=/etc/apache2/modules.d"
86
		elif use lighttpd ; then
87
			myconf="${myconf} --with-command-group=lighttpd"
88
		fi
89
	fi
90
91
	if use ssl; then
92
		myconf="${myconf} --enable-ssl"
93
	fi
94
95
	if use oracle; then
96
		myconf="${myconf} --enable-oracle"
97
	fi
98
99
	if use postgres; then
100
		myconf="${myconf} --enable-pgsql"
101
	fi
102
103
	if use mysql || use postgres || use oracle; then
104
		myconf="${myconf} --enable-idoutils"
105
	fi
106
107
	econf ${myconf} \
108
		--prefix=/usr \
109
		--bindir=$SELF_BINDIR \
110
		--sbindir=$SELF_SBINDIR \
111
		--datarootdir=$SELF_DATAROOTDIR \
112
		--localstatedir=$SELF_LOCALSTATEDIR \
113
		--sysconfdir=$SELF_SYSCONFDIR \
114
		--libexecdir=$SELF_LIBEXECDIR \
115
		--enable-event-broker \
116
		|| die "./configure failed"
117
}
118
119
src_compile() {
120
	emake CC=$(tc-getCC) icinga || die "make failed"
121
122
	if use mysql || use postgres || use oracle; then
123
		# Only compile the idoutils if one database is set.
124
		emake CC=$(tc-getCC) DESTDIR="${D}" idoutils || die "make failed"
125
	fi
126
	if use cgi; then
127
		# Only compile the idoutils if one database is set.
128
		emake CC=$(tc-getCC) DESTDIR="${D}" cgis html || die "make failed"
129
	fi
130
	
131
}
132
133
src_install() {
134
	dodoc Changelog INSTALLING LEGAL README UPGRADING
135
136
	emake DESTDIR="${D}" install
137
	emake DESTDIR="${D}" install-config
138
	emake DESTDIR="${D}" install-commandmode
139
		    
140
	TEMP_INSTALL_FILES=${T}/gentoo_install_files
141
	mkdir $TEMP_INSTALL_FILES
142
	cp ${FILESDIR}/* $TEMP_INSTALL_FILES/
143
144
	# substitude dirs
145
	sed -i -e "s:<BINDIR>:${SELF_BINDIR}:g" \
146
		-e "s:<SBINDIR>:$SELF_SBINDIR:g" \
147
		-e "s:<DATAROOTDIR>:$SELF_DATAROOTDIR:g" \
148
		-e "s:<LOCALSTATEDIR>:$SELF_LOCALSTATEDIR:g" \
149
		-e "s:<SYSCONFDIR>:$SELF_SYSCONFDIR:g" \
150
		${TEMP_INSTALL_FILES}/*
151
152
	newinitd "${TEMP_INSTALL_FILES}"/icinga icinga
153
	newconfd "${TEMP_INSTALL_FILES}"/conf.d icinga
154
155
	# Apache Module
156
	if use cgi ; then
157
	    emake DESTDIR="${D}" install-cgis
158
	    touch ${D}$SELF_SYSCONFDIR/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.conf" lighttpd_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
	if use mysql || use postgres || use oracle; then
174
	    emake DESTDIR="${D}" install-idoutils
175
	    newinitd "${TEMP_INSTALL_FILES}"/ido2db ido2db
176
	    insinto /usr/share/doc/${PF}/db
177
	    doins -r module/idoutils/db/*
178
	fi 
179
180
	keepdir $SELF_SYSCONFDIR
181
	keepdir $SELF_LOCALSTATEDIR
182
	keepdir $SELF_LOCALSTATEDIR/archives
183
	keepdir $SELF_LOCALSTATEDIR/rw
184
	keepdir $SELF_LOCALSTATEDIR/checkresults
185
186
	echo ${SELF_SBINDIR/-cgi-bin}
187
188
	chown -R root:root "${D}${SELF_LIBDIR}"
189
	find "${D}${SELF_LIBDIR}" -type d -print0 | xargs -0 chmod 755
190
	find "${D}${SELF_SBINDIR}" -type f -print0 | xargs -0 chmod 755
191
192
193
	for dir in "$SELF_SYSCONFDIR" "$SELF_LOCALSTATEDIR" ; do
194
		chown -R icinga:icinga "${D}/${dir}" || die "Failed chown of ${D}/${dir}"
195
	done
196
197
	if use !apache2 && use !lighttpd; then
198
		chown -R icinga:icinga "${D}$SELF_LOCALSTATEDIR"/rw || die "Failed chown of ${D}$SELF_LOCALSTATEDIR/rw"
199
	else
200
		if use apache2 ; then
201
			chown -R icinga:apache "${D}$SELF_LOCALSTATEDIR"/rw || die "Failed chown of ${D}$SELF_LOCALSTATEDIR/rw"
202
		elif use lighttpd ; then
203
			chown -R icinga:lighttpd "${D}$SELF_LOCALSTATEDIR"/rw || die "Failed chown of ${D}$SELF_LOCALSTATEDIR/rw"
204
		fi
205
	fi
206
207
	chmod ug+s "${D}$SELF_LOCALSTATEDIR"/rw || die "Failed chmod of ${D}$SELF_LOCALSTATEDIR/rw"
208
	chmod 0755 "${D}$SELF_SYSCONFDIR" || die "Failed chmod of ${D}$SELF_SYSCONFDIR"
209
}
210
211
pkg_postinst() {
212
	einfo "Fixing permissions"
213
	chown icinga:icinga "${ROOT}$SELF_LOCALSTATEDIR"
214
215
	elog "If you want icinga to start at boot time"
216
	elog "remember to execute:"
217
	elog "  rc-update add icinga default"
218
	elog
219
220
	if use mysql || use postgres || use oracle; then
221
	    elog "remember to execute:"
222
	    elog "  rc-update add ido2db default"
223
	    elog "to activate idoutils"
224
	    elog
225
	    elog "have a look in $SELF_SYSCONFDIR"
226
	    elog "  cp idomod.cfg-sample idomod.cfg"
227
	    elog "  cp ido2db.cfg-sample ido2db.cfg"
228
	    elog
229
	    elog "in /usr/share/doc/${PF}/db you can find the DB schemes to initialize the db"
230
	    elog
231
	    elog "also don't forget to activate the broker_module in incinga.cfg"
232
	    elog
233
	    elog "helpful should be ->http://docs.icinga.org/latest/en/quickstart-idoutils.html"
234
	    elog
235
	fi
236
237
	if use cgi ; then
238
		elog "This does not include cgis that are perl-dependent"
239
		elog "Note that the user your webserver is running at needs"
240
		elog "read-access to $SELF_SYSCONFDIR."
241
		elog
242
243
		if use apache2 || use lighttpd ; then
244
			elog "There are several possible solutions to accomplish this,"
245
			elog "choose the one you are most comfortable with:"
246
			elog
247
			if use apache2 ; then
248
				elog "	usermod -G icinga apache"
249
				elog "or"
250
				elog "	chown icinga:apache $SELF_SYSCONFDIR"
251
			elif use lighttpd ; then
252
				elog "  usermod -G icinga lighttpd "
253
				elog "or"
254
				elog "  chown icinga:lighttpd $SELF_SYSCONFDIR"
255
			fi
256
			elog
257
			elog "That will make icinga's web front end visable via"
258
			elog "http://localhost/icinga/"
259
			elog
260
		else
261
			elog "IMPORTANT: Do not forget to add the user your webserver"
262
			elog "is running as to the icinga group!"
263
		fi
264
265
	else
266
		elog "Please note that you have installed Icinga without web interface."
267
		elog "Please don't file any bugs about having no web interface when you do this."
268
		elog "Thank you!"
269
	fi
270
271
	elog
272
	elog "If your kernel has /proc protection, icinga"
273
	elog "will not be happy as it relies on accessing the proc"
274
	elog "filesystem. You can fix this by adding icinga into"
275
	elog "the group wheel, but this is not recomended."
276
	elog
277
}

Return to bug 271339