aboutsummaryrefslogtreecommitdiffstats
path: root/x11/kdebase4-runtime
diff options
context:
space:
mode:
authorwill <will@FreeBSD.org>2001-12-04 11:47:18 +0800
committerwill <will@FreeBSD.org>2001-12-04 11:47:18 +0800
commitc468d09b79a9eac13941146231554832ce733e30 (patch)
tree7ce19e920fd8fee43a88c44cfcfaadc3081846dc /x11/kdebase4-runtime
parent38faa34b2d2a41011556bf2ccde4785a7cb7c584 (diff)
downloadfreebsd-ports-gnome-c468d09b79a9eac13941146231554832ce733e30.tar.gz
freebsd-ports-gnome-c468d09b79a9eac13941146231554832ce733e30.tar.zst
freebsd-ports-gnome-c468d09b79a9eac13941146231554832ce733e30.zip
Upgrade KDE to 2.2.2:
* General: - Support for objprelink. - Hack for autoconf 2.13/automake 1.4. Note that we can't use the standard USE_AUTO* because they change things in work/*; KDE has its own way of doing that. - Light cleanup of extra dirs in the PLISTs provided by my mkplistpkg[1] script. - Speedups of both compile and runtime through the usage of --disable-debug and --enable-final. The latter did not work with the kdemultimedia package, unfortunately. - Patch updates. * audio/kdemultimedia2: - Patch to fix KSCD on FreeBSD[2]. It works very well now. * deskutils/kdepim: - Enable kpilot[3]. Pull in the latest pilot-link stuff. * devel/kdesdk, * devel/kdevelop: - No specific changes. * devel/qt-designer: - Make this port depend almost entirely on qt23 to make it more maintainable, so I don't have to keep hacking the patches to get them to apply. * editors/koffice, * games/kdegames, * graphics/kdegraphics: - No specific changes. * misc/kdeaddons: - SDL is required now. Cull SDL PLIST_SUB and such. - Fix breakage from hardcoding "sdl-config". * misc/kdeutils2: - Fix problem with klaptopdaemon[4] where it didn't properly display the battery time. This patch is untested, but applied. * net/kdenetwork2: - Fix DCC for KSIRC[5]. - Remove ktalkd from the build. It requires some weird thing in the configure script that I don't have time to look at. * sysutils/kdeadmin: - No specific changes. * textproc/kdoc: - Remove bogus requirement that kdoc requires Perl 5.6.0; it sure seems to operate fine with >= 5.005. But I'll let time tell. * www/quanta: - No specific changes (--disable-debug support only). * x11/kde2: - No specific changes. * x11/kdebase2: - Fix ksysguard compile by merging the files from the HEAD branch of KDE CVS that were missing at release time for FreeBSD[6]. :\ * x11/kdelibs2: - Recognize CUPS' spinoff[7]. - Add libxslt dependency since it was removed from kdelibs. - Fix libxml compile problems[8] (accomplished by upgrading). - Remove libkformula from port Makefile; this library has been spun off into koffice. - Fix mode problems with DCOP[9]. This allows you to save files properly. It also seems to be a FreeBSD specific problem. - Fix bashisms in kdeprint/imagetops script[10]. * x11-clocks/kdetoys2: - No specific changes. * x11-toolkits/qt23: - Do NOT upgrade to QT 2.3.2[11]. - Allow devel/qt-designer to depend on this port entirely for the patches by adding a perlre to accomplish this. * x11-wm/kdeartwork: - No specific changes. Thanks to the FreeBSD/KDE[1] team[12] who helped me test these out! [1] http://freebsd.kde.org/; http://www.databits.net/cgi-bin/cvsweb.cgi/scripts/portbuild/mkplistpkg [2] Submitted by: Matthew Holmes <matt@speakeasy.net> [3] PR: 31914 Submitted by: Alan Eldridge <alane@geeksrus.net> [4] PR: 28475 Submitted by: Arun Sharma <arun@sharmas.dhs.org> [5] Submitted by: Luc Morin <luc_m@videotron.ca> [6] Found at: http://webcvs.kde.org/kdebase/ksysguard/ksysguardd/FreeBSD/ [7] PR: 32321 Reported by: gad Submitted by: James A. Halstead <jah4007@cs.rit.edu> [8] PR: 32055 Reported by: William Richard <wrichard@trivalley.com>, others [9] PR: 31629 Submitted by: Alan Eldridge <alane@geeksrus.net> [10] PR: 32358 Submitted by: Alexander N. Kabaev <ak03@gte.com> [11] PR: 31809 Requested by: Nathan Ahlstrom <nrahlstr@winternet.com> (denied) [12] http://freebsd.kde.org/contact.shtml; http://lists.csociety.org/pipermail/kde-freebsd; http://lists.csociety.org/listinfo/kde-freebsd
Diffstat (limited to 'x11/kdebase4-runtime')
-rw-r--r--x11/kdebase4-runtime/Makefile24
-rw-r--r--x11/kdebase4-runtime/distinfo2
-rw-r--r--x11/kdebase4-runtime/files/patch-apm.c101
-rw-r--r--x11/kdebase4-runtime/files/patch-apm.h37
-rw-r--r--x11/kdebase4-runtime/files/patch-conf.c136
-rw-r--r--x11/kdebase4-runtime/files/patch-conf.h37
-rw-r--r--x11/kdebase4-runtime/files/patch-diskstat.c260
-rw-r--r--x11/kdebase4-runtime/files/patch-diskstat.h44
-rw-r--r--x11/kdebase4-runtime/files/patch-ksysguardd.c15
-rw-r--r--x11/kdebase4-runtime/files/patch-ksysguardd.h37
-rw-r--r--x11/kdebase4-runtime/files/patch-loadavg.c100
-rw-r--r--x11/kdebase4-runtime/files/patch-loadavg.h39
-rw-r--r--x11/kdebase4-runtime/files/patch-logfile.c184
-rw-r--r--x11/kdebase4-runtime/files/patch-logfile.h40
-rw-r--r--x11/kdebase4-runtime/files/patch-netdev.c322
-rw-r--r--x11/kdebase4-runtime/files/patch-netdev.h39
-rw-r--r--x11/kdebase4-runtime/pkg-plist38
17 files changed, 1423 insertions, 32 deletions
diff --git a/x11/kdebase4-runtime/Makefile b/x11/kdebase4-runtime/Makefile
index ee69d6cb95bb..f8e6c70e010f 100644
--- a/x11/kdebase4-runtime/Makefile
+++ b/x11/kdebase4-runtime/Makefile
@@ -6,8 +6,7 @@
#
PORTNAME= kdebase
-PORTVERSION= 2.2.1
-PORTREVISION= 1
+PORTVERSION= 2.2.2
CATEGORIES?= x11 kde
MASTER_SITES= ${MASTER_SITE_KDE}
MASTER_SITE_SUBDIR= stable/${PORTVERSION}/src
@@ -15,6 +14,9 @@ DIST_SUBDIR= KDE
MAINTAINER?= kde@FreeBSD.org
+BUILD_DEPENDS= autoconf213:${PORTSDIR}/devel/autoconf213 \
+ automake14:${PORTSDIR}/devel/automake14 \
+ objprelink:${PORTSDIR}/devel/objprelink
LIB_DEPENDS= intl.1:${PORTSDIR}/devel/gettext
USE_KDELIBS_VER=2
@@ -27,8 +29,13 @@ GNU_CONFIGURE= yes
CONFIGURE_ENV+= RUN_KAPPFINDER=no
CONFIGURE_ARGS+=--with-xdmdir=${X11BASE}/lib/X11/xdm \
--with-qt-dir=${X11BASE} \
- --without-ldap \
- --disable-closure
+ --without-ldap --disable-closure --enable-objprelink
+.if defined(PARALLEL_PACKAGE_BUILD) || defined(WANT_KDE_FINAL)
+CONFIGURE_ARGS+=--enable-final
+.endif
+.if defined(PARALLEL_PACKAGE_BUILD) || defined(WANT_KDE_NDEBUG)
+CONFIGURE_ARGS+=--disable-debug
+.endif
USE_GMAKE= yes
.include <bsd.port.pre.mk>
@@ -56,6 +63,15 @@ post-extract:
@${ECHO} "exit 0" >> ${WRKSRC}/mkpamserv
pre-configure:
+ ${MKDIR} ${WRKSRC}/auto-bin
+.for AC in autoconf autoheader
+ ${LN} -sf ${LOCALBASE}/bin/${AC}213 ${WRKSRC}/auto-bin/${AC}
+.endfor
+.for AM in automake aclocal
+ ${LN} -sf ${LOCALBASE}/bin/${AM}14 ${WRKSRC}/auto-bin/${AM}
+.endfor
+ cd ${WRKSRC} && env PATH=$$PATH:${WRKSRC}/auto-bin \
+ ${GMAKE} -f Makefile.cvs
${PERL} -pi -e "s@version-info 3:0@version-info ${SOMAJOR}:${SOMINOR}@g" ${WRKSRC}/libkonq/Makefile.in
${PERL} -pi -e "s@version-info 1:0:0@version-info ${SOMAJOR}:${SOMINOR}@g" ${WRKSRC}/khelpcenter/Makefile.in
${PERL} -pi -e "s@version-info 1:1:0@version-info ${SOMAJOR}:${SOMINOR}@g" ${WRKSRC}/nsplugins/Makefile.in
diff --git a/x11/kdebase4-runtime/distinfo b/x11/kdebase4-runtime/distinfo
index f0d9e99b49aa..251c4afefe28 100644
--- a/x11/kdebase4-runtime/distinfo
+++ b/x11/kdebase4-runtime/distinfo
@@ -1 +1 @@
-MD5 (KDE/kdebase-2.2.1.tar.bz2) = 14c7e9a73f5b60c6b4ed7c14acbfb69a
+MD5 (KDE/kdebase-2.2.2.tar.bz2) = 39635e42056ab2afb8e6f2ff761eea38
diff --git a/x11/kdebase4-runtime/files/patch-apm.c b/x11/kdebase4-runtime/files/patch-apm.c
new file mode 100644
index 000000000000..08925da1dee5
--- /dev/null
+++ b/x11/kdebase4-runtime/files/patch-apm.c
@@ -0,0 +1,101 @@
+--- /dev/null Mon Nov 19 17:14:17 2001
++++ ksysguard/ksysguardd/FreeBSD/apm.c Mon Nov 19 17:06:33 2001
+@@ -0,0 +1,98 @@
++/*
++ KSysGuard, the KDE System Guard
++
++ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of version 2 of the GNU General Public
++ License as published by the Free Software Foundation.
++
++ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++
++ $Id: apm.c,v 1.2 2001/09/18 14:03:53 tokoe Exp $
++*/
++
++#include <fcntl.h>
++#include <machine/apm_bios.h>
++#include <stdio.h>
++
++#include "Command.h"
++#include "apm.h"
++#include "ksysguardd.h"
++
++static int ApmFD, BattFill, BattTime;
++
++#define APMDEV "/dev/apm"
++
++/*
++================================ public part =================================
++*/
++
++void
++initApm(void)
++{
++ if ((ApmFD = open(APMDEV, O_RDONLY)) < 0)
++ return;
++
++ if (updateApm() < 0)
++ return;
++
++ registerMonitor("apm/batterycharge", "integer", printApmBatFill,
++ printApmBatFillInfo);
++ registerMonitor("apm/remainingtime", "integer", printApmBatTime,
++ printApmBatTimeInfo);
++}
++
++void
++exitApm(void)
++{
++ removeMonitor("apm/batterycharge");
++ removeMonitor("apm/remainingtime");
++
++ close(ApmFD);
++}
++
++int
++updateApm(void)
++{
++ struct apm_info info;
++ int retval;
++
++ retval = ioctl(ApmFD, APMIO_GETINFO, &info);
++
++ BattFill = info.ai_batt_life;
++ BattTime = info.ai_batt_time;
++
++ return retval;
++}
++
++void
++printApmBatFill(const char* c)
++{
++ fprintf(CurrentClient, "%d\n", BattFill);
++}
++
++void
++printApmBatFillInfo(const char* c)
++{
++ fprintf(CurrentClient, "Battery charge\t0\t100\t%%\n");
++}
++
++void
++printApmBatTime(const char* c)
++{
++ fprintf(CurrentClient, "%d\n", BattTime);
++}
++
++void
++printApmBatTimeInfo(const char* c)
++{
++ fprintf(CurrentClient, "Remaining battery time\t0\t0\tmin\n");
++}
diff --git a/x11/kdebase4-runtime/files/patch-apm.h b/x11/kdebase4-runtime/files/patch-apm.h
new file mode 100644
index 000000000000..73e509bdd61b
--- /dev/null
+++ b/x11/kdebase4-runtime/files/patch-apm.h
@@ -0,0 +1,37 @@
+--- /dev/null Mon Nov 19 17:14:17 2001
++++ ksysguard/ksysguardd/FreeBSD/apm.h Mon Nov 19 17:06:33 2001
+@@ -0,0 +1,34 @@
++/*
++ KSysGuard, the KDE System Guard
++
++ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of version 2 of the GNU General Public
++ License as published by the Free Software Foundation.
++
++ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++
++ $Id: apm.h,v 1.2 2001/09/18 14:03:53 tokoe Exp $
++*/
++
++#ifndef _apm_h_
++#define _apm_h_
++
++void initApm(void);
++void exitApm(void);
++int updateApm(void);
++
++void printApmBatFill(const char*);
++void printApmBatFillInfo(const char*);
++void printApmBatTime(const char*);
++void printApmBatTimeInfo(const char*);
++
++#endif
diff --git a/x11/kdebase4-runtime/files/patch-conf.c b/x11/kdebase4-runtime/files/patch-conf.c
new file mode 100644
index 000000000000..a4de97379b10
--- /dev/null
+++ b/x11/kdebase4-runtime/files/patch-conf.c
@@ -0,0 +1,136 @@
+--- /dev/null Mon Nov 19 17:14:17 2001
++++ ksysguard/ksysguardd/FreeBSD/conf.c Mon Nov 19 17:06:50 2001
+@@ -0,0 +1,133 @@
++/*
++ KSysGuard, the KDE System Guard
++
++ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of version 2 of the GNU General Public
++ License as published by the Free Software Foundation.
++
++ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++
++ $Id: conf.c,v 1.3 2001/11/05 23:24:19 tokoe Exp $
++*/
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++#include "Command.h"
++#include "ccont.h"
++#include "conf.h"
++
++CONTAINER LogFileList = 0;
++CONTAINER SensorList = 0;
++
++void parseConfigFile(const char *filename)
++{
++ FILE* config;
++ char line[2048];
++ char *begin, *token, *tmp, *confSensor;
++ ConfigLogFile *confLog;
++
++
++ if (LogFileList)
++ destr_ctnr(LogFileList, free);
++
++ if (SensorList)
++ destr_ctnr(SensorList, free);
++
++ LogFileList = new_ctnr(CT_DLL);
++ SensorList = new_ctnr(CT_DLL);
++
++ if ((config = fopen(filename, "r")) == NULL) {
++ log_error("can't open config file '%s'", filename);
++
++ /* if we can't open a config file we have to add the
++ available sensors manually
++ */
++
++ confSensor = strdup("ProcessList");
++ push_ctnr(SensorList, confSensor);
++ confSensor = strdup("Memory");
++ push_ctnr(SensorList, confSensor);
++ confSensor = strdup("Stat");
++ push_ctnr(SensorList, confSensor);
++ confSensor = strdup("NetDev");
++ push_ctnr(SensorList, confSensor);
++ confSensor = strdup("NetStat");
++ push_ctnr(SensorList, confSensor);
++ confSensor = strdup("CpuInfo");
++ push_ctnr(SensorList, confSensor);
++ confSensor = strdup("LoadAvg");
++ push_ctnr(SensorList, confSensor);
++ confSensor = strdup("DiskStat");
++ push_ctnr(SensorList, confSensor);
++ confSensor = strdup("LogFile");
++ push_ctnr(SensorList, confSensor);
++
++ return;
++ }
++
++ while (fgets(line, sizeof(line), config) != NULL) {
++ if ((line[0] == '#') || (strlen(line) == 0)) {
++ continue;
++ }
++
++ if (strchr(line, '#'))
++ *(strchr(line, '#')) = '\0';
++
++ if (line[strlen(line) - 1] == '\n')
++ line[strlen(line) - 1] = '\0';
++
++ if (!strncmp(line, "LogFiles", 8)) {
++ begin = strchr(line, '=');
++ begin++;
++
++ for (token = strtok(begin, ","); token; token = strtok(NULL, ",")) {
++ if ((confLog = (ConfigLogFile *)malloc(sizeof(ConfigLogFile))) == NULL) {
++ log_error("malloc() no free memory avail");
++ continue;
++ }
++ confLog->name = strdup(token);
++ tmp = strchr(confLog->name, ':');
++ *tmp = '\0';
++ confLog->path = tmp;
++ confLog->path++;
++
++ push_ctnr(LogFileList, confLog);
++ }
++ }
++ if (!strncmp(line, "Sensors", 7)) {
++ begin = strchr(line, '=');
++ begin++;
++
++ for (token = strtok(begin, ","); token; token = strtok(NULL, ",")) {
++ confSensor = strdup(token);
++ push_ctnr(SensorList, confSensor);
++ }
++ }
++ }
++
++ fclose(config);
++}
++
++int sensorAvailable(const char *sensor)
++{
++ int i;
++
++ for (i = 0; i < level_ctnr(SensorList); i++) {
++ char* name = get_ctnr(SensorList, i);
++ if (!strcmp(name, sensor))
++ return 1;
++ }
++
++ return 0;
++}
diff --git a/x11/kdebase4-runtime/files/patch-conf.h b/x11/kdebase4-runtime/files/patch-conf.h
new file mode 100644
index 000000000000..8aba2e520205
--- /dev/null
+++ b/x11/kdebase4-runtime/files/patch-conf.h
@@ -0,0 +1,37 @@
+--- /dev/null Mon Nov 19 17:14:17 2001
++++ ksysguard/ksysguardd/FreeBSD/conf.h Mon Nov 19 17:06:50 2001
+@@ -0,0 +1,34 @@
++/*
++ KSysGuard, the KDE System Guard
++
++ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of version 2 of the GNU General Public
++ License as published by the Free Software Foundation.
++
++ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++
++ $Id: conf.h,v 1.2 2001/09/18 14:03:53 tokoe Exp $
++*/
++
++#ifndef _conf_h_
++#define _conf_h_
++
++typedef struct {
++ char *name;
++ char *path;
++} ConfigLogFile;
++
++void parseConfigFile(const char *filename);
++
++int sensorAvailable(const char* sensor);
++
++#endif
diff --git a/x11/kdebase4-runtime/files/patch-diskstat.c b/x11/kdebase4-runtime/files/patch-diskstat.c
new file mode 100644
index 000000000000..5535e580a673
--- /dev/null
+++ b/x11/kdebase4-runtime/files/patch-diskstat.c
@@ -0,0 +1,260 @@
+--- /dev/null Mon Nov 19 17:14:17 2001
++++ ksysguard/ksysguardd/FreeBSD/diskstat.c Mon Nov 19 17:07:01 2001
+@@ -0,0 +1,257 @@
++/*
++ KSysGuard, the KDE System Guard
++
++ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of version 2 of the GNU General Public
++ License as published by the Free Software Foundation.
++
++ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++
++ $Id: diskstat.c,v 1.2 2001/09/18 14:03:53 tokoe Exp $
++*/
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <sys/param.h>
++#include <sys/stat.h>
++#include <sys/ucred.h>
++#include <sys/mount.h>
++#include <time.h>
++#include <unistd.h>
++
++#include "Command.h"
++#include "ccont.h"
++#include "diskstat.h"
++#include "ksysguardd.h"
++
++typedef struct {
++ char device[256];
++ char mntpnt[256];
++ long blocks;
++ long bfree;
++ long bused;
++ int bused_percent;
++} DiskInfo;
++
++static CONTAINER DiskStatList = 0;
++
++char *getMntPnt(const char *cmd)
++{
++ static char device[1024];
++ char *ptr;
++
++ memset(device, 0, sizeof(device));
++ sscanf(cmd, "partitions%1024s", device);
++
++ ptr = (char *)rindex(device, '/');
++ *ptr = '\0';
++
++ return (char *)device;
++}
++
++int numMntPnt(void)
++{
++ struct statfs *fs_info;
++ int i, n, counter = 0;
++
++ n = getmntinfo(&fs_info, MNT_WAIT);
++ for (i = 0; i < n; i++)
++ if (strcmp(fs_info[i].f_fstypename, "procfs") && strcmp(fs_info[i].f_fstypename, "swap") && strcmp(fs_info[i].f_fstypename, "devfs"))
++ counter++;
++
++ return counter;
++}
++
++/* ------------------------------ public part --------------------------- */
++
++void initDiskStat(void)
++{
++ char monitor[1024];
++ int i;
++
++ DiskStatList = new_ctnr(CT_DLL);
++
++ updateDiskStat();
++
++ registerMonitor("partitions/list", "listview", printDiskStat, printDiskStatInfo);
++
++ for (i = 0; i < level_ctnr(DiskStatList); i++) {
++ DiskInfo* disk_info = get_ctnr(DiskStatList, i);
++ snprintf(monitor, sizeof(monitor), "partitions%s/usedspace", disk_info->mntpnt);
++ registerMonitor(monitor, "integer", printDiskStatUsed, printDiskStatUsedInfo);
++ snprintf(monitor, sizeof(monitor), "partitions%s/freespace", disk_info->mntpnt);
++ registerMonitor(monitor, "integer", printDiskStatFree, printDiskStatFreeInfo);
++ snprintf(monitor, sizeof(monitor), "partitions%s/filllevel", disk_info->mntpnt);
++ registerMonitor(monitor, "integer", printDiskStatPercent, printDiskStatPercentInfo);
++ }
++}
++
++void checkDiskStat(void)
++{
++ if (numMntPnt() != level_ctnr(DiskStatList)) {
++ /* a filesystem was mounted or unmounted
++ so we do a reset */
++ exitDiskStat();
++ initDiskStat();
++ }
++}
++
++void exitDiskStat(void)
++{
++ DiskInfo *disk_info;
++ char monitor[1024];
++ int i;
++
++ removeMonitor("partitions/list");
++
++ for (i = 0; i < level_ctnr(DiskStatList); i++) {
++ disk_info = remove_ctnr(DiskStatList, i--);
++
++ snprintf(monitor, sizeof(monitor), "partitions%s/usedspace", disk_info->mntpnt);
++ removeMonitor(monitor);
++ snprintf(monitor, sizeof(monitor), "partitions%s/freespace", disk_info->mntpnt);
++ removeMonitor(monitor);
++ snprintf(monitor, sizeof(monitor), "partitions%s/filllevel", disk_info->mntpnt);
++ removeMonitor(monitor);
++
++ free(disk_info);
++ }
++
++ if (DiskStatList)
++ destr_ctnr(DiskStatList, free);
++}
++
++int updateDiskStat(void)
++{
++ struct statfs *fs_info;
++ struct statfs fs;
++ float percent;
++ int i, mntcount;
++ DiskInfo *disk_info;
++
++ /* let's hope there is no difference between the DiskStatList and
++ the number of mounted filesystems */
++ for (i = 0; i < level_ctnr(DiskStatList); i++)
++ free(remove_ctnr(DiskStatList, i--));
++
++ mntcount = getmntinfo(&fs_info, MNT_WAIT);
++
++ for (i = 0; i < mntcount; i++) {
++ fs = fs_info[i];
++ if (strcmp(fs.f_fstypename, "procfs") && strcmp(fs.f_fstypename, "devfs") && strcmp(fs.f_fstypename, "devfs")) {
++ percent = (((float)fs.f_blocks - (float)fs.f_bfree)/(float)fs.f_blocks);
++ percent = percent * 100;
++ if ((disk_info = (DiskInfo *)malloc(sizeof(DiskInfo))) == NULL) {
++ continue;
++ }
++ memset(disk_info, 0, sizeof(DiskInfo));
++ strncpy(disk_info->device, fs.f_mntfromname, 255);
++ if (!strcmp(fs.f_mntonname, "/")) {
++ strncpy(disk_info->mntpnt, "/root", 6);
++ } else {
++ strncpy(disk_info->mntpnt, fs.f_mntonname, 255);
++ }
++ disk_info->blocks = fs.f_blocks;
++ disk_info->bfree = fs.f_bfree;
++ disk_info->bused = (fs.f_blocks - fs.f_bfree);
++ disk_info->bused_percent = (int)percent;
++
++ push_ctnr(DiskStatList, disk_info);
++ }
++ }
++
++ return 0;
++}
++
++void printDiskStat(const char* cmd)
++{
++ int i;
++
++ for (i = 0; i < level_ctnr(DiskStatList); i++) {
++ DiskInfo* disk_info = get_ctnr(DiskStatList, i);
++ fprintf(CurrentClient, "%s\t%ld\t%ld\t%ld\t%d\t%s\n",
++ disk_info->device,
++ disk_info->blocks,
++ disk_info->bused,
++ disk_info->bfree,
++ disk_info->bused_percent,
++ disk_info->mntpnt);
++ }
++
++ fprintf(CurrentClient, "\n");
++}
++
++void printDiskStatInfo(const char* cmd)
++{
++ fprintf(CurrentClient, "Device\tBlocks\tUsed\tAvailable\tUsed %%\tMountPoint\n");
++}
++
++void printDiskStatUsed(const char* cmd)
++{
++ int i;
++ char *mntpnt = (char *)getMntPnt(cmd);
++
++ for (i = 0; i < level_ctnr(DiskStatList); i++) {
++ DiskInfo* disk_info = get_ctnr(DiskStatList, i);
++ if (!strcmp(mntpnt, disk_info->mntpnt)) {
++ fprintf(CurrentClient, "%ld\n", disk_info->bused);
++ }
++ }
++
++ fprintf(CurrentClient, "\n");
++}
++
++void printDiskStatUsedInfo(const char* cmd)
++{
++ fprintf(CurrentClient, "Used Blocks\t0\t-\tBlocks\n");
++}
++
++void printDiskStatFree(const char* cmd)
++{
++ int i;
++ char *mntpnt = (char *)getMntPnt(cmd);
++
++ for (i = 0; i < level_ctnr(DiskStatList); i++) {
++ DiskInfo* disk_info = get_ctnr(DiskStatList, i);
++ if (!strcmp(mntpnt, disk_info->mntpnt)) {
++ fprintf(CurrentClient, "%ld\n", disk_info->bfree);
++ }
++ }
++
++ fprintf(CurrentClient, "\n");
++}
++
++void printDiskStatFreeInfo(const char* cmd)
++{
++ fprintf(CurrentClient, "Free Blocks\t0\t-\tBlocks\n");
++}
++
++void printDiskStatPercent(const char* cmd)
++{
++ int i;
++ char *mntpnt = (char *)getMntPnt(cmd);
++
++ for (i = 0; i < level_ctnr(DiskStatList); i++) {
++ DiskInfo* disk_info = get_ctnr(DiskStatList, i);
++ if (!strcmp(mntpnt, disk_info->mntpnt)) {
++ fprintf(CurrentClient, "%d\n", disk_info->bused_percent);
++ }
++ }
++
++ fprintf(CurrentClient, "\n");
++}
++
++void printDiskStatPercentInfo(const char* cmd)
++{
++ fprintf(CurrentClient, "Used Blocks\t0\t100\t%%\n");
++}
diff --git a/x11/kdebase4-runtime/files/patch-diskstat.h b/x11/kdebase4-runtime/files/patch-diskstat.h
new file mode 100644
index 000000000000..3b5bf11b89c7
--- /dev/null
+++ b/x11/kdebase4-runtime/files/patch-diskstat.h
@@ -0,0 +1,44 @@
+--- /dev/null Mon Nov 19 17:14:17 2001
++++ ksysguard/ksysguardd/FreeBSD/diskstat.h Mon Nov 19 17:07:01 2001
+@@ -0,0 +1,41 @@
++/*
++ KSysGuard, the KDE System Guard
++
++ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of version 2 of the GNU General Public
++ License as published by the Free Software Foundation.
++
++ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++
++ $Id: diskstat.h,v 1.2 2001/09/18 14:03:53 tokoe Exp $
++*/
++
++#ifndef _diskstat_h_
++#define _diskstat_h_
++
++void initDiskStat(void);
++void exitDiskStat(void);
++
++int updateDiskStat(void);
++void checkDiskStat(void);
++
++void printDiskStat(const char* cmd);
++void printDiskStatInfo(const char* cmd);
++
++void printDiskStatUsed(const char* cmd);
++void printDiskStatUsedInfo(const char* cmd);
++void printDiskStatFree(const char* cmd);
++void printDiskStatFreeInfo(const char* cmd);
++void printDiskStatPercent(const char* cmd);
++void printDiskStatPercentInfo(const char* cmd);
++
++#endif
diff --git a/x11/kdebase4-runtime/files/patch-ksysguardd.c b/x11/kdebase4-runtime/files/patch-ksysguardd.c
new file mode 100644
index 000000000000..940aa4d327a5
--- /dev/null
+++ b/x11/kdebase4-runtime/files/patch-ksysguardd.c
@@ -0,0 +1,15 @@
+--- ksysguard/ksysguardd/FreeBSD/ksysguardd.c 2001/11/17 02:01:46 1.5
++++ ksysguard/ksysguardd/FreeBSD/ksysguardd.c 2001/11/17 06:16:15 1.6
+@@ -17,9 +17,11 @@
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+- $Id: ksysguardd.c,v 1.2.6.1 2001/11/08 10:48:51 tokoe Exp $
++ $Id: ksysguardd.c,v 1.6 2001/11/17 06:16:15 waba Exp $
+ */
+
++#include <config.h>
++
+ #include <ctype.h>
+ #include <fcntl.h>
+ #include <netdb.h>
diff --git a/x11/kdebase4-runtime/files/patch-ksysguardd.h b/x11/kdebase4-runtime/files/patch-ksysguardd.h
new file mode 100644
index 000000000000..1545b83d39d7
--- /dev/null
+++ b/x11/kdebase4-runtime/files/patch-ksysguardd.h
@@ -0,0 +1,37 @@
+--- /dev/null Mon Nov 19 17:14:17 2001
++++ ksysguard/ksysguardd/FreeBSD/ksysguardd.h Mon Nov 19 17:07:38 2001
+@@ -0,0 +1,34 @@
++/*
++ KSysGuard, the KDE System Guard
++
++ Copyright (c) 1999-2001 Chris Schlaeger <cs@kde.org>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of version 2 of the GNU General Public
++ License as published by the Free Software Foundation.
++
++ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++
++ $Id: ksysguardd.h,v 1.2 2001/11/08 10:52:55 tokoe Exp $
++*/
++
++#ifndef _ksysguardd_h_
++#define _ksysguardd_h_
++
++#include <stdio.h>
++
++extern int QuitApp;
++extern int RunAsDaemon;
++extern FILE* CurrentClient;
++
++void updateModules(void);
++void checkModules(void);
++
++#endif
diff --git a/x11/kdebase4-runtime/files/patch-loadavg.c b/x11/kdebase4-runtime/files/patch-loadavg.c
new file mode 100644
index 000000000000..ced78fa5ad68
--- /dev/null
+++ b/x11/kdebase4-runtime/files/patch-loadavg.c
@@ -0,0 +1,100 @@
+--- /dev/null Mon Nov 19 17:14:17 2001
++++ ksysguard/ksysguardd/FreeBSD/loadavg.c Mon Nov 19 17:07:47 2001
+@@ -0,0 +1,97 @@
++/*
++ KSysGuard, the KDE System Guard
++
++ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of version 2 of the GNU General Public
++ License as published by the Free Software Foundation.
++
++ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++
++ $Id: loadavg.c,v 1.2 2001/09/18 14:03:53 tokoe Exp $
++*/
++
++#include <stdio.h>
++#include <stdlib.h>
++
++#include "Command.h"
++#include "ksysguardd.h"
++#include "loadavg.h"
++
++static double LoadAvg[3];
++
++/*
++================================ public part =================================
++*/
++
++void
++initLoadAvg(void)
++{
++ if (updateLoadAvg() < 0)
++ return;
++
++ registerMonitor("cpu/loadavg1", "float", printLoadAvg1,
++ printLoadAvg1Info);
++ registerMonitor("cpu/loadavg5", "float", printLoadAvg5,
++ printLoadAvg5Info);
++ registerMonitor("cpu/loadavg15", "float", printLoadAvg15,
++ printLoadAvg15Info);
++}
++
++void
++exitLoadAvg(void)
++{
++ removeMonitor("cpu/loadavg1");
++ removeMonitor("cpu/loadavg5");
++ removeMonitor("cpu/loadavg15");
++}
++
++int
++updateLoadAvg(void)
++{
++ return getloadavg(LoadAvg, 3);
++}
++
++void
++printLoadAvg1(const char* c)
++{
++ fprintf(CurrentClient, "%f\n", LoadAvg[0]);
++}
++
++void
++printLoadAvg1Info(const char* c)
++{
++ fprintf(CurrentClient, "Load average 1 min\t0\t0\t\n");
++}
++
++void
++printLoadAvg5(const char* c)
++{
++ fprintf(CurrentClient, "%f\n", LoadAvg[1]);
++}
++
++void
++printLoadAvg5Info(const char* c)
++{
++ fprintf(CurrentClient, "Load average 5 min\t0\t0\t\n");
++}
++
++void
++printLoadAvg15(const char* c)
++{
++ fprintf(CurrentClient, "%f\n", LoadAvg[2]);
++}
++
++void
++printLoadAvg15Info(const char* c)
++{
++ fprintf(CurrentClient, "Load average 15 min\t0\t0\t\n");
++}
diff --git a/x11/kdebase4-runtime/files/patch-loadavg.h b/x11/kdebase4-runtime/files/patch-loadavg.h
new file mode 100644
index 000000000000..cdc680cbd492
--- /dev/null
+++ b/x11/kdebase4-runtime/files/patch-loadavg.h
@@ -0,0 +1,39 @@
+--- /dev/null Mon Nov 19 17:14:17 2001
++++ ksysguard/ksysguardd/FreeBSD/loadavg.h Mon Nov 19 17:07:47 2001
+@@ -0,0 +1,36 @@
++/*
++ KSysGuard, the KDE System Guard
++
++ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of version 2 of the GNU General Public
++ License as published by the Free Software Foundation.
++
++ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++
++ $Id: loadavg.h,v 1.2 2001/09/18 14:03:53 tokoe Exp $
++*/
++
++#ifndef _loadavg_h_
++#define _loadavg_h_
++
++void initLoadAvg(void);
++void exitLoadAvg(void);
++int updateLoadAvg(void);
++
++void printLoadAvg1(const char*);
++void printLoadAvg1Info(const char*);
++void printLoadAvg5(const char*);
++void printLoadAvg5Info(const char*);
++void printLoadAvg15(const char*);
++void printLoadAvg15Info(const char*);
++
++#endif
diff --git a/x11/kdebase4-runtime/files/patch-logfile.c b/x11/kdebase4-runtime/files/patch-logfile.c
new file mode 100644
index 000000000000..5fd3def1ae6b
--- /dev/null
+++ b/x11/kdebase4-runtime/files/patch-logfile.c
@@ -0,0 +1,184 @@
+--- /dev/null Mon Nov 19 17:14:17 2001
++++ ksysguard/ksysguardd/FreeBSD/logfile.c Mon Nov 19 17:07:55 2001
+@@ -0,0 +1,181 @@
++/*
++ KSysGuard, the KDE System Guard
++
++ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of version 2 of the GNU General Public
++ License as published by the Free Software Foundation.
++
++ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++
++ $Id: logfile.c,v 1.2 2001/09/18 14:03:53 tokoe Exp $
++*/
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++#include "Command.h"
++#include "ccont.h"
++#include "conf.h"
++#include "ksysguardd.h"
++#include "logfile.h"
++
++static CONTAINER LogFiles = 0;
++static unsigned long counter = 1;
++
++typedef struct {
++ char name[256];
++ FILE* fh;
++ unsigned long id;
++} LogFileEntry;
++
++extern CONTAINER LogFileList;
++
++/*
++================================ public part =================================
++*/
++
++void initLogFile(void)
++{
++ int i;
++ char monitor[1024];
++
++ registerCommand("logfile_register", registerLogFile);
++ registerCommand("logfile_unregister", unregisterLogFile);
++ registerCommand("logfile_registered", printRegistered);
++
++ for (i = 0; i < level_ctnr(LogFileList); i++)
++ {
++ FILE* fp;
++ ConfigLogFile *entry = get_ctnr(LogFileList, i);
++ /* register the log file if we can actually read the file. */
++ if ((fp = fopen(entry->path, "r")) != NULL)
++ {
++ fclose(fp);
++ snprintf(monitor, 1024, "logfiles/%s", entry->name);
++ registerMonitor(monitor, "logfile", printLogFile,
++ printLogFileInfo);
++ }
++ }
++
++ LogFiles = new_ctnr(CT_DLL);
++}
++
++void exitLogFile(void)
++{
++ if (LogFiles)
++ destr_ctnr(LogFiles, free);
++}
++
++void printLogFile(const char* cmd)
++{
++ char line[1024];
++ unsigned long id;
++ int i;
++ char ch;
++
++ sscanf(cmd, "%*s %lu", &id);
++
++ for (i = 0; i < level_ctnr(LogFiles); i++) {
++ LogFileEntry *entry = get_ctnr(LogFiles, i);
++
++ if (entry->id == id) {
++ while (fgets(line, sizeof(line), entry->fh) != NULL) {
++ fprintf(CurrentClient, "%s", line);
++ }
++ clearerr(entry->fh);
++ }
++ }
++
++ fprintf(CurrentClient, "\n");
++}
++
++void printLogFileInfo(const char* cmd)
++{
++ fprintf(CurrentClient, "LogFile\n");
++}
++
++void registerLogFile(const char* cmd)
++{
++ char name[256];
++ FILE* file;
++ LogFileEntry *entry;
++ int i;
++
++ memset(name, 0, sizeof(name));
++ sscanf(cmd, "%*s %256s", name);
++
++ for (i = 0; i < level_ctnr(LogFileList); i++) {
++ ConfigLogFile *conf = get_ctnr(LogFileList, i);
++ if (!strcmp(conf->name, name)) {
++ if ((file = fopen(conf->path, "r")) == NULL) {
++ print_error("fopen()");
++ fprintf(CurrentClient, "0\n");
++ return;
++ }
++
++ fseek(file, 0, SEEK_END);
++
++ if ((entry = (LogFileEntry *)malloc(sizeof(LogFileEntry))) == NULL) {
++ print_error("malloc()");
++ fprintf(CurrentClient, "0\n");
++ return;
++ }
++
++ entry->fh = file;
++ strncpy(entry->name, conf->name, 256);
++ entry->id = counter;
++
++ push_ctnr(LogFiles, entry);
++
++ fprintf(CurrentClient, "%lu\n", counter);
++ counter++;
++
++ return;
++ }
++ }
++
++ fprintf(CurrentClient, "0\n");
++}
++
++void unregisterLogFile(const char* cmd)
++{
++ unsigned long id;
++ int i;
++
++ sscanf(cmd, "%*s %lu", &id);
++
++ for (i = 0; i < level_ctnr(LogFiles); i++) {
++ LogFileEntry *entry = get_ctnr(LogFiles, i);
++
++ if (entry->id == id) {
++ fclose(entry->fh);
++ free(remove_ctnr(LogFiles, i));
++ fprintf(CurrentClient, "\n");
++ return;
++ }
++ }
++
++ fprintf(CurrentClient, "\n");
++}
++
++void printRegistered(const char* cmd)
++{
++ int i;
++
++ for (i = 0; i < level_ctnr(LogFiles); i++) {
++ LogFileEntry *entry = get_ctnr(LogFiles, i);
++ fprintf(CurrentClient, "%s:%lu\n", entry->name, entry->id);
++ }
++
++ fprintf(CurrentClient, "\n");
++}
diff --git a/x11/kdebase4-runtime/files/patch-logfile.h b/x11/kdebase4-runtime/files/patch-logfile.h
new file mode 100644
index 000000000000..69b8d6ed1ca6
--- /dev/null
+++ b/x11/kdebase4-runtime/files/patch-logfile.h
@@ -0,0 +1,40 @@
+--- /dev/null Mon Nov 19 17:14:17 2001
++++ ksysguard/ksysguardd/FreeBSD/logfile.h Mon Nov 19 17:07:55 2001
+@@ -0,0 +1,37 @@
++/*
++ KSysGuard, the KDE System Guard
++
++ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of version 2 of the GNU General Public
++ License as published by the Free Software Foundation.
++
++ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++
++ $Id: logfile.h,v 1.2 2001/09/18 14:03:53 tokoe Exp $
++*/
++
++#ifndef _logfile_h_
++#define _logfile_h_
++
++void initLogFile(void);
++void exitLogFile(void);
++
++void printLogFile(const char* cmd);
++void printLogFileInfo(const char* cmd);
++
++void registerLogFile(const char* cmd);
++void unregisterLogFile(const char* cmd);
++
++/* debug command */
++void printRegistered(const char* cmd);
++
++#endif
diff --git a/x11/kdebase4-runtime/files/patch-netdev.c b/x11/kdebase4-runtime/files/patch-netdev.c
new file mode 100644
index 000000000000..2c0f473ebbcf
--- /dev/null
+++ b/x11/kdebase4-runtime/files/patch-netdev.c
@@ -0,0 +1,322 @@
+--- /dev/null Mon Nov 19 17:14:17 2001
++++ ksysguard/ksysguardd/FreeBSD/netdev.c Mon Nov 19 17:08:04 2001
+@@ -0,0 +1,319 @@
++/*
++ KSysGuard, the KDE System Guard
++
++ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of version 2 of the GNU General Public
++ License as published by the Free Software Foundation.
++
++ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++
++ $Id: netdev.c,v 1.2 2001/09/18 14:03:53 tokoe Exp $
++*/
++
++#include <fcntl.h>
++#include <sys/socket.h>
++#include <net/if.h>
++#include <net/if_mib.h>
++#include <stdio.h>
++#include <string.h>
++#include <sys/sysctl.h>
++#include <sys/time.h>
++#include <sys/types.h>
++#include <unistd.h>
++
++
++#include "Command.h"
++#include "ksysguardd.h"
++#include "netdev.h"
++
++
++typedef struct {
++ char name[32];
++ u_long recBytes;
++ u_long recPacks;
++ u_long recErrs;
++ u_long recDrop;
++ u_long recMulticast;
++ u_long sentBytes;
++ u_long sentPacks;
++ u_long sentErrs;
++ u_long sentMulticast;
++ u_long sentColls;
++} NetDevInfo;
++
++#define MAXNETDEVS 64
++static NetDevInfo NetDevs[MAXNETDEVS];
++static int NetDevCnt = 0;
++
++char **parseCommand(const char *cmd)
++{
++ char tmp_cmd[1024];
++ char *begin;
++ static char sensor[100];
++ static char interface[100];
++ static char* retval[2];
++
++ strncpy(tmp_cmd, cmd, 1024);
++
++ begin = rindex(tmp_cmd, '/');
++ *begin = '\0';
++ begin++;
++ strcpy(sensor, begin);
++ retval[1] = sensor;
++
++ begin = rindex(tmp_cmd, '/');
++ *begin = '\0';
++ begin = rindex(tmp_cmd, '/');
++ begin++;
++ strcpy(interface, begin);
++ retval[0] = interface;
++
++ return retval;
++}
++
++int numActivIfaces(void)
++{
++ int counter = 0;
++ int name[6];
++ int num_iface, i;
++ size_t len;
++ struct ifmibdata ifmd;
++
++ len = sizeof(num_iface);
++ sysctlbyname("net.link.generic.system.ifcount", &num_iface, &len, NULL, 0);
++
++ for (i = 1; i < num_iface + 1; i++) {
++ name[0] = CTL_NET;
++ name[1] = PF_LINK;
++ name[2] = NETLINK_GENERIC;
++ name[3] = IFMIB_IFDATA;
++ name[4] = i;
++ name[5] = IFDATA_GENERAL;
++
++ len = sizeof(ifmd);
++ sysctl(name, 6, &ifmd, &len, NULL, 0);
++ if (ifmd.ifmd_flags & IFF_UP)
++ counter++;
++ }
++
++ return counter;
++}
++
++/* ------------------------------ public part --------------------------- */
++
++void initNetDev(void)
++{
++ int i;
++ char monitor[1024];
++
++ updateNetDev();
++
++ for (i = 0; i < NetDevCnt; i++) {
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/data", NetDevs[i].name);
++ registerMonitor(monitor, "integer", printNetDevRecBytes, printNetDevRecBytesInfo);
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/packets", NetDevs[i].name);
++ registerMonitor(monitor, "integer", printNetDevRecBytes, printNetDevRecBytesInfo);
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/errors", NetDevs[i].name);
++ registerMonitor(monitor, "integer", printNetDevRecBytes, printNetDevRecBytesInfo);
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/drops", NetDevs[i].name);
++ registerMonitor(monitor, "integer", printNetDevRecBytes, printNetDevRecBytesInfo);
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/multicast", NetDevs[i].name);
++ registerMonitor(monitor, "integer", printNetDevRecBytes, printNetDevRecBytesInfo);
++
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/data", NetDevs[i].name);
++ registerMonitor(monitor, "integer", printNetDevSentBytes, printNetDevSentBytesInfo);
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/packets", NetDevs[i].name);
++ registerMonitor(monitor, "integer", printNetDevSentBytes, printNetDevSentBytesInfo);
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/errors", NetDevs[i].name);
++ registerMonitor(monitor, "integer", printNetDevSentBytes, printNetDevSentBytesInfo);
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/multicast", NetDevs[i].name);
++ registerMonitor(monitor, "integer", printNetDevSentBytes, printNetDevSentBytesInfo);
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/collisions", NetDevs[i].name);
++ registerMonitor(monitor, "integer", printNetDevSentBytes, printNetDevSentBytesInfo);
++ }
++}
++
++void exitNetDev(void)
++{
++ int i;
++ char monitor[1024];
++
++ for (i = 0; i < NetDevCnt; i++) {
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/data", NetDevs[i].name);
++ removeMonitor(monitor);
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/packets", NetDevs[i].name);
++ removeMonitor(monitor);
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/errors", NetDevs[i].name);
++ removeMonitor(monitor);
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/drops", NetDevs[i].name);
++ removeMonitor(monitor);
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/multicast", NetDevs[i].name);
++ removeMonitor(monitor);
++
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/data", NetDevs[i].name);
++ removeMonitor(monitor);
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/packets", NetDevs[i].name);
++ removeMonitor(monitor);
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/errors", NetDevs[i].name);
++ removeMonitor(monitor);
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/multicast", NetDevs[i].name);
++ removeMonitor(monitor);
++ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/collisions", NetDevs[i].name);
++ removeMonitor(monitor);
++ }
++}
++
++void updateNetDev(void)
++{
++ int name[6];
++ int num_iface, i;
++ size_t len;
++ struct ifmibdata ifmd;
++
++ len = sizeof(num_iface);
++ sysctlbyname("net.link.generic.system.ifcount", &num_iface, &len, NULL, 0);
++
++ NetDevCnt = 0;
++ for (i = 1; i < num_iface + 1; i++) {
++ name[0] = CTL_NET;
++ name[1] = PF_LINK;
++ name[2] = NETLINK_GENERIC;
++ name[3] = IFMIB_IFDATA;
++ name[4] = i;
++ name[5] = IFDATA_GENERAL;
++
++ len = sizeof(ifmd);
++ sysctl(name, 6, &ifmd, &len, NULL, 0);
++ if (ifmd.ifmd_flags & IFF_UP) {
++ strncpy(NetDevs[NetDevCnt].name, ifmd.ifmd_name, 32);
++ NetDevs[NetDevCnt].recBytes = ifmd.ifmd_data.ifi_ibytes - NetDevs[NetDevCnt].recBytes;
++ NetDevs[NetDevCnt].recPacks = ifmd.ifmd_data.ifi_ipackets - NetDevs[NetDevCnt].recPacks;
++ NetDevs[NetDevCnt].recErrs = ifmd.ifmd_data.ifi_ierrors - NetDevs[NetDevCnt].recErrs;
++ NetDevs[NetDevCnt].recDrop = ifmd.ifmd_data.ifi_iqdrops - NetDevs[NetDevCnt].recDrop;
++ NetDevs[NetDevCnt].recMulticast = ifmd.ifmd_data.ifi_imcasts - NetDevs[NetDevCnt].recMulticast;
++ NetDevs[NetDevCnt].sentBytes = ifmd.ifmd_data.ifi_obytes - NetDevs[NetDevCnt].sentBytes;
++ NetDevs[NetDevCnt].sentPacks = ifmd.ifmd_data.ifi_opackets - NetDevs[NetDevCnt].sentPacks;
++ NetDevs[NetDevCnt].sentErrs = ifmd.ifmd_data.ifi_oerrors - NetDevs[NetDevCnt].sentErrs;
++ NetDevs[NetDevCnt].sentMulticast = ifmd.ifmd_data.ifi_omcasts - NetDevs[NetDevCnt].sentMulticast;
++ NetDevs[NetDevCnt].sentColls = ifmd.ifmd_data.ifi_collisions - NetDevs[NetDevCnt].sentColls;
++ NetDevCnt++;
++ }
++ }
++}
++
++void checkNetDev(void)
++{
++ if (numActivIfaces() != NetDevCnt) {
++ /* interface has been added or removed
++ so we do a reset */
++ exitNetDev();
++ initNetDev();
++ }
++}
++
++void printNetDevRecBytes(const char *cmd)
++{
++ int i;
++ char **retval;
++
++ retval = parseCommand(cmd);
++
++ if (retval[0] == NULL || retval[1] == NULL)
++ return;
++
++ for (i = 0; i < NetDevCnt; i++) {
++ if (!strcmp(NetDevs[i].name, retval[0])) {
++ if (!strncmp(retval[1], "data", 4))
++ fprintf(CurrentClient, "%lu", NetDevs[i].recBytes);
++ if (!strncmp(retval[1], "packets", 7))
++ fprintf(CurrentClient, "%lu", NetDevs[i].recPacks);
++ if (!strncmp(retval[1], "errors", 6))
++ fprintf(CurrentClient, "%lu", NetDevs[i].recErrs);
++ if (!strncmp(retval[1], "drops", 5))
++ fprintf(CurrentClient, "%lu", NetDevs[i].recDrop);
++ if (!strncmp(retval[1], "multicast", 9))
++ fprintf(CurrentClient, "%lu", NetDevs[i].recMulticast);
++ }
++ }
++
++ fprintf(CurrentClient, "\n");
++}
++
++void printNetDevRecBytesInfo(const char *cmd)
++{
++ char **retval;
++
++ retval = parseCommand(cmd);
++
++ if (retval[1] == NULL)
++ return;
++
++ if (!strncmp(retval[1], "data", 4))
++ fprintf(CurrentClient, "Received Data\t0\t0\tkBytes/s\n");
++ if (!strncmp(retval[1], "packets", 7))
++ fprintf(CurrentClient, "Received Packets\t0\t0\t1/s\n");
++ if (!strncmp(retval[1], "errors", 6))
++ fprintf(CurrentClient, "Receiver Errors\t0\t0\t1/s\n");
++ if (!strncmp(retval[1], "drops", 5))
++ fprintf(CurrentClient, "Receiver Drops\t0\t0\t1/s\n");
++ if (!strncmp(retval[1], "multicast", 9))
++ fprintf(CurrentClient, "Received Multicast Packets\t0\t0\t1/s\n");
++}
++
++void printNetDevSentBytes(const char *cmd)
++{
++ int i;
++ char **retval;
++
++ retval = parseCommand(cmd);
++
++ if (retval[0] == NULL || retval[1] == NULL)
++ return;
++
++ for (i = 0; i < NetDevCnt; i++) {
++ if (!strcmp(NetDevs[i].name, retval[0])) {
++ if (!strncmp(retval[1], "data", 4))
++ fprintf(CurrentClient, "%lu", NetDevs[i].sentBytes);
++ if (!strncmp(retval[1], "packets", 7))
++ fprintf(CurrentClient, "%lu", NetDevs[i].sentPacks);
++ if (!strncmp(retval[1], "errors", 6))
++ fprintf(CurrentClient, "%lu", NetDevs[i].sentErrs);
++ if (!strncmp(retval[1], "multicast", 9))
++ fprintf(CurrentClient, "%lu", NetDevs[i].sentMulticast);
++ if (!strncmp(retval[1], "collisions", 10))
++ fprintf(CurrentClient, "%lu", NetDevs[i].sentColls);
++ }
++ }
++
++ fprintf(CurrentClient, "\n");
++}
++
++void printNetDevSentBytesInfo(const char *cmd)
++{
++ char **retval;
++
++ retval = parseCommand(cmd);
++
++ if (retval[1] == NULL)
++ return;
++
++ if (!strncmp(retval[1], "data", 4))
++ fprintf(CurrentClient, "Sent Data\t0\t0\tkBytes/s\n");
++ if (!strncmp(retval[1], "packets", 7))
++ fprintf(CurrentClient, "Sent Packets\t0\t0\t1/s\n");
++ if (!strncmp(retval[1], "errors", 6))
++ fprintf(CurrentClient, "Transmitter Errors\t0\t0\t1/s\n");
++ if (!strncmp(retval[1], "multicast", 9))
++ fprintf(CurrentClient, "Sent Multicast Packets\t0\t0\t1/s\n");
++ if (!strncmp(retval[1], "collisions", 10))
++ fprintf(CurrentClient, "Transmitter Collisions\t0\t0\t1/s\n");
++}
diff --git a/x11/kdebase4-runtime/files/patch-netdev.h b/x11/kdebase4-runtime/files/patch-netdev.h
new file mode 100644
index 000000000000..3c291f85dc9e
--- /dev/null
+++ b/x11/kdebase4-runtime/files/patch-netdev.h
@@ -0,0 +1,39 @@
+--- /dev/null Mon Nov 19 17:14:17 2001
++++ ksysguard/ksysguardd/FreeBSD/netdev.h Mon Nov 19 17:08:04 2001
+@@ -0,0 +1,36 @@
++/*
++ KSysGuard, the KDE System Guard
++
++ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de>
++
++ This program is free software; you can redistribute it and/or
++ modify it under the terms of version 2 of the GNU General Public
++ License as published by the Free Software Foundation.
++
++ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++
++ $Id: netdev.h,v 1.2 2001/09/18 14:03:53 tokoe Exp $
++*/
++
++#ifndef _netdev_h_
++#define _netdev_h_
++
++void initNetDev(void);
++void exitNetDev(void);
++
++void updateNetDev(void);
++void checkNetDev(void);
++
++void printNetDevRecBytes(const char* cmd);
++void printNetDevRecBytesInfo(const char* cmd);
++void printNetDevSentBytes(const char* cmd);
++void printNetDevSentBytesInfo(const char* cmd);
++
++#endif
diff --git a/x11/kdebase4-runtime/pkg-plist b/x11/kdebase4-runtime/pkg-plist
index 5466b74bfbc6..3b9d7855dd8d 100644
--- a/x11/kdebase4-runtime/pkg-plist
+++ b/x11/kdebase4-runtime/pkg-plist
@@ -229,7 +229,6 @@ lib/kde2/libkcm_kwinoptions.la
lib/kde2/libkcm_kwinoptions.so
lib/kde2/libkcm_launch.la
lib/kde2/libkcm_launch.so
-lib/kde2/libkcm_launch.so.0
lib/kde2/libkcm_locale.la
lib/kde2/libkcm_locale.so
lib/kde2/libkcm_midi.la
@@ -277,7 +276,6 @@ lib/kde2/libkonqsidebartree_dirtree.la
lib/kde2/libkonqsidebartree_dirtree.so
lib/kde2/libkonqsidebartree_history.la
lib/kde2/libkonqsidebartree_history.so
-lib/kde2/libkonqsidebartree_history.so.0
lib/kde2/libkonqsound.la
lib/kde2/libkonqsound.so
lib/kde2/libkonqtree.la
@@ -1146,9 +1144,6 @@ share/apps/konsole/konsole_part.rc
share/apps/konsole/linux.desktop
share/apps/konsole/linux.keytab
share/apps/konsole/mc.desktop
-share/apps/konsole/pics/brightness.png
-share/apps/konsole/pics/colourness.png
-share/apps/konsole/pics/contrast.png
share/apps/konsole/shell.desktop
share/apps/konsole/su.desktop
share/apps/konsole/sumc.desktop
@@ -1284,8 +1279,14 @@ share/config/imsmaprc
share/config/interferencerc
share/config/kdesktop_custom_menu1
share/config/kdesktop_custom_menu2
+share/config/kdm/Xaccess
+share/config/kdm/Xreset
+share/config/kdm/Xservers
+share/config/kdm/Xsession
+share/config/kdm/Xsetup
+share/config/kdm/Xstartup
+share/config/kdm/Xwilling
share/config/kdm/kdmrc
-share/config/kdm/README
share/config/klipperrc
share/config/konqsidebartng.rc
share/config/konsolerc
@@ -2158,6 +2159,8 @@ share/locale/l10n/hr/entry.desktop
share/locale/l10n/hr/flag.png
share/locale/l10n/hu/entry.desktop
share/locale/l10n/hu/flag.png
+share/locale/l10n/id/entry.desktop
+share/locale/l10n/id/flag.png
share/locale/l10n/ie/entry.desktop
share/locale/l10n/ie/flag.png
share/locale/l10n/il/entry.desktop
@@ -2426,18 +2429,12 @@ share/wallpapers/simple_wallpaper.jpg
share/wallpapers/sunday_brunch.jpg
share/wallpapers/vegetative_fog.jpg
@dirrm share/wallpapers
-@exec mkdir %D/share/templates/.source/emptydir
-@exec chmod 644 %D/share/templates/.source/emptydir
-@unexec rmdir %D/share/templates/.source/emptydir
+@dirrm share/templates/.source/emptydir
@dirrm share/templates/.source
@dirrm share/templates
@dirrm share/sounds
-@dirrm share/servicetypes
@dirrm share/services/useragentstrings
@dirrm share/services/searchproviders
-@dirrm share/services/kded
-@dirrm share/services
-@dirrm share/mimelnk/application
@dirrm share/locale/l10n/za
@dirrm share/locale/l10n/ve
@dirrm share/locale/l10n/vc
@@ -2479,6 +2476,7 @@ share/wallpapers/vegetative_fog.jpg
@dirrm share/locale/l10n/is
@dirrm share/locale/l10n/il
@dirrm share/locale/l10n/ie
+@dirrm share/locale/l10n/id
@dirrm share/locale/l10n/hu
@dirrm share/locale/l10n/hr
@dirrm share/locale/l10n/hn
@@ -2512,22 +2510,13 @@ share/wallpapers/vegetative_fog.jpg
@dirrm share/locale/l10n/ag
@dirrm share/locale/l10n/C
@dirrm share/locale/l10n
-@dirrm share/locale/C
-@dirrm share/locale
@dirrm share/icons/locolor/32x32/apps
@dirrm share/icons/locolor/32x32
@dirrm share/icons/locolor/16x16/apps
@dirrm share/icons/locolor/16x16
@dirrm share/icons/locolor
-@dirrm share/icons/hicolor/48x48/filesystems
@dirrm share/icons/hicolor/48x48/apps
-@dirrm share/icons/hicolor/32x32/filesystems
@dirrm share/icons/hicolor/32x32/apps
-@dirrm share/icons/hicolor/32x32/actions
-@dirrm share/icons/hicolor/22x22/actions
-@dirrm share/icons/hicolor/16x16/filesystems
-@dirrm share/icons/hicolor/16x16/apps
-@dirrm share/icons/hicolor/16x16/actions
@dirrm share/fonts/override
@dirrm share/fonts
@dirrm share/doc/HTML/en/kwrite
@@ -2552,9 +2541,7 @@ share/wallpapers/vegetative_fog.jpg
@dirrm share/doc/HTML/en/kcontrol
@dirrm share/doc/HTML/en/kate
@dirrm share/doc/HTML/en/kaddressbook
-@dirrm share/doc/HTML/en
@dirrm share/config/kdm
-@dirrm share/config
@dirrm share/autostart
@dirrm share/apps/naughtyapplet/pics
@dirrm share/apps/naughtyapplet
@@ -2572,7 +2559,6 @@ share/wallpapers/vegetative_fog.jpg
@dirrm share/apps/kscreensaver
@dirrm share/apps/kpersonalizer/pics
@dirrm share/apps/kpersonalizer
-@dirrm share/apps/konsole/pics
@dirrm share/apps/konsole
@dirrm share/apps/konqueror/tiles
@dirrm share/apps/konqueror/profiles
@@ -2658,7 +2644,6 @@ share/wallpapers/vegetative_fog.jpg
@dirrm share/apps/kdcop
@dirrm share/apps/kcontrol/pics
@dirrm share/apps/kcontrol
-@dirrm share/apps/kconf_update
@dirrm share/apps/kcmusb
@dirrm share/apps/kcmlocale/pics
@dirrm share/apps/kcmlocale
@@ -2755,6 +2740,5 @@ share/wallpapers/vegetative_fog.jpg
@dirrm share/applnk/Applications
@dirrm share/applnk/.hidden
@dirrm share/applnk
-@dirrm lib/kde2
@dirrm include/kwin
@dirrm include/kate