ports/101070: New port: www/ziproxy A forwarding, non-caching, compressing proxy server

Pankov Pavel pankov_p at mail.ru
Sun Jul 30 22:20:15 UTC 2006


>Number:         101070
>Category:       ports
>Synopsis:       New port: www/ziproxy A forwarding, non-caching, compressing proxy server
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 30 22:20:13 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Pankov Pavel
>Release:        6.0-RELEASE, 6.1-RELEASE
>Organization:
MPEI
>Environment:
%uname -a
FreeBSD PANKOVPV.SOVIETSERVERS.COM 6.0-RELEASE-p4 FreeBSD 6.0-RELEASE-p4 #8: Mon Feb 27 09:09:25 MSK 2006     root at CRYO.SOVIETSERVERS.COM:/usr/obj/usr/src/sys/CRYO  i386
>Description:
Ziproxy is forwarding, non-caching, compressing proxy server. It
squeezes images by converting them to low quality jpegs and
optionally can also gzip HTML and other text-like data. It is
intended to free bandwidth on dialup connections.

WWW: http://ziproxy.sourceforge.net/
>How-To-Repeat:

>Fix:
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#       www/ziproxy
#       www/ziproxy/Makefile
#       www/ziproxy/pkg-descr
#       www/ziproxy/pkg-plist
#       www/ziproxy/distinfo
#       www/ziproxy/files
#       www/ziproxy/files/pkg-message.in
#       www/ziproxy/files/patch-ziproxy.conf
#       www/ziproxy/files/ziproxy.sh.in
#
echo c - www/ziproxy
mkdir -p www/ziproxy > /dev/null 2>&1
echo x - www/ziproxy/Makefile
sed 's/^X//' >www/ziproxy/Makefile << 'END-of-www/ziproxy/Makefile'
X# New ports collection makefile for:   ziproxy
X# Date created:                        28 July 2006
X# Whom:                                Pankov Pavel <pankov_p at mail.ru>
X#
X# $FreeBSD$
X
XPORTNAME=              ziproxy
XPORTVERSION=           2.1.0
XCATEGORIES=            www
XMASTER_SITES=          ${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR=    ${PORTNAME}
X
XMAINTAINER=            pankov_p at mail.ru
XCOMMENT=               A forwarding, non-caching, compressing proxy server
X
XLIB_DEPENDS=           ungif.5:${PORTSDIR}/graphics/libungif \
X                       png.5:${PORTSDIR}/graphics/png \
X                       jpeg.9:${PORTSDIR}/graphics/jpeg \
X                       confuse.0:${PORTSDIR}/devel/libconfuse
X
XUSE_BZIP2=             yes
X
XCFLAGS+=               -I${LOCALBASE}/include
XLDFLAGS+=              -L${LOCALBASE}/lib
XERRORFILES=            400.html 404.html 408.html 500.html 503.html
X
XCONFIGURE_ENV+=                CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
X
XGNU_CONFIGURE=         yes
XCONFIGURE_ARGS+=       --enable-shared-confuse --with-cfgfile=${PREFIX}/etc/ziproxy.conf
X
X.if !defined(NOPORTDOCS)
XPORTDOCS=              README
X.endif
X
XUSE_RC_SUBR=           ziproxy.sh
X
XSUB_FILES+=            pkg-message
X
X.include <bsd.port.pre.mk>
X
Xpost-patch:
X       @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \
X           ${WRKSRC}/etc/ziproxy.conf
X       @${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|g' \
X           ${WRKSRC}/etc/ziproxy.conf
X
X       @${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' \
X           ${WRKSRC}/configure
X
Xpost-install:
X       @${MKDIR} ${PREFIX}/etc
X       @${INSTALL_DATA} ${WRKSRC}/etc/ziproxy.conf ${PREFIX}/etc/ziproxy.conf.sample
X       @if [ ! -f ${PREFIX}/etc/ziproxy.conf ]; then \
X           ${CP} -p ${WRKSRC}/etc/ziproxy.conf ${PREFIX}/etc/ziproxy.conf ; \
X       fi
X
X.if !defined(NOPORTDOCS)
X       @${MKDIR} ${DOCSDIR}
X.for FILE in ${PORTDOCS}
X       @${INSTALL_DATA} ${WRKSRC}/${FILE} ${DOCSDIR}/${DOC}
X.endfor
X.endif
X
X       @${MKDIR} ${DATADIR}/error
X.for FILE in ${ERRORFILES}
X       @${INSTALL_DATA} ${WRKSRC}/var/ziproxy/error/${FILE} ${DATADIR}/error/${FILE}
X.endfor
X
X       @${CAT} ${PKGMESSAGE}
X
X.include <bsd.port.post.mk>
END-of-www/ziproxy/Makefile
echo x - www/ziproxy/pkg-descr
sed 's/^X//' >www/ziproxy/pkg-descr << 'END-of-www/ziproxy/pkg-descr'
XZiproxy is forwarding, non-caching, compressing proxy server. It
Xsqueezes images by converting them to low quality jpegs and
Xoptionally can also gzip HTML and other text-like data. It is
Xintended to free bandwidth on dialup connections.
X
XWWW: http://ziproxy.sourceforge.net/
X
X- pankovpv
Xpankov_p at mail.ru
END-of-www/ziproxy/pkg-descr
echo x - www/ziproxy/pkg-plist
sed 's/^X//' >www/ziproxy/pkg-plist << 'END-of-www/ziproxy/pkg-plist'
Xbin/ziproxy
X at unexec if cmp -s %D/etc/ziproxy.conf.sample %D/etc/ziproxy.conf; then rm -f %D/etc/ziproxy.conf; fi
X at exec if [ ! -f %D/etc/ziproxy.conf ] ; then cp -p %D/%F %B/ziproxy.conf; fi
Xetc/ziproxy.conf.sample
X%%DATADIR%%/error/400.html
X%%DATADIR%%/error/404.html
X%%DATADIR%%/error/408.html
X%%DATADIR%%/error/500.html
X%%DATADIR%%/error/503.html
X at dirrm %%DATADIR%%/error
X at dirrm %%DATADIR%%
END-of-www/ziproxy/pkg-plist
echo x - www/ziproxy/distinfo
sed 's/^X//' >www/ziproxy/distinfo << 'END-of-www/ziproxy/distinfo'
XMD5 (ziproxy-2.1.0.tar.bz2) = e474fbddfd9af2fba36318705746b997
XSHA256 (ziproxy-2.1.0.tar.bz2) = 7d9ebee8824d8cba1b212cf830346455ae0fe52af1ea2231a5d02237e37bfd58
XSIZE (ziproxy-2.1.0.tar.bz2) = 134815
END-of-www/ziproxy/distinfo
echo c - www/ziproxy/files
mkdir -p www/ziproxy/files > /dev/null 2>&1
echo x - www/ziproxy/files/pkg-message.in
sed 's/^X//' >www/ziproxy/files/pkg-message.in << 'END-of-www/ziproxy/files/pkg-message.in'
XBy default, to prevent creating non-controllable public proxies, ziproxy is configured to accept connections only on localhost.
XYou have to edit %%PREFIX%%/etc/ziproxy.conf to enable remote access to service.
X
XThere is no man page for ziproxy, but info can be found in %%DOCSDIR%%/README.
X
Xziproxy can be started by the following ways:
Xo daemon mode:
X    * add ziproxy_enable="YES" to your /etc/rc.conf
X    * use rc(8) script %%PREFIX%%/etc/rc.d/ziproxy.sh
Xo inetd mode:
X    * add ``http-proxy      8080/tcp   #HTTP Proxy'' to /etc/services
X    * add ``http-proxy      stream  tcp     nowait  nobody  /usr/local/bin/ziproxy  ziproxy -i'' to your /etc/inetd.conf
X    * reload inetd(8) config files by doing `/etc/rc.d/inetd reload`
END-of-www/ziproxy/files/pkg-message.in
echo x - www/ziproxy/files/patch-ziproxy.conf
sed 's/^X//' >www/ziproxy/files/patch-ziproxy.conf << 'END-of-www/ziproxy/files/patch-ziproxy.conf'
X--- etc/ziproxy.conf.orig      Wed Jul 26 09:01:36 2006
X+++ etc/ziproxy.conf   Mon Jul 31 01:07:02 2006
X@@ -9,7 +9,7 @@
X
X ## WARNING: Remember to restrict the access to Ziproxy
X ## if your machine is directly connected to the Internet.
X-# OnlyFrom = "127.0.0.1"
X+OnlyFrom = "localhost"
X
X # Inactivity timeout before closing the daemon (0 = no timeout)
X NetdTimeout = 0
X@@ -36,7 +36,7 @@
X ## HTTP auth file
X ## Should contain user:pass pairs, lines no longer than 128 chars
X ## Password is unencrypted
X-# PasswdFile="/usr/local/ziproxy/ziproxy.passwd"
X+# PasswdFile="/usr/local/etc/ziproxy.passwd"
X
X ## Forward everything to another proxy server.
X ## Modifications/compression is still applied.
X@@ -151,13 +151,12 @@
X ## Note: The internal defaults give more precise error messages.
X ##
X ## 400 - Bad request (malformed URL, or unknown URL type)
X-# CustomError400="/var/ziproxy/error/400.html"
X+# CustomError400="%%DATADIR%%/error/400.html"
X ## 404 - Unknown host (Ziproxy will not issue 'page not found' errors itself)
X-# CustomError404="/var/ziproxy/error/404.html"
X+# CustomError404="%%DATADIR%%/error/404.html"
X ## 408 - Request timed out
X-# CustomError408="/var/ziproxy/error/408.html"
X+# CustomError408="%%DATADIR%%/error/408.html"
X ## 500 - Internal error (or empty response from server)
X-# CustomError500="/var/ziproxy/error/500.html"
X+# CustomError500="%%DATADIR%%/error/500.html"
X ## 503 - Connection refused (or service unavailable)
X-# CustomError503="/var/ziproxy/error/503.html"
X-
X+# CustomError503="%%DATADIR%%/error/503.html"
END-of-www/ziproxy/files/patch-ziproxy.conf
echo x - www/ziproxy/files/ziproxy.sh.in
sed 's/^X//' >www/ziproxy/files/ziproxy.sh.in << 'END-of-www/ziproxy/files/ziproxy.sh.in'
X#!/bin/sh
X
X# PROVIDE: ziproxy
X# REQUIRE: DAEMON
X#
X# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
X# to enable this service:
X#
X# ziproxy_enable (bool):   Set to NO by default.
X#               Set it to YES to enable ziproxy.
X# ziproxy_config (path):   Set to %%PREFIX%%/etc/ziproxy.conf
X#               by default.
X#
X
X. "%%RC_SUBR%%"
X
Xname="ziproxy"
Xrcvar=${name}_enable
X
Xcommand=%%PREFIX%%/bin/${name}
Xpidfile=/var/run/${name}.pid
X
Xload_rc_config $name
X
X: ${ziproxy_enable="NO"}
X: ${ziproxy_config="%%PREFIX%%/etc/ziproxy.conf"}
X
Xcommand_args="-d -c ${ziproxy_config}"
X
Xrun_rc_command "$1"
END-of-www/ziproxy/files/ziproxy.sh.in
exit

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list