--- gkrellm-x86info-0.0.2.orig/debian/control +++ gkrellm-x86info-0.0.2/debian/control @@ -0,0 +1,14 @@ +Source: gkrellm-x86info +Section: x11 +Priority: optional +Build-Depends: debhelper (>= 7.0.50), gkrellm (>= 2.1.4), libgtk2.0-dev, dpatch +Maintainer: Martin Wuertele +Standards-Version: 3.9.2 + +Package: gkrellm-x86info +Architecture: i386 amd64 +Depends: ${shlibs:Depends}, ${misc:Depends}, gkrellm (>= 2.1.4) +Description: gkrellm plugin displaying the current processor speed + This gkrellm plugin calculates the current cpu clock speed and displays it as + a gkrellm monitor. This is useful on Notebooks with broken ACPI and varying + CPU speeds. --- gkrellm-x86info-0.0.2.orig/debian/copyright +++ gkrellm-x86info-0.0.2/debian/copyright @@ -0,0 +1,25 @@ +This package was debianized by Martin Wuertele maxx@debian.org on Sat, 13 Jul 2002 19:38:46 +0200. + +It was downloaded from: http://asdfnews.org/yargon/ + +Upstream Author: Jake Richardson + +Copyright: 2002 by Jake Richardson + +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, 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. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + --- gkrellm-x86info-0.0.2.orig/debian/changelog +++ gkrellm-x86info-0.0.2/debian/changelog @@ -0,0 +1,64 @@ +gkrellm-x86info (0.0.2-9) unstable; urgency=low + + * sync MHz.c with x86info 1.25 + * add README.Debian and document from which machine the stats are displayed + (Closes: #605202) + + -- Martin Wuertele Mon, 25 Jul 2011 14:46:04 +0200 + +gkrellm-x86info (0.0.2-8) unstable; urgency=low + + * added fPIC to fcc options (Closes: #562699), thanks to Carl Johnson + for debugging + + -- Martin Wuertele Sun, 27 Dec 2009 11:41:36 +0100 + +gkrellm-x86info (0.0.2-7) unstable; urgency=low + + * added versioned depends on debhelper + * converted changelog to UTF-8 + + -- Martin Wuertele Sat, 1 May 2004 21:13:35 +0200 + +gkrellm-x86info (0.0.2-6) unstable; urgency=low + + * updated package description + (Closes: #209638) + + -- Martin Wuertele Sun, 26 Oct 2003 13:29:12 +0100 + +gkrellm-x86info (0.0.2-5) unstable; urgency=low + + * changed directory form /usr/lib/gkrellm to /usr/lib/gkrellm2 (no clue, why + gkrellm version 2.x wants it there since the package is named gkrellm now) + (Closes: #179778) + + -- Martin Wuertele Tue, 4 Feb 2003 23:35:26 +0100 + +gkrellm-x86info (0.0.2-4) unstable; urgency=low + + * switched to standards version 3.5.8 + * port to gkrellm2 by Francois Barde + + -- Martin Wuertele Tue, 14 Jan 2003 22:18:03 +0100 + +gkrellm-x86info (0.0.2-3) unstable; urgency=low + + * changed build-depends from gdk-imlib-dev to gdk-imlib1-dev + * added Makefile + * changed to standards version 3.5.7.0 + + -- Martin Würtele Mon, 21 Oct 2002 20:42:03 +0200 + +gkrellm-x86info (0.0.2-2) unstable; urgency=low + + * removed /usr/share/gkrellm/plugins symlink + + -- Martin Würtele Thu, 18 Jul 2002 14:54:56 +0200 + +gkrellm-x86info (0.0.2-1) unstable; urgency=low + + * Initial release. + + -- Martin Würtele Sat, 13 Jul 2002 19:38:46 +0200 + --- gkrellm-x86info-0.0.2.orig/debian/compat +++ gkrellm-x86info-0.0.2/debian/compat @@ -0,0 +1 @@ +7 --- gkrellm-x86info-0.0.2.orig/debian/rules +++ gkrellm-x86info-0.0.2/debian/rules @@ -0,0 +1,96 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# This file is public domain software, originally written by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# Include dpatch stuff. +include /usr/share/dpatch/dpatch.make + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + CFLAGS += -g +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + + +build: build-stamp +build-stamp: patch-stamp + @echo "--- Compiling" + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + + touch build-stamp + +clean: clean1 unpatch clean2 +clean1: + @echo "--- Cleaning" + dh_testdir + dh_testroot + dh_clean + rm -f build-stamp + + # Add here commands to clean up after the build process. + [ ! -f Makefile ] || $(MAKE) clean + +clean2: + [ ! -f Makefile ] || rm -f Makefile + +install: build-stamp + dh_testdir + dh_testroot + dh_clean + dh_installdirs + + # Add here commands to install the package into debian/ + #install -d `pwd`/debian/gkrellm-x86info/usr/lib/gkrellm2/plugins + #install -c -s -m0644 gkx86info.so `pwd`/debian/gkrellm-x86info/usr/lib/gkrellm2/plugins/gkrellm-x86info.so + $(MAKE) install + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs README +# dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron +# dh_installinfo +# dh_undocumented +# dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_makeshlibs + dh_installdeb +# dh_perl + dh_shlibdeps `pwd`/debian/gkrellm-x86info/usr/lib/gkrellm/plugins/gkrellm-x86info.so + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: binary clean binary-indep binary-arch build install patch unpatch clean1 --- gkrellm-x86info-0.0.2.orig/debian/substvars +++ gkrellm-x86info-0.0.2/debian/substvars @@ -0,0 +1 @@ +misc:Depends= --- gkrellm-x86info-0.0.2.orig/debian/README.source +++ gkrellm-x86info-0.0.2/debian/README.source @@ -0,0 +1,2 @@ +This packages uses dpatch to manage differences between the upsteram and the +Debian version. --- gkrellm-x86info-0.0.2.orig/debian/dirs +++ gkrellm-x86info-0.0.2/debian/dirs @@ -0,0 +1 @@ +usr/lib/gkrellm2/plugins --- gkrellm-x86info-0.0.2.orig/debian/README.Debian +++ gkrellm-x86info-0.0.2/debian/README.Debian @@ -0,0 +1,4 @@ +Note: gkrellm-x86info always displays the cpu stats for the local machine, +even when gkrellm is started with -s option. + +Martin Würtele --- gkrellm-x86info-0.0.2.orig/debian/patches/02_gkrellm2-port.dpatch +++ gkrellm-x86info-0.0.2/debian/patches/02_gkrellm2-port.dpatch @@ -0,0 +1,82 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 02_gkrellm2-port.dpatch by Francois Barde +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Port gkrellm-x86info from gkrellm to gkrellm2 + +@DPATCH@ +--- gkx86info.c.orig 2001-10-06 06:44:27.000000000 +0200 ++++ ../gkx86info.c 2010-01-01 19:39:51.000000000 +0100 +@@ -7,18 +7,18 @@ + * + */ + +-#include ++#include + #include "gkx86info.h" + + #define CONFIG_NAME "gkx86info" + #define STYLE_NAME "gkx86info" + +-static Monitor *monitor; +-static Panel *panel; +-static Decal *decal_text1; ++static GkrellmMonitor *monitor; ++static GkrellmPanel *panel; ++static GkrellmDecal *decal_text1; + static gchar *info; + static gint style_id; +-static FILE *x86info_pipe = 0; ++//static FILE *x86info_pipe = 0; + + + static gint +@@ -62,8 +62,8 @@ + static void + create_plugin(GtkWidget *vbox, gint first_create) { + +- Style *style; +- TextStyle *ts, *ts_alt; ++ GkrellmStyle *style; ++ GkrellmTextstyle *ts, *ts_alt; + + if (first_create) + panel = gkrellm_panel_new0(); +@@ -73,21 +73,19 @@ + ts = gkrellm_meter_textstyle(style_id); + ts_alt = gkrellm_meter_alt_textstyle(style_id); + +- decal_text1 = gkrellm_create_decal_text(panel, "Ay", ts, style, -1, -1, -1); +- +- ++ decal_text1 = gkrellm_create_decal_text(panel, "8MHz", ts, style, ++ -1, -1, -1); + + gkrellm_panel_configure(panel, NULL, style); + gkrellm_panel_create(vbox, monitor, panel); + +- + if (first_create) +- gtk_signal_connect(GTK_OBJECT (panel->drawing_area), "expose_event", +- (GtkSignalFunc) panel_expose_event, NULL); ++ g_signal_connect(G_OBJECT (panel->drawing_area), "expose_event", ++ G_CALLBACK (panel_expose_event), NULL); + } + + +-static Monitor plugin_mon = { ++static GkrellmMonitor plugin_mon = { + + CONFIG_NAME, /* Name, for config tab. */ + 0, /* Id, 0 if a plugin */ +@@ -111,8 +109,8 @@ + }; + + +-Monitor * +-init_plugin() { ++GkrellmMonitor * ++gkrellm_init_plugin() { + + style_id = gkrellm_add_meter_style(&plugin_mon, STYLE_NAME); + monitor = &plugin_mon; --- gkrellm-x86info-0.0.2.orig/debian/patches/03_makefile.dpatch +++ gkrellm-x86info-0.0.2/debian/patches/03_makefile.dpatch @@ -0,0 +1,67 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 03_makefile.dpatch by Martin Wuertele +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Add Makefile + +@DPATCH@ +--- gkrellm-x86info-0.0.2.orig/Makefile ++++ gkrellm-x86info-0.0.2/Makefile +@@ -0,0 +1,57 @@ ++ ++# gkrellm-x86info ++# Copyright by Jake Richardson ++# Makefile by Martin Wuertele ++# ++# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++# ++ ++CC=gcc ++CFLAGS=-Wall ++ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) ++CFLAGS += -O0 ++else ++CFLAGS += -O2 ++endif ++ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) ++INSTALL_PROGRAM += -s ++endif ++ ++PREFIX=`pwd`/debian/gkrellm-x86info/usr ++ ++INSTALL=/usr/bin/install -m 0644 ++RM=/bin/rm -f ++RMDIR=/bin/rm -rf ++INSTDIR=/usr/bin/install -d ++ ++all: gkx86info ++ ++gkx86info: ++ $(CC) $(CFLAGS) -fPIC `pkg-config gtk+-2.0 --cflags` -c gkx86info.c ++ $(CC) $(CFLAGS) -fPIC -g -o MHz.o -c MHz.c ++ $(CC) $(CFLAGS) -fPIC -shared -o gkx86info.so MHz.o gkx86info.o ++ ++ ++install: gkx86info ++ @echo $(INSTDIR) $(PREFIX)/lib/gkrellm2/plugins ++ $(INSTDIR) $(PREFIX)/lib/gkrellm2/plugins ++# @echo $(INSTALL) ./gkx86info.so $(PREFIX)/lib/gkrellm2/plugins ++ $(INSTALL) ./gkx86info.so $(PREFIX)/lib/gkrellm2/plugins ++ ++uninstall: ++ $(RM) $(PREFIX)/share/gkrellm2/plugins/gkx86info.so ++ ++clean: ++ $(RM) MHz.o gkx86info.o gkx86info.so --- gkrellm-x86info-0.0.2.orig/debian/patches/01_gcc-options.dpatch +++ gkrellm-x86info-0.0.2/debian/patches/01_gcc-options.dpatch @@ -0,0 +1,21 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 01_gcc-options.dpatch by Martin Wuertele +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: replace gcc with $GCC and honor CFLAGS and DEB_BUILD_OPTIONS + +@DPATCH@ +--- build.orig 2001-10-06 06:35:45.000000000 +0200 ++++ ../build 2010-01-01 19:39:51.000000000 +0100 +@@ -1,5 +1,6 @@ + #!/bin/bash +-gcc -fPIC `gtk-config --cflags` `imlib-config --cflags-gdk` -c gkx86info.c +-gcc -Wall -W -g -O2 -o MHz.o -c MHz.c +-gcc -shared -Wall -o gkx86info.so MHz.o gkx86info.o +-#cp x86info-gkrellm-plugin.so ~/.gkrellm/plugins ++GCC=/usr/bin/gcc-2.95 ++$GCC -fPIC `pkg-config gtk+-2.0 --cflags` -c gkx86info.c ++$GCC -fPIC `--cflags` -o MHz.o -c MHz.c ++$GCC -fPIC `--cflags` -shared -o gkx86info.so MHz.o gkx86info.o ++#cp x86info-gkrellm-plugin.so ~/.gkrellm2/plugins + --- gkrellm-x86info-0.0.2.orig/debian/patches/00list +++ gkrellm-x86info-0.0.2/debian/patches/00list @@ -0,0 +1,2 @@ +02_gkrellm2-port.dpatch +03_makefile.dpatch --- gkrellm-x86info-0.0.2.orig/debian/patches/04_sync_with_x86info.dpatch +++ gkrellm-x86info-0.0.2/debian/patches/04_sync_with_x86info.dpatch @@ -0,0 +1,109 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 04_sync_with_x86info.dpatch by Martin Wuertele +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: updates MHz.c for recent processors + +@DPATCH@ + +--- MHz.c 2010-01-02 20:27:46.000000000 +0100 ++++ /tmp/x86info-1.25/bench/MHz.c 2009-10-30 16:59:46.000000000 +0100 +@@ -1,53 +1,65 @@ + /* +- * $Id: MHz.c,v 1.4 2001/05/21 18:58:01 davej Exp $ +- * This file is part of x86info. + * (C) 2001 Dave Jones. + * + * Licensed under the terms of the GNU GPL License version 2. +- * +- * Estimate CPU MHz routine by Andrea Arcangeli +- * Small changes by David Sterba +- * + */ + + #include + #include +-#include + #include ++#include ++ ++#include ++#include + +-__inline__ unsigned long long int rdtsc() ++#include "../x86info.h" ++#include "bench.h" ++ ++static volatile int nosignal = 0; ++ ++static void sighandler(int sig __attribute__((unused))) + { +- unsigned long long int x; +- __asm__ volatile (".byte 0x0f, 0x31" : "=A" (x)); +- return x; ++ nosignal = 1; + } + +-char *estimate_MHz() ++void estimate_MHz(struct cpudata *cpu) + { +- char *buffer; +- struct timezone tz; +- struct timeval tvstart, tvstop; +- unsigned long long int cycles[2]; /* gotta be 64 bit */ +- unsigned int microseconds; /* total time taken */ +- +- memset(&tz, 0, sizeof(tz)); ++ unsigned long long int cycles[2]; /* gotta be 64 bit */ ++ unsigned int eax, ebx, ecx, edx; ++ unsigned long r; ++ ++ /* Make sure we have a TSC (and hence RDTSC) */ ++ cpuid(cpu->number, 1, &eax, &ebx, &ecx, &edx); ++ if ((edx & (1<<4)) == 0) { ++ printf("No TSC, MHz calculation cannot be performed.\n"); ++ cpu->MHz = 0; ++ return; ++ } ++ ++ if (signal(SIGALRM, sighandler) == SIG_ERR) { ++ printf("Some kind of signal failure.\n"); ++ return; ++ } + +- /* get this function in cached memory */ +- gettimeofday(&tvstart, &tz); + cycles[0] = rdtsc(); +- gettimeofday(&tvstart, &tz); + +- /* we don't trust that this is any specific length of time */ +- usleep(100); +- ++ alarm(1); ++ while (!nosignal) ++ r = r * rand(); ++ ++ nosignal = 0; ++ + cycles[1] = rdtsc(); +- gettimeofday(&tvstop, &tz); +- microseconds = ((tvstop.tv_sec-tvstart.tv_sec)*1000000) + +- (tvstop.tv_usec-tvstart.tv_usec); +- +- buffer = malloc(sizeof(char)*512); +- sprintf(buffer, "%lldMHz", +- (cycles[1]-cycles[0])/microseconds); + +- return buffer; ++ /* Check to see if rdtsc wrapped */ ++ if (cycles[1] < cycles[0]) ++ /* yes we did. */ ++ cpu->MHz = ((-1ULL - cycles[0]) + cycles[1]) / 1000000; ++ else ++ cpu->MHz = (cycles[1] - cycles[0]) / 1000000; ++ ++ if ((cpu->MHz % 50) > 15) ++ cpu->MHz = ((cpu->MHz / 50) * 50) + 50; ++ else ++ cpu->MHz = ((cpu->MHz / 50) * 50); + } --- gkrellm-x86info-0.0.2.orig/debian/source/format +++ gkrellm-x86info-0.0.2/debian/source/format @@ -0,0 +1 @@ +1.0