rpms/gnome-applet-sensors/FC-6 sensors-applet-1.8.1-get-min-max-from-libsensors.patch, NONE, 1.1 .cvsignore, 1.6, 1.7 gnome-applet-sensors.spec, 1.10, 1.11 sources, 1.6, 1.7

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Mon Jul 16 11:33:31 UTC 2007


Author: jwrdegoede

Update of /cvs/extras/rpms/gnome-applet-sensors/FC-6
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv2599

Modified Files:
	.cvsignore gnome-applet-sensors.spec sources 
Added Files:
	sensors-applet-1.8.1-get-min-max-from-libsensors.patch 
Log Message:
* Sun Jul 15 2007 Hans de Goede <j.w.r.degoede at hhs.nl> 1.8.1-1
- New upstream release 1.8.1 (fixes bz 235655, 190509)
- Add gtk-icon-update-cache to post scripts (fixes bz 206529)
- Pass proper directory for omf files to scrollkeeper-update in post script
- Initialize sensors low and high tresholds from libsensors settings
- Various specfile cleanups


sensors-applet-1.8.1-get-min-max-from-libsensors.patch:

--- NEW FILE sensors-applet-1.8.1-get-min-max-from-libsensors.patch ---
diff -up sensors-applet-1.8.1/src/sensors-applet.c.minmax sensors-applet-1.8.1/src/sensors-applet.c
--- sensors-applet-1.8.1/src/sensors-applet.c.minmax	2007-07-03 13:05:48.000000000 +0200
+++ sensors-applet-1.8.1/src/sensors-applet.c	2007-07-15 09:43:04.000000000 +0200
@@ -63,7 +63,6 @@
 #include "about-dialog.h"
 
 #define SENSORS_APPLET_MENU_FILE "SensorsApplet.xml"
-#define DEFAULT_GRAPH_COLOR "#ff0000"
 #define DEFAULT_APPLET_SIZE 24 /* initially set as
                                 * sensors_applet->size to ensure a
                                 * real value is stored */
@@ -1177,6 +1176,25 @@ static ActiveSensor *sensors_applet_find
 }
 	
 	
+void sensors_applet_get_default_limits(SensorType type,
+                                       gdouble *low_value,
+                                       gdouble *high_value) {
+        switch (type) {
+        case TEMP_SENSOR:
+                *low_value = 20.0;
+                *high_value = 60.0;
+                break;
+        case FAN_SENSOR:
+                *low_value = 600.0;
+                *high_value = 3000.0;
+                break;
+        default:
+                *low_value = 0.0;
+                *high_value = 0.0;
+        }
+}
+
+
 /* path should be the full path to a file representing the sensor (eg
  * /dev/hda or /sys/devices/platform/i2c-0/0-0290/temp1_input) */
 gboolean sensors_applet_add_sensor(SensorsApplet *sensors_applet,
@@ -1191,21 +1209,9 @@ gboolean sensors_applet_add_sensor(Senso
 	gdouble low_value, high_value;
 
 	g_assert(sensors_applet);
+	
+	sensors_applet_get_default_limits(type, &low_value, &high_value);
         
-        switch (type) {
-        case TEMP_SENSOR:
-                low_value = 20.0;
-                high_value = 60.0;
-                break;
-        case FAN_SENSOR:
-                low_value = 600.0;
-                high_value = 3000.0;
-                break;
-        default:
-                low_value = 0.0;
-                high_value = 0.0;
-        }
-
 	return sensors_applet_add_sensor_full_details(sensors_applet,
                                                       path,
 						      id,
diff -up sensors-applet-1.8.1/src/sensors-applet.h.minmax sensors-applet-1.8.1/src/sensors-applet.h
--- sensors-applet-1.8.1/src/sensors-applet.h.minmax	2007-07-04 13:02:08.000000000 +0200
+++ sensors-applet-1.8.1/src/sensors-applet.h	2007-07-15 09:43:04.000000000 +0200
@@ -37,6 +37,7 @@ typedef struct _ActiveSensor ActiveSenso
 
 #define GRAPH_FRAME_EXTRA_WIDTH 6
 #define SENSORS_APPLET_ICON "sensors-applet"
+#define DEFAULT_GRAPH_COLOR "#ff0000"
 
 /* device icons */
 typedef enum {
@@ -250,6 +251,10 @@ gboolean sensors_applet_add_sensor(Senso
 				   SensorType type,
 				   IconType icon); 
 
+void sensors_applet_get_default_limits(SensorType type,
+                                       gdouble *low_value,
+                                       gdouble *high_value);
+                                                                              
 /**
  * to be called by things like prefs dialog to turn off a sensor alarm
  */
diff -up sensors-applet-1.8.1/src/libsensors-sensors-interface.c.minmax sensors-applet-1.8.1/src/libsensors-sensors-interface.c
--- sensors-applet-1.8.1/src/libsensors-sensors-interface.c.minmax	2007-07-02 15:36:08.000000000 +0200
+++ sensors-applet-1.8.1/src/libsensors-sensors-interface.c	2007-07-15 09:46:06.000000000 +0200
@@ -181,6 +181,26 @@ static char *get_sensor_interesting_labe
 	return NULL;
 }
 
+static void get_sensor_min_max(const sensors_chip_name *chip, int n1, int n2,
+                               int number, gdouble *low_value,
+                               gdouble *high_value) {
+	const sensors_feature_data *data;
+	double value;
+	
+	/* The sub features are returned directly after the main feature by
+	   sensors_get_all_features(), so no need to iterate over all features */
+	while ((data = sensors_get_all_features (*chip, &n1, &n2)) != NULL &&
+			data->mapping == number) {
+		if ((data->mode & SENSORS_MODE_R) && 
+		    (sensors_get_feature(*chip, data->number, &value) == 0)) {
+			if (!strcmp(data->name + strlen(data->name) - 4, "_min"))
+				*low_value = value;
+			if (!strcmp(data->name + strlen(data->name) - 4, "_max"))
+				*high_value = value;
+		}
+	}
+}
+
 static void libsensors_sensors_interface_get_sensors(SensorsApplet *sensors_applet) {
 	FILE *file;
 	const sensors_chip_name *chip;
@@ -225,6 +245,7 @@ static void libsensors_sensors_interface
 					SensorType type;
 					gboolean visible;
 					IconType icon;
+					gdouble low_value, high_value;
 						
 					gchar *url;
 							
@@ -235,12 +256,21 @@ static void libsensors_sensors_interface
 					// the 'path' contains all the information we need to
 					// identify this sensor later
 					url = g_strdup_printf ("sensor://%s/%d", chip_name, data->number);
+
+					// get low and high values
+					sensors_applet_get_default_limits(type,
+						&low_value, &high_value);
+					get_sensor_min_max(chip, n1, n2, data->number,
+						&low_value, &high_value);
 						
 					// the id identifies a particular sensor for the user;
 					// we default to the label returned by libsensors
-					sensors_applet_add_sensor (sensors_applet,
-						url, label, label,
-						LIBSENSORS, visible, type, icon);
+					sensors_applet_add_sensor_full_details(
+						sensors_applet, url, label, label,
+ 						LIBSENSORS, type, visible,
+						low_value, high_value, FALSE,
+						"", "", 0, 1.0, 0.0, icon,
+                                                DEFAULT_GRAPH_COLOR);
 
 					g_free (url);
 				}


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/gnome-applet-sensors/FC-6/.cvsignore,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- .cvsignore	31 Aug 2006 23:54:52 -0000	1.6
+++ .cvsignore	16 Jul 2007 11:32:59 -0000	1.7
@@ -1 +1 @@
-sensors-applet-1.7.8.tar.gz
+sensors-applet-1.8.1.tar.gz


Index: gnome-applet-sensors.spec
===================================================================
RCS file: /cvs/extras/rpms/gnome-applet-sensors/FC-6/gnome-applet-sensors.spec,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- gnome-applet-sensors.spec	2 Sep 2006 06:58:35 -0000	1.10
+++ gnome-applet-sensors.spec	16 Jul 2007 11:32:59 -0000	1.11
@@ -1,20 +1,16 @@
 Name:           gnome-applet-sensors
-Version:        1.7.8
-Release:        3%{?dist}
+Version:        1.8.1
+Release:        1%{?dist}
 Summary:        Gnome panel applet for hardware sensors
-
 Group:          User Interface/Desktops
 License:        GPL
 URL:            http://sensors-applet.sourceforge.net/
-Source0:        http://dl.sourceforge.net/sourceforge/sensors-applet/sensors-applet-%{version}.tar.gz
-
+Source0:        http://downloads.sourceforge.net/sensors-applet/sensors-applet-%{version}.tar.gz
+Patch0:         sensors-applet-1.8.1-get-min-max-from-libsensors.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-BuildRequires: gettext, gnome-doc-utils
-BuildRequires: gnome-panel-devel >= 2.8
-BuildRequires: lm_sensors-devel, libnotify-devel
-BuildRequires: intltool, perl-XML-Parser
-BuildRequires:  scrollkeeper
+BuildRequires:  gnome-panel-devel >= 2.8
+BuildRequires:  gettext gnome-doc-utils lm_sensors-devel libnotify-devel
+BuildRequires:  intltool perl-XML-Parser scrollkeeper
 Requires(post): scrollkeeper
 Requires(postun): scrollkeeper
 
@@ -37,30 +33,39 @@
 
 %prep
 %setup -q -n sensors-applet-%{version}
+%patch0 -p1 -z .minmax
 chmod -x %{_builddir}/sensors-applet-%{version}/AUTHORS
 chmod -x %{_builddir}/sensors-applet-%{version}/NEWS
 chmod -x %{_builddir}/sensors-applet-%{version}/TODO
 chmod -x %{_builddir}/sensors-applet-%{version}/ChangeLog
 
-%build
 
+%build
+# add --with-nvidia once libXNVCtrl has been approved, also add a BR on
+# libXNVCtrl-devel then.   
 %configure --disable-scrollkeeper --enable-libnotify
 make %{?_smp_mflags}
 
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%makeinstall
-rm $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/icon-theme.cache
-
-# Note: the find_lang macro requires gettext
+make install DESTDIR=$RPM_BUILD_ROOT
 %find_lang sensors-applet
 
+
 %post
-scrollkeeper-update -q -o %{_datadir}/omf/%{name} || :
+scrollkeeper-update -q -o %{_datadir}/omf/sensors-applet || :
+touch --no-create %{_datadir}/icons/hicolor || :
+if [ -x %{_bindir}/gtk-update-icon-cache ]; then
+  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
+fi
 
 %postun
 scrollkeeper-update -q || :
+touch --no-create %{_datadir}/icons/hicolor || :
+if [ -x %{_bindir}/gtk-update-icon-cache ]; then
+  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
+fi
 
 
 %clean
@@ -72,13 +77,21 @@
 %doc AUTHORS COPYING ChangeLog NEWS README TODO
 %{_datadir}/gnome-2.0/ui/*.xml
 %{_libdir}/bonobo/servers/*.server
-%{_libexecdir}/*
+%{_libexecdir}/sensors-applet
 %{_datadir}/omf/sensors-applet/
 %{_datadir}/gnome/help/sensors-applet/
 %{_datadir}/pixmaps/sensors-applet/
-%{_datadir}/icons/hicolor/*/*/*
+%{_datadir}/icons/hicolor/*/*/*.png
+
 
 %changelog
+* Sun Jul 15 2007 Hans de Goede <j.w.r.degoede at hhs.nl> 1.8.1-1
+- New upstream release 1.8.1 (fixes bz 235655, 190509)
+- Add gtk-icon-update-cache to post scripts (fixes bz 206529)
+- Pass proper directory for omf files to scrollkeeper-update in post script
+- Initialize sensors low and high tresholds from libsensors settings
+- Various specfile cleanups
+
 * Fri Sep 01 2006 Aaron Kurtz <a.kurtz at hardsun.net> - 1.7.8-3
 - Fix broken upgrade path
 
@@ -120,4 +133,3 @@
 
 * Sat Feb 26 2005 Gianluca Sforna <giallu[AT]gmail.com> - 0.6.2-0.1
 - Initial RPM release.
-


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/gnome-applet-sensors/FC-6/sources,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- sources	31 Aug 2006 23:54:52 -0000	1.6
+++ sources	16 Jul 2007 11:32:59 -0000	1.7
@@ -1 +1 @@
-0d71eaae6f4bad3c1b6d44d71929d954  sensors-applet-1.7.8.tar.gz
+929d7106d81d9add78b80514ad848403  sensors-applet-1.8.1.tar.gz




More information about the fedora-extras-commits mailing list