Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 361723
Collapse All | Expand All

(-)app-admin/collectd/collectd-4.10.3.ebuild (-3 / +23 lines)
Lines 3-8 Link Here
3
# $Header: /var/cvsroot/gentoo-x86/app-admin/collectd/collectd-4.10.3.ebuild,v 1.2 2011/03/30 20:30:37 dilfridge Exp $
3
# $Header: /var/cvsroot/gentoo-x86/app-admin/collectd/collectd-4.10.3.ebuild,v 1.2 2011/03/30 20:30:37 dilfridge Exp $
4
4
5
EAPI=3
5
EAPI=3
6
GENTOO_DEPEND_ON_PERL=no # we depend on it only if use=perl
6
7
7
inherit eutils base linux-info perl-app autotools
8
inherit eutils base linux-info perl-app autotools
8
9
Lines 12-19 SRC_URI="${HOMEPAGE}/files/${P}.tar.bz2" Link Here
12
13
13
LICENSE="GPL-2"
14
LICENSE="GPL-2"
14
SLOT="0"
15
SLOT="0"
15
KEYWORDS="~amd64 ~x86"
16
KEYWORDS="~arm ~sparc ~amd64 ~x86"
16
IUSE="contrib debug kernel_linux kernel_FreeBSD kernel_Darwin"
17
IUSE="static-libs contrib debug kernel_linux kernel_FreeBSD kernel_Darwin perl"
17
18
18
# The plugin lists have to follow here since they extend IUSE
19
# The plugin lists have to follow here since they extend IUSE
19
20
Lines 71-76 COMMON_DEPEND=" Link Here
71
	collectd_plugins_onewire?		( sys-fs/owfs )
72
	collectd_plugins_onewire?		( sys-fs/owfs )
72
	collectd_plugins_oracle?		( >=dev-db/oracle-instantclient-basic-11.2.0.1.0 )
73
	collectd_plugins_oracle?		( >=dev-db/oracle-instantclient-basic-11.2.0.1.0 )
73
	collectd_plugins_perl?			( dev-lang/perl[ithreads] ( || ( sys-devel/libperl[ithreads] >=sys-devel/libperl-5.10 ) ) )
74
	collectd_plugins_perl?			( dev-lang/perl[ithreads] ( || ( sys-devel/libperl[ithreads] >=sys-devel/libperl-5.10 ) ) )
75
	perl?							( dev-lang/perl[ithreads] ( || ( sys-devel/libperl[ithreads] >=sys-devel/libperl-5.10 ) ) )
74
	collectd_plugins_ping?			( net-libs/liboping )
76
	collectd_plugins_ping?			( net-libs/liboping )
75
	collectd_plugins_postgresql?		( >=dev-db/postgresql-base-8.2 )
77
	collectd_plugins_postgresql?		( >=dev-db/postgresql-base-8.2 )
76
	collectd_plugins_python?		( =dev-lang/python-2* )
78
	collectd_plugins_python?		( =dev-lang/python-2* )
Lines 102-107 RDEPEND="${COMMON_DEPEND} Link Here
102
PATCHES=(
104
PATCHES=(
103
	"${FILESDIR}/${PN}-4.10.1"-{libperl,libiptc,noowniptc}.patch
105
	"${FILESDIR}/${PN}-4.10.1"-{libperl,libiptc,noowniptc}.patch
104
	"${FILESDIR}/${PN}-4.10.2"-{libocci,libnotify-0.7,nohal}.patch
106
	"${FILESDIR}/${PN}-4.10.2"-{libocci,libnotify-0.7,nohal}.patch
107
	"${FILESDIR}/${PN}-4.10.2"-bind-time-fix.patch
105
	)
108
	)
106
109
107
# @FUNCTION: collectd_plugin_kernel_linux
110
# @FUNCTION: collectd_plugin_kernel_linux
Lines 184-189 pkg_setup() { Link Here
184
	fi
187
	fi
185
188
186
	enewgroup collectd
189
	enewgroup collectd
190
	enewuser collectd 85 -1 /var/lib/collectd collectd
187
}
191
}
188
192
189
src_prepare() {
193
src_prepare() {
Lines 250-255 src_configure() { Link Here
250
				fi
254
				fi
251
				myconf+=" --disable-${plugin}"
255
				myconf+=" --disable-${plugin}"
252
			fi
256
			fi
257
		elif [[ "${plugin}" = "collectd_plugins_perl" ]]; then
258
			if use collectd_plugins_perl && ! use perl; then
259
				ewarn "Perl plugin disabled as perl bindings disabled by -perl use flag"
260
				myconf+= --disable-perl
261
			else
262
				myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
263
			fi
253
		else
264
		else
254
			myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
265
			myconf+=" $(use_enable collectd_plugins_${plugin} ${plugin})"
255
		fi
266
		fi
Lines 265-272 src_configure() { Link Here
265
		myconf+=" --with-libiptc=no"
276
		myconf+=" --with-libiptc=no"
266
	fi
277
	fi
267
278
279
	myconf+=" $(use_with perl perl-bindings)"
280
268
	# Finally, run econf.
281
	# Finally, run econf.
269
	KERNEL_DIR="${KERNEL_DIR}" econf --config-cache --without-included-ltdl --disable-static --localstatedir=/var ${myconf}
282
	KERNEL_DIR="${KERNEL_DIR}" econf --config-cache --without-included-ltdl $(use_enable static-libs static) --localstatedir=/var ${myconf}
270
}
283
}
271
284
272
src_install() {
285
src_install() {
Lines 275-280 src_install() { Link Here
275
	fixlocalpod
288
	fixlocalpod
276
289
277
	find "${D}/usr/" -name "*.la" -exec rm -f {} +
290
	find "${D}/usr/" -name "*.la" -exec rm -f {} +
291
	rm -f ${D}/usr/$(get_libdir)/collectd/*.a
292
	use collectd_plugins_ping && setcap cap_net_raw+ep ${D}/usr/sbin/collectd
293
	chown root:collectd ${D}/etc/collectd.conf
294
	chmod u=rw,g=r,o= ${D}/etc/collectd.conf
278
295
279
	dodoc AUTHORS ChangeLog NEWS README TODO || die
296
	dodoc AUTHORS ChangeLog NEWS README TODO || die
280
297
Lines 284-289 src_install() { Link Here
284
	fi
301
	fi
285
302
286
	keepdir /var/lib/${PN} || die
303
	keepdir /var/lib/${PN} || die
304
	chown collectd:collectd ${D}/var/lib/${PN}
287
305
288
	newinitd "${FILESDIR}/${PN}.initd" ${PN} || die
306
	newinitd "${FILESDIR}/${PN}.initd" ${PN} || die
289
	newconfd "${FILESDIR}/${PN}.confd" ${PN} || die
307
	newconfd "${FILESDIR}/${PN}.confd" ${PN} || die
Lines 291-296 src_install() { Link Here
291
	insinto /etc/logrotate.d
309
	insinto /etc/logrotate.d
292
	newins "${FILESDIR}/logrotate" collectd || die
310
	newins "${FILESDIR}/logrotate" collectd || die
293
311
312
	sed -i -e 's:^#PIDFile     "/var/run/collectd.pid":PIDFile     "/var/run/collectd/collectd.pid":' "${D}"/etc/collectd.conf || die
313
	sed -i -e 's:^#	SocketFile "/var/run/collectd-unixsock":#	SocketFile "/var/run/collectd/collectd-unixsock":' "${D}"/etc/collectd.conf || die
294
	sed -i -e 's:^.*LoadPlugin perl$:# The new, correct way to load the perl plugin -- \n# <LoadPlugin perl>\n#   Globals true\n# </LoadPlugin>:' "${D}"/etc/collectd.conf || die
314
	sed -i -e 's:^.*LoadPlugin perl$:# The new, correct way to load the perl plugin -- \n# <LoadPlugin perl>\n#   Globals true\n# </LoadPlugin>:' "${D}"/etc/collectd.conf || die
295
	sed -i -e 's:^.*LoadPlugin python$:# The new, correct way to load the python plugin -- \n# <LoadPlugin python>\n#   Globals true\n# </LoadPlugin>:' "${D}"/etc/collectd.conf || die
315
	sed -i -e 's:^.*LoadPlugin python$:# The new, correct way to load the python plugin -- \n# <LoadPlugin python>\n#   Globals true\n# </LoadPlugin>:' "${D}"/etc/collectd.conf || die
296
}
316
}
(-)app-admin/collectd/files/collectd.initd (-2 / +4 lines)
Lines 3-11 Link Here
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /var/cvsroot/gentoo-x86/app-admin/collectd/files/collectd.initd,v 1.3 2010/12/16 17:33:45 dilfridge Exp $
4
# $Header: /var/cvsroot/gentoo-x86/app-admin/collectd/files/collectd.initd,v 1.3 2010/12/16 17:33:45 dilfridge Exp $
5
5
6
: ${COLLECTD_PIDFILE:='/var/run/collectd.pid'}
6
: ${COLLECTD_PIDFILE:='/var/run/collectd/collectd.pid'}
7
: ${COLLECTD_CFGFILE:='/etc/collectd.conf'}
7
: ${COLLECTD_CFGFILE:='/etc/collectd.conf'}
8
: ${COLLECTD_NICELVL:='5'}
8
: ${COLLECTD_NICELVL:='5'}
9
: ${COLLECTD_USER:='collectd'}
9
10
10
opts="${opts} configtest"
11
opts="${opts} configtest"
11
12
Lines 42-50 checkconfig() { Link Here
42
43
43
start() {
44
start() {
44
	checkconfig || return 1
45
	checkconfig || return 1
46
	[ -d /var/run/collectd ] || mkdir /var/run/collectd && chown collectd:collectd /var/run/collectd
45
47
46
	ebegin "Starting collectd"
48
	ebegin "Starting collectd"
47
	start-stop-daemon --start \
49
	start-stop-daemon --start -c "${COLLECTD_USER}:collectd" \
48
		--nicelevel "${COLLECTD_NICELVL}" --exec /usr/sbin/collectd -- \
50
		--nicelevel "${COLLECTD_NICELVL}" --exec /usr/sbin/collectd -- \
49
			-P "${COLLECTD_PIDFILE}" -C "${COLLECTD_CFGFILE}"
51
			-P "${COLLECTD_PIDFILE}" -C "${COLLECTD_CFGFILE}"
50
	eend $? "Failed to start collectd"
52
	eend $? "Failed to start collectd"
(-)app-admin/collectd/files/collectd.confd (-1 / +7 lines)
Lines 13-16 Link Here
13
13
14
# File used to store the PID file. Usually you won't need to touch it.
14
# File used to store the PID file. Usually you won't need to touch it.
15
#
15
#
16
#COLLECTD_PIDFILE='/var/run/collectd.pid'
16
#COLLECTD_PIDFILE='/var/run/collectd/collectd.pid'
17
18
# User to run collectd as (default is collectd, change to root or give
19
# collectd user appropriate if you use on of the plugins that require
20
# more privileges like ping or iptables plugins)
21
#
22
#COLLECTD_USER='collectd'

Return to bug 361723