/[gentoo-x86]/net-proxy/wwwoffle/wwwoffle-2.9i.ebuild
Gentoo

Contents of /net-proxy/wwwoffle/wwwoffle-2.9i.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Sun Mar 31 10:26:44 2013 UTC (7 years, 4 months ago) by ago
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +2 -2 lines
Stable for sparc, wrt bug #457462

(Portage version: 2.1.11.52/cvs/Linux ppc64, signed Manifest commit with key 7194459F)

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

  ViewVC Help
Powered by ViewVC 1.1.20