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