--- polipo-1.0.4.orig/debian/README.Debian
+++ polipo-1.0.4/debian/README.Debian
@@ -0,0 +1,50 @@
+polipo for Debian
+-----------------
+
+Polipo is available from http://www.pps.jussieu.fr/~jch/software/polipo/.
+
+There was a webpage devoted to this Debian package which you can find at
+http://www.srcf.ucam.org/~teh30/debian/polipo/. But due new maintainer,
+new versions not available there. Look up the Debian repository for it.
+
+
+How to use polipo for Debian
+----------------------------
+
+Configure your browser to use a proxy on host 'localhost', port '8123'.
+
+
+  Online documentation
+  --------------------
+
+Once polipo is running, online documentation is available at
+http://127.0.0.1:8123/doc/.  Alternatively you can find the same information
+on the Polipo website: http://www.pps.jussieu.fr/~jch/software/polipo/manual/
+
+
+  Allowing other computers to access polipo
+  -----------------------------------------
+
+By default polipo will only accept local connections.  If you want other
+computers on your network to be able to use this machine as a web cache,
+then uncomment the 'proxyAddress' line in /etc/polipo/config.  For
+security's sake you should enable the 'allowedClients' variable and add the
+address of your network, e.g. 'allowedClients = 127.0.0.1, 194.168.42.0/24'. 
+You might also want to set 'disableLocalInterface=true', otherwise all the
+proxy's users can see what pages the others have been accessing.
+
+
+  Using polipo with a modem or a mobile connection
+  ------------------------------------------------
+
+Polipo will go on- and offline automatically whenever PPP (modem) or
+other network connections are established or brought down. You can
+specify on which type of connection this behaviour will occur by editing
+the file /etc/polipo/options and setting the method option to the
+appropriate value, i.e. `method ppp'. For IPv4 the following methods
+allowed: any for any method (default), static, manual, dhcp, bootp, ppp,
+wvdial. The loopback method is not applicable. You can find a list of
+these methods in the interfaces(5) manpage. Note: you can add multiple
+`method' lines in the options file.
+
+ -- Denis V. Sirotkin <fechiny@gmail.com>, Sun, 29 Jul 2007 18:26:38 +0600
--- polipo-1.0.4.orig/debian/polipo.info
+++ polipo-1.0.4/debian/polipo.info
@@ -0,0 +1 @@
+polipo.info
--- polipo-1.0.4.orig/debian/patches/20_config.dpatch
+++ polipo-1.0.4/debian/patches/20_config.dpatch
@@ -0,0 +1,56 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 20_config.dpatch by Denis V. Sirotkin <fechiny@gmail.com>
+## Original changes was done by Tom Huckstep <tom-debian-polipo@jaguarpaw.co.uk>
+##
+## DP: Change description
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p1 ${patch_opts} < $0;;
+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
+    *)
+	echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+	exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+
+--- polipo-1.0.1.orig/config.sample
++++ polipo-1.0.1/config.sample
+@@ -1,8 +1,7 @@
+ # Sample configuration file for Polipo. -*-sh-*-
+ 
+-# You should not need to use a configuration file; all configuration
+-# variables have reasonable defaults.  If you want to use one, you
+-# can copy this to /etc/polipo/config or to ~/.polipo and modify.
++# You should not need to edit this configuration file; all configuration
++# variables have reasonable defaults.
+ 
+ # This file only contains some of the configuration variables; see the
+ # list given by ``polipo -v'' and the manual for more.
+@@ -17,11 +16,11 @@
+ # proxyAddress = "::0"        # both IPv4 and IPv6
+ # proxyAddress = "0.0.0.0"    # IPv4 only
+ 
+-# If you do that, you'll want to restrict the set of hosts allowed to
+-# connect:
+-
+-# allowedClients = "127.0.0.1, 134.157.168.57"
+-# allowedClients = "127.0.0.1, 134.157.168.0/24"
++# If you are enabling 'proxyAddress' above, then you want to enable the
++# 'allowedClients' variable to the address of your network, e.g.
++# allowedClients = 127.0.0.1, 192.168.42.0/24
++                                            
++# allowedClients = 127.0.0.1              
+ 
+ # Uncomment this if you want your Polipo to identify itself by
+ # something else than the host name:
--- polipo-1.0.4.orig/debian/patches/10_makefile.dpatch
+++ polipo-1.0.4/debian/patches/10_makefile.dpatch
@@ -0,0 +1,58 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10_makefile.dpatch by Denis V. Sirotkin <fechiny@gmail.com>
+## Original changes was done by Tom Huckstep <tom-debian-polipo@jaguarpaw.co.uk>
+##
+## DP: Change description
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p1 ${patch_opts} < $0;;
+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
+    *)
+	echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+	exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+
+--- polipo-1.0.1.orig/Makefile
++++ polipo-1.0.1/Makefile
+@@ -1,4 +1,5 @@
+-PREFIX = /usr/local
++PREFIX = /usr
++TARGET = $(DESTDIR)
+ BINDIR = $(PREFIX)/bin
+ MANDIR = $(PREFIX)/man
+ INFODIR = $(PREFIX)/info
+@@ -62,7 +63,7 @@
+ 
+ DEFINES = $(FILE_DEFINES) $(PLATFORM_DEFINES)
+ 
+-CFLAGS = $(MD5INCLUDES) $(CDEBUGFLAGS) $(DEFINES) $(EXTRA_DEFINES)
++override CFLAGS += $(MD5INCLUDES) $(CDEBUGFLAGS) $(DEFINES) $(EXTRA_DEFINES)
+ 
+ SRCS = util.c event.c io.c chunk.c atom.c object.c log.c diskcache.c main.c \
+        config.c local.c http.c client.c server.c auth.c tunnel.c \
+@@ -91,10 +92,13 @@
+ 	mkdir -p $(TARGET)$(BINDIR)
+ 	mkdir -p $(TARGET)$(LOCAL_ROOT)
+ 	mkdir -p $(TARGET)$(LOCAL_ROOT)/doc
++	mkdir -p $(TARGET)/etc/polipo
+ 	rm -f $(TARGET)$(BINDIR)/polipo
+ 	cp -f polipo $(TARGET)$(BINDIR)/
+ 	cp -f html/* $(TARGET)$(LOCAL_ROOT)/doc
+ 	cp -f localindex.html $(TARGET)$(LOCAL_ROOT)/index.html
++	cp -f config.sample $(TARGET)/etc/polipo/config
++	cp -f forbidden.sample $(TARGET)/etc/polipo/forbidden
+ 
+ install.man: all
+ 	mkdir -p $(TARGET)$(MANDIR)/man1
--- polipo-1.0.4.orig/debian/patches/30_log-permission.dpatch
+++ polipo-1.0.4/debian/patches/30_log-permission.dpatch
@@ -0,0 +1,47 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 30_log-permission.dpatch by Denis V. Sirotkin <fechiny@gmail.com>
+##
+## DP: Set umask 026 so log files are opened with permission 750
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p1 ${patch_opts} < $0;;
+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
+    *)
+	echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+	exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+
+--- polipo-1.0.4.orig/log.c
++++ polipo-1.0.4/log.c
+@@ -80,7 +80,9 @@
+ 
+     if(logFile != NULL && logFile->length > 0) {
+         FILE *f;
++	mode_t mask = umask(026);
+         f = fopen(logFile->string, "a");
++	umask(mask);
+         if(f == NULL) {
+             do_log_error(L_ERROR, errno, "Couldn't open log file %s",
+                          logFile->string);
+@@ -340,7 +342,9 @@
+ {
+     if(logFile) {
+         FILE *f;
++	mode_t mask = umask(026);
+         f = fopen(logFile->string, "a");
++	umask(mask);
+         if(f == NULL) {
+             do_log_error(L_ERROR, errno, "Couldn't reopen log file %s",
+                          logFile->string);
--- polipo-1.0.4.orig/debian/patches/00list
+++ polipo-1.0.4/debian/patches/00list
@@ -0,0 +1,3 @@
+10_makefile.dpatch
+20_config.dpatch
+30_log-permission.dpatch
--- polipo-1.0.4.orig/debian/compat
+++ polipo-1.0.4/debian/compat
@@ -0,0 +1 @@
+5
--- polipo-1.0.4.orig/debian/polipo.cron.daily
+++ polipo-1.0.4/debian/polipo.cron.daily
@@ -0,0 +1,20 @@
+#!/bin/sh        
+set -e
+
+FORBIDDEN_FILE=/etc/polipo/forbidden
+CONFIG_FILE=/etc/polipo/config
+
+if [ ! -x /usr/bin/polipo ]; then
+  exit 0
+fi
+
+if [ ! -f $FORBIDDEN_FILE ]; then
+  FORBIDDEN_FILE=/dev/null
+fi  
+
+PIDFILE=/var/run/polipo/polipo.pid
+[ -f "$PIDFILE" ] && kill -USR1 $(cat "$PIDFILE")
+su -c \
+	"nice polipo -x -c $CONFIG_FILE forbiddenFile=$FORBIDDEN_FILE > /dev/null" \
+	proxy
+[ -f "$PIDFILE" ] && kill -USR2 $(cat "$PIDFILE")
--- polipo-1.0.4.orig/debian/options
+++ polipo-1.0.4/debian/options
@@ -0,0 +1,9 @@
+# See the /usr/share/doc/polipo/README.Debian file for details on this file
+
+method any
+#method static
+#method manual
+#method dhcp
+#method bootp
+#method ppp
+#method wvdial
--- polipo-1.0.4.orig/debian/polipo.manpages
+++ polipo-1.0.4/debian/polipo.manpages
@@ -0,0 +1 @@
+polipo.man
--- polipo-1.0.4.orig/debian/docs
+++ polipo-1.0.4/debian/docs
@@ -0,0 +1 @@
+README
--- polipo-1.0.4.orig/debian/cdbs/options.mk
+++ polipo-1.0.4/debian/cdbs/options.mk
@@ -0,0 +1,3 @@
+common-install-arch::
+	shopt nullglob; \
+	install --mode=644 -D debian/options $(DEB_DESTDIR)/etc/polipo/
--- polipo-1.0.4.orig/debian/cdbs/ip-updown.mk
+++ polipo-1.0.4/debian/cdbs/ip-updown.mk
@@ -0,0 +1,9 @@
+common-install-arch::
+	shopt nullglob; \
+	for d in ip-up ip-down; do \
+		for script in debian/updown/$$d/*; do \
+			S=`basename $$script` ;\
+			install --mode=755 -D $$script \
+				$(DEB_DESTDIR)/etc/ppp/$$d.d/$$S ;\
+		done ;\
+	done
--- polipo-1.0.4.orig/debian/cdbs/helper-scripts.mk
+++ polipo-1.0.4/debian/cdbs/helper-scripts.mk
@@ -0,0 +1,10 @@
+common-install-arch::
+	shopt nullglob; \
+	for p in debian/helper-scripts/*; do \
+		PACKAGE=`basename $$p` ;\
+		for script in $$p/*; do \
+			S=`basename $$script` ;\
+			install --mode=755 -D $$script \
+				$(DEB_DESTDIR)/usr/lib/$$PACKAGE/$$S ;\
+		done ;\
+	done
--- polipo-1.0.4.orig/debian/cdbs/if-updown.mk
+++ polipo-1.0.4/debian/cdbs/if-updown.mk
@@ -0,0 +1,9 @@
+common-install-arch::
+	shopt nullglob; \
+	for d in if-up if-down; do \
+		for script in debian/updown/$$d/*; do \
+			S=`basename $$script` ;\
+			install --mode=755 -D $$script \
+				$(DEB_DESTDIR)/etc/network/$$d.d/$$S ;\
+		done ;\
+	done
--- polipo-1.0.4.orig/debian/watch
+++ polipo-1.0.4/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://www.pps.jussieu.fr/~jch/software/files/polipo/ polipo-(\d*\.\d*\.\d*)\.tar\.gz
--- polipo-1.0.4.orig/debian/polipo.doc-base
+++ polipo-1.0.4/debian/polipo.doc-base
@@ -0,0 +1,13 @@
+Document: polipo
+Title: Debian polipo Manual
+Author: Juliusz Chroboczek
+Abstract: The Polipo web cache
+Section: web
+
+Format: Info
+Index: /usr/share/info/polipo.info.gz
+Files: /usr/share/info/polipo.info.gz
+
+Format: HTML
+Index: /usr/share/polipo/www/index.html
+Files: /usr/share/polipo/www/*.html
--- polipo-1.0.4.orig/debian/control
+++ polipo-1.0.4/debian/control
@@ -0,0 +1,37 @@
+Source: polipo
+Section: web
+Priority: optional
+Maintainer: Denis V. Sirotkin <fechiny@gmail.com>
+Build-Depends: debhelper (>= 5), cdbs, texinfo, dpatch
+Standards-Version: 3.7.3
+Homepage: http://www.pps.jussieu.fr/~jch/software/polipo/
+
+Package: polipo
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: a small, caching web proxy
+ Polipo is a caching web proxy (a web cache) designed to be used by one
+ person or a small group of people. It is similar in spirit to WWWOFFLE, but
+ the implementation techniques are more like the ones ones used by Squid.
+ .
+ Polipo has some features that are unique among currently available proxies:
+ .
+  o Polipo will use HTTP/1.1 pipelining if it believes that the remote
+  server supports it, whether the incoming requests are pipelined or
+  come in simultaneously on multiple connections (this is more than the
+  simple usage of persistent connections, which is done by e.g. Squid);
+ .
+  o Polipo will cache the initial segment of an instance if the
+  download has been interrupted, and, if necessary, complete it later
+  using Range requests;
+ .
+  o Polipo will upgrade client requests to HTTP/1.1 even if they come
+  in as HTTP/1.0, and up- or downgrade server replies to the client's
+  capabilities (this may involve conversion to or from the HTTP/1.1
+  chunked encoding);
+ .
+  o Polipo has fairly complete support for IPv6 (except for scoped
+  (link-local) addresses).
+ .
+ Optionally, Polipo can use a technique known as Poor Man's Multiplexing
+ to reduce latency.
--- polipo-1.0.4.orig/debian/polipo.postrm
+++ polipo-1.0.4/debian/polipo.postrm
@@ -0,0 +1,44 @@
+#!/bin/sh
+# postrm script for polipo
+
+set -e
+
+CACHE_DIR=/var/cache/polipo
+PID_DIR=/var/run/polipo
+LOG_DIR=/var/log/polipo
+
+IPUP_D=/etc/ppp/ip-up.d
+IPDOWN_D=/etc/ppp/ip-down.d
+
+case "$1" in
+    purge)
+
+# Remove polipo related directories
+	for DIR in "$CACHE_DIR" "$PID_DIR" "$LOG_DIR"; do
+	    echo -n "Purging $DIR..."
+	    rm -rf "$DIR"
+	    echo " done"
+	done
+
+# Removing old /etc/ppp/ip-up/down.d/ scripts
+	for D in "$IPUP_D" "$IPDOWN_D"; do
+	    if [ -e "$D/polipo.old" ]; then
+		rm -f "$D/polipo.old"
+	    fi
+	done
+
+    ;;
+
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+
+esac
+
+#DEBHELPER#
+
+exit 0
--- polipo-1.0.4.orig/debian/polipo.logrotate
+++ polipo-1.0.4/debian/polipo.logrotate
@@ -0,0 +1,10 @@
+/var/log/polipo/polipo.log {
+        create 644 proxy proxy
+        rotate 7
+        compress
+        daily
+        postrotate
+		PIDFILE=/var/run/polipo/polipo.pid
+		if [ -f "$PIDFILE" ] ; then kill -USR1 $(cat "$PIDFILE") ; fi
+        endscript
+}
--- polipo-1.0.4.orig/debian/copyright
+++ polipo-1.0.4/debian/copyright
@@ -0,0 +1,28 @@
+This package was debianized by Tom Huckstep <t.huckstep@bigfoot.com> on
+Sun, 14 Dec 2003 12:55:35 +0000.
+
+It was downloaded from: http://www.pps.jussieu.fr/~jch/software/files/
+
+Upstream Author: Juliusz Chroboczek <jch@pps.jussieu.fr>
+
+Copyright:
+
+Copyright (c) 2003 by Juliusz Chroboczek
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
--- polipo-1.0.4.orig/debian/init.d
+++ polipo-1.0.4/debian/init.d
@@ -0,0 +1,79 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          polipo
+# Required-Start:    $local_fs
+# Required-Stop:     $local_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start or stop the polipo web cache
+### END INIT INFO
+#
+# Author:	Tom Ellis Huckstep <tom-debian-polipo@jaguarpaw.co.uk>
+#
+
+set -e
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+PPCTL=/usr/lib/polipo/polipo-control
+test -x $PPCTL  || exit 0
+
+NAME=polipo
+DESC=polipo
+
+# Include polipo defaults if available
+#if [ -f /etc/default/polipo ] ; then
+#	. /etc/default/polipo
+#fi
+
+# Make sure /var/run/polipo exists.
+if [ ! -e /var/run/$NAME ] ; then
+	mkdir -p /var/run/$NAME
+	chown proxy:proxy /var/run/$NAME
+	chmod 755 /var/run/$NAME
+fi
+
+case "$1" in
+  start)
+	echo -n "Starting $DESC: "
+        $PPCTL start
+	echo "$NAME."
+	;;
+  stop)
+	echo -n "Stopping $DESC: "
+        $PPCTL stop
+	echo "$NAME."
+	;;
+  #reload)
+	#
+	#	If the daemon can reload its config files on the fly
+	#	for example by sending it SIGHUP, do it here.
+	#
+	#	If the daemon responds to changes in its config file
+	#	directly anyway, make this a do-nothing entry.
+	#
+	# echo "Reloading $DESC configuration files."
+	# start-stop-daemon --stop --signal 1 --quiet --pidfile \
+	#	/var/run/$NAME.pid --exec $DAEMON
+  #;;
+  restart|force-reload)
+	#
+	#	If the "reload" option is implemented, move the "force-reload"
+	#	option to the "reload" entry above. If not, "force-reload" is
+	#	just the same as "restart".
+	#
+	echo -n "Restarting $DESC: "
+        $PPCTL stop
+	sleep 1
+        $PPCTL start
+	echo "$NAME."
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
+	echo "Usage: $N {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
--- polipo-1.0.4.orig/debian/changelog
+++ polipo-1.0.4/debian/changelog
@@ -0,0 +1,292 @@
+polipo (1.0.4-1~bpo40+1) etch-backports; urgency=low
+
+  * Rebuilt for etch.
+
+ -- Andreas Metzler <ametzler@debian.org>  Sun, 27 Jan 2008 13:11:53 +0100
+
+polipo (1.0.4-1) unstable; urgency=low
+
+  * New upstream release
+  * Create /var/cache/polipo, /var/log/polipo and /var/run/polipo
+    directories by postinst script. /var/log/polipo now has proxy:adm
+    owners and 2755 rights, log files are proxy:adm 640 (closes: #291822)
+  * Remove /var/cache/polipo, /var/log/polipo and /var/run/polipo
+    directories by postrm script, make full cleanup on purging package
+  * debian/control: change Standards-Version to 3.7.3
+  * debian/control: move Homepage to pseudo-header
+  * init.d: make sure /var/run/polipo exists
+  * init.d: remove the S runlevel from Default-Stop
+
+ -- Denis V. Sirotkin <fechiny@gmail.com>  Fri, 11 Jan 2008 23:13:27 +0500
+
+polipo (1.0.3-1) unstable; urgency=low
+
+  * New upstream release
+  * Changed pattern in the debian/watch to avoid searching testing versions
+    like `polipo-20071001'
+
+ -- Denis V. Sirotkin <fechiny@gmail.com>  Mon, 08 Oct 2007 19:21:32 +0600
+
+polipo (1.0.2-1) unstable; urgency=low
+
+  * New upstream release (closes: #439441)
+
+ -- Denis V. Sirotkin <fechiny@gmail.com>  Mon, 27 Aug 2007 18:25:05 +0600
+
+polipo (1.0.1-2) unstable; urgency=low
+
+  * Install the sample forbidden file into /etc/polipo
+  * Added network if-up/down scripts similar to ppp ip-up/down
+    (closes: #305852, #418715)
+  * Added debian/watch file
+  * debian/compat: changed debhelper compatibility to 5
+  * debian/control: changed Build-Depends on debhelper (>= 5)
+  * dpatch applied
+
+ -- Denis V. Sirotkin <fechiny@gmail.com>  Sun, 29 Jul 2007 18:25:25 +0600
+
+polipo (1.0.1-1) unstable; urgency=low
+
+  * New upstream release
+  * New maintainer (closes: #430411)
+
+ -- Denis V. Sirotkin <fechiny@gmail.com>  Wed, 27 Jun 2007 14:37:06 +0600
+
+polipo (1.0.0-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Tom Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Fri, 15 Jun 2007 10:29:16 +0100
+
+polipo (0.9.12-1) unstable; urgency=low
+
+  * New upstream release (closes: #405962, #409998, #405283, #402490)
+
+ -- Tom Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Mon, 12 Feb 2007 14:29:39 +0000
+
+polipo (0.9.10-1) unstable; urgency=low
+
+  * New upstream release (closes: #349942, #385751)
+  * Add 'Index' field to 'Info' section of doc-base control file
+    (closes: #372245)
+  * Remove debiandoc-sgml entry from doc-base control file.  This has never
+    existed, as far as I remember, and I don't know what it was doing there.
+  * Added LSB-compliant init script header
+
+ -- Tom Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Mon,  4 Sep 2006 13:51:33 +0100
+
+polipo (0.9.9-1) unstable; urgency=low
+
+  * New upstream release (closes: #315655, #332411 CAN-2005-3163)
+  * Fixed bug in logrotate script which causes an error when the pidfile
+    does not exist (closes: #294442, thanks to Vineet Kumar)
+
+ -- Tom Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Tue,  4 Oct 2005 14:35:02 +0100
+
+polipo (0.9.8-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Tom Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Mon, 24 Jan 2005 23:22:46 +0000
+
+polipo (0.9.7-2) unstable; urgency=low
+
+  * Apply lax HTTP parser patch so that Polipo continues to talk to servers
+    whose HTTP is buggy (closes: #265128)
+
+ -- Tom Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Fri, 14 Jan 2005 11:22:18 +0000
+
+polipo (0.9.7-1) unstable; urgency=low
+
+  * New upstream release
+  * /var/cache/polipo, /var/log/polipo and /var/run/polipo now have
+    permissions 750, for privacy  (closes: #283523, thanks to Hugo Haas)
+
+ -- Tom Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Mon, 27 Dec 2004 17:58:22 +0000
+
+polipo (0.9.6-1) unstable; urgency=low
+
+  * New upstream release (closes #277985, #265128)
+  * forbiddenFile can be a directory: fix polipo-control accordingly, closes #277929
+    (thanks to VSJ)
+
+ -- Tom Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Sun, 31 Oct 2004 19:32:21 +0000
+
+polipo (0.9.5-1) unstable; urgency=low
+
+  * New upstream release (closes: #253150, #253156)
+
+ -- Tom Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Mon, 21 Jun 2004 22:04:28 +0100
+
+polipo (0.9.4-3) unstable; urgency=low
+
+  * Append ".patch" suffix to "debian/patches/polipo--devel--0--patch-23",
+    so that it actually applies.
+  * polipo-control: Quote "`nameOfPID $PID`".  Thanks to Gergely Nagy,
+    closes: #251071
+  * Applied polipo--devel--0--patch-25 to fix char signedness issues. 
+    Thanks to Gergely Nagy, closes #250419
+
+ -- Tom Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Sun, 30 May 2004 22:20:36 +0100
+
+polipo (0.9.4-2) unstable; urgency=low
+
+  * Applied polipo--devel--0--patch-23 to fix 'connection->flags &
+    2' assertion bug
+
+ -- Tom Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Sun, 16 May 2004 10:34:41 +0100
+
+polipo (0.9.4-1) unstable; urgency=low
+
+  * New upstream release
+  * Renamed /etc/ppp/ip-up/down.d/polipo to /etc/ppp/ip-up/down.d/1polipo,
+    so that polipo comes online pretty soon after PPP is brought up,
+    closes: #249051
+  * Put polipo.ppp.ip-up/down in ip-up/down directories, because I'm now
+    using the name '1polipo' instead of 'polipo'.  A CDBS script I wrote
+    (debian/cdbs/ip-updown.mk) deals with installing these files.
+  * polipo.postinst: move ip-up/down.d/polipo to polipo.old,
+    because we are now using the name '1polipo', but we do not want to
+    delete a former conffile.  'polipo.old' will not be run by run-parts.
+  * Actually set the variable $OPTION_FILE in ip-up/down.d/polipo, instead
+    of stupidly leaving it dangling.
+
+ -- Tom Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Sat, 15 May 2004 11:04:36 +0100
+
+polipo (0.9.3-4) unstable; urgency=low
+
+  * Standards-Version: 3.6.1
+  * Lengthed package description, closes: #245160
+
+ -- Tom Ellis Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Sun, 25 Apr 2004 12:25:26 +0100
+
+polipo (0.9.3-3) unstable; urgency=low
+
+  * Override DEB_MAKE_INVOKE, since the upstream Makefile expects CFLAGS to
+    be left untouched.  Fixes LOCAL_ROOT, DISK_CACHE_ROOT exchange bug.
+
+ -- Tom Ellis Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Fri,  9 Apr 2004 21:45:17 +0100
+
+polipo (0.9.3-2) unstable; urgency=low
+
+  * Build system is now CDBS
+  * Added Build-Depends: debhelper (>= 4.1.0), cdbs
+  * CDBS: debian/cbds/helper-scripts.mk installs all the scripts in
+          debian/helper-scripts/$PACKAGE_NAME
+  * PATCH: Upstream request->ohandler crash bug patch
+
+ -- Tom Ellis Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Thu,  8 Apr 2004 14:44:08 +0100
+
+polipo (0.9.3-1) unstable; urgency=low
+
+  * New upstream release
+  * /usr/lib/polipo/polipo-control removes stale pidfiles before running
+    polipo.  Now polipo will start even if the last one crashed.
+
+ -- Tom Ellis Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Tue,  6 Apr 2004 22:06:41 +0100
+
+polipo (0.9.2-2) unstable; urgency=low
+
+  * Created /var/lib/polipo/polipo-control as an abstraction for starting,
+    stopping, going offline and online
+  * init.d and ppp.ip-up/down now use polipo-control
+
+ -- Tom Ellis Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Tue, 30 Mar 2004 15:08:05 +0100
+
+polipo (0.9.2-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Tom Ellis Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Mon, 29 Mar 2004 00:08:41 +0100
+
+polipo (0.9.1-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Tom Ellis Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Fri, 12 Mar 2004 21:53:46 +0000
+
+polipo (0.9-2) unstable; urgency=low
+
+  * server.c: upstream patch to fix "Connection to (host) is broken" in
+    Konqueror
+
+ -- Tom Ellis Huckstep <tom-debian-polipo@jaguarpaw.co.uk>  Sun,  7 Mar 2004 10:35:00 +0000
+
+polipo (0.9-1) unstable; urgency=low
+
+  * New upstream release
+  * Use in scripts: proxyOffline=true/false rather than proxyOffline=3/0. 
+    The latter is no longer valid.
+  * control/Build-Depends: added texinfo (for makeinfo)
+
+ -- Tom Ellis Huckstep <t.huckstep@bigfoot.com>  Sat, 21 Feb 2004 12:37:57 +0000
+
+polipo (0.8.4-1) unstable; urgency=low
+
+  * New upstream release
+  * init.d: fix off/online mode detection bug
+  * polipo.logrotate: reopen logfile with -USR1
+  * polipo.cron.daily: run purge command as user "proxy"
+  * polipo.ppp.ip-up/down: fix $HOME expansion bug
+
+ -- Tom Ellis Huckstep <t.huckstep@bigfoot.com>  Sun, 11 Jan 2004 13:15:03 +0000
+
+polipo (0.8.3-3) unstable; urgency=low
+
+  * polipo.cron.daily: redirect stdout of purge command to /dev/null. 
+    Closes another bug reported by Martin Bretschneider.
+  * init.d script now decides to start in online or offline mode by seeing
+    if the kernel has a default route.  It no longer takes
+    /etc/polipo/options into account.
+  * init.d script runs polipo with config file and forbidden file specified.
+    This fixes complaints about not being able to expand $HOME.
+  * cron.daily script runs polipo with config file and forbidden file
+    specified.  This fixes complaints about not being able to expand $HOME. 
+  * ip-up/down come into action unless "noppp" is specified in
+    /etc/polipo/options
+
+ -- Tom Ellis Huckstep <t.huckstep@bigfoot.com>  Sat, 27 Dec 2003 23:09:27 +0000
+
+polipo (0.8.3-2) unstable; urgency=low
+
+  * init.d script now decides whether to start in offline mode by looking at
+    /etc/polipo/options
+  * Added ip-up/down scripts to switch between offline and online modes
+  * Fixed bug in init.d/polipo: restart and force-reload targets now start
+    polipo as proxy:proxy rather than root:root
+  * Added cache purging to cron.daily
+  * Changed initscript S and K priorities to 30, because that's what 'oops'
+    has
+  * Decided on permissions polipo:polipo 644 for /var/log/polipo/*
+  * Create /var/log/polipo in postinst.  Closes bug reported by Martin
+    Bretschneider
+
+ -- Tom Ellis Huckstep <t.huckstep@bigfoot.com>  Tue, 23 Dec 2003 15:41:58 +0000
+
+polipo (0.8.3-1) unstable; urgency=low
+
+  * New upstream release
+  * rules install target is now install.binary
+  * init.d/polipo now uses the new daemonise and pidFile options to give
+    correct 'start' behaviour
+  * added a logrotate config
+
+ -- Tom Ellis Huckstep <t.huckstep@bigfoot.com>  Mon, 22 Dec 2003 00:09:16 +0000
+
+polipo (0.8.2-2) unstable; urgency=low
+
+  * Changed package synopsis and description in accordance with the
+    packaging manual best practices
+  * Use dh_installinfo and dh_installman instead of entries in the
+    upstream Makefile
+
+ -- Tom Ellis Huckstep <t.huckstep@bigfoot.com>  Wed, 17 Dec 2003 12:21:55 +0000
+
+polipo (0.8.2-1) unstable; urgency=low
+
+  * Initial Release.
+  * Changed the Makfile to install into DESTDIR
+  * Install the sample config file into /etc/polipo
+
+ -- Tom Ellis Huckstep <t.huckstep@bigfoot.com>  Sun, 14 Dec 2003 12:55:35 +0000
+
--- polipo-1.0.4.orig/debian/polipo.postinst
+++ polipo-1.0.4/debian/polipo.postinst
@@ -0,0 +1,56 @@
+#!/bin/sh
+# postinst script for polipo
+
+set -e
+
+CACHE_DIR=/var/cache/polipo
+PID_DIR=/var/run/polipo
+LOG_DIR=/var/log/polipo
+
+IPUP_D=/etc/ppp/ip-up.d
+IPDOWN_D=/etc/ppp/ip-down.d
+
+case "$1" in
+    configure)
+
+# Creating needed directories
+        mkdir -p "$CACHE_DIR"
+	chown proxy:proxy "$CACHE_DIR"
+	chmod 750 "$CACHE_DIR"
+
+	mkdir -p "$PID_DIR"
+	chown proxy:proxy "$PID_DIR"
+	chmod 755 "$PID_DIR"
+
+	if [ -e "$LOG_DIR" ]; then
+	    chmod -R 640 "$LOG_DIR"
+	fi
+	mkdir -p "$LOG_DIR"
+	chown proxy:adm "$LOG_DIR"
+	chmod 2755 "$LOG_DIR"
+
+# /etc/ppp/ip-up/down.d/1polipo used to be called ip-up/down/polipo, so move
+# the old one out of the way
+	for D in "$IPUP_D" "$IPDOWN_D"; do
+	    if [ -e "$D/polipo" ]; then
+		mv "$D/polipo" "$D/polipo.old"
+	    fi
+	done
+
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
+
--- polipo-1.0.4.orig/debian/updown/if-down/01polipo
+++ polipo-1.0.4/debian/updown/if-down/01polipo
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+OPTION_FILE=/etc/polipo/options
+PPCTL=/usr/lib/polipo/polipo-control
+test -x $PPCTL  || exit 0
+
+# Exit if lo interface
+[ "$METHOD" = "loopback" ] && exit 0
+
+if [ -f $OPTION_FILE ] && \
+	( grep -qsxi '^[[:blank:]]*method[[:blank:]]*any[[:blank:]]*$' $OPTION_FILE \
+	|| grep -qsxi '^[[:blank:]]*method[[:blank:]]*$METHOD[[:blank:]]*$' $OPTION_FILE ) then
+    $PPCTL go-offline
+fi
+
+exit 0
--- polipo-1.0.4.orig/debian/updown/ip-down/1polipo
+++ polipo-1.0.4/debian/updown/ip-down/1polipo
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+OPTION_FILE=/etc/polipo/options
+PPCTL=/usr/lib/polipo/polipo-control
+test -x $PPCTL  || exit 0
+
+# Exit if lo interface
+[ "$METHOD" = "loopback" ] && exit 0
+
+if [ -f $OPTION_FILE ] && \
+	( grep -qsxi '^[[:blank:]]*method[[:blank:]]*any[[:blank:]]*$' $OPTION_FILE \
+	|| grep -qsxi '^[[:blank:]]*method[[:blank:]]*ppp[[:blank:]]*$' $OPTION_FILE ) then
+    $PPCTL go-offline
+fi
+
+exit 0
--- polipo-1.0.4.orig/debian/updown/if-up/01polipo
+++ polipo-1.0.4/debian/updown/if-up/01polipo
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+OPTION_FILE=/etc/polipo/options
+PPCTL=/usr/lib/polipo/polipo-control
+test -x $PPCTL  || exit 0
+
+# Exit if lo interface
+[ "$METHOD" = "loopback" ] && exit 0
+
+if [ -f $OPTION_FILE ] && \
+	( grep -qsxi '^[[:blank:]]*method[[:blank:]]*any[[:blank:]]*$' $OPTION_FILE \
+	|| grep -qsxi '^[[:blank:]]*method[[:blank:]]*$METHOD[[:blank:]]*$' $OPTION_FILE ) then
+    $PPCTL go-online
+fi
+
+exit 0
--- polipo-1.0.4.orig/debian/updown/ip-up/1polipo
+++ polipo-1.0.4/debian/updown/ip-up/1polipo
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+OPTION_FILE=/etc/polipo/options
+PPCTL=/usr/lib/polipo/polipo-control
+test -x $PPCTL  || exit 0
+
+# Exit if lo interface
+[ "$METHOD" = "loopback" ] && exit 0
+
+if [ -f $OPTION_FILE ] && \
+	( grep -qsxi '^[[:blank:]]*method[[:blank:]]*any[[:blank:]]*$' $OPTION_FILE \
+	|| grep -qsxi '^[[:blank:]]*method[[:blank:]]*ppp[[:blank:]]*$' $OPTION_FILE ) then
+    $PPCTL go-online
+fi
+
+exit 0
--- polipo-1.0.4.orig/debian/rules
+++ polipo-1.0.4/debian/rules
@@ -0,0 +1,13 @@
+#!/usr/bin/make -f
+include /usr/share/cdbs/1/rules/dpatch.mk
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/makefile.mk
+include debian/cdbs/helper-scripts.mk
+include debian/cdbs/ip-updown.mk
+include debian/cdbs/if-updown.mk
+include debian/cdbs/options.mk
+
+DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) make -C $(DEB_BUILDDIR)
+
+DEB_MAKE_BUILD_TARGET = all
+DEB_MAKE_INSTALL_TARGET = install.binary DESTDIR=$(DEB_DESTDIR)
--- polipo-1.0.4.orig/debian/helper-scripts/polipo/polipo-control
+++ polipo-1.0.4/debian/helper-scripts/polipo/polipo-control
@@ -0,0 +1,147 @@
+#!/bin/sh
+
+set -e
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+DAEMON=/usr/bin/polipo
+test -x $DAEMON || exit 0
+
+CONFIG_FILE=/etc/polipo/config
+FORBIDDEN_FILE=/etc/polipo/forbidden
+
+NAME=polipo
+
+PIDFILE=/var/run/$NAME/$NAME.pid
+LOGFILE=/var/log/$NAME/$NAME.log
+USER=proxy
+GROUP=proxy
+DAEMON_OPTS="-c $CONFIG_FILE pidFile=$PIDFILE daemonise=true logFile=$LOGFILE"
+
+offlineMode() {
+        # At the moment this only depends on the presence of a default route
+        # Eventually this will be configurable via $OPTION_FILE
+        if /sbin/route -n | grep  ^0.0.0.0 > /dev/null; then
+                # We have a default route - go online
+                echo -n false
+        else
+                # We don't have a default route - go offline
+                echo -n true
+        fi
+}
+
+forbiddenFile() {
+        if [ -f $FORBIDDEN_FILE ] || [ -d $FORBIDDEN_FILE ]; then
+                echo -n $FORBIDDEN_FILE
+        else
+                echo -n /dev/null
+        fi
+}
+
+waitForPIDRemove() {
+        T=30
+        for i in `seq 1 $T`; do
+                if [ ! -f $PIDFILE ]; then return; fi
+                sleep 1
+        done
+        echo "Waited $T seconds and $PIDFILE did not disappear.  Giving up." 2>&1
+}
+
+# Outputs the binary name of the process with PID $1, e.g. /usr/sbin/polipo
+nameOfPID() {
+	ps -o command= -p $1 | cut -f1 '-d '
+}
+
+# Returns true if the pidfile exists, and there is a polipo process running
+# with the PID therein.  False otherwise.
+alreadyRunning() {
+	if [ -r $PIDFILE ]; then
+		PID=`cat $PIDFILE`
+		if [ "`nameOfPID $PID`" = $DAEMON ]; then
+			return 0 # TRUE
+		fi
+	fi
+	return 1 # FALSE
+}
+
+# Deletes polipo's pidfile if it exists
+# This is designed to remove the pidfile from a crashed polipo before
+# starting a new one
+removePIDFile() {
+	if [ -e $PIDFILE ]; then
+		echo -n "Removing stale pidfile"
+		rm $PIDFILE
+		echo "."
+	fi
+}
+
+DAEMON_OPTS="$DAEMON_OPTS forbiddenFile=`forbiddenFile`"
+
+polipo_start() {
+        DAEMON_OPTS="$DAEMON_OPTS proxyOffline=`offlineMode`"
+
+	if alreadyRunning; then
+		echo "$DAEMON already running -- doing nothing"
+		exit
+	fi	
+
+	removePIDFile
+
+        start-stop-daemon --start --quiet --pidfile $PIDFILE \
+                --chuid $USER:$GROUP --exec $DAEMON -- $DAEMON_OPTS
+}
+
+polipo_stop() {
+        start-stop-daemon --stop --quiet --pidfile $PIDFILE \
+                --oknodo --exec $DAEMON
+}
+
+polipo_go_online() {
+        DAEMON_OPTS="$DAEMON_OPTS proxyOffline=false"
+
+        test ! -f $PIDFILE && return
+
+        start-stop-daemon --stop --quiet --pidfile \
+                 $PIDFILE --oknodo --exec $DAEMON
+        waitForPIDRemove
+        start-stop-daemon --start --quiet --pidfile $PIDFILE \
+                 --chuid $USER:$GROUP --exec $DAEMON -- $DAEMON_OPTS
+}
+
+polipo_go_offline() {
+        DAEMON_OPTS="$DAEMON_OPTS proxyOffline=true"
+
+        test ! -f $PIDFILE && return
+
+        start-stop-daemon --stop --quiet --pidfile \
+                 $PIDFILE --oknodo --exec $DAEMON
+        waitForPIDRemove
+        start-stop-daemon --start --quiet --pidfile $PIDFILE \
+                 --chuid $USER:$GROUP --exec $DAEMON -- $DAEMON_OPTS
+}
+
+case "$1" in
+  start)
+        polipo_start
+        ;;
+  stop)
+        polipo_stop
+        ;;
+  restart)
+        polipo_stop
+        waitForPIDRemove
+        polipo_start
+        ;;
+  go-offline)
+        polipo_go_offline
+        ;;
+  go-online)
+        polipo_go_online
+        ;;
+  *)
+        N=polipo-control
+        echo "Usage: $N {start|stop|go-offline|go-online}" >&2
+        exit 1         
+esac
+
+exit 0
