Bug 183768 - Port www/adzap fix for perl 5.16 [PATCH]
Summary: Port www/adzap fix for perl 5.16 [PATCH]
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: William Grzybowski
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-08 01:10 UTC by Horia Racoviceanu
Modified: 2013-11-09 13:20 UTC (History)
0 users

See Also:


Attachments
file.diff (7.24 KB, patch)
2013-11-08 01:10 UTC, Horia Racoviceanu
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Horia Racoviceanu 2013-11-08 01:10:00 UTC
Can't locate flush.pl

Fix: - Bump PORTREVISION to 1
- Add patch-scripts_squid_redirect-nodata to files to
  use IO::Handle instead of flush.pl 
  Patch obtained from Gentoo:
  https://bugs.gentoo.org/show_bug.cgi?id=425196
- Install as "squid_redirect" instead of "squid_redirect-nodata
  to match the defaults in the configuration files
- Add BSD LICENSE
- Remove PKGMESSAGE
- Add DOCS option
- Add EXAMPLES option
- Add PORTDOCS
- Use STAGEDIR
- Change pkg-plist to match new OPTIONS and STAGEDIR
- Remove extra spaces from pkg-descr
- Pass maintainership to submitter

Build log:
https://redports.org/buildarchive/20131107230452-78837/

Patch attached with submission follows:
Comment 1 William Grzybowski freebsd_committer freebsd_triage 2013-11-09 03:34:18 UTC
Responsible Changed
From-To: freebsd-ports-bugs->wg

I'll take it.
Comment 2 William Grzybowski freebsd_committer freebsd_triage 2013-11-09 13:13:34 UTC
State Changed
From-To: open->closed

Committed. Thanks!
Comment 3 dfilter service freebsd_committer freebsd_triage 2013-11-09 13:13:43 UTC
Author: wg
Date: Sat Nov  9 13:13:30 2013
New Revision: 333287
URL: http://svnweb.freebsd.org/changeset/ports/333287

Log:
  www/adzap: fix for perl 5.16
  
  - Fix for perl 5.16
  - Add LICENSE (BSD)
  - Add DOCS and EXAMPLES options
  - Pass maintainership to submitter
  
  PR:		ports/183768
  Submitted by:	Horia Racoviceanu <horia racoviceanu.com>

Added:
  head/www/adzap/files/patch-scripts_squid_redirect-nodata   (contents, props changed)
Modified:
  head/www/adzap/Makefile
  head/www/adzap/pkg-descr
  head/www/adzap/pkg-plist

Modified: head/www/adzap/Makefile
==============================================================================
--- head/www/adzap/Makefile	Sat Nov  9 13:09:49 2013	(r333286)
+++ head/www/adzap/Makefile	Sat Nov  9 13:13:30 2013	(r333287)
@@ -3,36 +3,42 @@
 
 PORTNAME=	adzap
 PORTVERSION=	20110915
+PORTREVISION=	1
 CATEGORIES=	www perl5
 MASTER_SITES=	http://adzapper.sourceforge.net/
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	horia@racoviceanu.com
 COMMENT=	Filter out animated ad banners from web pages
 
+LICENSE=	BSD
+
 USES=		perl5
 NO_BUILD=	yes
 USE_PERL5=	run
 
+OPTIONS_DEFINE=	DOCS EXAMPLES
+
+PORTDOCS=	index.html update-instructions.txt TODO my-bsd-license.html
+PORTEXAMPLES=	*
 SUB_FILES=	adzap.conf pkg-message
-PKGMESSAGE=	${WRKDIR}/pkg-message
 
-NO_STAGE=	yes
 do-configure:
 .for FILE in squid_redirect-nodata wrapzap zapchain
-	${REINPLACE_CMD} -e "s:/usr/bin/perl:${PERL5}:g" \
+	@${REINPLACE_CMD} -e "s:/usr/bin/perl:${PERL5}:g" \
 			-e "s:%%PREFIX%%:${PREFIX}:g" ${WRKSRC}/scripts/${FILE}
 .endfor
 
 do-install:
-	${INSTALL_SCRIPT} ${WRKSRC}/scripts/squid_redirect-nodata ${PREFIX}/libexec/
-	${INSTALL_SCRIPT} ${WRKSRC}/scripts/wrapzap ${PREFIX}/libexec/adzap
-	${INSTALL_SCRIPT} ${WRKSRC}/scripts/zapchain ${PREFIX}/libexec/
-	${INSTALL} -d ${EXAMPLESDIR}
-	${CP} -R ${WRKSRC}/zaps ${EXAMPLESDIR}
-	${CP} -R ${WRKSRC}/rc ${EXAMPLESDIR}
-	${INSTALL_DATA} ${WRKDIR}/adzap.conf ${EXAMPLESDIR}
+	${INSTALL_SCRIPT} ${WRKSRC}/scripts/squid_redirect-nodata ${STAGEDIR}${PREFIX}/libexec/squid_redirect
+	${INSTALL_SCRIPT} ${WRKSRC}/scripts/wrapzap ${STAGEDIR}${PREFIX}/libexec/adzap
+	${INSTALL_SCRIPT} ${WRKSRC}/scripts/zapchain ${STAGEDIR}${PREFIX}/libexec/
+
+	${INSTALL} -d ${STAGEDIR}${EXAMPLESDIR}
+	${CP} -R ${WRKSRC}/zaps ${STAGEDIR}${EXAMPLESDIR}
+	${CP} -R ${WRKSRC}/rc ${STAGEDIR}${EXAMPLESDIR}
+	${INSTALL_DATA} ${WRKDIR}/adzap.conf ${STAGEDIR}${EXAMPLESDIR}
 
-post-install:
-	@${CAT} ${PKGMESSAGE}
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
 
 .include <bsd.port.mk>

Added: head/www/adzap/files/patch-scripts_squid_redirect-nodata
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/adzap/files/patch-scripts_squid_redirect-nodata	Sat Nov  9 13:13:30 2013	(r333287)
@@ -0,0 +1,107 @@
+--- scripts/squid_redirect-nodata.orig
++++ scripts/squid_redirect-nodata
+@@ -31,7 +31,7 @@ use bytes;
+ 
+ use POSIX ":sys_wait_h";
+ use Socket;
+-require 'flush.pl';
++use IO::Handle;
+ 
+ $::IOSIZE=1024;
+ 
+@@ -232,7 +232,7 @@ while (defined ($_=<STDIN>))
+ {
+   if (defined $::LogFile)
+   { print LOGFILE $_;
+-    flush(LOGFILE);
++    LOGFILE->flush();
+   }
+   chomp;
+   
+@@ -259,7 +259,7 @@ while (defined ($_=<STDIN>))
+     }
+   }
+ 
+-  flush(STDOUT);
++  STDOUT->flush();
+ }
+ 
+ exit 0;
+@@ -789,14 +788,16 @@ sub proxy_forkchild($$$)
+       }
+ 
+       # dispatch request and headers
+-      printflush(GCHILD_WRITE,"$method $uri $v1 $v2\n")
++      print GCHILD_WRITE "$method $uri $v1 $v2\n"
+ 	|| die "tell grandchild the request: $!";
++      GCHILD_WRITE->flush();
+ 
+       print PROXY "$method $uri HTTP/$v1.$v2\r\n";
+       for my $H (@hdrs)
+       { print PROXY $H->[0], ":", $H->[1], "\r\n";
+       }
+-      printflush(PROXY,"\r\n");
++      print PROXY "\r\n";
++      PROXY->flush();
+       ##warn "[$$]: sent rq to proxy\n";
+ 
+       proxy_copybody(CONN,PROXY,$method,$persist,\@hdrs)
+@@ -965,8 +966,9 @@ sub proxy_grandchild($)
+     }
+ 
+     warn "[$child:$$]: pass response to parent\n";
+-    printflush(TOCHILD,($persist ? PERSIST : CLOSE)." $code $info")
++    print TOCHILD ($persist ? PERSIST : CLOSE)." $code $info"
+ 	|| die "[$child:$$]: print(TOCHILD) fails: $!";
++    TOCHILD->flush();
+     warn "[$child:$$]: told parent, passing response to client\n";
+ 
+     # copy to child
+@@ -974,7 +976,8 @@ sub proxy_grandchild($)
+     for my $H (@hdrs)
+     { print CONN $H->[0], ":", $H->[1], "\r\n";
+     }
+-    printflush(CONN,"\r\n");
++    print CONN "\r\n";
++    CONN->flush();
+ 
+     # see RFC2616 section 10
+     if (
+@@ -1050,11 +1053,13 @@ sub proxy_copycl($$$)
+ 	)
+   {
+     ##warn "[$$]: read ".length($_)." bytes of request body\n";
+-    if (! printflush($to,$_))
+-    { warn "$::cmd: [$$]: printflush($to,..): $!";
++    $to->autoflush(1);
++    if (! print $to $_)
++    { warn "$::cmd: [$$]: print $to ..): $!";
+       $ok=0;
+       last COPY;
+     }
++    $to->autoflush(0);
+     $cl-=length if defined $cl;
+   }
+   warn "[$$]: finished unchunked body, ok=$ok";
+@@ -1083,10 +1088,10 @@ sub proxy_copychunked($$)
+     { print $to $_;
+       $chunksize-=length;
+     }
+-    flush($to);
++    $to->flush();
+   }
+ 
+-  flush($to);
++  $to->flush();
+ 
+   # pass trailer headers
+   while (defined($_=<$from>) && !/^\r?\n/)
+@@ -1096,7 +1101,7 @@ sub proxy_copychunked($$)
+   { ##warn "[$$]: final trailer: $_";
+     print $to $_;
+   }
+-  flush($to);
++  $to->flush();
+ 
+   return (1,"");
+ }

Modified: head/www/adzap/pkg-descr
==============================================================================
--- head/www/adzap/pkg-descr	Sat Nov  9 13:09:49 2013	(r333286)
+++ head/www/adzap/pkg-descr	Sat Nov  9 13:13:30 2013	(r333287)
@@ -1,7 +1,7 @@
-  Adzap is a http-redirector script for squid, that zaps by replacing
+Adzap is a http-redirector script for squid, that zaps by replacing
 those annoying ad banners from web pages with placeholder GIFs.
 It lives in the web proxy and so requires no special browser
-facilities.  It's readily customizable, small, fast, and easy to
+facilities. It's readily customizable, small, fast, and easy to
 install.
 
 WWW: http://adzapper.sourceforge.net/

Modified: head/www/adzap/pkg-plist
==============================================================================
--- head/www/adzap/pkg-plist	Sat Nov  9 13:09:49 2013	(r333286)
+++ head/www/adzap/pkg-plist	Sat Nov  9 13:13:30 2013	(r333287)
@@ -1,47 +1,3 @@
 libexec/adzap
-libexec/squid_redirect-nodata
+libexec/squid_redirect
 libexec/zapchain
-%%EXAMPLESDIR%%/adzap.conf
-%%EXAMPLESDIR%%/rc/proxy-home.pac
-%%EXAMPLESDIR%%/rc/proxy-zip.pac
-%%EXAMPLESDIR%%/rc/patterns
-%%EXAMPLESDIR%%/rc/squid/ERR_ACCESS_DENIED
-%%EXAMPLESDIR%%/rc/squid/Mykefile
-%%EXAMPLESDIR%%/rc/squid/ip-ranges@zip.raw
-%%EXAMPLESDIR%%/rc/squid/tplt
-%%EXAMPLESDIR%%/rc/squid/tplt-home
-%%EXAMPLESDIR%%/rc/squid/tplt-zip
-%%EXAMPLESDIR%%/zaps/ad-clear.gif
-%%EXAMPLESDIR%%/zaps/ad-clear.mp3
-%%EXAMPLESDIR%%/zaps/ad-clear.swf
-%%EXAMPLESDIR%%/zaps/ad-grey.gif
-%%EXAMPLESDIR%%/zaps/ad-old.gif
-%%EXAMPLESDIR%%/zaps/ad.gif
-%%EXAMPLESDIR%%/zaps/ad.mp3
-%%EXAMPLESDIR%%/zaps/ad.swf
-%%EXAMPLESDIR%%/zaps/adbg-clear.gif
-%%EXAMPLESDIR%%/zaps/adbg.gif
-%%EXAMPLESDIR%%/zaps/closepopup-clear.html
-%%EXAMPLESDIR%%/zaps/closepopup.html
-%%EXAMPLESDIR%%/zaps/counter-clear.gif
-%%EXAMPLESDIR%%/zaps/counter-clear.js
-%%EXAMPLESDIR%%/zaps/counter.gif
-%%EXAMPLESDIR%%/zaps/counter.js
-%%EXAMPLESDIR%%/zaps/no-op-clear.html
-%%EXAMPLESDIR%%/zaps/no-op-clear.js
-%%EXAMPLESDIR%%/zaps/no-op-counter-clear.html
-%%EXAMPLESDIR%%/zaps/no-op-counter-clear.js
-%%EXAMPLESDIR%%/zaps/no-op-counter.html
-%%EXAMPLESDIR%%/zaps/no-op-counter.js
-%%EXAMPLESDIR%%/zaps/no-op.html
-%%EXAMPLESDIR%%/zaps/no-op.js
-%%EXAMPLESDIR%%/zaps/webbug-clear.gif
-%%EXAMPLESDIR%%/zaps/webbug-clear.html
-%%EXAMPLESDIR%%/zaps/webbug-clear.js
-%%EXAMPLESDIR%%/zaps/webbug.gif
-%%EXAMPLESDIR%%/zaps/webbug.html
-%%EXAMPLESDIR%%/zaps/webbug.js
-@dirrm %%EXAMPLESDIR%%/rc/squid
-@dirrm %%EXAMPLESDIR%%/rc
-@dirrm %%EXAMPLESDIR%%/zaps
-@dirrm %%EXAMPLESDIR%%
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"