1 |
commit: 6dc95066dbe1e0879147cca99e9f3d6af74da2c3 |
2 |
Author: Austin English <wizardedit <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 3 19:13:09 2016 +0000 |
4 |
Commit: Austin English <wizardedit <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 3 19:17:01 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6dc95066 |
7 |
|
8 |
net-proxy/wwwoffle: use #!/sbin/openrc-run instead of #!/sbin/runscript |
9 |
|
10 |
Gentoo-Bug: https://bugs.gentoo.org/573846 |
11 |
|
12 |
Package-Manager: portage-2.2.26 |
13 |
|
14 |
net-proxy/wwwoffle/files/wwwoffle-online.initd | 4 +- |
15 |
net-proxy/wwwoffle/files/wwwoffle.initd | 4 +- |
16 |
net-proxy/wwwoffle/wwwoffle-2.9i-r1.ebuild | 108 +++++++++++++++++++++++++ |
17 |
3 files changed, 112 insertions(+), 4 deletions(-) |
18 |
|
19 |
diff --git a/net-proxy/wwwoffle/files/wwwoffle-online.initd b/net-proxy/wwwoffle/files/wwwoffle-online.initd |
20 |
index 780708a..82fc730 100644 |
21 |
--- a/net-proxy/wwwoffle/files/wwwoffle-online.initd |
22 |
+++ b/net-proxy/wwwoffle/files/wwwoffle-online.initd |
23 |
@@ -1,5 +1,5 @@ |
24 |
-#!/sbin/runscript |
25 |
-# Copyright 1999-2004 Gentoo Foundation |
26 |
+#!/sbin/openrc-run |
27 |
+# Copyright 1999-2016 Gentoo Foundation |
28 |
# Distributed under the terms of the GNU General Public License v2 |
29 |
# $Id$ |
30 |
|
31 |
|
32 |
diff --git a/net-proxy/wwwoffle/files/wwwoffle.initd b/net-proxy/wwwoffle/files/wwwoffle.initd |
33 |
index 8aa6e10..7feca30 100644 |
34 |
--- a/net-proxy/wwwoffle/files/wwwoffle.initd |
35 |
+++ b/net-proxy/wwwoffle/files/wwwoffle.initd |
36 |
@@ -1,5 +1,5 @@ |
37 |
-#!/sbin/runscript |
38 |
-# Copyright 1999-2004 Gentoo Foundation |
39 |
+#!/sbin/openrc-run |
40 |
+# Copyright 1999-2016 Gentoo Foundation |
41 |
# Distributed under the terms of the GNU General Public License v2 |
42 |
# $Id$ |
43 |
|
44 |
|
45 |
diff --git a/net-proxy/wwwoffle/wwwoffle-2.9i-r1.ebuild b/net-proxy/wwwoffle/wwwoffle-2.9i-r1.ebuild |
46 |
new file mode 100644 |
47 |
index 0000000..d84b479 |
48 |
--- /dev/null |
49 |
+++ b/net-proxy/wwwoffle/wwwoffle-2.9i-r1.ebuild |
50 |
@@ -0,0 +1,108 @@ |
51 |
+# Copyright 1999-2016 Gentoo Foundation |
52 |
+# Distributed under the terms of the GNU General Public License v2 |
53 |
+# $Id$ |
54 |
+ |
55 |
+EAPI=6 |
56 |
+inherit eutils user |
57 |
+ |
58 |
+DESCRIPTION="Web caching proxy suitable for non-permanent Internet connections" |
59 |
+HOMEPAGE="http://www.gedanken.org.uk/software/wwwoffle/" |
60 |
+SRC_URI="http://www.gedanken.org.uk/software/${PN}/download/${P}.tgz" |
61 |
+ |
62 |
+KEYWORDS="amd64 ppc ppc64 sparc x86" |
63 |
+SLOT="0" |
64 |
+LICENSE="GPL-2" |
65 |
+IUSE="gnutls ipv6 zlib" |
66 |
+ |
67 |
+RDEPEND="gnutls? ( net-libs/gnutls ) |
68 |
+ zlib? ( sys-libs/zlib )" |
69 |
+DEPEND="dev-lang/perl |
70 |
+ sys-devel/flex |
71 |
+ ${RDEPEND}" |
72 |
+ |
73 |
+# Unsure whether to depend on >=www-misc/htdig-3.1.6-r4 or not |
74 |
+ |
75 |
+src_prepare() { |
76 |
+ eapply "${FILESDIR}"/${PN}-2.9i-define.patch |
77 |
+ sed -i cache/Makefile.in \ |
78 |
+ -e 's#$(TAR) xpf #$(TAR) --no-same-owner -xpf #' \ |
79 |
+ || die |
80 |
+ default |
81 |
+} |
82 |
+ |
83 |
+src_configure() { |
84 |
+ econf \ |
85 |
+ $(use_with gnutls) \ |
86 |
+ $(use_with ipv6) \ |
87 |
+ $(use_with zlib) |
88 |
+} |
89 |
+ |
90 |
+src_install() { |
91 |
+ default |
92 |
+ |
93 |
+ # documentation fix |
94 |
+ # del empty doc dirs |
95 |
+ rmdir "${D}/usr/doc/${PN}"/{it,nl,ru} || die |
96 |
+ dodir /usr/share/doc |
97 |
+ mv "${D}/usr/doc/${PN}" "${D}/usr/share/doc/${PF}" || die |
98 |
+ rmdir "${D}/usr/doc" || die |
99 |
+ |
100 |
+ # install the wwwoffled init script |
101 |
+ newinitd "${FILESDIR}/${PN}.initd" wwwoffled |
102 |
+ newinitd "${FILESDIR}/${PN}-online.initd" wwwoffled-online |
103 |
+ newconfd "${FILESDIR}/${PN}-online.confd" wwwoffled-online |
104 |
+ |
105 |
+ keepdir /var/spool/wwwoffle/{http,outgoing,monitor,lasttime,lastout,local} |
106 |
+ for number in 1 2 3 4 5 6 7 8 9; do |
107 |
+ keepdir "/var/spool/wwwoffle/prevtime${number}" "/var/spool/wwwoffle/prevout${number}" |
108 |
+ done |
109 |
+ |
110 |
+ # empty dirs are removed during update |
111 |
+ keepdir \ |
112 |
+ /var/spool/wwwoffle/search/{mnogosearch/db,htdig/tmp,htdig/db-lasttime,htdig/db,namazu/db} |
113 |
+ |
114 |
+ touch \ |
115 |
+ "${D}/var/spool/wwwoffle/search/htdig/wwwoffle-htdig.log" \ |
116 |
+ "${D}/var/spool/wwwoffle/search/mnogosearch/wwwoffle-mnogosearch.log" \ |
117 |
+ "${D}/var/spool/wwwoffle/search/namazu/wwwoffle-namazu.log" |
118 |
+ |
119 |
+ # TODO htdig indexing as part of initscripts |
120 |
+ |
121 |
+ # robots.txt modification - /var/spool/wwwoffle/html/en |
122 |
+ # - remove Disallow: /index |
123 |
+ sed -i -e "s|Disallow:.*/index|#Disallow: /index|" "${D}/var/spool/wwwoffle/html/en/robots.txt" |
124 |
+} |
125 |
+ |
126 |
+pkg_preinst() { |
127 |
+ # Add a wwwoffle user |
128 |
+ enewgroup wwwoffle |
129 |
+ enewuser wwwoffle -1 -1 /var/spool/wwwoffle wwwoffle |
130 |
+ |
131 |
+ # Changing the user:group to wwwoffle:woffle |
132 |
+ fowners -R wwwoffle:wwwoffle /var/spool/wwwoffle /etc/wwwoffle |
133 |
+ sed -i -e 's/^[# \t]\(run-[gu]id[ \t]*=[ \t]*\)[a-zA-Z0-9]*[ \t]*$/ \1wwwoffle/g' \ |
134 |
+ "${D}/etc/wwwoffle/wwwoffle.conf" |
135 |
+ |
136 |
+} |
137 |
+ |
138 |
+pkg_postinst() { |
139 |
+ # fix permissions for those upgrading |
140 |
+ for number in 1 2 3 4 5 6 7 8 9; |
141 |
+ do |
142 |
+ [ ! -d "${ROOT}/var/spool/wwwoffle/prevtime${number}" ] && \ |
143 |
+ keepdir "${ROOT}/var/spool/wwwoffle/prevtime${number}" |
144 |
+ [ ! -d "${ROOT}/var/spool/wwwoffle/prevout${number}" ] && \ |
145 |
+ keepdir "${ROOT}/var/spool/wwwoffle/prevout${number}" |
146 |
+ done |
147 |
+ chown -R wwwoffle:wwwoffle "${ROOT}/var/spool/wwwoffle" "${ROOT}/etc/wwwoffle" |
148 |
+ |
149 |
+ [ -f "${T}/stopped" ] && \ |
150 |
+ ewarn "wwwoffled was stopped. /etc/init.d/wwwoffled start to restart AFTER etc-update" |
151 |
+ |
152 |
+ einfo "wwwoffled should run as an ordinary user now. The run-uid and run-gid should be set" |
153 |
+ einfo "to \"wwwoffle\" in your /etc/wwwoffle/wwwoffle.conf. Please uncomment this if it hasn't been already" |
154 |
+ |
155 |
+ einfo "This is for your own security. Otherwise wwwoffle is run as root which is relay bad if" |
156 |
+ einfo "there is an exploit in this program that allows remote/local users to execute arbitary" |
157 |
+ einfo "commands as the root user." |
158 |
+} |