diff options
author | Jeroen Roovers <jer@gentoo.org> | 2011-03-11 16:25:07 +0000 |
---|---|---|
committer | Jeroen Roovers <jer@gentoo.org> | 2011-03-11 16:25:07 +0000 |
commit | 3b7b526c4f3d7eff4b1f0e903bd97adddbe021e6 (patch) | |
tree | dd732803c6ae6e137e086ad7353bbc4b6b2bcf20 /net-proxy/tinyproxy | |
parent | fixup cosmetics (diff) | |
download | gentoo-2-3b7b526c4f3d7eff4b1f0e903bd97adddbe021e6.tar.gz gentoo-2-3b7b526c4f3d7eff4b1f0e903bd97adddbe021e6.tar.bz2 gentoo-2-3b7b526c4f3d7eff4b1f0e903bd97adddbe021e6.zip |
Use a static initd script instead of a dynamically changed one (bug #358123).
(Portage version: 2.2.0_alpha26/cvs/Linux i686)
Diffstat (limited to 'net-proxy/tinyproxy')
-rw-r--r-- | net-proxy/tinyproxy/ChangeLog | 6 | ||||
-rw-r--r-- | net-proxy/tinyproxy/files/tinyproxy-1.8.2.initd | 45 | ||||
-rw-r--r-- | net-proxy/tinyproxy/tinyproxy-1.8.2.ebuild | 9 |
3 files changed, 52 insertions, 8 deletions
diff --git a/net-proxy/tinyproxy/ChangeLog b/net-proxy/tinyproxy/ChangeLog index cfba9d72e484..2116daa7c7d1 100644 --- a/net-proxy/tinyproxy/ChangeLog +++ b/net-proxy/tinyproxy/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for net-proxy/tinyproxy # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/tinyproxy/ChangeLog,v 1.24 2011/03/10 17:27:13 jer Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-proxy/tinyproxy/ChangeLog,v 1.25 2011/03/11 16:25:07 jer Exp $ + + 11 Mar 2011; Jeroen Roovers <jer@gentoo.org> tinyproxy-1.8.2.ebuild, + +files/tinyproxy-1.8.2.initd: + Use a static initd script instead of a dynamically changed one (bug #358123). 10 Mar 2011; Jeroen Roovers <jer@gentoo.org> tinyproxy-1.8.2.ebuild: The test suite needs fortune to be installed, by Myckel Habets (bug #358113). diff --git a/net-proxy/tinyproxy/files/tinyproxy-1.8.2.initd b/net-proxy/tinyproxy/files/tinyproxy-1.8.2.initd new file mode 100644 index 000000000000..96c658d20769 --- /dev/null +++ b/net-proxy/tinyproxy/files/tinyproxy-1.8.2.initd @@ -0,0 +1,45 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/tinyproxy/files/tinyproxy-1.8.2.initd,v 1.1 2011/03/11 16:25:07 jer Exp $ + +CONFFILE="/etc/${SVCNAME}.conf" + +depend() { + use logger dns + need net +} + +checkconfig() { + if [ ! -f "${CONFFILE}" ]; then + eerror "Configuration file ${CONFFILE} not found!" + return 1 + fi + + PIDFILE=$(sed -n -e 's/^[[:space:]]*PidFile[[:space:]]\+"\(.*\)"[[:space:]]*$/\1/p' "${CONFFILE}") + return 0 +} + +start() { + checkconfig || return 1 + + ebegin "Starting tinyproxy" + if [ -n "${PIDFILE}" ]; then + start-stop-daemon --start --pidfile "${PIDFILE}" --startas /usr/sbin/tinyproxy -- -c "${CONFFILE}" + else + start-stop-daemon --start --exec /usr/sbin/tinyproxy -- -c "${CONFFILE}" + fi + eend $? +} + +stop() { + checkconfig || return 1 + + ebegin "Stopping tinyproxy" + if [ -n "${PIDFILE}" ]; then + start-stop-daemon --stop --pidfile "${PIDFILE}" + else + start-stop-daemon --stop --exec /usr/sbin/tinyproxy + fi + eend $? +} diff --git a/net-proxy/tinyproxy/tinyproxy-1.8.2.ebuild b/net-proxy/tinyproxy/tinyproxy-1.8.2.ebuild index 20c427819817..006ef1ef8532 100644 --- a/net-proxy/tinyproxy/tinyproxy-1.8.2.ebuild +++ b/net-proxy/tinyproxy/tinyproxy-1.8.2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/tinyproxy/tinyproxy-1.8.2.ebuild,v 1.4 2011/03/10 17:27:13 jer Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-proxy/tinyproxy/tinyproxy-1.8.2.ebuild,v 1.5 2011/03/11 16:25:07 jer Exp $ EAPI="2" @@ -31,11 +31,6 @@ src_prepare() { epatch "${FILESDIR}"/${PN}-1.8.1-ldflags.patch use minimal && epatch "${FILESDIR}/${PN}-1.8.1-minimal.patch" sed -i etc/${PN}.conf.in -e "s|nobody|${PN}|g" || die "sed failed" - sed \ - -e "/CONFFILE/s:${PN}/::g" \ - "${FILESDIR}/${PN}.initd" \ - > "${WORKDIR}"/${PN}.initd \ - || die "sed failed" eautoreconf } @@ -72,7 +67,7 @@ src_install() { keepdir /var/log/${PN} keepdir /var/run/${PN} - newinitd "${WORKDIR}"/tinyproxy.initd tinyproxy + newinitd "${FILESDIR}"/${P}.initd tinyproxy } pkg_postinst() { |