diff options
author | 2013-03-18 11:56:49 +0000 | |
---|---|---|
committer | 2013-03-18 11:56:49 +0000 | |
commit | d3f51d0e7ac57175a870ef59678dd3fb9d939280 (patch) | |
tree | 739477ba908ea5792fd945de042d9ec53c3807cb /net-proxy | |
parent | Add patch by Sven Wehner <sven@atelophobia.de> fixing build with USE="truetyp... (diff) | |
download | gentoo-2-d3f51d0e7ac57175a870ef59678dd3fb9d939280.tar.gz gentoo-2-d3f51d0e7ac57175a870ef59678dd3fb9d939280.tar.bz2 gentoo-2-d3f51d0e7ac57175a870ef59678dd3fb9d939280.zip |
Removes the use of flush.pl (#425196). Thanks to Brennan Shacklett
(Portage version: 2.2.0_alpha166/cvs/Linux x86_64, signed Manifest commit with key 0x5772769F4E046AEC)
Diffstat (limited to 'net-proxy')
-rw-r--r-- | net-proxy/adzapper/ChangeLog | 10 | ||||
-rw-r--r-- | net-proxy/adzapper/adzapper-20110915-r2.ebuild | 57 | ||||
-rw-r--r-- | net-proxy/adzapper/files/20110915-flush.patch | 107 |
3 files changed, 172 insertions, 2 deletions
diff --git a/net-proxy/adzapper/ChangeLog b/net-proxy/adzapper/ChangeLog index 23000fb961fe..ef10e395fe5d 100644 --- a/net-proxy/adzapper/ChangeLog +++ b/net-proxy/adzapper/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-proxy/adzapper -# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/adzapper/ChangeLog,v 1.62 2012/08/10 14:11:59 jer Exp $ +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/adzapper/ChangeLog,v 1.63 2013/03/18 11:56:48 tove Exp $ + +*adzapper-20110915-r2 (18 Mar 2013) + + 18 Mar 2013; Torsten Veller <tove@gentoo.org> +files/20110915-flush.patch, + +adzapper-20110915-r2.ebuild: + Removes the use of flush.pl (#425196). Thanks to Brennan Shacklett *adzapper-20110915-r1 (10 Aug 2012) diff --git a/net-proxy/adzapper/adzapper-20110915-r2.ebuild b/net-proxy/adzapper/adzapper-20110915-r2.ebuild new file mode 100644 index 000000000000..d08e2edc1f38 --- /dev/null +++ b/net-proxy/adzapper/adzapper-20110915-r2.ebuild @@ -0,0 +1,57 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/adzapper/adzapper-20110915-r2.ebuild,v 1.1 2013/03/18 11:56:48 tove Exp $ + +EAPI=5 + +MY_P=${P/zapper/zap} + +inherit eutils + +DESCRIPTION="Redirector for squid that intercepts advertising, page counters and some web bugs" +HOMEPAGE="http://adzapper.sourceforge.net/" +SRC_URI="http://adzapper.sourceforge.net/${MY_P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86" +IUSE="" + +RDEPEND="dev-lang/perl" + +S="${WORKDIR}"/${P/per/} + +src_prepare() { + epatch "${FILESDIR}"/20110915-flush.patch + # update the zapper path in various scripts + local SCRPATH="/etc/adzapper/squid_redirect" + sed -i \ + -e "s|^zapper=.*|zapper=${SCRPATH}|" \ + -e "s|^ZAPPER=.*|ZAPPER=\"${SCRPATH}\"|" \ + -e "s|^pidfile=.*|pidfile=/var/run/squid.pid|" \ + -e "s|^PIDFILE=.*|PIDFILE=\"/var/run/squid.pid\"|" \ + -e "s|^RESTARTCMD=.*|RESTARTCMD=\"/etc/init.d/squid restart\"|" \ + scripts/wrapzap scripts/update-zapper* \ + || die "sed updating failed." +} + +src_install() { + exeinto /etc/adzapper + doexe \ + scripts/wrapzap \ + scripts/zapchain \ + adblock-plus/adblockplus2adzapper.py + newexe scripts/squid_redirect-nodata squid_redirect + + insinto /etc/adzapper + doins scripts/update-zapper* + + insinto /var/www/localhost/htdocs/zap + doins zaps/* +} + +pkg_postinst() { + einfo "To enable adzapper, add the following lines to /etc/squid/squid.conf:" + einfo " url_rewrite_program /etc/adzapper/wrapzap" + einfo " url_rewrite_children 10" +} diff --git a/net-proxy/adzapper/files/20110915-flush.patch b/net-proxy/adzapper/files/20110915-flush.patch new file mode 100644 index 000000000000..3fb4ce913db0 --- /dev/null +++ b/net-proxy/adzapper/files/20110915-flush.patch @@ -0,0 +1,107 @@ +--- a/scripts/squid_redirect-nodata ++++ b/scripts/squid_redirect-nodata +@@ -31,7 +31,7 @@ + + use POSIX ":sys_wait_h"; + use Socket; +-require 'flush.pl'; ++use IO::Handle; + + $::IOSIZE=1024; + +@@ -232,7 +232,7 @@ + { + if (defined $::LogFile) + { print LOGFILE $_; +- flush(LOGFILE); ++ LOGFILE->flush();; + } + chomp; + +@@ -259,7 +259,7 @@ + } + } + +- flush(STDOUT); ++ STDOUT->flush(); + } + + exit 0; +@@ -789,14 +789,16 @@ + } + + # 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 +967,9 @@ + } + + 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 +977,8 @@ + 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 +1054,13 @@ + ) + { + ##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 +1089,10 @@ + { print $to $_; + $chunksize-=length; + } +- flush($to); ++ $to->flush(); + } + +- flush($to); ++ $to->flush(); + + # pass trailer headers + while (defined($_=<$from>) && !/^\r?\n/) +@@ -1096,7 +1102,7 @@ + { ##warn "[$$]: final trailer: $_"; + print $to $_; + } +- flush($to); ++ $to->flush(); + + return (1,""); + } |