From b45ad32f77804ab78822459e8c1b9dfbcefa4470 Mon Sep 17 00:00:00 2001 From: Will Andrews Date: Sun, 9 Nov 2003 07:40:29 +0000 Subject: Add superkaramba 0.33, a KDE tool that allows interactive eye-candy on the desktop. PR: 56493 Submitted by: Markus Brueffer --- deskutils/superkaramba/Makefile | 50 ++++ deskutils/superkaramba/distinfo | 1 + deskutils/superkaramba/files/patch-configure | 11 + deskutils/superkaramba/files/patch-cpusensor.cpp | 53 +++++ deskutils/superkaramba/files/patch-karamba.cpp | 29 +++ deskutils/superkaramba/files/patch-memsensor.cpp | 261 +++++++++++++++++++++ deskutils/superkaramba/files/patch-memsensor.h | 42 ++++ .../superkaramba/files/patch-networksensor.cpp | 107 +++++++++ deskutils/superkaramba/files/patch-networksensor.h | 27 +++ .../superkaramba/files/patch-sensorsensor.cpp | 63 +++++ deskutils/superkaramba/files/patch-sensorsensor.h | 12 + .../superkaramba/files/patch-src::Makefile.in | 11 + .../superkaramba/files/patch-uptimesensor.cpp | 74 ++++++ deskutils/superkaramba/pkg-descr | 11 + deskutils/superkaramba/pkg-plist | 13 + 15 files changed, 765 insertions(+) create mode 100644 deskutils/superkaramba/Makefile create mode 100644 deskutils/superkaramba/distinfo create mode 100644 deskutils/superkaramba/files/patch-configure create mode 100644 deskutils/superkaramba/files/patch-cpusensor.cpp create mode 100644 deskutils/superkaramba/files/patch-karamba.cpp create mode 100644 deskutils/superkaramba/files/patch-memsensor.cpp create mode 100644 deskutils/superkaramba/files/patch-memsensor.h create mode 100644 deskutils/superkaramba/files/patch-networksensor.cpp create mode 100644 deskutils/superkaramba/files/patch-networksensor.h create mode 100644 deskutils/superkaramba/files/patch-sensorsensor.cpp create mode 100644 deskutils/superkaramba/files/patch-sensorsensor.h create mode 100644 deskutils/superkaramba/files/patch-src::Makefile.in create mode 100644 deskutils/superkaramba/files/patch-uptimesensor.cpp create mode 100644 deskutils/superkaramba/pkg-descr create mode 100644 deskutils/superkaramba/pkg-plist (limited to 'deskutils/superkaramba') diff --git a/deskutils/superkaramba/Makefile b/deskutils/superkaramba/Makefile new file mode 100644 index 000000000000..a75cd08ed4e0 --- /dev/null +++ b/deskutils/superkaramba/Makefile @@ -0,0 +1,50 @@ +# New ports collection makefile for: superkaramba +# Date created: Sat Nov 8 20:23:31 CET 2003 +# Whom: Markus Brueffer +# +# $FreeBSD$ + +PORTNAME= superkaramba +PORTVERSION= 0.33 +CATEGORIES= deskutils kde +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= netdragon + +MAINTAINER= brueffer@phoenix-systems.de +COMMENT= KDE tool that allows interactive eye-candy on the desktop + +.if defined(WITH_XMMS) +LIB_DEPENDS= xmms.4:${PORTSDIR}/multimedia/xmms +.endif + +.if defined(WITH_XMBMON) +RUN_DEPENDS= mbmon:${PORTSDIR}/sysutils/xmbmon +.endif + +USE_KDEBASE_VER= 3 +GNU_CONFIGURE= yes +USE_GMAKE= yes +USE_GNOME= glib12 gtk12 +USE_PYTHON= yes +PYTHON_VERSION= python2.3 +INSTALLS_SHLIB= yes +USE_REINPLACE= yes + +CONFIGURE_ARGS+= --with-pythondir=${PYTHON_INCLUDEDIR} + +CONFIGURE_TARGET= --build=${ARCH}-portbld-freebsd${OSREL} + +pre-everything:: +.if !defined(WITH_XMMS) + @${ECHO_MSG} "You can enable XMMS support by defining WITH_XMMS." +.endif +.if !defined(WITH_XMBMON) + @${ECHO_MSG} "You can enable mainboard monitor support by defining WITH_XMBMON." +.endif + +post-patch: + @${REINPLACE_CMD} -e 's|-O2 ||g' ${WRKSRC}/${CONFIGURE_SCRIPT} + +.include +.include "${PORTSDIR}/x11/kde3/Makefile.kde" +.include diff --git a/deskutils/superkaramba/distinfo b/deskutils/superkaramba/distinfo new file mode 100644 index 000000000000..e5d5f177964a --- /dev/null +++ b/deskutils/superkaramba/distinfo @@ -0,0 +1 @@ +MD5 (superkaramba-0.33.tar.gz) = 132d094a8e35383c757aaf5739fcb856 diff --git a/deskutils/superkaramba/files/patch-configure b/deskutils/superkaramba/files/patch-configure new file mode 100644 index 000000000000..af972e3b4f9f --- /dev/null +++ b/deskutils/superkaramba/files/patch-configure @@ -0,0 +1,11 @@ +--- configure.orig Mon Oct 20 05:45:57 2003 ++++ configure Mon Oct 20 05:49:00 2003 +@@ -31352,7 +31352,7 @@ + ac_save_libs="$LIBS" + LIBS="`xmms-config --libs`" + ac_CPPFLAGS_save="$CPPFLAGS" +- CPPFLAGS="$CPPFLAGS $all_includes `xmms-config --cflags`" ++ CPPFLAGS="$CPPFLAGS $all_includes `xmms-config --cflags` $LIBPTHREAD" + ac_LDFLAGS_save="$LDFLAGS" + LDFLAGS="$LDFLAGS $all_libraries" + cat >conftest.$ac_ext <<_ACEOF diff --git a/deskutils/superkaramba/files/patch-cpusensor.cpp b/deskutils/superkaramba/files/patch-cpusensor.cpp new file mode 100644 index 000000000000..b52b696c4f5e --- /dev/null +++ b/deskutils/superkaramba/files/patch-cpusensor.cpp @@ -0,0 +1,53 @@ +--- src/cpusensor.cpp.orig Mon Apr 21 15:17:03 2003 ++++ src/cpusensor.cpp Wed Aug 27 16:27:57 2003 +@@ -8,6 +8,14 @@ + * (at your option) any later version. * + ***************************************************************************/ + ++#ifdef __FreeBSD__ ++#include ++#include ++#include ++#include ++#include ++#endif ++ + #include "cpusensor.h" + + CPUSensor::CPUSensor( QString cpu, int interval ) : Sensor( interval ) +@@ -24,6 +32,19 @@ + + void CPUSensor::getTicks (long &u,long &s,long &n,long &i) + { ++#ifdef __FreeBSD__ ++ static long cp_time[CPUSTATES]; ++ ++ size_t size = sizeof(cp_time); ++ ++ /* get the cp_time array */ ++ if (sysctlbyname("kern.cp_time", &cp_time, &size, NULL, 0) != -1) { ++ u = cp_time[CP_USER]; ++ s = cp_time[CP_SYS] + cp_time[CP_INTR]; ++ n = cp_time[CP_NICE]; ++ i = cp_time[CP_IDLE]; ++ } ++#else + QFile file("/proc/stat"); + QString line; + if ( file.open(IO_ReadOnly | IO_Translate) ) +@@ -46,6 +67,7 @@ + i = rx.cap(4).toLong(); + file.close(); + } ++#endif + else + { + u = 0; +@@ -53,7 +75,6 @@ + n = 0; + i = 0; + } +- + } + + int CPUSensor::getCPULoad() diff --git a/deskutils/superkaramba/files/patch-karamba.cpp b/deskutils/superkaramba/files/patch-karamba.cpp new file mode 100644 index 000000000000..9dfb42009cd3 --- /dev/null +++ b/deskutils/superkaramba/files/patch-karamba.cpp @@ -0,0 +1,29 @@ +--- src/karamba.cpp.orig 2003-11-07 01:15:20.000000000 -0500 ++++ src/karamba.cpp 2003-11-07 02:30:39.000000000 -0500 +@@ -2662,6 +2662,26 @@ + + } + ++ if( getBoolean("RIGHTBAR", line ) ) ++ { ++ int dw = QApplication::desktop()->width(); ++ move( dw - w, y ); ++ KWin::setStrut( winId(), 0, w, 0, 0 ); ++ toggleLocked->setChecked( true ); ++ slotToggleLocked(); ++ toggleLocked->setEnabled(false); ++ ++ } ++ if( getBoolean("LEFTBAR", line) ) ++ { ++ int dw = QApplication::desktop()->width(); ++ move( 0, y ); ++ KWin::setStrut( winId(), w, 0, 0, 0 ); ++ toggleLocked->setChecked( true ); ++ slotToggleLocked(); ++ toggleLocked->setEnabled(false); ++ ++ } + + bool found = false; + QString path = getString( "MASK", line, found ); diff --git a/deskutils/superkaramba/files/patch-memsensor.cpp b/deskutils/superkaramba/files/patch-memsensor.cpp new file mode 100644 index 000000000000..bc030ef0167e --- /dev/null +++ b/deskutils/superkaramba/files/patch-memsensor.cpp @@ -0,0 +1,261 @@ +--- src/memsensor.cpp.orig Mon Apr 21 15:17:03 2003 ++++ src/memsensor.cpp Fri Sep 5 12:07:36 2003 +@@ -12,63 +12,202 @@ + #include + #include + #include ++ ++#ifdef __FreeBSD__ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* define pagetok in terms of pageshift */ ++#define pagetok(size) ((size) << pageshift) ++#endif ++ + MemSensor::MemSensor(int msec) : Sensor(msec) + { ++#ifdef __FreeBSD__ ++ /* get the page size with "getpagesize" and calculate pageshift from it */ ++ int pagesize = getpagesize(); ++ pageshift = 0; ++ while (pagesize > 1) ++ { ++ pageshift++; ++ pagesize >>= 1; ++ } ++ ++ /* we only need the amount of log(2)1024 for our conversion */ ++ pageshift -= 10; ++ ++# if __FreeBSD_version < 500018 ++ connect(&ksp, SIGNAL(receivedStdout(KProcess *, char *, int )), ++ this,SLOT(receivedStdout(KProcess *, char *, int ))); ++ connect(&ksp, SIGNAL(processExited(KProcess *)), ++ this,SLOT(processExited( KProcess * ))); ++ ++ swapTotal = swapUsed = 0; ++ ++ MaxSet = false; ++ + readValues(); ++# else ++ kd = kvm_open("/dev/null", "/dev/null", "/dev/null", O_RDONLY, "kvm_open"); ++# endif ++#else ++ readValues(); ++#endif + } ++ + MemSensor::~MemSensor() + {} + ++#ifdef __FreeBSD__ ++void MemSensor::receivedStdout(KProcess *, char *buffer, int len ) ++{ ++ buffer[len] = 0; ++ sensorResult += QString( QCString(buffer) ); ++} ++ ++void MemSensor::processExited(KProcess *) ++{ ++ QStringList stringList = QStringList::split('\n',sensorResult); ++ sensorResult = ""; ++ QStringList itemsList = QStringList::split(' ', stringList[1]); ++ ++ swapUsed = itemsList[2].toInt(); ++ swapTotal = itemsList[1].toInt(); ++} ++#endif + + int MemSensor::getMemTotal() + { ++#ifdef __FreeBSD__ ++ static int mem = 0; ++ size_t size = sizeof(mem); ++ ++ sysctlbyname("hw.physmem", &mem, &size, NULL, 0); ++ return (mem / 1024); ++#else + QRegExp rx( "MemTotal:\\s*(\\d+)" ); + rx.search( meminfo ); + return ( rx.cap(1).toInt() ); ++#endif + } + + int MemSensor::getMemFree() + { ++#ifdef __FreeBSD__ ++ static int mem = 0; ++ size_t size = sizeof(mem); ++ ++ sysctlbyname("vm.stats.vm.v_free_count", &mem, &size, NULL, 0); ++ return (pagetok(mem)); ++#else + QRegExp rx( "MemFree:\\s*(\\d+)" ); + rx.search( meminfo ); + return ( rx.cap(1).toInt() ); ++#endif + } + + + int MemSensor::getBuffers() + { ++#ifdef __FreeBSD__ ++ static int mem = 0; ++ size_t size = sizeof(mem); ++ ++ sysctlbyname("vfs.bufspace", &mem, &size, NULL, 0); ++ return (mem / 1024); ++#else + QRegExp rx( "Buffers:\\s*(\\d+)" ); + rx.search( meminfo ); + return ( rx.cap(1).toInt() ); ++#endif + } + + int MemSensor::getCached() + { ++#ifdef __FreeBSD__ ++ static int mem = 0; ++ size_t size = sizeof(mem); ++ ++ sysctlbyname("vm.stats.vm.v_cache_count", &mem, &size, NULL, 0); ++ return (pagetok(mem)); ++#else + QRegExp rx1( "Cached:\\s*(\\d+)" ); + QRegExp rx2( "SwapCached:\\s*(\\d+)" ); + rx1.search( meminfo ); + rx2.search( meminfo ); + return ( rx1.cap(1).toInt() + rx2.cap(1).toInt() ); ++#endif + } + + + int MemSensor::getSwapTotal() + { ++#ifdef __FreeBSD__ ++# if __FreeBSD_version < 500018 ++ return(swapTotal); ++# else ++ int n = -1; ++ int pagesize = getpagesize(); ++ int retavail = 0; ++ ++ if (kd != NULL) ++ n = kvm_getswapinfo(kd, &swapinfo, 1, 0); ++ ++ if (n < 0 || swapinfo.ksw_total == 0) ++ return(0); ++ ++ retavail = swapinfo.ksw_total * pagesize / 1024; ++ ++ return(retavail); ++# endif ++#else + QRegExp rx( "SwapTotal:\\s*(\\d+)" ); + rx.search( meminfo ); + return ( rx.cap(1).toInt() ); ++#endif + } + + int MemSensor::getSwapFree() + { ++#ifdef __FreeBSD__ ++# if __FreeBSD_version < 500018 ++ return(swapTotal - swapUsed); ++# else ++ int n = -1; ++ int pagesize = getpagesize(); ++ int retfree = 0; ++ ++ if (kd != NULL) ++ n = kvm_getswapinfo(kd, &swapinfo, 1, 0); ++ if (n < 0 || swapinfo.ksw_total == 0) ++ return(0); ++ ++ retfree = (swapinfo.ksw_total - swapinfo.ksw_used) * pagesize / 1024; ++ ++ return(retfree); ++# endif ++#else + QRegExp rx( "SwapFree:\\s*(\\d+)" ); + rx.search( meminfo ); + return ( rx.cap(1).toInt() ); ++#endif + } + +- + void MemSensor::readValues() + { ++#ifdef __FreeBSD__ ++# if __FreeBSD_version < 500018 ++ ksp.clearArguments(); ++ ksp << "swapinfo"; ++ ksp.start( KProcess::NotifyOnExit,KProcIO::Stdout); ++# endif ++#else + QFile file("/proc/meminfo"); + QString line; + if ( file.open(IO_ReadOnly | IO_Translate) ) +@@ -77,15 +216,21 @@ + meminfo = t.read(); + file.close(); + } ++#endif + } + + void MemSensor::update() + { ++#if (defined(__FreeBSD__) && __FreeBSD_version < 500018) + readValues(); ++#endif + QString format; + SensorParams *sp; + Meter *meter; + QObjectListIt it( *objList ); ++#if (defined(__FreeBSD__) && __FreeBSD_version < 500018) ++ bool set = false; ++#endif + + int totalMem = getMemTotal(); + int usedMem = totalMem - getMemFree(); +@@ -96,6 +241,12 @@ + while (it != 0) + { + sp = (SensorParams*)(*it); ++#if (defined(__FreeBSD__) && __FreeBSD_version < 500018) ++ if ( (!MaxSet) && (totalSwap > 0) ) { ++ setMaxValue(sp); ++ bool set = true; ++ } ++#endif + meter = sp->getMeter(); + format = sp->getParam("FORMAT"); + if (format.length() == 0 ) +@@ -118,6 +269,11 @@ + meter->setValue(format); + ++it; + } ++#if (defined(__FreeBSD__) && __FreeBSD_version < 500018) ++ if (set) ++ MaxSet = true; ++#endif ++ + } + + void MemSensor::setMaxValue( SensorParams *sp ) +@@ -133,7 +289,6 @@ + } + if( f=="%fm" || f== "%um" || f=="%fmb" || f=="%umb" ) + meter->setMax( getMemTotal() / 1024 ); +- + if( f=="%fs" || f== "%us" ) + meter->setMax( getSwapTotal() / 1024 ); + } diff --git a/deskutils/superkaramba/files/patch-memsensor.h b/deskutils/superkaramba/files/patch-memsensor.h new file mode 100644 index 000000000000..9a5e8fba3e87 --- /dev/null +++ b/deskutils/superkaramba/files/patch-memsensor.h @@ -0,0 +1,42 @@ +--- src/memsensor.h.orig Mon Apr 21 15:17:03 2003 ++++ src/memsensor.h Fri Sep 5 12:08:46 2003 +@@ -12,6 +12,12 @@ + #include "sensor.h" + #include + #include ++#ifdef __FreeBSD__ ++#include ++#include ++#include ++#include ++#endif + + class MemSensor : public Sensor + { +@@ -36,6 +42,26 @@ + private: + QString meminfo; + void readValues(); ++#ifdef __FreeBSD__ ++ int pageshift; /* log base 2 of the pagesize */ ++ QString sensorResult; ++ int swapTotal; ++ int swapUsed; ++ ++# if __FreeBSD_version < 500018 ++ KShellProcess ksp; ++ bool MaxSet; ++ ++# else ++ kvm_t *kd; ++ kvm_swap swapinfo; ++# endif ++ ++private slots: ++ void receivedStdout(KProcess *, char *buffer, int); ++ void processExited(KProcess *); ++ ++#endif + }; + + #endif // MEMSENSOR_H diff --git a/deskutils/superkaramba/files/patch-networksensor.cpp b/deskutils/superkaramba/files/patch-networksensor.cpp new file mode 100644 index 000000000000..413d1f98d207 --- /dev/null +++ b/deskutils/superkaramba/files/patch-networksensor.cpp @@ -0,0 +1,107 @@ +--- src/networksensor.cpp.orig Mon Apr 21 15:17:03 2003 ++++ src/networksensor.cpp Sat Nov 8 19:51:04 2003 +@@ -7,14 +7,67 @@ + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ ++#ifdef __FreeBSD__ ++#include ++#include ++#include ++#include ++#endif ++ ++#include + #include "networksensor.h" + + NetworkSensor::NetworkSensor( QString dev, int interval ):Sensor( interval ) + { + device = dev.lower(); ++ ++#ifdef __FreeBSD__ ++ /* Determine number of interfaces */ ++ u_int n = 0; ++ size_t nlen = 0; ++ nlen = sizeof(n); ++ sysctlbyname("net.link.generic.system.ifcount", &n, &nlen, NULL, 0); ++ ++ size_t if_miblen = 0; ++ if_miblen = sizeof(if_mib); ++ static int name[] = { CTL_NET, ++ PF_LINK, ++ NETLINK_GENERIC, ++ IFMIB_IFDATA, ++ 0, ++ IFDATA_GENERAL }; ++ ++ /* ++ If the device was defined by the theme, find the right devicenumber. ++ If not, use the device that holds the default route. ++ */ ++ ++ if_number = -1; ++ ++ for (int i = 1; i <= n; ++i) { ++ name[4] = i; ++ /* Get data for iface-number i */ ++ sysctl(name, 6, (void*)&if_mib, (size_t*)&if_miblen, (void*)NULL, (size_t)0); ++ ++ if ( device == "" ) { ++ /* Does the interface hold the default route? */ ++ if ( if_mib.ifmd_flags & RTF_GATEWAY ) { ++ if_number = i; ++ break; ++ } ++ } ++ else { ++ /* We found the right interface? */ ++ if (QString(if_mib.ifmd_name) == device) { ++ if_number = i; ++ break; ++ } ++ } ++ } ++#else + if( device == "" ) + device = "eth0"; +- ++#endif + getInOutBytes(receivedBytes,transmittedBytes); + netTimer.start(); + +@@ -24,6 +77,27 @@ + } + void NetworkSensor::getInOutBytes ( unsigned long &in,unsigned long &out) const + { ++#ifdef __FreeBSD__ ++ if (if_number != -1) { ++ size_t if_miblen = 0; ++ if_miblen = sizeof(if_mib); ++ static int name[] = { CTL_NET, ++ PF_LINK, ++ NETLINK_GENERIC, ++ IFMIB_IFDATA, ++ if_number, ++ IFDATA_GENERAL }; ++ ++ sysctl(name, 6, (void*)&if_mib, (size_t*)&if_miblen, (void*)NULL, (size_t)0); ++ ++ in = if_mib.ifmd_data.ifi_ibytes; ++ out = if_mib.ifmd_data.ifi_obytes; ++ } ++ else { ++ in = 0; ++ out = 0; ++ } ++#else + QFile file("/proc/net/dev"); + QString line; + if ( file.open(IO_ReadOnly | IO_Translate) ) +@@ -49,6 +123,7 @@ + } + file.close(); + } ++#endif + } + + void NetworkSensor::update() diff --git a/deskutils/superkaramba/files/patch-networksensor.h b/deskutils/superkaramba/files/patch-networksensor.h new file mode 100644 index 000000000000..14fb452e8598 --- /dev/null +++ b/deskutils/superkaramba/files/patch-networksensor.h @@ -0,0 +1,27 @@ +--- src/networksensor.h.orig Mon Apr 21 15:17:03 2003 ++++ src/networksensor.h Wed Aug 27 16:36:58 2003 +@@ -15,6 +15,12 @@ + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#include ++#include ++#include ++#endif + + class NetworkSensor : public Sensor + { +@@ -30,7 +36,10 @@ + unsigned long transmittedBytes; + QTime netTimer; + QString device; +- ++#ifdef __FreeBSD__ ++ int if_number; ++ ifmibdata if_mib; ++#endif + void getInOutBytes (unsigned long &in,unsigned long &out) const; + + }; diff --git a/deskutils/superkaramba/files/patch-sensorsensor.cpp b/deskutils/superkaramba/files/patch-sensorsensor.cpp new file mode 100644 index 000000000000..d0aef9f41471 --- /dev/null +++ b/deskutils/superkaramba/files/patch-sensorsensor.cpp @@ -0,0 +1,63 @@ +--- src/sensorsensor.cpp.orig Mon Apr 21 15:17:03 2003 ++++ src/sensorsensor.cpp Fri Sep 5 15:07:50 2003 +@@ -12,6 +12,22 @@ + + SensorSensor::SensorSensor( int interval ) : Sensor( interval ) + { ++#ifdef __FreeBSD__ ++ sensorMapBSD["VCore 1"] = "VC0"; ++ sensorMapBSD["VCore 2"] = "VC1"; ++ sensorMapBSD["+3.3V"] = "V33"; ++ sensorMapBSD["+5V"] = "V50P"; ++ sensorMapBSD["+12V"] = "V12P"; ++ sensorMapBSD["-12V"] = "V12N"; ++ sensorMapBSD["-5V"] = "V50N"; ++ sensorMapBSD["fan1"] = "FAN0"; ++ sensorMapBSD["fan2"] = "FAN1"; ++ sensorMapBSD["fan3"] = "FAN2"; ++ sensorMapBSD["temp1"] = "TEMP0"; ++ sensorMapBSD["temp2"] = "TEMP1"; ++ sensorMapBSD["temp3"] = "TEMP2"; ++#endif ++ + connect(&ksp, SIGNAL(receivedStdout(KProcess *, char *, int )), + this,SLOT(receivedStdout(KProcess *, char *, int ))); + connect(&ksp, SIGNAL(processExited(KProcess *)), +@@ -36,8 +52,11 @@ + QStringList stringList = QStringList::split('\n',sensorResult); + sensorResult = ""; + QStringList::Iterator it = stringList.begin(); ++#ifdef __FreeBSD__ ++ QRegExp rx( "^(\\S+)\\s+:\\s+[\\+\\-]?(\\d+\\.?\\d*)"); ++#else + QRegExp rx( "^(\\S+):\\s+[\\+\\-]?(\\d+\\.?\\d*)"); +- ++#endif + while( it != stringList.end()) + { + rx.search( *it ); +@@ -69,7 +88,12 @@ + { + format = "%v"; + } ++ ++#ifdef __FreeBSD__ ++ format.replace( QRegExp("%v", false), sensorMap[sensorMapBSD[type]]); ++#else + format.replace( QRegExp("%v", false), sensorMap[type]); ++#endif + meter->setValue(format); + ++lit; + } +@@ -78,7 +102,11 @@ + void SensorSensor::update() + { + ksp.clearArguments(); ++#ifdef __FreeBSD__ ++ ksp << "mbmon -r -c 1"; ++#else + ksp << "sensors"; ++#endif + ksp.start( KProcess::NotifyOnExit,KProcIO::Stdout); + } + diff --git a/deskutils/superkaramba/files/patch-sensorsensor.h b/deskutils/superkaramba/files/patch-sensorsensor.h new file mode 100644 index 000000000000..3423c38b7b66 --- /dev/null +++ b/deskutils/superkaramba/files/patch-sensorsensor.h @@ -0,0 +1,12 @@ +--- src/sensorsensor.h.orig Fri Sep 5 15:00:20 2003 ++++ src/sensorsensor.h Fri Sep 5 15:12:17 2003 +@@ -32,6 +32,9 @@ + KShellProcess ksp; + + QMap sensorMap; ++#ifdef __FreeBSD__ ++ QMap sensorMapBSD; ++#endif + QString sensorResult; + + private slots: diff --git a/deskutils/superkaramba/files/patch-src::Makefile.in b/deskutils/superkaramba/files/patch-src::Makefile.in new file mode 100644 index 000000000000..a74264a67dc8 --- /dev/null +++ b/deskutils/superkaramba/files/patch-src::Makefile.in @@ -0,0 +1,11 @@ +--- src/Makefile.in.orig Mon Oct 20 04:58:41 2003 ++++ src/Makefile.in Mon Oct 20 04:59:19 2003 +@@ -261,7 +261,7 @@ + # the application source, library search path, and link libraries + superkaramba_SOURCES = main.cpp karamba.cpp meter.h meter.cpp bar.h bar.cpp sensor.h sensor.cpp datesensor.h datesensor.cpp textlabel.h textlabel.cpp memsensor.h memsensor.cpp uptimesensor.h uptimesensor.cpp cpusensor.h cpusensor.cpp networksensor.h networksensor.cpp imagelabel.h imagelabel.cpp graph.h graph.cpp xmmssensor.h xmmssensor.cpp programsensor.h programsensor.cpp disksensor.h disksensor.cpp sensorparams.h sensorparams.cpp sensorsensor.h sensorsensor.cpp textfilesensor.h textfilesensor.cpp clickarea.h clickarea.cpp noatunsensor.h noatunsensor.cpp karambarootpixmap.h karambarootpixmap.cpp clickmap.h clickmap.cpp rsssensor.h rsssensor.cpp textfield.h textfield.cpp taskmanager.h taskmanager.cpp showdesktop.h showdesktop.cpp richtextlabel.h richtextlabel.cpp karambasessionmanaged.h karambasessionmanaged.cpp welcomeform.h welcomeform.cpp systemtray.h systemtray.cpp + superkaramba_LDFLAGS = -Wl,-export-dynamic $(KDE_RPATH) $(all_libraries) $(PYTHONLIB) +-superkaramba_LDADD = -lkio -lXpm $(LIB_KDEUI) $(XMMS_LIBS) $(LIBPYTHON) ++superkaramba_LDADD = -lkio -lXpm $(LIB_KDEUI) $(XMMS_LIBS) $(LIBPYTHON) -lkvm + + # this is where the desktop file will go + shelldesktopdir = $(kde_appsdir)/Utilities diff --git a/deskutils/superkaramba/files/patch-uptimesensor.cpp b/deskutils/superkaramba/files/patch-uptimesensor.cpp new file mode 100644 index 000000000000..9fcccddcb85d --- /dev/null +++ b/deskutils/superkaramba/files/patch-uptimesensor.cpp @@ -0,0 +1,74 @@ +--- src/uptimesensor.cpp.orig Wed Aug 27 01:32:14 2003 ++++ src/uptimesensor.cpp Wed Aug 27 02:34:41 2003 +@@ -7,6 +7,11 @@ + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ ++#ifdef __FreeBSD__ ++#include ++#include ++#endif ++ + #include "uptimesensor.h" + + UptimeSensor::UptimeSensor( int interval ) : Sensor( interval ) +@@ -16,6 +21,42 @@ + + void UptimeSensor::update() + { ++#ifdef __FreeBSD__ ++ struct timeval boottime; ++ time_t now; /* the current time of day */ ++ ++ double avenrun[3]; ++ time_t uptime; ++ int days, hours, i, mins, secs; ++ int mib[2]; ++ size_t size; ++ char buf[256]; ++ ++ /* ++ * Get time of day. ++ */ ++ (void)time(&now); ++ ++ /* ++ * Determine how long system has been up. ++ * (Found by looking getting "boottime" from the kernel) ++ */ ++ mib[0] = CTL_KERN; ++ mib[1] = KERN_BOOTTIME; ++ size = sizeof(boottime); ++ if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && ++ boottime.tv_sec != 0) { ++ uptime = now - boottime.tv_sec; ++ if (uptime > 60) ++ uptime += 30; ++ days = uptime / 86400; ++ uptime %= 86400; ++ hours = uptime / 3600; ++ uptime %= 3600; ++ mins = uptime / 60; ++ secs = uptime % 60; ++ } ++#else + QFile file("/proc/uptime"); + QString line; + if ( file.open(IO_ReadOnly | IO_Translate) ) +@@ -35,7 +76,7 @@ + int mins = uptime / 60; + uptime -= mins * 60; + int secs = uptime; +- ++#endif + + QString format; + SensorParams *sp; +@@ -63,5 +104,7 @@ + meter->setValue(format); + ++it; + } ++#ifndef __FreeBSD__ + } ++#endif + } diff --git a/deskutils/superkaramba/pkg-descr b/deskutils/superkaramba/pkg-descr new file mode 100644 index 000000000000..b6a9cf1df308 --- /dev/null +++ b/deskutils/superkaramba/pkg-descr @@ -0,0 +1,11 @@ +SuperKaramba is, in simple terms, a tool that allows you to easily +create interactive eye-candy on your KDE desktop. + +Here are just some examples of the things that can be done: + + o Display system information such as CPU Usage, MP3 playing, etc. + o Create cool custom toolbars that work any way imaginable + o Create little games or virtual pets that live on your desktop + o Display information from the internet, such as weather and headlines + +WWW: http://netdragon.sourceforge.net diff --git a/deskutils/superkaramba/pkg-plist b/deskutils/superkaramba/pkg-plist new file mode 100644 index 000000000000..027217e6d889 --- /dev/null +++ b/deskutils/superkaramba/pkg-plist @@ -0,0 +1,13 @@ +bin/superkaramba +share/applnk/Utilities/karamba.desktop +share/apps/superkaramba/karambaui.rc +share/doc/HTML/en/karamba/common +share/doc/HTML/en/karamba/index.cache.bz2 +share/doc/HTML/en/karamba/index.docbook +@dirrm share/doc/HTML/en/karamba +@unexec rmdir %D/share/doc/HTML/en 2>/dev/null || true +@unexec rmdir %D/share/doc/HTML 2>/dev/null || true +@dirrm share/apps/superkaramba +@unexec rmdir %D/share/apps 2>/dev/null || true +@unexec rmdir %D/share/applnk/Utilities 2>/dev/null || true +@unexec rmdir %D/share/applnk 2>/dev/null || true -- cgit v1.2.3