Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Feb 2004 14:42:32 -0600 (CST)
From:      Jim Pirzyk <pirzyk@uiuc.edu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/62980: New Port: devel/p5-Filesys-Statvfs-Df perl interface to statvfs
Message-ID:  <200402172042.i1HKgWrQ056867@lilo.cso.uiuc.edu>
Resent-Message-ID: <200402172050.i1HKoGvu051876@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         62980
>Category:       ports
>Synopsis:       New Port: devel/p5-Filesys-Statvfs-Df perl interface to statvfs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 17 12:50:16 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Jim Pirzyk
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
>Environment:
System: FreeBSD lilo.cso.uiuc.edu 4.9-STABLE FreeBSD 4.9-STABLE #9: Thu Feb 5 14:18:38 CST 2004 root@lilo.cso.uiuc.edu:/usr/obj/usr/src/sys/LILO_KERNEL i386


	
>Description:
	Port to have an interface to statvfs().

>How-To-Repeat:
	
>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	p5-Filesys-Statvfs_Df
#	p5-Filesys-Statvfs_Df/Makefile
#	p5-Filesys-Statvfs_Df/distinfo
#	p5-Filesys-Statvfs_Df/pkg-descr
#	p5-Filesys-Statvfs_Df/pkg-plist
#	p5-Filesys-Statvfs_Df/files
#	p5-Filesys-Statvfs_Df/files/patch-Statvfs.xs
#
echo c - p5-Filesys-Statvfs_Df
mkdir -p p5-Filesys-Statvfs_Df > /dev/null 2>&1
echo x - p5-Filesys-Statvfs_Df/Makefile
sed 's/^X//' >p5-Filesys-Statvfs_Df/Makefile << 'END-of-p5-Filesys-Statvfs_Df/Makefile'
X# New ports collection makefile for:	p5-Filesys-Statvfs_Df
X# Date created:			
X# Whom:	      			
X#
X#
X
XPORTNAME=	Filesys-Statvfs_Df
XPORTVERSION=	0.68
XCATEGORIES=	devel perl5
XMASTER_SITES=	${MASTER_SITE_PERL_CPAN}
XMASTER_SITE_SUBDIR=	Filesys
XPKGNAMEPREFIX=	p5-
X
XMAINTAINER=	pirzyk@freebsd.org
XCOMMENT=  provides an interface between Perl and the statvfs() system call.
X
XPERL_CONFIGURE=	yes
X
XMAN3PREFIX=	${PREFIX}/lib/perl5/${PERL_VERSION}
XMAN3=		Filesys::Df.3 Filesys::Statvfs.3
X
X.include <bsd.port.mk>
END-of-p5-Filesys-Statvfs_Df/Makefile
echo x - p5-Filesys-Statvfs_Df/distinfo
sed 's/^X//' >p5-Filesys-Statvfs_Df/distinfo << 'END-of-p5-Filesys-Statvfs_Df/distinfo'
XMD5 (Filesys-Statvfs_Df-0.68.tar.gz) = 8425476ff9de21513a0264faadca7d07
END-of-p5-Filesys-Statvfs_Df/distinfo
echo x - p5-Filesys-Statvfs_Df/pkg-descr
sed 's/^X//' >p5-Filesys-Statvfs_Df/pkg-descr << 'END-of-p5-Filesys-Statvfs_Df/pkg-descr'
XFilesys::Statvfs provides an interface between
XPerl and the statvfs() system call.
X
XFilesys::Df uses Filesys::Statvfs to obtain
Xfilesystem statistics then creates additional
Xfilesystem information such as percent full,
Xuser and superuser differentials, etc.
X
XFilesys::Df will also let you specify the
Xblock size for the values you wish to see.
XThe default block size output is 1024 bytes per
Xblock. So if you want to get the size in bytes
Xjust take the block size and * it by 1024.
X
END-of-p5-Filesys-Statvfs_Df/pkg-descr
echo x - p5-Filesys-Statvfs_Df/pkg-plist
sed 's/^X//' >p5-Filesys-Statvfs_Df/pkg-plist << 'END-of-p5-Filesys-Statvfs_Df/pkg-plist'
X%%SITE_PERL%%/%%PERL_ARCH%%/Filesys/Df.pm
X%%SITE_PERL%%/%%PERL_ARCH%%/Filesys/Statvfs.pm
X%%SITE_PERL%%/%%PERL_ARCH%%/auto/Filesys/Statvfs/.packlist
X@unexec rmdir %D/%%SITE_PERL%%/%%PERL_ARCH%%/auto/Filesys 2>/dev/null || true
X@unexec rmdir %D/%%SITE_PERL%%/Filesys 2>/dev/null || true
END-of-p5-Filesys-Statvfs_Df/pkg-plist
echo c - p5-Filesys-Statvfs_Df/files
mkdir -p p5-Filesys-Statvfs_Df/files > /dev/null 2>&1
echo x - p5-Filesys-Statvfs_Df/files/patch-Statvfs.xs
sed 's/^X//' >p5-Filesys-Statvfs_Df/files/patch-Statvfs.xs << 'END-of-p5-Filesys-Statvfs_Df/files/patch-Statvfs.xs'
X--- Statvfs.xs.orig	Wed Nov 22 09:57:31 2000
X+++ Statvfs.xs	Tue Feb 17 10:13:35 2004
X@@ -5,12 +5,21 @@
X #include "perl.h"
X #include "XSUB.h"
X #include "config.h"
X-#include<sys/statvfs.h>
X+#if defined(__APPLE__ ) || defined(__FreeBSD__)
X+#include <sys/param.h>
X+#include <sys/mount.h>
X+#else
X+#include <sys/statvfs.h>
X+#endif
X #ifdef __cplusplus
X }
X #endif
X 
X-typedef struct statvfs Statvfs;
X+#if defined(__APPLE__ ) || defined(__FreeBSD__)
X+	typedef struct statfs Statvfs;
X+#else
X+	typedef struct statvfs Statvfs;
X+#endif
X 
X MODULE = Filesys::Statvfs	PACKAGE = Filesys::Statvfs
X 
X@@ -20,34 +29,63 @@
X 	PREINIT:
X 	Statvfs st;
X 	Statvfs *st_ptr;
X+	long t;
X 	PPCODE:
X+#if defined(__APPLE__ ) || defined(__FreeBSD__)
X+	if(statfs(dir, &st) == 0) {
X+#else
X 	if(statvfs(dir, &st) == 0) {
X+#endif
X 		st_ptr=&st;
X 		EXTEND(sp, 15);
X 		PUSHs(sv_2mortal(newSViv(st_ptr->f_bsize)));
X+#if defined(__APPLE__ ) || defined(__FreeBSD__)
X+		PUSHs(sv_2mortal(newSViv(0)));
X+#else
X 		PUSHs(sv_2mortal(newSViv(st_ptr->f_frsize)));
X+#endif
X 		PUSHs(sv_2mortal(newSViv(st_ptr->f_blocks)));
X 		PUSHs(sv_2mortal(newSViv(st_ptr->f_bfree)));
X 		PUSHs(sv_2mortal(newSViv(st_ptr->f_bavail)));
X 		PUSHs(sv_2mortal(newSViv(st_ptr->f_files)));
X 		PUSHs(sv_2mortal(newSViv(st_ptr->f_ffree)));
X+#if defined(__APPLE__ ) || defined(__FreeBSD__)
X+		PUSHs(sv_2mortal(newSViv(st_ptr->f_ffree)));
X+#else
X 		PUSHs(sv_2mortal(newSViv(st_ptr->f_favail)));
X+#endif
X #if defined(_AIX__) || defined(_LINUX__)
X 		PUSHs(sv_2mortal(newSViv(0)));
X #else
X+#if defined(__APPLE__ ) || defined(__FreeBSD__)
X+		memcpy (&t, &st_ptr->f_fsid, sizeof (long));
X+		PUSHs(sv_2mortal(newSViv(t)));
X+#else
X 		PUSHs(sv_2mortal(newSViv(st_ptr->f_fsid)));
X #endif
X+#endif
X #ifdef _LINUX__
X 		PUSHs(sv_2mortal(newSVpv(NULL, 1)));
X #else
X+#if defined(__APPLE__ ) || defined(__FreeBSD__)
X+		PUSHs(sv_2mortal(newSVpv(st_ptr->f_fstypename, 0)));
X+#else
X 		PUSHs(sv_2mortal(newSVpv(st_ptr->f_basetype, 0)));
X #endif
X+#endif
X+#if defined(__APPLE__ ) || defined(__FreeBSD__)
X+		PUSHs(sv_2mortal(newSViv(st_ptr->f_flags)));
X+		PUSHs(sv_2mortal(newSVpv(st_ptr->f_mntonname, MNAMELEN)));
X+#else
X 		PUSHs(sv_2mortal(newSViv(st_ptr->f_flag)));
X 		PUSHs(sv_2mortal(newSViv(st_ptr->f_namemax)));
X+#endif
X #if defined(_DEC__) || defined(_LINUX__)
X 		PUSHs(sv_2mortal(newSVpv(NULL, 1)));
X #else
X+#if ! defined(__APPLE__ ) && ! defined(__FreeBSD__)
X 		PUSHs(sv_2mortal(newSVpv(st_ptr->f_fstr, 0)));
X+#endif
X #endif
X #ifdef _HPUX__
X 		PUSHs(sv_2mortal(newSViv(st_ptr->f_size))); 
END-of-p5-Filesys-Statvfs_Df/files/patch-Statvfs.xs
exit

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402172042.i1HKgWrQ056867>