# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-apps/lm_sensors/lm_sensors-2.10.4.ebuild,v 1.6 2008/01/17 20:43:49 fmccor Exp $ inherit eutils linux-info toolchain-funcs multilib DESCRIPTION="Hardware Monitoring user-space utilities" HOMEPAGE="http://www.lm-sensors.org/" SRC_URI="http://dl.lm-sensors.org/lm-sensors/releases/${P}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="sensord" COMMON="sensord? ( net-analyzer/rrdtool )" DEPEND="${COMMON} sys-apps/sed >=virtual/linux-sources-2.6.5" RDEPEND="${COMMON} dev-lang/perl >=x11-misc/read-edid-1.4.1-r1 virtual/logger" pkg_setup() { linux-info_pkg_setup if kernel_is lt 2 6 5; then die "You need a kernel newer than 2.6.5 to use ${P}." fi if ! (linux_chkconfig_present HWMON); then eerror "${P} requires CONFIG_HWMON to be enabled." eerror "Set" eerror "CONFIG_HWMON" eerror "in /usr/src/linux/.config or" eerror "Device Drivers --->" eerror " Hardware Monitoring support" eerror "in menuconfig." die "CONFIG_HWMON disabled." fi if ! (linux_chkconfig_present I2C); then ewarn "You have CONFIG_I2C disabled. Most sensors won't work" ewarn "Without that, to enable it, set" ewarn "CONFIG_I2C" ewarn "in /usr/src/linux/.config or" ewarn "Device Drivers --->" ewarn " I2C support --->" ewarn "in menuconfig." fi if ! (linux_chkconfig_present I2C_CHARDEV); then ewarn "You have CONFIG_I2C_CHARDEV disabled. sensors-detect" ewarn "will not work, to fix this set" ewarn "CONFIG_I2C_CHARDEV" ewarn "in /usr/src/linux/.config or" ewarn "Device Drivers --->" ewarn " I2C support --->" ewarn " I2C device interface" ewarn "in menuconfig." fi } src_unpack() { unpack ${A} cd "${S}" epatch "${FILESDIR}"/${PN}-3.0.1-sensors-detect-gentoo.patch if use sensord; then sed -i -e 's:^# \(PROG_EXTRA\):\1:' "${S}"/Makefile fi } src_compile() { einfo einfo "You may safely ignore any errors from compilation" einfo "that contain \"No such file or directory\" references." einfo emake CC=$(tc-getCC) LINUX=${KV_DIR} I2C_HEADERS=${KV_DIR}/include user \ || die "emake user failed" } src_install() { emake DESTDIR="${D}" PREFIX=/usr MANDIR=/usr/share/man LIBDIR=/usr/$(get_libdir) \ KERNELINCLUDEFILES="" user_install || die "emake user_install failed" newinitd "${FILESDIR}"/lm_sensors3-init.d lm_sensors newinitd "${FILESDIR}"/fancontrol-init.d fancontrol if use sensord; then newconfd "${FILESDIR}"/sensord-conf.d sensord newinitd "${FILESDIR}"/sensord3-init.d sensord fi dodoc CHANGES CONTRIBUTORS INSTALL README dodoc doc/{donations,fan*,FAQ,progs,temperature-sensors,vid} dohtml doc/lm_sensors-FAQ.html docinto chips dodoc doc/chips/* docinto developers dodoc doc/developers/* } pkg_postinst() { elog elog "Please run \`/usr/sbin/sensors-detect' in order to setup" elog "/etc/conf.d/lm_sensors." elog elog "/etc/conf.d/lm_sensors is vital to the init-script." elog "Please make sure you also add lm_sensors to the desired" elog "runlevel. Otherwise your I2C modules won't get loaded" elog "on the next startup." elog elog "You will also need to run the above command if you're upgrading from" elog "<=${PN}-2.9.0, as the needed entries in /etc/conf.d/lm_sensors has" elog "changed." elog elog "Be warned, the probing of hardware in your system performed by" elog "sensors-detect could freeze your system. Also make sure you read" elog "the documentation before running lm_sensors on IBM ThinkPads." elog elog "Please refer to the lm_sensors documentation for more information." elog "(http://www.lm-sensors.org/wiki/Documentation)" elog }