diff options
Diffstat (limited to 'misc/xdf')
-rw-r--r-- | misc/xdf/Makefile | 24 | ||||
-rw-r--r-- | misc/xdf/distinfo | 1 | ||||
-rw-r--r-- | misc/xdf/files/patch-Makefile | 22 | ||||
-rw-r--r-- | misc/xdf/files/patch-xdf.H | 21 | ||||
-rw-r--r-- | misc/xdf/files/patch-xdf.cc | 85 | ||||
-rw-r--r-- | misc/xdf/pkg-comment | 1 | ||||
-rw-r--r-- | misc/xdf/pkg-descr | 8 | ||||
-rw-r--r-- | misc/xdf/pkg-plist | 1 |
8 files changed, 163 insertions, 0 deletions
diff --git a/misc/xdf/Makefile b/misc/xdf/Makefile new file mode 100644 index 000000000000..a86c00815171 --- /dev/null +++ b/misc/xdf/Makefile @@ -0,0 +1,24 @@ +# New ports collection makefile for: xdf +# Date created: 9 November 2002 +# Whom: David Vidal-Rodriguez +# +# $FreeBSD$ +# + +PORTNAME= xdf +PORTVERSION= 1.3 +CATEGORIES= misc +MASTER_SITES= http://home.in.tum.de/~vidalrod/ports/ + +MAINTAINER= vidalrod@in.tum.de + +LIB_DEPENDS= xview.3:${PORTSDIR}/x11-toolkits/xview + +USE_XLIB= yes +USE_X_PREFIX= yes +USE_GMAKE= yes + +post-install: + strip ${PREFIX}/bin/xdf + +.include <bsd.port.mk> diff --git a/misc/xdf/distinfo b/misc/xdf/distinfo new file mode 100644 index 000000000000..284f8e19018d --- /dev/null +++ b/misc/xdf/distinfo @@ -0,0 +1 @@ +MD5 (xdf-1.3.tar.gz) = 14cb702a28058c9e25c7daf34a36a09c diff --git a/misc/xdf/files/patch-Makefile b/misc/xdf/files/patch-Makefile new file mode 100644 index 000000000000..dde4d56b5468 --- /dev/null +++ b/misc/xdf/files/patch-Makefile @@ -0,0 +1,22 @@ +--- Makefile.orig Wed Nov 13 05:06:28 2002 ++++ Makefile Thu Jan 16 04:47:43 2003 +@@ -7,9 +7,7 @@ + # on Linux systems "make ; make install" (run as superuser) should do everything + # + +- +-CCFLAGS = -m486 -O2 +-CPPFLAGS += $(CCFLAGS) -I /usr/openwin/include -I/usr/lib/g++-include -DMAIN ++CPPFLAGS += $(CCFLAGS) -I/usr/include -I/usr/local/include -I/usr/X11R6/include -I/usr/lib/g++-include -DMAIN + LDFLAGS += -L /usr/openwin/lib -L /usr/X11R6/lib + LDLIBS += -lxview -lX11 -lolgx + +@@ -17,7 +15,7 @@ + + PROGRAM = xdf + SOURCES.cc = xdf.cc +-INSTALLPATH = /usr/local/bin ++INSTALLPATH = /usr/X11R6/bin + SOURCES.h = + SOURCES.c = + SOURCES.G = diff --git a/misc/xdf/files/patch-xdf.H b/misc/xdf/files/patch-xdf.H new file mode 100644 index 000000000000..da0f9f5f9445 --- /dev/null +++ b/misc/xdf/files/patch-xdf.H @@ -0,0 +1,21 @@ +--- xdf.H Mon Dec 22 00:10:05 1997 ++++ ../xdf/xdf.H Fri Nov 8 21:17:34 2002 +@@ -51,14 +51,14 @@ + + /*{{{ Variables */ + char* prgname; +-FILE* fstab; +-FILE* mtab; +-struct mntent* table; ++struct fstab* fstab; ++struct statfs* mtab; ++struct statfs* table; + struct statfs stat_buffer; + int mountpoints; + Partition* par_table[50]; + struct itimerval timer; +- ++int mntcount; + + #ifdef NO_ISO9660 + int no_iso9660 = TRUE; diff --git a/misc/xdf/files/patch-xdf.cc b/misc/xdf/files/patch-xdf.cc new file mode 100644 index 000000000000..f3f78b2610f8 --- /dev/null +++ b/misc/xdf/files/patch-xdf.cc @@ -0,0 +1,85 @@ +--- xdf.cc.orig Wed Nov 13 05:06:28 2002 ++++ xdf.cc Thu Jan 16 05:40:43 2003 +@@ -18,18 +18,18 @@ + #include <stdio.h> + #include <iostream.h> + #include <strstream.h> +-#include <syscall.h> ++#include <sys/syscall.h> + #include <sys/param.h> + #include <sys/types.h> +-#include <sys/vfs.h> ++// #include <sys/vfs.h> + #include <unistd.h> + #include <ctype.h> + #include <pwd.h> + #include <stdlib.h> + #include <assert.h> +-#include <mntent.h> ++//#include <mntent.h> + #include <sys/mount.h> +-#include <linux/fs.h> ++#include <fstab.h> + + #include "config.H" + #include "xdf.H" +@@ -74,17 +74,22 @@ + /*{{{ Get Information and create Panel */ + int row = 0; + +- fstab = setmntent( "/etc/fstab", "r"); ++ if (! setfsent()) { ++ perror("Couldn't open /etc/fstab!\n"); ++ return 255; ++ } ++ + + mountpoints=0; +- while ( table = getmntent( fstab ) ) { +- if ( strcmp( "swap", table->mnt_dir) && strcmp( "/proc", table->mnt_dir) +- && ( strcmp( "nfs", table->mnt_type ) || ( ! no_nfs ) ) +- && ( strcmp( "iso9660", table->mnt_type ) || ( ! no_iso9660 ) ) ++ fstab = getfsent(); ++ while ( fstab ) { ++ if ( strcmp( "swap", fstab->fs_file) && strcmp( "/proc", fstab->fs_file) ++ && ( strcmp( "nfs", fstab->fs_vfstype ) || ( ! no_nfs ) ) ++ && ( strcmp( "cd9660", fstab->fs_vfstype ) || ( ! no_iso9660 ) ) + ){ + par_table[mountpoints] = new Partition; +- par_table[mountpoints]->name = new char[ strlen(table->mnt_dir) + 1 ]; +- strcpy(par_table[mountpoints]->name, table->mnt_dir); ++ par_table[mountpoints]->name = new char[ strlen(fstab->fs_file) + 1 ]; ++ strcpy(par_table[mountpoints]->name, fstab->fs_file); + statfs(par_table[mountpoints]->name, &stat_buffer); + par_table[mountpoints]->last_max_value = + par_table[mountpoints]->max_value = ((double)stat_buffer.f_blocks * (double)stat_buffer.f_bsize) / (double) 1024; +@@ -97,8 +102,9 @@ + par_table[mountpoints]->last_value = -1; + mountpoints++; + } ++ fstab = getfsent(); + } +- endmntent( fstab ); ++ endfsent(); + + /*{{{ Title strings */ + +@@ -230,13 +236,14 @@ + par_table[i]->status = TRUE; + } + +- mtab = setmntent( "/etc/mtab", "r"); +- while ( table = getmntent( mtab ) ){ +- for ( int i = 0 ; i < mountpoints ; ++i ){ +- if ( !strcmp(par_table[i]->name, table->mnt_dir) ) par_table[i]->status = FALSE; ++ mntcount = getmntinfo(&mtab, 0); ++ for (int i = 0; i < mntcount; i++) { ++ for (int j = 0; j < mountpoints; j++) { ++ table = &mtab[i]; ++ if (! strcmp(par_table[j]->name, table->f_mntonname)) par_table[j]->status = FALSE; + } + } +- endmntent( mtab ); + + for ( int i = 0 ; i < mountpoints ; ++i ){ + if ( par_table[i]->status == FALSE && par_table[i]->last_status == TRUE) { diff --git a/misc/xdf/pkg-comment b/misc/xdf/pkg-comment new file mode 100644 index 000000000000..fff447380761 --- /dev/null +++ b/misc/xdf/pkg-comment @@ -0,0 +1 @@ +A graphical disk space viewer for X diff --git a/misc/xdf/pkg-descr b/misc/xdf/pkg-descr new file mode 100644 index 000000000000..3251f046d8a8 --- /dev/null +++ b/misc/xdf/pkg-descr @@ -0,0 +1,8 @@ +This is a port of xdf, a rather old program which shows +the usage of mounted filesystems. It makes use of a graphical +bar to show the percentage of use space, and values are displayed +in human-readable form (K, M, G, T,...) +See xdf -? for help. + +- David Vidal-Rodriguez +vidalrod@in.tum.de diff --git a/misc/xdf/pkg-plist b/misc/xdf/pkg-plist new file mode 100644 index 000000000000..c0b935bde411 --- /dev/null +++ b/misc/xdf/pkg-plist @@ -0,0 +1 @@ +bin/xdf |