summaryrefslogtreecommitdiff
path: root/net-proxy/polipo
diff options
context:
space:
mode:
Diffstat (limited to 'net-proxy/polipo')
-rw-r--r--net-proxy/polipo/Manifest10
-rw-r--r--net-proxy/polipo/files/config8
-rw-r--r--net-proxy/polipo/files/polipo.crond-222
-rw-r--r--net-proxy/polipo/files/polipo.initd-565
-rw-r--r--net-proxy/polipo/files/polipo_at.service11
-rw-r--r--net-proxy/polipo/metadata.xml8
-rw-r--r--net-proxy/polipo/polipo-1.1.1-r4.ebuild61
-rw-r--r--net-proxy/polipo/polipo-9999.ebuild61
8 files changed, 246 insertions, 0 deletions
diff --git a/net-proxy/polipo/Manifest b/net-proxy/polipo/Manifest
new file mode 100644
index 000000000000..dc8c51c488f6
--- /dev/null
+++ b/net-proxy/polipo/Manifest
@@ -0,0 +1,10 @@
+AUX config 167 SHA256 3b600497508790390eb5413cc53ab04bfe8b083324472732b11847acddc91bda SHA512 a92a738016ed6da4fa47d23b2cfdb5296b0c1a818eabcf319550f62e41ba45d6a9103bd7cd956a417cab3b87d18f16227fd9fbadb95dcc267c3983c61d4bdd00 WHIRLPOOL 216fa4587def4639b05a16d7a53fc96f9ef7bd3a4defd9fd4c7e0e38dd0d7265af7563ffcf710a3bc00ffb702262921aec44a38f8cc152ebecce7a6a4fd4801d
+AUX polipo.crond-2 640 SHA256 b17f66c5f8eeb26c698f56458c607dbce8b630257c64c497aa8031d6010a68b3 SHA512 36c13e9790210c378968d9c6958be412fd2f1d2739aab560d8df4064fb92cb2b79dbfcb3e674f285b48eb42a3b2c6226862d1d0f9a6ce28e14de5797d62f1354 WHIRLPOOL 89227fd7a033236fd8255ed1161ba5279d660c2beb2887482bb7ca9844a2fa243752ba07e8491f7e3064490542909bbbc4dfcac19f369e8fb5828e495fa8e8ba
+AUX polipo.initd-5 1536 SHA256 81c0bf86e26770ae9e522fcce86ab05528d37ce8ad3ce1bcf17250bbd0285a6a SHA512 9a1da0f1a156ce58ed25b20d4e06ac11c0a3040bc032a77c688a518dcb308c6f8ffe6bdeaa608d03fd1feead89ac5f04ce98853de88d32a1af0a79005a0c26bd WHIRLPOOL a8a40cb436f71d80a87d4d87c52eabf7f85d709149d4bb88a313f9d2586de87d3ae1a03c142a7f63bce5cb0c5a837c5c7135cffcbbf9d6b39395458b861e0ff9
+AUX polipo_at.service 184 SHA256 2f193ad5a6cdedc6b53179c1bf6c170141cb850166f290212f3bf57dd6df164e SHA512 cc4d1c1b4cf8dfd835956d73292282892e64cb3f2f0e4cfb09f816912d078cee793dcb5ed09037b52accfca6239edf7411ef82d4e1bc57d4be97a5163536cb23 WHIRLPOOL 94babbdce84bdcad508531dbfac57ddb90fe823c7bde9b5444800a5d684a599acbcdf4b3d356da4f76f5ec37994175364fec44abcbfe824c984ab39b2c622a7a
+DIST polipo-1.1.1.tar.gz 182891 SHA256 a259750793ab79c491d05fcee5a917faf7d9030fb5d15e05b3704e9c9e4ee015 SHA512 7324ca96c19bf9f089146a12dba349ea8cd2669ee02d0599ed6c6116d11eb0e7cef7830d91d16921ba5cdd0ce06e6f831901832326d8118ebe0a565feeec7fb1 WHIRLPOOL 2904a68cc64500dc6207713e255e49eb6d9fb3d73c0ff80c19b71cf1ae6ceee533b625643c7a177924f4d254deae659cdc4137218ae152582da65d0b933f65e3
+EBUILD polipo-1.1.1-r4.ebuild 1646 SHA256 c5a1f7309e85e343811fc80b7438f14c0ecc8bc3c2625f3338969105cae9437b SHA512 e36c7738bac32f9982a9239f13f46170b8e8b24429c46ee41cb4268d95b7568d7335b6493959f70ffd916570460378148e5f6df65b61d07331bc2bca621f2e8f WHIRLPOOL db263347e0cee69fcbb2b56854348f91e6372de9ae155a5557d4e4705e5e925c6d5b8fd34c9579d87008375bcdd23628acb3cad75a1e0e5cc6581ca57b71d1d5
+EBUILD polipo-9999.ebuild 1648 SHA256 60e299e3c3af9b13330132fb38f6b0fe274b6f2e2de80be07383d7586184156f SHA512 a91d887ce7ce9ce0f204cb67d2ae4cdbd7921a3f86e48c171a652ab283142aafa6c67dcadab03a01991f82399cb36c858ae6d68c45e587141d81b9da41ea496f WHIRLPOOL b57389de43ca1e9a62db8074aaf06b7d45f401abec06ec875b474d9a29ef9824a638ca6fb6c26157496d300d82a0904becc5a8f7aab11be195d1ca5247c756e7
+MISC ChangeLog 3750 SHA256 242b9cf53bfd3a03777d0f06f638eaf7b880cfe941f6079a584136a74771dfbf SHA512 13ca0ea97a4f8b4414d89ebd7bc81365dc24c7296f6ca823f3377c990fd832da761c4c7d7cb6bf816958b20358f03d98c2149bc2eb81991ca075b39dc56a2440 WHIRLPOOL c7e3c54211aace2e3279e7dad7a95bf720d1b0e99ee6ab549894eef888bbee2d3f680779028c677d701b8c324ad86470acb7867b03efd3af7adc5dfcc5382acc
+MISC ChangeLog-2015 8299 SHA256 699e9330747db84488836868e58e3532f4086ea7257f7b0652a7091903b2a378 SHA512 aa2bef1b67188fb42ce2792607bbbdddefcb404f2300225fe594ac410723f999d7321bab977d1e85d2f357210f2572d7f49d3bdce8024e61279c4037df888a51 WHIRLPOOL a4f8dad130932b0bc4eb59808a18f468dab5a799a66019eadf41c6d0300c96eaa57085d048efe2b3fee573136f1f7a789b1701a982c425658090469786b958c5
+MISC metadata.xml 350 SHA256 b6b6c04d0fa2a18accb7bb9c74924ba3b25d417fe6cc7d844bc28271aad36ca6 SHA512 f1a615c85840eaaeaf3ffddc6ee4cf6e0c63b75227ffbbc6d3eb2c02809d45110610a39a4872497f31c5966a23056a6c1190d9db84c2817252df8e6f61ebe7a9 WHIRLPOOL 9f1f59b6aff7ac0261e1910f6717fed35de14c057eba5f0121acdc92f420a304f4d7d3f93a9b35a2574b6f75be20fde692a34903b5ffdff76931766a2610b694
diff --git a/net-proxy/polipo/files/config b/net-proxy/polipo/files/config
new file mode 100644
index 000000000000..4c9235582594
--- /dev/null
+++ b/net-proxy/polipo/files/config
@@ -0,0 +1,8 @@
+daemonise=false
+diskCacheRoot=/var/cache/polipo/
+proxyAddress=127.0.0.1
+proxyName=localhost
+serverSlots=4
+serverMaxSlots=8
+cacheIsShared=true
+allowedClients=127.0.0.1
diff --git a/net-proxy/polipo/files/polipo.crond-2 b/net-proxy/polipo/files/polipo.crond-2
new file mode 100644
index 000000000000..6b2d609d6d6a
--- /dev/null
+++ b/net-proxy/polipo/files/polipo.crond-2
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# Loop through all init.d instances
+for f in /etc/init.d/polipo*; do
+ # only proceed if daemon is running
+ "${f}" --quiet status || continue
+
+ myname="${f#/etc/init.d/polipo}"
+ conffile="/etc/polipo/config${myname}"
+ pidfile="/var/run/polipo${myname}.pid"
+
+ # check if disk cache is enabled
+ polipo -v -c "${CONFFILE}" |
+ awk '$1 ~ /diskCacheRoot/ { if ($3 == "(none)") exit 1}' ||
+ continue
+
+ # Expire old cached objects
+ kill -USR1 $(cat "${pidfile}")
+ sleep 1
+ nice -n 15 su -s "/bin/sh" -c "polipo -c ${conffile} -x" polipo > /dev/null
+ kill -USR2 $(cat "${pidfile}")
+done
diff --git a/net-proxy/polipo/files/polipo.initd-5 b/net-proxy/polipo/files/polipo.initd-5
new file mode 100644
index 000000000000..08f3394eda68
--- /dev/null
+++ b/net-proxy/polipo/files/polipo.initd-5
@@ -0,0 +1,65 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+CONFFILE="/etc/polipo/config${SVCNAME#polipo}"
+PIDFILE="/var/run/${SVCNAME}.pid"
+
+depend() {
+ use net
+}
+
+checkconfig() {
+ { polipo -v -c "${CONFFILE}" || return 1 ; } | {
+ local retvalue=0
+ local name type value desc
+ while read name type value desc ; do
+ case ${name} in
+ configFile)
+ if [ "${value}" = "(none)" ] ; then
+ eerror "Unable to read configuration file /etc/polipo/config"
+ retvalue=1
+ fi
+ ;;
+ daemonise)
+ if [ "${value}" != "false" ] ; then
+ eerror "Configuration option not supported by this init script: ${name}=${value}"
+ retvalue=1
+ fi
+ ;;
+ pidFile)
+ if [ "${value}" != "(none)" ] ; then
+ eerror "Configuration option not supported by this init script: ${name}=${value}"
+ retvalue=1
+ fi
+ ;;
+ diskCacheRoot)
+ if [ "${value}" != "(none)" ] ; then
+ # Ensure that cache directory exists and have proper permissions
+ if ! [ -d "{value}" ]; then
+ mkdir -p -m 0750 "${value}"
+ chown polipo:polipo "${value}"
+ fi
+ fi
+ ;;
+ esac
+ done
+ return ${retvalue}
+ }
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting ${SVCNAME} HTTP proxy"
+ start-stop-daemon --start --user polipo \
+ --background --pidfile "${PIDFILE}" --make-pidfile \
+ --exec /usr/bin/polipo -- -c "${CONFFILE}"
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME} HTTP proxy"
+ start-stop-daemon --stop --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/net-proxy/polipo/files/polipo_at.service b/net-proxy/polipo/files/polipo_at.service
new file mode 100644
index 000000000000..5018ac6c75e0
--- /dev/null
+++ b/net-proxy/polipo/files/polipo_at.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Polipo Proxy Server
+After=network.target
+
+[Service]
+ExecStart=/usr/bin/polipo -c /etc/polipo/%i
+User=polipo
+PrivateDevices=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-proxy/polipo/metadata.xml b/net-proxy/polipo/metadata.xml
new file mode 100644
index 000000000000..7833140b1e69
--- /dev/null
+++ b/net-proxy/polipo/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>bircoph@gentoo.org</email>
+</maintainer>
+<longdescription>A small and fast caching web proxy designed to be used by one person or a small group of people.</longdescription>
+</pkgmetadata>
diff --git a/net-proxy/polipo/polipo-1.1.1-r4.ebuild b/net-proxy/polipo/polipo-1.1.1-r4.ebuild
new file mode 100644
index 000000000000..9af6bb0e936b
--- /dev/null
+++ b/net-proxy/polipo/polipo-1.1.1-r4.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+if [[ ${PV} == "9999" ]] ; then
+ _GIT=git-r3
+ EGIT_REPO_URI="https://github.com/jech/${PN}.git"
+ SRC_URI=""
+ KEYWORDS=""
+else
+ SRC_URI="http://www.pps.jussieu.fr/~jch/software/files/${PN}/${P}.tar.gz"
+ KEYWORDS="amd64 x86"
+fi
+
+inherit ${_GIT} toolchain-funcs user systemd
+
+DESCRIPTION="A caching web proxy"
+HOMEPAGE="http://www.pps.jussieu.fr/~jch/software/polipo/"
+LICENSE="MIT GPL-2"
+SLOT="0"
+IUSE="systemd"
+
+DEPEND="sys-apps/texinfo"
+RDEPEND=""
+
+pkg_setup() {
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 /var/cache/${PN} ${PN}
+}
+
+src_compile() {
+ tc-export CC
+ emake PREFIX=/usr "CDEBUGFLAGS=${CFLAGS}" all
+}
+
+src_install() {
+ einstall PREFIX=/usr MANDIR=/usr/share/man INFODIR=/usr/share/info "TARGET=${D}"
+
+ newinitd "${FILESDIR}/${PN}.initd-5" ${PN}
+ insinto /etc/${PN} ; doins "${FILESDIR}/config"
+ systemd_newunit "${FILESDIR}/${PN}_at.service" "${PN}@.service"
+ if ! use systemd; then
+ exeinto /etc/cron.weekly ; newexe "${FILESDIR}/${PN}.crond-2" ${PN}
+ fi
+
+ dodoc CHANGES README
+ dohtml html/*
+}
+
+pkg_postinst() {
+ elog "Do not forget to read the manual."
+ elog "Change the config file in /etc/${PN} to suit your needs."
+ elog ""
+ elog "Polipo init scripts can now be multiplexed:"
+ elog "1. create /etc/${PN}/config.foo"
+ elog "2. symlink /etc/init.d/{${PN}.foo -> ${PN}}"
+ elog " a. if you are using OpenRC, symlink /etc/init.d/{${PN}.foo -> ${PN}}"
+ elog " b. if you are using systemd, execute \"systemctl enable polipo@config.foo\""
+ elog "3. make sure all instances use unique ip:port pair and cachedir, if any"
+}
diff --git a/net-proxy/polipo/polipo-9999.ebuild b/net-proxy/polipo/polipo-9999.ebuild
new file mode 100644
index 000000000000..02fb9f59cb50
--- /dev/null
+++ b/net-proxy/polipo/polipo-9999.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+if [[ ${PV} == "9999" ]] ; then
+ _GIT=git-r3
+ EGIT_REPO_URI="https://github.com/jech/${PN}.git"
+ SRC_URI=""
+ KEYWORDS=""
+else
+ SRC_URI="http://www.pps.jussieu.fr/~jch/software/files/${PN}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+inherit ${_GIT} toolchain-funcs user systemd
+
+DESCRIPTION="A caching web proxy"
+HOMEPAGE="http://www.pps.jussieu.fr/~jch/software/polipo/"
+LICENSE="MIT GPL-2"
+SLOT="0"
+IUSE="systemd"
+
+DEPEND="sys-apps/texinfo"
+RDEPEND=""
+
+pkg_setup() {
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 /var/cache/${PN} ${PN}
+}
+
+src_compile() {
+ tc-export CC
+ emake PREFIX=/usr "CDEBUGFLAGS=${CFLAGS}" all
+}
+
+src_install() {
+ einstall PREFIX=/usr MANDIR=/usr/share/man INFODIR=/usr/share/info "TARGET=${D}"
+
+ newinitd "${FILESDIR}/${PN}.initd-5" ${PN}
+ insinto /etc/${PN} ; doins "${FILESDIR}/config"
+ systemd_newunit "${FILESDIR}/${PN}_at.service" "${PN}@.service"
+ if ! use systemd; then
+ exeinto /etc/cron.weekly ; newexe "${FILESDIR}/${PN}.crond-2" ${PN}
+ fi
+
+ dodoc CHANGES README
+ dohtml html/*
+}
+
+pkg_postinst() {
+ elog "Do not forget to read the manual."
+ elog "Change the config file in /etc/${PN} to suit your needs."
+ elog ""
+ elog "Polipo init scripts can now be multiplexed:"
+ elog "1. create /etc/${PN}/config.foo"
+ elog "2. symlink /etc/init.d/{${PN}.foo -> ${PN}}"
+ elog " a. if you are using OpenRC, symlink /etc/init.d/{${PN}.foo -> ${PN}}"
+ elog " b. if you are using systemd, execute \"systemctl enable polipo@config.foo\""
+ elog "3. make sure all instances use unique ip:port pair and cachedir, if any"
+}