aboutsummaryrefslogtreecommitdiff
path: root/www/adzap
diff options
context:
space:
mode:
authorWilliam Grzybowski <wg@FreeBSD.org>2013-11-09 13:13:30 +0000
committerWilliam Grzybowski <wg@FreeBSD.org>2013-11-09 13:13:30 +0000
commit84accb780efd8ff5d92e10043f0958ca299a9034 (patch)
tree635f51c4cd0f1d6dd01af706657a72c0f15ff27d /www/adzap
parentb8481a8c7d49a7d09d75b160c085e8b4a273c2ee (diff)
downloadports-84accb780efd8ff5d92e10043f0958ca299a9034.tar.gz
ports-84accb780efd8ff5d92e10043f0958ca299a9034.zip
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>
Notes
Notes: svn path=/head/; revision=333287
Diffstat (limited to 'www/adzap')
-rw-r--r--www/adzap/Makefile34
-rw-r--r--www/adzap/files/patch-scripts_squid_redirect-nodata107
-rw-r--r--www/adzap/pkg-descr4
-rw-r--r--www/adzap/pkg-plist46
4 files changed, 130 insertions, 61 deletions
diff --git a/www/adzap/Makefile b/www/adzap/Makefile
index 96b347c9809c..d60afc9f30d0 100644
--- a/www/adzap/Makefile
+++ b/www/adzap/Makefile
@@ -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}
-
-post-install:
- @${CAT} ${PKGMESSAGE}
+ ${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}
+
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>
diff --git a/www/adzap/files/patch-scripts_squid_redirect-nodata b/www/adzap/files/patch-scripts_squid_redirect-nodata
new file mode 100644
index 000000000000..253c8def2e42
--- /dev/null
+++ b/www/adzap/files/patch-scripts_squid_redirect-nodata
@@ -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,"");
+ }
diff --git a/www/adzap/pkg-descr b/www/adzap/pkg-descr
index 238848dec5ae..4d6b35f1b975 100644
--- a/www/adzap/pkg-descr
+++ b/www/adzap/pkg-descr
@@ -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/
diff --git a/www/adzap/pkg-plist b/www/adzap/pkg-plist
index 1575df547bc7..cf82e077d994 100644
--- a/www/adzap/pkg-plist
+++ b/www/adzap/pkg-plist
@@ -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%%