--- wmtemp-0.0.6.orig/temp.c +++ wmtemp-0.0.6/temp.c @@ -1,3 +1,4 @@ +#define DEBUG(x) x #include #include #include @@ -10,10 +11,10 @@ static char sensors = 0; static const sensors_chip_name *chip_name = NULL; -static const sensors_feature_data *feature; +static const sensors_feature *feature; -char *cpu_feature_name = "temp1"; -char *sys_feature_name = "temp2"; +char *cpu_feature_name = "temp1_input"; +char *sys_feature_name = "temp2_input"; temperature_t t_type = CELCIUS; @@ -33,14 +34,21 @@ void temp_init(const char *filename) { const sensors_chip_name *name; int chip_nr = 0, f1, f2; - + + char str[256]; + + char *feattext = NULL; + const sensors_subfeature *subfeature; + atexit(temp_deinit); - f = fopen(filename, "r"); - if (f == NULL) { - fprintf(stderr, "could not open configfile %s: %s\n", filename, - strerror(errno)); - exit(1); + if (filename) { + f = fopen(filename, "r"); + if (f == NULL) { + fprintf(stderr, "could not open configfile %s: %s\n", filename, + strerror(errno)); + exit(1); + } } if (sensors_init(f)) { @@ -49,21 +57,29 @@ } sensors = 1; - - while ((name = sensors_get_detected_chips(&chip_nr)) != NULL && + while ((name = sensors_get_detected_chips(NULL, &chip_nr)) != NULL && chip_name == NULL) { f1 = f2 = 0; + DEBUG(printf("chip_nr=%d %d\n",chip_nr,__LINE__);) + + sensors_snprintf_chip_name(str, 256, name); + DEBUG(printf("chip name = %s (%d)\n",str,__LINE__);) + + while ((feature = sensors_get_features( name, &f1)) != NULL) { - while ((feature = sensors_get_all_features(*name, &f1, &f2)) != NULL) { - if (sensors_get_ignored(*name, feature->number) != 0) { - if (strcmp(feature->name, cpu_feature_name) == 0) { - cpu_feature = feature->number; - chip_name = name; - } else if (strcmp(feature->name, sys_feature_name) == 0) { - sys_feature = feature->number; - chip_name = name; - } + feattext = sensors_get_label( name, feature ); + DEBUG(printf("f1=%d feattext=%s (%d) \n",f1,feattext,__LINE__);) + + if ( (subfeature = sensors_get_subfeature (name, feature, SENSORS_SUBFEATURE_TEMP_INPUT)) ) { + DEBUG(printf("subfeature name =%s (%d) \n",subfeature->name,__LINE__);) + if (strcmp(subfeature->name, cpu_feature_name) == 0) { + cpu_feature = subfeature->number; + chip_name = name; + } + else if (strcmp(subfeature->name, sys_feature_name) == 0) { + sys_feature = subfeature->number; } + } } } @@ -76,8 +92,8 @@ void temp_getusage(unsigned int *cpu_temp, unsigned int *sys_temp) { double cpu, sys; - sensors_get_feature(*chip_name, cpu_feature, &cpu); - sensors_get_feature(*chip_name, sys_feature, &sys); + sensors_get_value(chip_name, cpu_feature, &cpu); + sensors_get_value(chip_name, sys_feature, &sys); if (t_type == FAHRENHEIT) { cpu = TO_FAHRENHEIT(cpu); --- wmtemp-0.0.6.orig/main.c +++ wmtemp-0.0.6/main.c @@ -53,7 +53,7 @@ static unsigned int sys_temp = 0; static unsigned int alarm_cpu = 60; static unsigned int alarm_sys = 60; -char *configfile = "/etc/sensors.conf"; +char *configfile = NULL; static char **backlight_on_xpm; static char **backlight_off_xpm; @@ -419,9 +419,9 @@ printf(" -c location of the sensors.conf file\n"); printf(" ('/etc/sensors.conf' is default)\n"); printf(" -cf which feature to use for cpu temperature\n"); - printf(" ('temp1' is default)\n"); + printf(" ('temp1_input' is default)\n"); printf(" -sf which feature to use for sys temperature\n"); - printf(" ('temp2' is default)\n"); + printf(" ('temp2_input' is default)\n"); printf(" -s swap the cpu and sys temperatures\n"); printf(" (/etc/sensors.conf is default)\n"); printf(" -f show temperatures in Fahrenheit\n"); --- wmtemp-0.0.6.orig/Makefile +++ wmtemp-0.0.6/Makefile @@ -1,13 +1,15 @@ -CC=gcc -LD=gcc +#CC=gcc +#LD=gcc SED=sed STRIP=strip -DEST?=/usr/local/bin -MAN?=/usr/local/share/man/man1 - -CFLAGS=-Wall -Werror -O2 -I/usr/include/sensors -I/usr/local/include/sensors -LDFLAGS= +PREFIX?=/usr/local +DEST=$(PREFIX)/bin +MAN=$(PREFIX)/share/man/man1 + +CFLAGS?=-Wall -Werror -O2 +LDFLAGS?= +INCLUDE=-I/usr/include/sensors -I/usr/local/include/sensors LIBS=-L/usr/X11R6/lib -L/usr/local/lib -lX11 -lXext -lXpm -lsensors XPM=xpm/celcius_on.o xpm/celcius_off.o xpm/fahrenheit_on.o \ @@ -24,21 +26,21 @@ $(SED) -e "s/^static //" <$< >>$@ .c.o: - $(CC) $(CFLAGS) -c -o $@ $< + $(CC) $(CFLAGS) $(INCLUDE) -c -o $@ $< $(TARGET): $(OBJS) - $(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) - $(STRIP) $@ + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) clean: rm -f *.o xpm/*.o xpm/*.c core $(TARGET) install: cp $(TARGET) $(DEST)/$(TARGET) +# $(STRIP) $(DEST)/$(TARGET) chmod 755 $(DEST)/$(TARGET) - cp $(MANPAGE) $(MAN)/$(MANPAGE) - gzip -9 $(MAN)/$(MANPAGE) - chmod 644 $(MAN)/$(MANPAGE) +# cp $(MANPAGE) $(MAN)/$(MANPAGE) +# gzip -9 $(MAN)/$(MANPAGE) +# chmod 644 $(MAN)/$(MANPAGE) main.o: dockapp.h temp.h xpm/xpm.h dockapp.o: dockapp.h --- wmtemp-0.0.6.orig/dockapp.c +++ wmtemp-0.0.6/dockapp.c @@ -49,7 +49,6 @@ { XClassHint *classhint; XWMHints *wmhints; - Status stat; XTextProperty title; XSizeHints sizehints; Window root; @@ -132,7 +131,7 @@ XSetWMNormalHints(display, icon_window, &sizehints); /* Set WindowTitle for AfterStep Wharf */ - stat = XStringListToTextProperty(&appname, 1, &title); + XStringListToTextProperty(&appname, 1, &title); XSetWMName(display, window, &title); XSetWMName(display, icon_window, &title); --- wmtemp-0.0.6.orig/debian/control +++ wmtemp-0.0.6/debian/control @@ -0,0 +1,14 @@ +Source: wmtemp +Section: x11 +Priority: extra +Maintainer: Riccardo Stagni +Build-Depends: debhelper (>= 7.0.50~), libsensors4-dev (>= 3.1.2), libxpm-dev, libxext-dev, x11proto-xext-dev, libx11-dev +Standards-Version: 3.8.3 +Homepage: http://gnodde.org/wmtemp/ + +Package: wmtemp +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, lm-sensors +Description: WM dock applet displaying lm_sensors temperature values + Nifty small dock applet for Window Maker that continuously displays + CPU and case temperature by virtue of lm_sensors --- wmtemp-0.0.6.orig/debian/docs +++ wmtemp-0.0.6/debian/docs @@ -0,0 +1 @@ +CREDITS --- wmtemp-0.0.6.orig/debian/dirs +++ wmtemp-0.0.6/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/man/man1 --- wmtemp-0.0.6.orig/debian/copyright +++ wmtemp-0.0.6/debian/copyright @@ -0,0 +1,35 @@ +This package was debianized by Lars Steinke on +Fri, 4 Jun 2004 15:14:00 +0200. + +It was downloaded from http://gnodde.org/wmtemp/wmtemp-0.0.6.tar.gz + +Upstream Author: Peter Gnodde +Project Home: http://gnodde.org/wmtemp + +Copyright: + + All code and design by Peter Gnodde + Copyright 2003-2008 Peter Gnodde + +License: + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the + Free Software Foundation, Inc., + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + + Please see /usr/share/common-licenses/GPL-2 for the full license. + +The Debian packaging is copyright 2008, Riccardo Stagni +and is licensed under the GPL, see `/usr/share/common-licenses/GPL'. + --- wmtemp-0.0.6.orig/debian/watch +++ wmtemp-0.0.6/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://gnodde.org/wmtemp/wmtemp-([\d\.]*).tar.gz --- wmtemp-0.0.6.orig/debian/menu +++ wmtemp-0.0.6/debian/menu @@ -0,0 +1,2 @@ +?package(wmtemp):needs="X11" section="Applications/System/Monitoring"\ + title="wmtemp" command="/usr/bin/wmtemp" --- wmtemp-0.0.6.orig/debian/compat +++ wmtemp-0.0.6/debian/compat @@ -0,0 +1 @@ +7 --- wmtemp-0.0.6.orig/debian/changelog +++ wmtemp-0.0.6/debian/changelog @@ -0,0 +1,112 @@ +wmtemp (0.0.6-3.3) unstable; urgency=low + + * Non-maintainer upload. + * Fix "FTBFS: dockapp.c:52:16: error: variable 'stat' set but not used + [-Werror=unused-but-set-variable]": apply patch from peter green, removing + two unused variables. (Closes: #646488) + + -- gregor herrmann Tue, 22 Nov 2011 20:45:17 +0100 + +wmtemp (0.0.6-3.2) unstable; urgency=low + + * Non-maintainer upload to fix the previous upload. + * Don't try to open /etc/sensors.conf, use the default path instead + unless a configurationf file is specified. + + -- Aurelien Jarno Sat, 09 Apr 2011 16:10:42 +0200 + +wmtemp (0.0.6-3.1) unstable; urgency=low + + * Non-maintainer upload. + * Switch to libsensors4 api, thanks to Hugo Vanwoerkom for the patch. + (Closes: #610816). + + -- Aurelien Jarno Sat, 12 Mar 2011 22:13:32 +0100 + +wmtemp (0.0.6-3) unstable; urgency=low + + * Fix "backlight color change incomplete" changing the xpm files + (Closes: #523890) + * Now we use the automagical dh + * Bumped Standards-Version to 3.8.3, no changes needed. + * Lintian fixes: copyright-with-old-dh-make-debian-copyright + + -- Riccardo Stagni Thu, 12 Nov 2009 21:42:55 +0100 + +wmtemp (0.0.6-2) unstable; urgency=low + + * Bumped Standards-Version to 3.8.0, changed debian/rules to support the + standard values of DEB_BUILD_OPTIONS: + added support to parallel builds (even if we compile just 3 C source + files) and removed the nostrip check (because we rely on dh_strip) + * debian/control: lowered package priority (we depend on lm-sensors + which is extra). + * Removed useless xutils dependency + (this also fixes lintian's build-depends-on-obsolete-package) + * Added dependency on x11proto-xext-dev as we use some of its headers. + + -- Riccardo Stagni Fri, 20 Jun 2008 02:34:07 +0200 + +wmtemp (0.0.6-1) unstable; urgency=low + + * New upstream release + - corrected some cosmetic issues within -h output (closes: #474107) + * Removed the check from debian/rules for Makefile existance in the "clean" + target: since we don't use autoconf, a missing makefile *should* be a + problem anywhere. + * Updated debian/copyright + + -- Riccardo Stagni Mon, 28 Apr 2008 19:57:33 +0200 + +wmtemp (0.0.5-5) unstable; urgency=low + + * New maintainer (closes: #465958) + * Added Homepage field (from package description) + * Update menu file + * Standards-Version bumped to 3.7.3 (changed menu section) + * lintian: + - debian-rules-ignores-make-clean-error (even if we don't use autoconf) + - copyright-without-copyright-notice (rewritten debian/copyright) + - build-depends-on-1-revision + * Disable forced stripping (closes: #438277) + * Added watchfile + + -- Riccardo Stagni Thu, 27 Mar 2008 01:22:25 +0100 + +wmtemp (0.0.5-4) unstable; urgency=low + + * Fixed Build-Depends for xlibs-dev transition using + xlibs-split-check and objdump (closes #346882). + + -- Lars Steinke Sat, 14 Jan 2006 14:22:10 +0100 + +wmtemp (0.0.5-3) unstable; urgency=low + + * Fixed lintian warning concerning format of menu entry. + + -- Lars Steinke Sat, 14 Jan 2006 14:10:52 +0100 + +wmtemp (0.0.5-2) unstable; urgency=low + + * Forgot calling dh_installmenu. + + -- Lars Steinke Sun, 18 Dec 2005 17:57:35 +0100 + +wmtemp (0.0.5-1) unstable; urgency=low + + * New upstream (closes #315552). + + -- Lars Steinke Sun, 18 Dec 2005 17:14:00 +0200 + +wmtemp (0.0.4-2) unstable; urgency=low + + * Manpage fixes. + + -- Lars Steinke (Debian Developer) Fri, 4 Jun 2004 17:14:00 +0200 + +wmtemp (0.0.4-1) unstable; urgency=low + + * Initial Release. + + -- Lars Steinke (Debian Developer) Fri, 4 Jun 2004 15:14:00 +0200 + --- wmtemp-0.0.6.orig/debian/rules +++ wmtemp-0.0.6/debian/rules @@ -0,0 +1,10 @@ +#!/usr/bin/make -f +%: + dh $@ + +override_dh_auto_install: + $(MAKE) install PREFIX=$(CURDIR)/debian/wmtemp/usr + +override_dh_installman: + dh_installman wmtemp.1x + --- wmtemp-0.0.6.orig/xpm/kelvin_on.xpm +++ wmtemp-0.0.6/xpm/kelvin_on.xpm @@ -4,13 +4,13 @@ " c None", ". c #020202", "+ c #0A0A0A", -"@ c #484C46", +"@ c #484C46 s Back1", "# c #DEDEDE", "$ c #779866", -"% c #6EC63B", -"& c #2E4C17", -"* c #6CB237", -"= c #3E463E", +"% c #6EC63B s Back0", +"& c #2E4C17 s Back1", +"* c #6CB237 s Back1", +"= c #3E463E s Back1", " ...................................................... ", " .%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%. ", ".%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#", --- wmtemp-0.0.6.orig/xpm/fahrenheit_on.xpm +++ wmtemp-0.0.6/xpm/fahrenheit_on.xpm @@ -4,13 +4,13 @@ " c None", ". c #020202", "+ c #0A0A0A", -"@ c #484C46", +"@ c #484C46 s Back1", "# c #DEDEDE", "$ c #779866", -"% c #6EC63B", -"& c #2E4C17", -"* c #6CB237", -"= c #3E463E", +"% c #6EC63B s Back0", +"& c #2E4C17 s Back1", +"* c #6CB237 s Back1", +"= c #3E463E s Back1", " ...................................................... ", " .%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%. ", ".%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#", --- wmtemp-0.0.6.orig/xpm/celcius_on.xpm +++ wmtemp-0.0.6/xpm/celcius_on.xpm @@ -4,13 +4,13 @@ " c None", ". c #020202", "+ c #0A0A0A", -"@ c #484C46", +"@ c #484C46 s Back1", "# c #DEDEDE", "$ c #779866", -"% c #6EC63B", -"& c #2E4C17", -"* c #6CB237", -"= c #3E463E", +"% c #6EC63B s Back0", +"& c #2E4C17 s Back1", +"* c #6CB237 s Back1", +"= c #3E463E s Back1", " ...................................................... ", " .%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%. ", ".%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#",