1 |
commit: b40f47bc15453de494f0d19a33cd1e8f9828d606 |
2 |
Author: Andrew Savchenko <bircoph <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Dec 7 12:39:58 2015 +0000 |
4 |
Commit: Andrew Savchenko <bircoph <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Dec 7 12:39:58 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b40f47bc |
7 |
|
8 |
net-proxy/polipo: fix bug 567660 |
9 |
|
10 |
Replace bash-specific test expression by a POSIX compatible one. |
11 |
|
12 |
Package-Manager: portage-2.2.26 |
13 |
Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org> |
14 |
|
15 |
net-proxy/polipo/files/polipo.initd-3 | 66 +++++++++++++++++++++++++++++++++ |
16 |
net-proxy/polipo/polipo-1.1.1-r2.ebuild | 62 +++++++++++++++++++++++++++++++ |
17 |
2 files changed, 128 insertions(+) |
18 |
|
19 |
diff --git a/net-proxy/polipo/files/polipo.initd-3 b/net-proxy/polipo/files/polipo.initd-3 |
20 |
new file mode 100644 |
21 |
index 0000000..48cd738 |
22 |
--- /dev/null |
23 |
+++ b/net-proxy/polipo/files/polipo.initd-3 |
24 |
@@ -0,0 +1,66 @@ |
25 |
+#!/sbin/runscript |
26 |
+# Copyright 1999-2015 Gentoo Technologies, Inc. |
27 |
+# Distributed under the terms of the GNU General Public License v2 |
28 |
+# $Id$ |
29 |
+ |
30 |
+CONFFILE="/etc/polipo/config${SVCNAME#polipo}" |
31 |
+PIDFILE="/var/run/${SVCNAME}.pid" |
32 |
+ |
33 |
+depend() { |
34 |
+ need net |
35 |
+} |
36 |
+ |
37 |
+checkconfig() { |
38 |
+ { polipo -v -c "${CONFFILE}" || return 1 ; } | { |
39 |
+ local retvalue=0 |
40 |
+ local name type value desc |
41 |
+ while read name type value desc ; do |
42 |
+ case ${name} in |
43 |
+ configFile) |
44 |
+ if [ "${value}" = "(none)" ] ; then |
45 |
+ eerror "Unable to read configuration file /etc/polipo/config" |
46 |
+ retvalue=1 |
47 |
+ fi |
48 |
+ ;; |
49 |
+ daemonise) |
50 |
+ if [ "${value}" != "false" ] ; then |
51 |
+ eerror "Configuration option not supported by this init script: ${name}=${value}" |
52 |
+ retvalue=1 |
53 |
+ fi |
54 |
+ ;; |
55 |
+ pidFile) |
56 |
+ if [ "${value}" != "(none)" ] ; then |
57 |
+ eerror "Configuration option not supported by this init script: ${name}=${value}" |
58 |
+ retvalue=1 |
59 |
+ fi |
60 |
+ ;; |
61 |
+ diskCacheRoot) |
62 |
+ if [ "${value}" != "(none)" ] ; then |
63 |
+ # Ensure that cache directory exists and have proper permissions |
64 |
+ if ! [ -d "{value}" ]; then |
65 |
+ mkdir -p -m 0750 "${value}" |
66 |
+ chown polipo:polipo "${value}" |
67 |
+ fi |
68 |
+ fi |
69 |
+ ;; |
70 |
+ esac |
71 |
+ done |
72 |
+ return ${retvalue} |
73 |
+ } |
74 |
+} |
75 |
+ |
76 |
+start() { |
77 |
+ checkconfig || return 1 |
78 |
+ |
79 |
+ ebegin "Starting Polipo HTTP proxy" |
80 |
+ start-stop-daemon --start --user polipo \ |
81 |
+ --background --pidfile "${PIDFILE}" --make-pidfile \ |
82 |
+ --exec /usr/bin/polipo -- -c "${CONFFILE}" |
83 |
+ eend $? |
84 |
+} |
85 |
+ |
86 |
+stop() { |
87 |
+ ebegin "Stopping Polipo HTTP proxy" |
88 |
+ start-stop-daemon --stop --pidfile "${PIDFILE}" |
89 |
+ eend $? |
90 |
+} |
91 |
|
92 |
diff --git a/net-proxy/polipo/polipo-1.1.1-r2.ebuild b/net-proxy/polipo/polipo-1.1.1-r2.ebuild |
93 |
new file mode 100644 |
94 |
index 0000000..bc266a3 |
95 |
--- /dev/null |
96 |
+++ b/net-proxy/polipo/polipo-1.1.1-r2.ebuild |
97 |
@@ -0,0 +1,62 @@ |
98 |
+# Copyright 1999-2015 Gentoo Foundation |
99 |
+# Distributed under the terms of the GNU General Public License v2 |
100 |
+# $Id$ |
101 |
+ |
102 |
+EAPI="5" |
103 |
+ |
104 |
+if [[ ${PV} == "9999" ]] ; then |
105 |
+ _GIT=git-r3 |
106 |
+ EGIT_REPO_URI="https://github.com/jech/${PN}.git" |
107 |
+ SRC_URI="" |
108 |
+ KEYWORDS="" |
109 |
+else |
110 |
+ SRC_URI="http://www.pps.jussieu.fr/~jch/software/files/${PN}/${P}.tar.gz" |
111 |
+ KEYWORDS="~amd64 ~x86" |
112 |
+fi |
113 |
+ |
114 |
+inherit ${_GIT} toolchain-funcs user systemd |
115 |
+ |
116 |
+DESCRIPTION="A caching web proxy" |
117 |
+HOMEPAGE="http://www.pps.jussieu.fr/~jch/software/polipo/" |
118 |
+LICENSE="MIT GPL-2" |
119 |
+SLOT="0" |
120 |
+IUSE="systemd" |
121 |
+ |
122 |
+DEPEND="sys-apps/texinfo" |
123 |
+RDEPEND="" |
124 |
+ |
125 |
+pkg_setup() { |
126 |
+ enewgroup ${PN} |
127 |
+ enewuser ${PN} -1 -1 /var/cache/${PN} ${PN} |
128 |
+} |
129 |
+ |
130 |
+src_compile() { |
131 |
+ tc-export CC |
132 |
+ emake PREFIX=/usr "CDEBUGFLAGS=${CFLAGS}" all |
133 |
+} |
134 |
+ |
135 |
+src_install() { |
136 |
+ einstall PREFIX=/usr MANDIR=/usr/share/man INFODIR=/usr/share/info "TARGET=${D}" |
137 |
+ |
138 |
+ newinitd "${FILESDIR}/${PN}.initd-3" ${PN} |
139 |
+ insinto /etc/${PN} ; doins "${FILESDIR}/config" |
140 |
+ systemd_newunit "${FILESDIR}/${PN}_at.service" "${PN}@.service" |
141 |
+ if ! use systemd; then |
142 |
+ exeinto /etc/cron.weekly ; newexe "${FILESDIR}/${PN}.crond-2" ${PN} |
143 |
+ fi |
144 |
+ |
145 |
+ dodoc CHANGES README |
146 |
+ dohtml html/* |
147 |
+} |
148 |
+ |
149 |
+pkg_postinst() { |
150 |
+ elog "Do not forget to read the manual." |
151 |
+ elog "Change the config file in /etc/${PN} to suit your needs." |
152 |
+ elog "" |
153 |
+ elog "Polipo init scripts can now be multiplexed:" |
154 |
+ elog "1. create /etc/${PN}/config.foo" |
155 |
+ elog "2. symlink /etc/init.d/{${PN}.foo -> ${PN}}" |
156 |
+ elog " a. if you are using OpenRC, symlink /etc/init.d/{${PN}.foo -> ${PN}}" |
157 |
+ elog " b. if you are using systemd, execute \"systemctl enable polipo@××××××.foo\"" |
158 |
+ elog "3. make sure all instances use unique ip:port pair and cachedir, if any" |
159 |
+} |