commit:     88902c0975557bccd36d67f8c23341c7187aa8f4
Author:     Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 26 03:02:46 2016 +0000
Commit:     Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
CommitDate: Tue Apr 26 03:02:46 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=88902c09

net-proxy/polipo: unloosing net dependency

use net is sufficient and requires in some use cases

Package-Manager: portage-2.2.28
Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org>

 net-proxy/polipo/files/polipo.initd-5              | 66 ++++++++++++++++++++++
 .../{polipo-9999.ebuild => polipo-1.1.1-r4.ebuild} |  2 +-
 net-proxy/polipo/polipo-9999.ebuild                |  2 +-
 3 files changed, 68 insertions(+), 2 deletions(-)

diff --git a/net-proxy/polipo/files/polipo.initd-5 
b/net-proxy/polipo/files/polipo.initd-5
new file mode 100644
index 0000000..e0cabe6
--- /dev/null
+++ b/net-proxy/polipo/files/polipo.initd-5
@@ -0,0 +1,66 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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/polipo-9999.ebuild 
b/net-proxy/polipo/polipo-1.1.1-r4.ebuild
similarity index 97%
copy from net-proxy/polipo/polipo-9999.ebuild
copy to net-proxy/polipo/polipo-1.1.1-r4.ebuild
index 559a3ed..84b743e 100644
--- a/net-proxy/polipo/polipo-9999.ebuild
+++ b/net-proxy/polipo/polipo-1.1.1-r4.ebuild
@@ -38,7 +38,7 @@ src_compile() {
 src_install() {
        einstall PREFIX=/usr MANDIR=/usr/share/man INFODIR=/usr/share/info 
"TARGET=${D}"
 
-       newinitd "${FILESDIR}/${PN}.initd-4" ${PN}
+       newinitd "${FILESDIR}/${PN}.initd-5" ${PN}
        insinto /etc/${PN} ; doins "${FILESDIR}/config"
        systemd_newunit "${FILESDIR}/${PN}_at.service" "${PN}@.service"
        if ! use systemd; then

diff --git a/net-proxy/polipo/polipo-9999.ebuild 
b/net-proxy/polipo/polipo-9999.ebuild
index 559a3ed..84b743e 100644
--- a/net-proxy/polipo/polipo-9999.ebuild
+++ b/net-proxy/polipo/polipo-9999.ebuild
@@ -38,7 +38,7 @@ src_compile() {
 src_install() {
        einstall PREFIX=/usr MANDIR=/usr/share/man INFODIR=/usr/share/info 
"TARGET=${D}"
 
-       newinitd "${FILESDIR}/${PN}.initd-4" ${PN}
+       newinitd "${FILESDIR}/${PN}.initd-5" ${PN}
        insinto /etc/${PN} ; doins "${FILESDIR}/config"
        systemd_newunit "${FILESDIR}/${PN}_at.service" "${PN}@.service"
        if ! use systemd; then

Reply via email to