diff options
author | swills <swills@FreeBSD.org> | 2011-07-26 06:44:29 +0800 |
---|---|---|
committer | swills <swills@FreeBSD.org> | 2011-07-26 06:44:29 +0800 |
commit | bc61c744268bc7b32beab964cf32b014172b9525 (patch) | |
tree | be337cd29761ad80132cc8a3f7d93b80096b4c49 /security/arirang | |
parent | 34338ba6f33ed160b4bc5e756ab177cffe1a3ee4 (diff) | |
download | freebsd-ports-graphics-bc61c744268bc7b32beab964cf32b014172b9525.tar.gz freebsd-ports-graphics-bc61c744268bc7b32beab964cf32b014172b9525.tar.zst freebsd-ports-graphics-bc61c744268bc7b32beab964cf32b014172b9525.zip |
- Fix with Ruby 1.9
PR: ports/159171
Submitted by: swills
Approved by: maintainer (bapt)
Diffstat (limited to 'security/arirang')
-rw-r--r-- | security/arirang/Makefile | 10 | ||||
-rw-r--r-- | security/arirang/files/extra-patch-ruby19 | 19 | ||||
-rw-r--r-- | security/arirang/files/patch-ariruby.c | 38 |
3 files changed, 59 insertions, 8 deletions
diff --git a/security/arirang/Makefile b/security/arirang/Makefile index 1e9e85b2292..19e4d6680d7 100644 --- a/security/arirang/Makefile +++ b/security/arirang/Makefile @@ -7,7 +7,7 @@ PORTNAME= arirang PORTVERSION= 2.02 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 1 CATEGORIES= security www MASTER_SITES= http://monkey.org/~pilot/arirang/ @@ -24,6 +24,8 @@ USE_LIBRUBY= yes USE_OPENSSL= yes +CFLAGS+= -I${LOCALBASE}/include/ruby-${RUBY_VER} -I${LOCALBASE}/include/ruby-${RUBY_VER}/${RUBY_ARCH} + do-install: ${INSTALL_PROGRAM} ${WRKSRC}/arirang ${PREFIX}/sbin ${MKDIR} ${PREFIX}/share/arirang @@ -31,4 +33,8 @@ do-install: ${INSTALL_DATA} ${WRKSRC}/scanrule/*.uxe ${PREFIX}/share/arirang ${INSTALL_DATA} ${WRKSRC}/script/*.rb ${PREFIX}/share/arirang -.include <bsd.port.mk> +.include <bsd.port.pre.mk> +.if ${RUBY_VER} == 1.9 +EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ruby19 +.endif +.include <bsd.port.post.mk> diff --git a/security/arirang/files/extra-patch-ruby19 b/security/arirang/files/extra-patch-ruby19 new file mode 100644 index 00000000000..ef7b1551f32 --- /dev/null +++ b/security/arirang/files/extra-patch-ruby19 @@ -0,0 +1,19 @@ +--- ariruby.c.orig 2011-07-24 21:50:51.119557755 -0400 ++++ ariruby.c 2011-07-24 21:52:04.985558821 -0400 +@@ -63,6 +63,7 @@ + + static int sock; + int nb = 0; ++void* rb_load_file_return; + struct sockaddr_in http; + struct hostent *he; + char *sendbuf = NULL; +@@ -132,7 +133,7 @@ + ariruby_run(void) + { + int status; +- status = ruby_exec(); ++ status = ruby_run_node(rb_load_file_return); + #ifdef DEBUG + printf("status = %d \n", status); + #endif diff --git a/security/arirang/files/patch-ariruby.c b/security/arirang/files/patch-ariruby.c index b44c4f587eb..2a057ad2634 100644 --- a/security/arirang/files/patch-ariruby.c +++ b/security/arirang/files/patch-ariruby.c @@ -1,5 +1,31 @@ ---- ariruby.c.orig Fri Apr 29 09:23:11 2011 -+++ ariruby.c Fri Apr 29 09:24:14 2011 +--- ariruby.c.orig 2011-04-27 21:34:36.000000000 -0400 ++++ ariruby.c 2011-07-24 21:50:51.119557755 -0400 +@@ -189,7 +189,7 @@ + static VALUE + ariprint(VALUE self, VALUE outbuf) + { +- fprintf(stdout, "%s", RSTRING(outbuf)->ptr); ++ fprintf(stdout, "%s", RSTRING_PTR(outbuf)); + + return self; + } +@@ -198,14 +198,14 @@ + arisend(VALUE self, VALUE data) + { + int len; +- len = RSTRING(data)->len; ++ len = RSTRING_LEN(data); + + if ((sendbuf = (char *)malloc(len + 1)) == NULL) { + perror("arisend malloc failed"); + close(sock); + exit(0); + } +- memcpy(sendbuf, RSTRING(data)->ptr, len); ++ memcpy(sendbuf, RSTRING_PTR(data), len); + + if (len == 0) { + fprintf(stderr, "please set a data in arisend function \n"); @@ -519,9 +519,6 @@ if (sendbuf != NULL) free(sendbuf); @@ -10,13 +36,13 @@ if (nb == -1 || nb == -2) { #if !(defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)) alarm(0); -@@ -543,6 +540,9 @@ - if (!pflags) +@@ -544,6 +541,9 @@ exit(0); } -+ + + if (headbuf != NULL) + free(headbuf); - ++ if (sslflags) ssl_free(ctx, ssl); + |