diff options
author | knu <knu@FreeBSD.org> | 2001-06-21 22:29:16 +0800 |
---|---|---|
committer | knu <knu@FreeBSD.org> | 2001-06-21 22:29:16 +0800 |
commit | 093a455d3d326ee2403f2c6d7f6f48d0d92adac7 (patch) | |
tree | 96ebdca52b8c7ca9a2c437a5fec74a7f97444b9d /sysutils | |
parent | 07f3d2bdbe1245849dafef7525865c753f8625ed (diff) | |
download | freebsd-ports-gnome-093a455d3d326ee2403f2c6d7f6f48d0d92adac7.tar.gz freebsd-ports-gnome-093a455d3d326ee2403f2c6d7f6f48d0d92adac7.tar.zst freebsd-ports-gnome-093a455d3d326ee2403f2c6d7f6f48d0d92adac7.zip |
Add ruby-quota, a Ruby library to manipulate filesystem quotas.
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/Makefile | 1 | ||||
-rw-r--r-- | sysutils/ruby-quota/Makefile | 36 | ||||
-rw-r--r-- | sysutils/ruby-quota/distinfo | 1 | ||||
-rw-r--r-- | sysutils/ruby-quota/files/patch-extconf.rb | 8 | ||||
-rw-r--r-- | sysutils/ruby-quota/files/patch-quota.c | 85 | ||||
-rw-r--r-- | sysutils/ruby-quota/files/patch-test.rb | 12 | ||||
-rw-r--r-- | sysutils/ruby-quota/pkg-comment | 1 | ||||
-rw-r--r-- | sysutils/ruby-quota/pkg-descr | 4 | ||||
-rw-r--r-- | sysutils/ruby-quota/pkg-plist | 6 |
9 files changed, 154 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile index c646bce57d93..bb3da676fe60 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -121,6 +121,7 @@ SUBDIR += rtty SUBDIR += rmonitor SUBDIR += roottail + SUBDIR += ruby-quota SUBDIR += ruby-syslog SUBDIR += safecat SUBDIR += samefile diff --git a/sysutils/ruby-quota/Makefile b/sysutils/ruby-quota/Makefile new file mode 100644 index 000000000000..edefb693ffec --- /dev/null +++ b/sysutils/ruby-quota/Makefile @@ -0,0 +1,36 @@ +# New ports collection makefile for: ruby-quota +# Date created: 21 June 2001 +# Whom: Akinori MUSHA aka knu <knu@idaemons.org> +# +# $FreeBSD$ +# + +PORTNAME= quota +PORTVERSION= 0.2 +CATEGORIES= sysutils ruby +MASTER_SITES= http://kt-www.jaist.ac.jp/~ttate/ftp/ +PKGNAMEPREFIX= ${RUBY_PKGNAMEPREFIX} +DISTNAME= ruby-${PORTNAME}-${PORTVERSION} +DIST_SUBDIR= ruby + +MAINTAINER= knu@FreeBSD.org + +USE_RUBY= yes +USE_RUBY_EXTCONF= yes + +WRKSRC= ${WRKDIR}/ruby-${PORTNAME}-${PORTVERSION} +INSTALL_TARGET= site-install + +DOCS_EN= ChangeLog README.html + +post-install: +.if !defined(NOPORTDOCS) + ${MKDIR} ${RUBY_DOCDIR}/${PORTNAME} +.for f in ${DOCS_EN} + ${INSTALL_DATA} ${WRKSRC}/${f} ${RUBY_DOCDIR}/${PORTNAME}/ +.endfor + ${MKDIR} ${RUBY_EXAMPLESDIR}/${PORTNAME} + ${INSTALL_DATA} ${WRKSRC}/test.rb ${RUBY_EXAMPLESDIR}/${PORTNAME}/ +.endif + +.include <bsd.port.mk> diff --git a/sysutils/ruby-quota/distinfo b/sysutils/ruby-quota/distinfo new file mode 100644 index 000000000000..b94cec1833ca --- /dev/null +++ b/sysutils/ruby-quota/distinfo @@ -0,0 +1 @@ +MD5 (ruby/ruby-quota-0.2.tar.gz) = 065172663f9f2b29ff000a6130307716 diff --git a/sysutils/ruby-quota/files/patch-extconf.rb b/sysutils/ruby-quota/files/patch-extconf.rb new file mode 100644 index 000000000000..95ef65b715ff --- /dev/null +++ b/sysutils/ruby-quota/files/patch-extconf.rb @@ -0,0 +1,8 @@ +--- extconf.rb.orig Thu Sep 14 11:26:19 2000 ++++ extconf.rb Thu Jun 21 21:50:09 2001 +@@ -9,4 +9,5 @@ + + have_header("linux/quota.h") # for linux + have_header("sys/fs/ufs_quota.h") # for solaris ++have_header("ufs/ufs/quota.h") # for *bsd + create_makefile("quota") diff --git a/sysutils/ruby-quota/files/patch-quota.c b/sysutils/ruby-quota/files/patch-quota.c new file mode 100644 index 000000000000..7af46dff476b --- /dev/null +++ b/sysutils/ruby-quota/files/patch-quota.c @@ -0,0 +1,85 @@ +--- quota.c.orig Sun Dec 3 22:19:44 2000 ++++ quota.c Thu Jun 21 22:06:42 2001 +@@ -16,6 +16,12 @@ + #include <sys/fs/ufs_quota.h> + #endif + ++#ifdef HAVE_UFS_UFS_QUOTA_H /* for *BSD */ ++#include <sys/types.h> ++#include <sys/fcntl.h> ++#include <ufs/ufs/quota.h> ++#endif ++ + static VALUE rb_mQuota; + static VALUE rb_sDiskQuota; + static VALUE rb_eQuotaError, rb_eQuotaCtlError; +@@ -31,6 +37,17 @@ + return quotactl(QCMD(cmd,GRPQUOTA),dev,-uid,addr); + }; + }; ++#elif defined(HAVE_UFS_UFS_QUOTA_H) ++static int ++rb_quotactl(int cmd, char *dev, uid_t uid, caddr_t addr) ++{ ++ if( uid >= 0 ){ ++ return quotactl(dev,QCMD(cmd,USRQUOTA),uid,addr); ++ } ++ else{ ++ return quotactl(dev,QCMD(cmd,GRPQUOTA),-uid,addr); ++ }; ++}; + #elif defined(HAVE_SYS_FS_UFS_QUOTA_H) + static int + rb_quotactl(int cmd, char *dev, uid_t uid, caddr_t addr) +@@ -83,7 +100,7 @@ + if( rb_quotactl(Q_GETQUOTA,c_dev,c_uid,(caddr_t)(&c_dqb)) == -1 ){ + rb_sys_fail("quotactl"); + }; +-#if defined(HAVE_LINUX_QUOTA_H) ++#if defined(HAVE_LINUX_QUOTA_H) || defined(HAVE_UFS_UFS_QUOTA_H) + dqb = rb_struct_new(rb_sDiskQuota, + UINT2NUM(c_dqb.dqb_bhardlimit), + UINT2NUM(c_dqb.dqb_bsoftlimit), +@@ -149,7 +166,7 @@ + + #define GetMember(mem) \ + ((v = rb_struct_getmember(dqb,rb_intern(mem))) == Qnil) ? 0 : (NUM2UINT(v)) +-#if defined(HAVE_LINUX_QUOTA_H) ++#if defined(HAVE_LINUX_QUOTA_H) || defined(HAVE_UFS_UFS_QUOTA_H) + c_dqb.dqb_bhardlimit = GetMember("bhardlimit"); + c_dqb.dqb_bsoftlimit = GetMember("bsoftlimit"); + c_dqb.dqb_curblocks = GetMember("curblocks"); +@@ -180,6 +197,7 @@ + return Qnil; + }; + ++#ifdef Q_SETQLIM + VALUE + rb_quota_setqlim(VALUE self, VALUE dev, VALUE uid, VALUE dqb) + { +@@ -220,6 +238,7 @@ + #endif + return Qnil; + }; ++#endif + + VALUE + rb_quota_sync(VALUE self, VALUE dev) +@@ -252,7 +271,7 @@ + "bhardlimit", + "bsoftlimit", + "curblocks", +-#if defined(HAVE_LINUX_QUOTA_H) ++#if defined(HAVE_LINUX_QUOTA_H) || defined(HAVE_UFS_UFS_QUOTA_H) + "ihardlimit", + "isoftlimit", + "curinodes", +@@ -272,6 +291,8 @@ + rb_define_module_function(rb_mQuota,"quotaoff",rb_quota_quotaoff,1); + rb_define_module_function(rb_mQuota,"getquota",rb_quota_getquota,2); + rb_define_module_function(rb_mQuota,"setquota",rb_quota_setquota,3); ++#ifdef Q_SETQLIM + rb_define_module_function(rb_mQuota,"setqlim",rb_quota_setqlim,3); ++#endif + rb_define_module_function(rb_mQuota,"sync",rb_quota_sync,1); + }; diff --git a/sysutils/ruby-quota/files/patch-test.rb b/sysutils/ruby-quota/files/patch-test.rb new file mode 100644 index 000000000000..c730133264b4 --- /dev/null +++ b/sysutils/ruby-quota/files/patch-test.rb @@ -0,0 +1,12 @@ +--- test.rb.orig Sun Dec 3 22:36:02 2000 ++++ test.rb Thu Jun 21 23:06:55 2001 +@@ -11,6 +11,9 @@ + when /^SunOS/ + $DEV = "/quotas" + $QUOTAS = "/quotas" ++when /BSD/ ++ $DEV = "/mnt/test" ++ $QUOTAS = "/mnt/test/quota.user" + end + + print("user id: ") diff --git a/sysutils/ruby-quota/pkg-comment b/sysutils/ruby-quota/pkg-comment new file mode 100644 index 000000000000..1befd894d09b --- /dev/null +++ b/sysutils/ruby-quota/pkg-comment @@ -0,0 +1 @@ +A Ruby library to manipulate filesystem quotas diff --git a/sysutils/ruby-quota/pkg-descr b/sysutils/ruby-quota/pkg-descr new file mode 100644 index 000000000000..ba4aa7031b04 --- /dev/null +++ b/sysutils/ruby-quota/pkg-descr @@ -0,0 +1,4 @@ +Ruby-quota is a ruby library to manipulate filesystem quotas. + +WWW: http://kt-www.jaist.ac.jp/~ttate/ruby/ruby-ext.html +Author: Takaaki Tateishi <ttate@jaist.ac.jp> diff --git a/sysutils/ruby-quota/pkg-plist b/sysutils/ruby-quota/pkg-plist new file mode 100644 index 000000000000..be31d11ac7e5 --- /dev/null +++ b/sysutils/ruby-quota/pkg-plist @@ -0,0 +1,6 @@ +%%RUBY_SITEARCHLIBDIR%%/quota.so +%%PORTDOCS%%%%RUBY_EXAMPLESDIR%%/quota/test.rb +%%PORTDOCS%%@dirrm %%RUBY_EXAMPLESDIR%%/quota +%%PORTDOCS%%%%RUBY_DOCDIR%%/quota/ChangeLog +%%PORTDOCS%%%%RUBY_DOCDIR%%/quota/README.html +%%PORTDOCS%%@dirrm %%RUBY_DOCDIR%%/quota |