summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2010-06-27 18:48:45 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2010-06-27 18:48:45 +0000
commitb6b882b8166c7b1b87ea39513341c83de4c2d748 (patch)
tree061fde135982ee6b1ec79cd9f1e4284c95492bdf /sys-apps/lm_sensors
parentx86 stable, bug 322791 (diff)
downloadgentoo-2-b6b882b8166c7b1b87ea39513341c83de4c2d748.tar.gz
gentoo-2-b6b882b8166c7b1b87ea39513341c83de4c2d748.tar.bz2
gentoo-2-b6b882b8166c7b1b87ea39513341c83de4c2d748.zip
Fix support of multiple chips wrt #325083 by Horst Prote.
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/lm_sensors')
-rw-r--r--sys-apps/lm_sensors/ChangeLog9
-rw-r--r--sys-apps/lm_sensors/files/lm_sensors-3.1.2-changeset_r5835.patch54
-rw-r--r--sys-apps/lm_sensors/lm_sensors-3.1.2-r1.ebuild98
3 files changed, 160 insertions, 1 deletions
diff --git a/sys-apps/lm_sensors/ChangeLog b/sys-apps/lm_sensors/ChangeLog
index f673dc4e5451..bff01a66580e 100644
--- a/sys-apps/lm_sensors/ChangeLog
+++ b/sys-apps/lm_sensors/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-apps/lm_sensors
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/lm_sensors/ChangeLog,v 1.106 2010/06/27 17:44:25 armin76 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/lm_sensors/ChangeLog,v 1.107 2010/06/27 18:48:45 ssuominen Exp $
+
+*lm_sensors-3.1.2-r1 (27 Jun 2010)
+
+ 27 Jun 2010; Samuli Suominen <ssuominen@gentoo.org>
+ +lm_sensors-3.1.2-r1.ebuild,
+ +files/lm_sensors-3.1.2-changeset_r5835.patch:
+ Fix support of multiple chips wrt #325083 by Horst Prote.
27 Jun 2010; Raúl Porcel <armin76@gentoo.org> lm_sensors-3.1.2.ebuild:
alpha stable wrt #301474
diff --git a/sys-apps/lm_sensors/files/lm_sensors-3.1.2-changeset_r5835.patch b/sys-apps/lm_sensors/files/lm_sensors-3.1.2-changeset_r5835.patch
new file mode 100644
index 000000000000..d7d9d3cf4176
--- /dev/null
+++ b/sys-apps/lm_sensors/files/lm_sensors-3.1.2-changeset_r5835.patch
@@ -0,0 +1,54 @@
+http://bugs.gentoo.org/325083
+http://www.lm-sensors.org/changeset/5835
+
+--- prog/sensord/rrd.c
++++ prog/sensord/rrd.c
+@@ -138,7 +138,9 @@
+ }
+
++/* Returns the number of features processed, or -1 on error */
+ static int _applyToFeatures(FeatureFN fn, void *data,
+ const sensors_chip_name *chip,
+- const ChipDescriptor *desc)
++ const ChipDescriptor *desc,
++ int labelOffset)
+ {
+ int i;
+@@ -148,5 +150,5 @@
+ char *label;
+
+- for (i = 0; i < MAX_RRD_SENSORS && features[i].format; ++i) {
++ for (i = 0; labelOffset + i < MAX_RRD_SENSORS && features[i].format; ++i) {
+ feature = features + i;
+ rawLabel = feature->feature->name;
+@@ -159,9 +161,9 @@
+ }
+
+- rrdCheckLabel(rawLabel, i);
+- fn(data, rrdLabels[i], label, feature);
++ rrdCheckLabel(rawLabel, labelOffset + i);
++ fn(data, rrdLabels[labelOffset + i], label, feature);
+ free(label);
+ }
+- return 0;
++ return i;
+ }
+
+@@ -185,5 +187,5 @@
+ static int applyToFeatures(FeatureFN fn, void *data)
+ {
+- int i, i_detected, ret;
++ int i, i_detected, ret, labelOffset = 0;
+ const sensors_chip_name *chip, *chip_arg;
+ ChipDescriptor *desc;
+@@ -198,7 +200,8 @@
+ continue;
+
+- ret = _applyToFeatures(fn, data, chip, desc);
+- if (ret)
++ ret = _applyToFeatures(fn, data, chip, desc, labelOffset);
++ if (ret < 0)
+ return ret;
++ labelOffset += ret;
+ }
+ }
diff --git a/sys-apps/lm_sensors/lm_sensors-3.1.2-r1.ebuild b/sys-apps/lm_sensors/lm_sensors-3.1.2-r1.ebuild
new file mode 100644
index 000000000000..02efafb02e07
--- /dev/null
+++ b/sys-apps/lm_sensors/lm_sensors-3.1.2-r1.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/lm_sensors/lm_sensors-3.1.2-r1.ebuild,v 1.1 2010/06/27 18:48:45 ssuominen Exp $
+
+EAPI="2"
+
+inherit eutils flag-o-matic 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="~alpha ~amd64 ~ppc ~sparc ~x86"
+IUSE="sensord"
+
+DEPEND="sys-apps/sed
+ sensord? ( net-analyzer/rrdtool )"
+RDEPEND="dev-lang/perl
+ virtual/logger"
+
+CONFIG_CHECK="~HWMON ~I2C_CHARDEV ~I2C"
+WARNING_HWMON="${PN} requires CONFIG_HWMON to be enabled for use."
+WARNING_I2C_CHARDEV="sensors-detect requires CONFIG_I2C_CHARDEV to be enabled."
+WARNING_I2C="${PN} requires CONFIG_I2C to be enabled for most sensors."
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-sensors-detect-gentoo.patch \
+ "${FILESDIR}"/${P}-changeset_r5835.patch
+
+ if use sensord; then
+ sed -i -e 's:^#\(PROG_EXTRA.*\):\1:' "${S}"/Makefile || die
+ fi
+
+ # Respect LDFLAGS
+ sed -i -e 's/\$(LIBDIR)$/\$(LIBDIR) \$(LDFLAGS)/g' Makefile || die
+}
+
+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) \
+ || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX=/usr MANDIR=/usr/share/man LIBDIR=/usr/$(get_libdir) \
+ install || die "emake install failed"
+
+ newinitd "${FILESDIR}"/lm_sensors-3-init.d lm_sensors || die
+ newinitd "${FILESDIR}"/fancontrol-init.d fancontrol || die
+
+ if use sensord; then
+ newconfd "${FILESDIR}"/sensord-conf.d sensord || die
+ newinitd "${FILESDIR}"/sensord-3-init.d sensord || die
+ fi
+
+ dodoc CHANGES CONTRIBUTORS INSTALL README*
+
+ dodoc doc/donations doc/fancontrol.txt doc/fan-divisors \
+ doc/progs doc/temperature-sensors doc/vid
+
+ docinto chips
+ dodoc doc/chips/*
+
+ docinto developers
+ dodoc doc/developers/applications
+}
+
+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, 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 "Also make sure you have read:"
+ elog "http://www.lm-sensors.org/wiki/FAQ/Chapter3#Mysensorshavestoppedworkinginkernel2.6.31"
+ elog
+ elog "Please refer to the lm_sensors documentation for more information."
+ elog "(http://www.lm-sensors.org/wiki/Documentation)"
+ elog
+}