From owner-svn-ports-head@FreeBSD.ORG Sat Sep 14 14:40:34 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 41D99540; Sat, 14 Sep 2013 14:40:34 +0000 (UTC) (envelope-from sunpoet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1DE932A5C; Sat, 14 Sep 2013 14:40:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8EEeX1j074086; Sat, 14 Sep 2013 14:40:33 GMT (envelope-from sunpoet@svn.freebsd.org) Received: (from sunpoet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8EEeX7x074084; Sat, 14 Sep 2013 14:40:33 GMT (envelope-from sunpoet@svn.freebsd.org) Message-Id: <201309141440.r8EEeX7x074084@svn.freebsd.org> From: Sunpoet Po-Chuan Hsieh Date: Sat, 14 Sep 2013 14:40:33 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r327290 - in head/security/ruby-tcpwrap: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Sep 2013 14:40:34 -0000 Author: sunpoet Date: Sat Sep 14 14:40:33 2013 New Revision: 327290 URL: http://svnweb.freebsd.org/changeset/ports/327290 Log: - Fix build with ruby19 [1] - Remove DEPRECATED and EXPIRATION_DATE - Convert to new LIB_DEPENDS format - Convert to new options framework - Simplify DOC_EN and DOC_JA installation Obtained from: NetBSD [1] Added: head/security/ruby-tcpwrap/files/ head/security/ruby-tcpwrap/files/patch-tcpwrap.c (contents, props changed) Modified: head/security/ruby-tcpwrap/Makefile Modified: head/security/ruby-tcpwrap/Makefile ============================================================================== --- head/security/ruby-tcpwrap/Makefile Sat Sep 14 14:34:49 2013 (r327289) +++ head/security/ruby-tcpwrap/Makefile Sat Sep 14 14:40:33 2013 (r327290) @@ -13,16 +13,15 @@ DIST_SUBDIR= ruby MAINTAINER= ruby@FreeBSD.org COMMENT= TCP wrappers library for Ruby -DEPRECATED= Does not work with Ruby 1.9 -EXPIRATION_DATE= 2013-05-02 +LIB_DEPENDS= libident.so:${PORTSDIR}/security/libident -LIB_DEPENDS= ident.0:${PORTSDIR}/security/libident +OPTIONS_DEFINE= DOCS USE_RUBY= yes USE_RUBY_EXTCONF= yes WRKSRC= ${WRKDIR}/ruby-${PORTNAME} -CONFIGURE_ARGS= --with-libwrap-dir="/usr" \ +CONFIGURE_ARGS= --with-libwrap-dir=/usr \ --with-ident-dir="${LOCALBASE}" INSTALL_TARGET= site-install @@ -30,21 +29,15 @@ INSTALL_TARGET= site-install DOCS_EN= README.en doc/tcpwrap.html.en DOCS_JA= README.ja doc/tcpwrap.html.ja +.include + post-install: -.if !defined(NOPORTDOCS) +.if ${PORT_OPTIONS:MDOCS} ${MKDIR} ${RUBY_MODEXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/sample/echod.rb ${RUBY_MODEXAMPLESDIR}/ ${MKDIR} ${RUBY_MODDOCDIR}/ja -.for f in ${DOCS_EN} - ${INSTALL_DATA} ${WRKSRC}/${f} ${RUBY_MODDOCDIR}/ -.endfor -.for f in ${DOCS_JA} - ${INSTALL_DATA} ${WRKSRC}/${f} ${RUBY_MODDOCDIR}/ja/ -.endfor + cd ${WRKSRC}/ && ${INSTALL_DATA} ${DOCS_EN} ${RUBY_MODDOCDIR}/ + cd ${WRKSRC}/ && ${INSTALL_DATA} ${DOCS_JA} ${RUBY_MODDOCDIR}/ja/ .endif -.include -.if ${RUBY_VER} == 1.9 -BROKEN= does not build with ruby 1.9 -.endif -.include +.include Added: head/security/ruby-tcpwrap/files/patch-tcpwrap.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/ruby-tcpwrap/files/patch-tcpwrap.c Sat Sep 14 14:40:33 2013 (r327290) @@ -0,0 +1,73 @@ +--- 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 + #include + #include +@@ -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