rpms/xfce4-sensors-plugin/F-8 xfce4-sensors-plugin-0.10.99.2-lm_sensors3x.patch, NONE, 1.1 .cvsignore, 1.3, 1.4 sources, 1.3, 1.4 xfce4-sensors-plugin.spec, 1.11, 1.12

Christoph Wickert (cwickert) fedora-extras-commits at redhat.com
Mon Dec 10 23:39:05 UTC 2007


Author: cwickert

Update of /cvs/pkgs/rpms/xfce4-sensors-plugin/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1202/F-8

Modified Files:
	.cvsignore sources xfce4-sensors-plugin.spec 
Added Files:
	xfce4-sensors-plugin-0.10.99.2-lm_sensors3x.patch 
Log Message:
* Fri Dec 07 2007 Christoph Wickert <fedora christoph-wickert de> - 0.10.99.2-3
- Rebuild for Xfce 4.4.2


xfce4-sensors-plugin-0.10.99.2-lm_sensors3x.patch:

--- NEW FILE xfce4-sensors-plugin-0.10.99.2-lm_sensors3x.patch ---
diff -up xfce4-sensors-plugin-0.10.99.2/panel-plugin/middlelayer.c.lmsens3x xfce4-sensors-plugin-0.10.99.2/panel-plugin/middlelayer.c
--- xfce4-sensors-plugin-0.10.99.2/panel-plugin/middlelayer.c.lmsens3x	2007-10-28 16:21:52.000000000 +0100
+++ xfce4-sensors-plugin-0.10.99.2/panel-plugin/middlelayer.c	2007-11-23 22:58:34.000000000 +0100
@@ -110,6 +110,7 @@ refresh_all_chips (GPtrArray *chips )
 }
 
 
+#if SENSORS_API_VERSION < 0x400 /* libsensor 3 code */
 void
 categorize_sensor_type (t_chipfeature* chipfeature)
 {
@@ -141,7 +142,7 @@ categorize_sensor_type (t_chipfeature* c
 
    TRACE ("leaves categorize_sensor_type");
 }
-
+#endif
 
 int
 sensors_get_feature_wrapper (t_chip *chip, int number, double *value)
@@ -153,7 +154,11 @@ sensors_get_feature_wrapper (t_chip *chi
 
     if (chip->type==LMSENSOR ) {
         #ifdef HAVE_LIBSENSORS
-            return sensors_get_feature (*(chip->chip_name), number, value);
+            #if SENSORS_API_VERSION < 0x400 /* libsensor 3 code */
+                return sensors_get_feature (*(chip->chip_name), number, value);
+            #else
+                return sensors_get_value (chip->chip_name, number, value);
+            #endif
         #else
             return -1;
         #endif
diff -up xfce4-sensors-plugin-0.10.99.2/panel-plugin/lmsensors.c.lmsens3x xfce4-sensors-plugin-0.10.99.2/panel-plugin/lmsensors.c
--- xfce4-sensors-plugin-0.10.99.2/panel-plugin/lmsensors.c.lmsens3x	2007-10-20 19:40:40.000000000 +0200
+++ xfce4-sensors-plugin-0.10.99.2/panel-plugin/lmsensors.c	2007-11-23 22:59:15.000000000 +0100
@@ -47,12 +47,28 @@ t_chip *setup_chip (GPtrArray *chips, co
     chip->chip_name = (sensors_chip_name *) g_malloc (sizeof(sensors_chip_name));
     memcpy ( (void *) (chip->chip_name), (void *) name, sizeof(sensors_chip_name) );
 
+#if SENSORS_API_VERSION < 0x400 /* libsensor 3 code */
     chip->sensorId = g_strdup_printf ("%s-%x-%x", name->prefix, name->bus, name->addr);
+#else
+    switch (name->bus.type) {
+        case SENSORS_BUS_TYPE_I2C:
+        case SENSORS_BUS_TYPE_SPI:
+            chip->sensorId = g_strdup_printf ("%s-%x-%x", name->prefix,
+                                              name->bus.nr, name->addr);
+            break;
+        default:
+            chip->sensorId = g_strdup_printf ("%s-%x", name->prefix, name->addr);
+    }
+#endif
     chip->num_features=0;
     chip->name = g_strdup (_("LM Sensors"));
     chip->chip_features = g_ptr_array_new();
 
+#if SENSORS_API_VERSION < 0x400 /* libsensor 3 code */
     chip->description = g_strdup (sensors_get_adapter_name (num_sensorchips-1));
+#else
+    chip->description = g_strdup (sensors_get_adapter_name (&name->bus));
+#endif
 
     TRACE("leaves setup_chip");
 
@@ -71,14 +87,23 @@ void setup_chipfeature (t_chipfeature *c
     chipfeature->address = number;
     chipfeature->show = FALSE;
 
+#if SENSORS_API_VERSION < 0x400 /* libsensor 3 code */
     categorize_sensor_type (chipfeature);
+#endif
 
     TRACE("leaves setup_chipfeature");
 }
 
 
+#if SENSORS_API_VERSION < 0x400 /* libsensor 3 code */
 t_chipfeature *find_chipfeature    (const sensors_chip_name *name, t_chip *chip, int number)
 {
+#else
+t_chipfeature *find_chipfeature    (const sensors_chip_name *name, t_chip *chip, const sensors_feature *feature)
+{
+    const sensors_subfeature *sub_feature = NULL;
+    int number = -1;
+#endif
     int res;
     double sensorFeature;
     t_chipfeature *chipfeature;
@@ -87,6 +112,7 @@ t_chipfeature *find_chipfeature    (cons
 
     chipfeature = g_new0 (t_chipfeature, 1);
 
+#if SENSORS_API_VERSION < 0x400 /* libsensor 3 code */
     if (sensors_get_ignored (*(name), number)==1) {
         res = sensors_get_label(*(name), number,
                                 &(chipfeature->name));
@@ -95,6 +121,87 @@ t_chipfeature *find_chipfeature    (cons
             res = sensors_get_feature (*(name), number,
                                         &sensorFeature);
 
+#else /* libsensors 4 code */
+
+    switch (feature->type) {
+    case SENSORS_FEATURE_IN:
+        sub_feature = sensors_get_subfeature(name, feature,
+                                             SENSORS_SUBFEATURE_IN_INPUT);
+        if (!sub_feature)
+            break;
+
+        number = sub_feature->number;
+        chipfeature->class = VOLTAGE;
+        chipfeature->min_value = 2.8;
+        chipfeature->max_value = 12.2;
+
+        if ((sub_feature = sensors_get_subfeature(name, feature,
+                SENSORS_SUBFEATURE_IN_MIN)) &&
+                !sensors_get_value(name, sub_feature->number, &sensorFeature))
+            chipfeature->min_value = sensorFeature;
+
+        if ((sub_feature = sensors_get_subfeature(name, feature,
+                SENSORS_SUBFEATURE_IN_MAX)) &&
+                !sensors_get_value(name, sub_feature->number, &sensorFeature))
+            chipfeature->max_value = sensorFeature;
+
+        break;
+
+    case SENSORS_FEATURE_FAN:
+        sub_feature = sensors_get_subfeature(name, feature,
+                                             SENSORS_SUBFEATURE_FAN_INPUT);
+        if (!sub_feature)
+            break;
+
+        number = sub_feature->number;
+        chipfeature->class = SPEED;
+        chipfeature->min_value = 1000.0;
+        chipfeature->max_value = 3500.0;
+
+        if ((sub_feature = sensors_get_subfeature(name, feature,
+                SENSORS_SUBFEATURE_FAN_MIN)) &&
+                !sensors_get_value(name, sub_feature->number, &sensorFeature))
+            chipfeature->min_value = sensorFeature;
+
+        break;
+
+    case SENSORS_FEATURE_TEMP:
+        sub_feature = sensors_get_subfeature(name, feature,
+                                             SENSORS_SUBFEATURE_TEMP_INPUT);
+        if (!sub_feature)
+            break;
+
+        number = sub_feature->number;
+        chipfeature->class = TEMPERATURE;
+        chipfeature->min_value = 0.0;
+        chipfeature->max_value = 80.0;
+
+        if ((sub_feature = sensors_get_subfeature(name, feature,
+                SENSORS_SUBFEATURE_TEMP_MIN)) &&
+                !sensors_get_value(name, sub_feature->number, &sensorFeature))
+            chipfeature->min_value = sensorFeature;
+
+        if (((sub_feature = sensors_get_subfeature(name, feature,
+                SENSORS_SUBFEATURE_TEMP_MAX)) ||
+                (sub_feature = sensors_get_subfeature(name, feature,
+                SENSORS_SUBFEATURE_TEMP_CRIT))) &&
+                !sensors_get_value(name, sub_feature->number, &sensorFeature))
+            chipfeature->max_value = sensorFeature;
+    }
+
+    if (number != -1) {
+
+        chipfeature->name = sensors_get_label(name, feature);
+
+        if (!chipfeature->name)
+            chipfeature->name = feature->name;
+
+        if (chipfeature->name) {
+            res = sensors_get_value (name, number,
+                                        &sensorFeature);
+
+#endif /* libsensor3 / libsensors4 code */
+
             if (res==0) {
                 setup_chipfeature (chipfeature, number, sensorFeature);
                 chip->num_features++;
@@ -103,6 +210,7 @@ t_chipfeature *find_chipfeature    (cons
             }
         }
     }
+    g_free(chipfeature);
 
     TRACE("leaves find_chipfeature with null");
     return NULL;
@@ -114,8 +222,9 @@ int initialize_libsensors (GPtrArray *ch
     int sensorsInit, nr1, nr2, num_sensorchips; /*    , numchips;  */
     t_chip *chip;
     t_chipfeature *chipfeature; /* , *furtherchipfeature; */
-    FILE *file;
     const sensors_chip_name *detected_chip;
+#if SENSORS_API_VERSION < 0x400 /* libsensor 3 code */
+    FILE *file;
     const sensors_feature_data *sfd;
 
     TRACE("enters initialize_libsensors");
@@ -167,6 +276,45 @@ int initialize_libsensors (GPtrArray *ch
         TRACE ("leaves initialize_libsensors with -1");
         return -1;
     }
+#else
+    const sensors_feature *sfd;
+    TRACE("enters initialize_libsensors");
+    
+    sensorsInit = sensors_init(NULL);
+    if (sensorsInit != 0)
+    {
+        g_printf(_("Error: Could not connect to sensors!"));
+        /* FIXME: better popup window? write to special logfile? */
+        return -2;
+    }
+
+    num_sensorchips = 0;
+    detected_chip = sensors_get_detected_chips (NULL, &num_sensorchips);
+    /* iterate over chips on mainboard */
+    while (detected_chip!=NULL)
+    {
+        chip = setup_chip (chips, detected_chip, num_sensorchips);
+
+        nr1 = 0;
+        nr2 = 0;
+        /* iterate over chip features, i.e. id, cpu temp, mb temp... */
+        /* numchips = get_number_chip_features (detected_chip); */
+        sfd = sensors_get_features (detected_chip, &nr1);
+        while (sfd != NULL)
+        {
+            chipfeature = find_chipfeature (detected_chip, chip, sfd);
+            if (chipfeature!=NULL) {
+                g_ptr_array_add (chip->chip_features, chipfeature);
+            }
+            sfd = sensors_get_features (detected_chip, &nr1);
+        }
+
+        detected_chip = sensors_get_detected_chips (NULL, &num_sensorchips);
+    } /* end while sensor chipNames */
+
+    TRACE ("leaves initialize_libsensors with 1");
+    return 1;
+#endif
 }
 
 


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/xfce4-sensors-plugin/F-8/.cvsignore,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- .cvsignore	5 Oct 2006 12:58:03 -0000	1.3
+++ .cvsignore	10 Dec 2007 23:38:27 -0000	1.4
@@ -1 +1 @@
-xfce4-sensors-plugin-0.10.0.tar.bz2
+xfce4-sensors-plugin-0.10.99.2.tar.bz2


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/xfce4-sensors-plugin/F-8/sources,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sources	5 Oct 2006 12:58:03 -0000	1.3
+++ sources	10 Dec 2007 23:38:27 -0000	1.4
@@ -1 +1 @@
-fa431e2b6bb0dd151047e05f7383a844  xfce4-sensors-plugin-0.10.0.tar.bz2
+5646407da37c6be63476b63347d0870b  xfce4-sensors-plugin-0.10.99.2.tar.bz2


Index: xfce4-sensors-plugin.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xfce4-sensors-plugin/F-8/xfce4-sensors-plugin.spec,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- xfce4-sensors-plugin.spec	25 Aug 2007 11:36:10 -0000	1.11
+++ xfce4-sensors-plugin.spec	10 Dec 2007 23:38:27 -0000	1.12
@@ -1,17 +1,18 @@
 Name: 		xfce4-sensors-plugin
-Version: 	0.10.0
-Release: 	6%{?dist}
+Version: 	0.10.99.2
+Release: 	3%{?dist}
 Summary: 	Sensors plugin for the Xfce panel
 
 Group: 		User Interface/Desktops
 License:	GPLv2+
 URL:		http://goodies.xfce.org/projects/panel-plugins/%{name}
 Source0:	http://goodies.xfce.org/releases/%{name}/%{name}-%{version}.tar.bz2
+Patch0:		%{name}-0.10.99.2-lm_sensors3x.patch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-BuildRequires:	xfce4-panel-devel >= 4.3.20, libxfcegui4-devel >= 4.3.20, libxml2-devel
+BuildRequires:	xfce4-panel-devel >= 4.4.0, libxfcegui4-devel >= 4.4.0, libxml2-devel
 BuildRequires:	gettext, perl(XML::Parser), lm_sensors-devel >= 2.8
-Requires:	xfce4-panel >= 4.4.0, lm_sensors >= 2.8
+Requires:	xfce4-panel >= 4.4.1, lm_sensors >= 2.8, hddtemp
 ExcludeArch:	s390 s390x
 
 %description
@@ -19,6 +20,7 @@
 
 %prep
 %setup -q
+%patch0 -p1 -b .lm_sensors3x
 
 %build
 %configure --disable-static
@@ -48,6 +50,19 @@
 %{_datadir}/icons/hicolor/48x48/apps/xfce-sensors.png
 
 %changelog
+* Fri Dec 07 2007 Christoph Wickert <fedora christoph-wickert de> - 0.10.99.2-3
+- Rebuild for Xfce 4.4.2
+
+* Mon Nov 19 2007 Christoph Wickert <fedora christoph-wickert de> - 0.10.99.2-2
+- Add Hans de Goede's patch for lm_sensors-3.0.0-RC1
+
+* Wed Nov 07 2007 Christoph Wickert <fedora christoph-wickert de> - 0.10.99.2-1
+- Update to 0.10.99.2
+
+* Sat Oct 27 2007 Christoph Wickert <fedora christoph-wickert de> - 0.10.99.1-1
+- Update to 0.10.99.1
+- Require hddtemp because it is supported now
+
 * Sat Aug 25 2007 Christoph Wickert <fedora christoph-wickert de> - 0.10.0-6
 - Rebuild for BuildID feature
 - Update license tag




More information about the fedora-extras-commits mailing list