Fri Sep 10 07:49:08 2010 UTC ()
* Add LICENSE.
* Remove RUBY_HAS_ARCHLIB.
* Chante PKG_DESTDIR_SUPPORT to user-destdir.
* Add patch to support both ruby18 and ruby19.
(taca)
diff -r1.16 -r1.17 pkgsrc/security/ruby-tcpwrap/Makefile
diff -r1.4 -r1.5 pkgsrc/security/ruby-tcpwrap/distinfo
diff -r0 -r1.1 pkgsrc/security/ruby-tcpwrap/patches/patch-aa
--- pkgsrc/security/ruby-tcpwrap/Makefile 2009/02/15 03:27:56 1.16
+++ pkgsrc/security/ruby-tcpwrap/Makefile 2010/09/10 07:49:07 1.17
| @@ -1,34 +1,34 @@ | | | @@ -1,34 +1,34 @@ |
1 | # $NetBSD: Makefile,v 1.16 2009/02/15 03:27:56 taca Exp $ | | 1 | # $NetBSD: Makefile,v 1.17 2010/09/10 07:49:07 taca Exp $ |
2 | | | 2 | |
3 | DISTNAME= ruby-tcpwrap-0.6 | | 3 | DISTNAME= ruby-tcpwrap-0.6 |
4 | PKGNAME= ${RUBY_PKGPREFIX}-tcpwrap-0.6 | | 4 | PKGNAME= ${RUBY_PKGPREFIX}-tcpwrap-0.6 |
5 | PKGREVISION= 5 | | 5 | PKGREVISION= 5 |
6 | CATEGORIES= security ruby | | 6 | CATEGORIES= security ruby |
7 | MASTER_SITES= http://www.shugo.net/archive/ruby-tcpwrap/ | | 7 | MASTER_SITES= http://www.shugo.net/archive/ruby-tcpwrap/ |
8 | | | 8 | |
9 | MAINTAINER= taca@NetBSD.org | | 9 | MAINTAINER= taca@NetBSD.org |
10 | HOMEPAGE= # not available | | 10 | HOMEPAGE= # not available |
11 | COMMENT= TCP wrappers library for Ruby | | 11 | COMMENT= TCP wrappers library for Ruby |
| | | 12 | LICENSE= 2-clause-bsd |
12 | | | 13 | |
13 | RUBY_HAS_ARCHLIB= yes | | 14 | PKG_DESTDIR_SUPPORT= user-destdir |
14 | USE_RUBY_EXTCONF= yes | | 15 | USE_RUBY_EXTCONF= yes |
15 | WRKSRC= ${WRKDIR}/ruby-tcpwrap | | 16 | WRKSRC= ${WRKDIR}/ruby-tcpwrap |
16 | INSTALL_TARGET= site-install | | 17 | INSTALL_TARGET= site-install |
17 | DOCS_EN= README.en doc/tcpwrap.html.en | | 18 | DOCS_EN= README.en doc/tcpwrap.html.en |
18 | DOCS_JA= README.ja doc/tcpwrap.html.ja | | 19 | DOCS_JA= README.ja doc/tcpwrap.html.ja |
19 | | | 20 | |
20 | INSTALLATION_DIRS= ${RUBY_DOC}/tcpwrap/ja ${RUBY_EG}/tcpwrap | | 21 | INSTALLATION_DIRS= ${RUBY_DOC}/tcpwrap/ja ${RUBY_EG}/tcpwrap |
21 | PKG_DESTDIR_SUPPORT= destdir | | | |
22 | | | 22 | |
23 | post-install: | | 23 | post-install: |
24 | ${INSTALL_DATA} ${WRKSRC}/sample/echod.rb \ | | 24 | ${INSTALL_DATA} ${WRKSRC}/sample/echod.rb \ |
25 | ${DESTDIR}${PREFIX}/${RUBY_EG}/tcpwrap | | 25 | ${DESTDIR}${PREFIX}/${RUBY_EG}/tcpwrap |
26 | .for f in ${DOCS_EN} | | 26 | .for f in ${DOCS_EN} |
27 | ${INSTALL_DATA} ${WRKSRC}/${f} ${DESTDIR}${PREFIX}/${RUBY_DOC}/tcpwrap | | 27 | ${INSTALL_DATA} ${WRKSRC}/${f} ${DESTDIR}${PREFIX}/${RUBY_DOC}/tcpwrap |
28 | .endfor | | 28 | .endfor |
29 | .for f in ${DOCS_JA} | | 29 | .for f in ${DOCS_JA} |
30 | ${INSTALL_DATA} ${WRKSRC}/${f} ${DESTDIR}${PREFIX}/${RUBY_DOC}/tcpwrap/ja | | 30 | ${INSTALL_DATA} ${WRKSRC}/${f} ${DESTDIR}${PREFIX}/${RUBY_DOC}/tcpwrap/ja |
31 | .endfor | | 31 | .endfor |
32 | | | 32 | |
33 | .include "../../lang/ruby/modules.mk" | | 33 | .include "../../lang/ruby/modules.mk" |
34 | .include "../../security/libident/buildlink3.mk" | | 34 | .include "../../security/libident/buildlink3.mk" |
--- pkgsrc/security/ruby-tcpwrap/distinfo 2006/01/03 14:25:50 1.4
+++ pkgsrc/security/ruby-tcpwrap/distinfo 2010/09/10 07:49:07 1.5
| @@ -1,5 +1,6 @@ | | | @@ -1,5 +1,6 @@ |
1 | $NetBSD: distinfo,v 1.4 2006/01/03 14:25:50 taca Exp $ | | 1 | $NetBSD: distinfo,v 1.5 2010/09/10 07:49:07 taca Exp $ |
2 | | | 2 | |
3 | SHA1 (ruby-tcpwrap-0.6.tar.gz) = e66ce2b424db90d461686784d7b69003df76e6de | | 3 | SHA1 (ruby-tcpwrap-0.6.tar.gz) = e66ce2b424db90d461686784d7b69003df76e6de |
4 | RMD160 (ruby-tcpwrap-0.6.tar.gz) = ebc9dad7beb4f2f222f71a252502905c61ec41e2 | | 4 | RMD160 (ruby-tcpwrap-0.6.tar.gz) = ebc9dad7beb4f2f222f71a252502905c61ec41e2 |
5 | Size (ruby-tcpwrap-0.6.tar.gz) = 4504 bytes | | 5 | Size (ruby-tcpwrap-0.6.tar.gz) = 4504 bytes |
| | | 6 | SHA1 (patch-aa) = bde50e2d875089b149eace7a001cec7b05afe005 |
$NetBSD: patch-aa,v 1.1 2010/09/10 07:49:07 taca Exp $
Use modern Ruby API.
--- tcpwrap.c.orig 2003-08-20 03:30:10.000000000 +0000
+++ tcpwrap.c
@@ -25,7 +25,12 @@
*/
#include "ruby.h"
+#ifdef HAVE_RUBY_IO_H /* Ruby 1.9 and later */
+#include "ruby/io.h"
+#else /* Ruby 1.8.x */
#include "rubyio.h"
+#define rb_io_stdio_file(iot) ((iot)->f)
+#endif
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -101,7 +106,7 @@ static VALUE tcpd_accept(VALUE self)
tcp_wrapper_t *tcpd;
VALUE sock;
int sockfd;
- OpenFile *fptr;
+ rb_io_t *fptr;
struct sockaddr_storage addr;
char client_name[NI_MAXHOST] = STRING_UNKNOWN;
char client_addr[NI_MAXHOST] = STRING_UNKNOWN;
@@ -113,7 +118,7 @@ static VALUE tcpd_accept(VALUE self)
again:
sock = rb_funcall(tcpd->server, rb_intern("accept"), 0);
GetOpenFile(sock, fptr);
- sockfd = fileno(fptr->f);
+ sockfd = fileno(rb_io_stdio_file(fptr));
if (getpeername(sockfd, (struct sockaddr*) &addr, &len) < 0)
rb_sys_fail("getpeername(2)");
error = getnameinfo((struct sockaddr*) &addr, len,
@@ -132,7 +137,7 @@ static VALUE tcpd_accept(VALUE self)
if (tcpd->ident_lookup)
client_user = ident_id(sockfd, tcpd->ident_timeout);
#endif
- if (!hosts_ctl(RSTRING(tcpd->daemon)->ptr,
+ if (!hosts_ctl(RSTRING_PTR(tcpd->daemon),
client_name,
client_addr,
(client_user == NULL) ? STRING_UNKNOWN : client_user)) {
@@ -156,8 +161,8 @@ tcpd_s_set_hosts_allow(VALUE self, VALUE
{
static char hosts_allow[MAXPATHLEN];
- Check_SafeStr(s);
- snprintf(hosts_allow, sizeof(hosts_allow), "%s", RSTRING(s)->ptr);
+ SafeStringValue(s);
+ snprintf(hosts_allow, sizeof(hosts_allow), "%s", RSTRING_PTR(s));
if(access(hosts_allow, R_OK) < 0)
rb_warning("cannot read %s", hosts_allow);
hosts_allow_table = hosts_allow;
@@ -176,8 +181,8 @@ tcpd_s_set_hosts_deny(VALUE self, VALUE
{
static char hosts_deny[MAXPATHLEN];
- Check_SafeStr(s);
- snprintf(hosts_deny, sizeof(hosts_deny), "%s", RSTRING(s)->ptr);
+ SafeStringValue(s);
+ snprintf(hosts_deny, sizeof(hosts_deny), "%s", RSTRING_PTR(s));
if(access(hosts_deny, R_OK) < 0)
rb_warning("cannot read %s", hosts_deny);
hosts_deny_table = hosts_deny;
@@ -196,7 +201,7 @@ str_to_ctlstr(VALUE s)
{
if(NIL_P(s)) return STRING_UNKNOWN;
Check_Type(s, T_STRING);
- return RSTRING(s)->ptr;
+ return RSTRING_PTR(s);
}
static VALUE