[xfce4-sensors-plugin] Fix FTBFS. Thanks to Johannes Lips for the patch (#715838) Improve ACPI support. Thanks to Raphael G

Christoph Wickert cwickert at fedoraproject.org
Sun Jul 3 13:30:37 UTC 2011


commit 17f248f55d455da80494da0026cda88f34df514e
Author: Christoph Wickert <cwickert at fedoraproject.org>
Date:   Sun Jul 3 15:29:24 2011 +0200

    Fix FTBFS. Thanks to Johannes Lips for the patch (#715838)
    Improve ACPI support. Thanks to Raphael Groner for the patches (#661933)

 xfce4-sensors-plugin-1.0.0-acpi-info.patch         |   13 +++++
 xfce4-sensors-plugin-1.0.0-battery.patch           |   53 ++++++++++++++++++++
 ...-plugin-1.0.0-configure-help-acpi-default.patch |   22 ++++++++
 xfce4-sensors-plugin-1.0.0-gcc.patch               |   10 ++++
 xfce4-sensors-plugin.spec                          |   46 +++++++++++++++--
 5 files changed, 138 insertions(+), 6 deletions(-)
---
diff --git a/xfce4-sensors-plugin-1.0.0-acpi-info.patch b/xfce4-sensors-plugin-1.0.0-acpi-info.patch
new file mode 100644
index 0000000..aa8bfac
--- /dev/null
+++ b/xfce4-sensors-plugin-1.0.0-acpi-info.patch
@@ -0,0 +1,13 @@
+diff --git a/include/acpi.h b/include/acpi.h
+index 5be01bc..9fe7005 100644
+--- a/include/acpi.h
++++ b/include/acpi.h
+@@ -30,7 +30,7 @@
+ #define ACPI_FILE_BATTERY_INFO  "info"
+ #define ACPI_FILE_FAN           "state"
+ 
+-#define ACPI_INFO               "info_"
++#define ACPI_INFO               "info"
+ 
+ /* Gtk/Glib includes */
+ #include <glib.h>
diff --git a/xfce4-sensors-plugin-1.0.0-battery.patch b/xfce4-sensors-plugin-1.0.0-battery.patch
new file mode 100644
index 0000000..7094a43
--- /dev/null
+++ b/xfce4-sensors-plugin-1.0.0-battery.patch
@@ -0,0 +1,53 @@
+diff --git a/lib/acpi.c b/lib/acpi.c
+index 9ea746c..a51220d 100644
+--- a/lib/acpi.c
++++ b/lib/acpi.c
+@@ -211,7 +211,7 @@ double get_battery_zone_value (char *zone)
+     value = 0.0;
+ 
+ #ifdef HAVE_SYSFS_ACPI
+-    filename = g_strdup_printf ("/sys/class/power_supply/%s/energy_now", zone);
++    filename = g_strdup_printf ("/sys/class/power_supply/%s/charge_now", zone);
+ #else
+     filename = g_strdup_printf ("%s/%s/%s/%s", ACPI_PATH, ACPI_DIR_BATTERY,
+                                 zone, ACPI_FILE_BATTERY_STATE);
+@@ -312,7 +312,7 @@ int read_battery_zone (t_chip *chip)
+                     fclose (file);
+                 }
+                 g_free (filename);
+-                filename = g_strdup_printf ("/sys/class/power_supply/%s/energy_now", de->d_name);
++                filename = g_strdup_printf ("/sys/class/power_supply/%s/charge_now", de->d_name);
+                 file = fopen (filename, "r");
+                 if (file) {
+ 
+@@ -398,7 +398,7 @@ get_battery_max_value (char *name, t_chipfeature *chipfeature)
+     TRACE ("enters get_battery_max_value");
+ 
+ #ifdef HAVE_SYSFS_ACPI
+-    filename = g_strdup_printf ("/sys/class/power_supply/%s/energy_full", name);
++    filename = g_strdup_printf ("/sys/class/power_supply/%s/charge_full", name);
+ #else
+     filename = g_strdup_printf ("%s/%s/%s/%s", ACPI_PATH,
+                                             ACPI_DIR_BATTERY, name,
+@@ -577,7 +577,7 @@ refresh_acpi (gpointer chip_feature, gpointer data)
+             cf->raw_value = get_battery_zone_value (cf->devicename); /* zone */
+             /* g_free (zone); */
+             /*  g_free (cf->formatted_value);
+-            cf->formatted_value = g_strdup_printf (_("%.0f mWh"), cf->raw_value); */
++            cf->formatted_value = g_strdup_printf (_("%.0f mAh"), cf->raw_value); */
+             break;
+ 
+         case STATE:
+diff --git a/lib/sensors-interface-common.c b/lib/sensors-interface-common.c
+index b3e2234..73b65f8 100644
+--- a/lib/sensors-interface-common.c
++++ b/lib/sensors-interface-common.c
+@@ -150,7 +150,7 @@ format_sensor_value (t_tempscale scale, t_chipfeature *chipfeature,
+                break;
+ 
+         case ENERGY:
+-               *help = g_strdup_printf(_("%.0f mWh"), sensorFeature);
++               *help = g_strdup_printf(_("%.0f mAh"), sensorFeature);
+                break;
+ 
+         case STATE:
diff --git a/xfce4-sensors-plugin-1.0.0-configure-help-acpi-default.patch b/xfce4-sensors-plugin-1.0.0-configure-help-acpi-default.patch
new file mode 100644
index 0000000..23824fd
--- /dev/null
+++ b/xfce4-sensors-plugin-1.0.0-configure-help-acpi-default.patch
@@ -0,0 +1,22 @@
+diff --git a/configure.in.orig b/configure.in
+index bca79a4..90adb6a 100644
+--- a/configure.in.orig
++++ b/configure.in
+@@ -172,7 +172,7 @@ AM_CONDITIONAL([HAVE__NETCAT], [test x$enable_netcat = x"yes"])
+ 
+ 
+ dnl Check for interface for /proc/acpi to be used
+-AC_ARG_ENABLE([procacpi], [AC_HELP_STRING([--enable-procacpi], [Use /proc/acpi to read your CPU temperature @<:@default=yes@:>@])],
++AC_ARG_ENABLE([procacpi], [AC_HELP_STRING([--enable-procacpi], [Use /proc/acpi to read your CPU temperature @<:@default=auto@:>@])],
+ [],
+ [
+     enable_procacpi=auto
+@@ -193,7 +193,7 @@ if test x"$enable_procacpi" = x"yes"; then
+ fi
+ 
+ dnl Check for interface for /sys/class/power_supply to be used
+-AC_ARG_ENABLE([sysfsacpi], [AC_HELP_STRING([--enable-sysfsacpi], [Use /sys/class/power_supply to read your battery value @<:@default=yes@:>@])],
++AC_ARG_ENABLE([sysfsacpi], [AC_HELP_STRING([--enable-sysfsacpi], [Use /sys/class/power_supply to read your battery value @<:@default=auto@:>@])],
+ [],
+ [
+     enable_sysfsacpi=auto
diff --git a/xfce4-sensors-plugin-1.0.0-gcc.patch b/xfce4-sensors-plugin-1.0.0-gcc.patch
new file mode 100644
index 0000000..ea411fb
--- /dev/null
+++ b/xfce4-sensors-plugin-1.0.0-gcc.patch
@@ -0,0 +1,10 @@
+--- xfce4-sensors-plugin-1.0.0/src/Makefile.am	2009-11-06 12:02:11.000000000 +0100
++++ xfce4-sensors-plugin-1.0.0/src/Makefile.am	2011-07-03 09:42:54.973198573 +0200
+@@ -34,7 +34,6 @@
+ # @LIBXFCE4PANEL_CFLAGS@
+ 
+ xfce4_sensors_LDFLAGS = \
+-	--no-undefined \
+ 	@PLATFORM_LDFLAGS@
+ 
+ xfce4_sensors_LDADD = \
diff --git a/xfce4-sensors-plugin.spec b/xfce4-sensors-plugin.spec
index 76b53a4..2639b16 100644
--- a/xfce4-sensors-plugin.spec
+++ b/xfce4-sensors-plugin.spec
@@ -1,3 +1,5 @@
+# Review at https://bugzilla.redhat.com/show_bug.cgi?id=173552
+
 Name:           xfce4-sensors-plugin
 Version:        1.0.0
 Release:        4%{?dist}
@@ -12,12 +14,32 @@ Patch1:         xfce4-sensors-plugin-1.0.0-libnotify-0.7.0.patch
 # Fixes underlinking in panel-plugin and src
 # http://bugzilla.xfce.org/show_bug.cgi?id=7095
 Patch2:         xfce4-sensors-plugin-1.0.0-underlink.patch
+# Fixes FTBFS due to incorrect compiler flags
+# https://bugzilla.redhat.com/show_bug.cgi?id=715838
+Patch3:         xfce4-sensors-plugin-1.0.0-gcc.patch
+# Fixes display of ACPI version
+# http://bugzilla.xfce.org/show_bug.cgi?id=6956
+Patch4:         xfce4-sensors-plugin-1.0.0-acpi-info.patch
+# Use correct units for battery state
+# http://bugzilla.xfce.org/show_bug.cgi?id=6959
+Patch5:         xfce4-sensors-plugin-1.0.0-battery.patch
+# Fix wrong default values in configure help
+# http://bugzilla.xfce.org/show_bug.cgi?id=6960
+Patch6:         xfce4-sensors-plugin-1.0.0-configure-help-acpi-default.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-BuildRequires:  xfce4-panel-devel >= 4.4.0, libxfcegui4-devel >= 4.4.0
+BuildRequires:  xfce4-panel-devel >= 4.4.0
+BuildRequires:  libxfcegui4-devel >= 4.4.0
 BuildRequires:  lm_sensors-devel >= 2.8, hddtemp, libnotify-devel >= 0.4
-BuildRequires:  gettext, perl(XML::Parser), intltool, desktop-file-utils, libtool, xfce4-dev-tools
-Requires:       xfce4-panel >= 4.4.1, lm_sensors >= 2.8, hddtemp
+BuildRequires:  gettext
+BuildRequires:  intltool
+BuildRequires:  desktop-file-utils, libtool
+# because of patches 2 and 3
+BuildRequires:  xfce4-dev-tools
+Requires:       xfce4-panel >= 4.4.1
+Requires:       lm_sensors >= 2.8
+Requires:       hddtemp
+# lm_sensors is not available on s390 and s390x
 ExcludeArch:    s390 s390x
 
 %description
@@ -39,14 +61,22 @@ Static libraries and header files for the xfce4-sensors-plugin.
 %if 0%{?fedora} >= 15
 %patch1 -p1 -b .libnotify-0.7.0
 %endif
-%patch2 -p1 -b .underlink
+%patch2 -p1 -b .gcc
+%patch3 -p1 -b .underlink
+%patch4 -p1 -b .acpi
+%patch5 -p1 -b .battery
+%patch6 -p1 -b .configure-help
+
 
 %build
 # Xfce has its own autotools-running-script thingy, if you use autoreconf
 # it'll fall apart horribly
 xdt-autogen
 
-%configure --disable-static --with-pathhddtemp=%{_bindir}/hddtemp
+%configure --disable-static \
+        --enable-sysfsacpi=yes \
+        --with-pathhddtemp=%{_bindir}/hddtemp \
+
 make %{?_smp_mflags}
 
 
@@ -54,7 +84,7 @@ make %{?_smp_mflags}
 rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir}
 %find_lang %{name}
-rm ${RPM_BUILD_ROOT}%{_libdir}/xfce4/modules/libxfce4sensors.la
+find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
 desktop-file-install --vendor ""                                \
         --dir ${RPM_BUILD_ROOT}%{_datadir}/applications         \
         --delete-original                                       \
@@ -99,6 +129,10 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Sun Jul 03 2011 Christoph Wickert <cwickert at fedoraproject.org> - 1.
+- Fix FTBFS. Thanks to Johannes Lips for the patch (#715838)
+- Improve ACPI support. Thanks to Raphael Groner for the patches (#661933)
+
 * Mon Feb 07 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.0.0-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 


More information about the scm-commits mailing list