# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=6 PYTHON_COMPAT=( python3_{4,5,6} ) inherit eutils distutils-r1 user DESCRIPTION="Provides modern nag-free HTTPS connections for an HTTP proxy." HOMEPAGE="http://www.proxfilter.net/proxhttpsproxy" SRC_URI="https://www.prxbx.com/forums/attachment.php?aid=1029 -> ProxHTTPSProxyMII_py1.5wipb.zip" LICENSE="MIT" KEYWORDS="~amd64 ~x86" SLOT="0" IUSE="systemd squid" RESTRICT="fetch" RDEPEND=" >=dev-lang/python-3[ssl] dev-python/colorama[${PYTHON_USEDEP}] dev-python/pyopenssl[${PYTHON_USEDEP}] dev-python/PySocks[${PYTHON_USEDEP}] dev-python/urllib3[${PYTHON_USEDEP}] net-proxy/privoxy squid? ( net-proxy/squid ) " DEPEND="${RDEPEND}" DOCS=( Docs/changelog.txt Docs/readme.txt ) S="${WORKDIR}/ProxHTTPSProxyMII_py 1.5wipb" pkg_setup() { enewgroup proxhttpsproxy enewuser proxhttpsproxy -1 -1 /opt/proxhttpsproxy proxhttpsproxy } src_compile(){ echo "nothing to compile" } src_install() { insinto /opt/${PN} doins -r Certs doins CA.crt cacert.pem config.ini *.py insinto /etc/privoxy doins ${FILESDIR}/proxhttpsproxy.action doins ${FILESDIR}/proxhttpsproxy.filter if use systemd; then insinto /usr/lib/systemd/user newins "${FILESDIR}/${PN}-systemd.init" ${PN}.service else newinitd "${FILESDIR}/${PN}-openrc.init" ${PN} fi dodoc ${DOCS} make_wrapper "${PN}" "python3 /opt/${PN}/ProxHTTPSProxy.py" diropts -m 0750 -g proxhttpsproxy -o proxhttpsproxy /opt/${PN} dodir /etc/env.d echo "CONFIG_PROTECT=/opt/proxhttpsproxy/config.ini" >> "${ED}"/etc/env.d/33proxhttpsproxy || die } pkg_postinst() { einfo "Guide to setup ProxHTTPSProxyMII together with privoxy" einfo " https://prxbx.com/forums/showthread.php?tid=2224" einfo "Guide for complete transparent proxy chain" einfo " https://prxbx.com/forums/showthread.php?tid=2172&pid=19270#pid19270" einfo "" einfo "Do not forget to do follwing:" einfo "- add proxhttpsproxy.action and proxhttpsproxy.filter to /etc/privoxy/config" einfo "- install CA.crt in every system & Mozilla application you intend to use." einfo "- synchronize client computers with server time clock" einfo "- block on firewall traffic from outside networks" }