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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Wed Aug 1 19:49:05 2012 UTC (23 months, 1 week ago) by jer
Branch: MAIN
Version bump. Inherit user, not eutils.

(Portage version: 2.2.0_alpha120/cvs/Linux x86_64)

1 jer 1.1 # Copyright 1999-2012 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.9e.ebuild,v 1.5 2009/11/18 18:45:07 armin76 Exp $
4    
5     EAPI=4
6     inherit user
7    
8     DESCRIPTION="Web caching proxy suitable for non-permanent Internet connections"
9     SRC_URI="http://www.gedanken.demon.co.uk/download-wwwoffle/${P}.tgz"
10     HOMEPAGE="http://www.gedanken.demon.co.uk/wwwoffle"
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     sed -i cache/Makefile.in \
27     -e 's#$(TAR) xpf #$(TAR) --no-same-owner -xpf #' \
28     || die
29     }
30    
31     src_configure() {
32     econf $(use_with zlib) \
33     $(use_with gnutls) \
34     $(use_with ipv6) || die "econf failed"
35     }
36    
37     src_install() {
38     default
39    
40     # documentation fix
41     # del empty doc dirs
42     rmdir "${D}/usr/doc/${PN}"/{it,nl,ru}
43     dodir /usr/share/doc
44     mv "${D}/usr/doc/${PN}" "${D}/usr/share/doc/${PF}"
45     rmdir "${D}/usr/doc"
46    
47     # install the wwwoffled init script
48     newinitd "${FILESDIR}/${PN}.initd" wwwoffled
49     newinitd "${FILESDIR}/${PN}-online.initd" wwwoffled-online
50     newconfd "${FILESDIR}/${PN}-online.confd" wwwoffled-online
51    
52     keepdir /var/spool/wwwoffle/{http,outgoing,monitor,lasttime,lastout,local}
53     for number in 1 2 3 4 5 6 7 8 9; do
54     keepdir "/var/spool/wwwoffle/prevtime${number}" "/var/spool/wwwoffle/prevout${number}"
55     done
56    
57     # empty dirs are removed during update
58     keepdir \
59     /var/spool/wwwoffle/search/{mnogosearch/db,htdig/tmp,htdig/db-lasttime,htdig/db,namazu/db}
60    
61     touch \
62     "${D}/var/spool/wwwoffle/search/htdig/wwwoffle-htdig.log" \
63     "${D}/var/spool/wwwoffle/search/mnogosearch/wwwoffle-mnogosearch.log" \
64     "${D}/var/spool/wwwoffle/search/namazu/wwwoffle-namazu.log"
65    
66     # TODO htdig indexing as part of initscripts
67    
68     # robots.txt modification - /var/spool/wwwoffle/html/en
69     # - remove Disallow: /index
70     sed -i -e "s|Disallow:.*/index|#Disallow: /index|" "${D}/var/spool/wwwoffle/html/en/robots.txt"
71     }
72    
73     pkg_preinst() {
74     # Add a wwwoffle user
75     enewgroup wwwoffle
76     enewuser wwwoffle -1 -1 /var/spool/wwwoffle wwwoffle
77    
78     # Changing the user:group to wwwoffle:woffle
79     fowners -R wwwoffle:wwwoffle /var/spool/wwwoffle /etc/wwwoffle
80     sed -i -e 's/^[# \t]\(run-[gu]id[ \t]*=[ \t]*\)[a-zA-Z0-9]*[ \t]*$/ \1wwwoffle/g' \
81     "${D}/etc/wwwoffle/wwwoffle.conf"
82    
83     }
84    
85     pkg_postinst() {
86     # fix permissions for those upgrading
87     for number in 1 2 3 4 5 6 7 8 9;
88     do
89     [ ! -d "${ROOT}/var/spool/wwwoffle/prevtime${number}" ] && \
90     keepdir "${ROOT}/var/spool/wwwoffle/prevtime${number}"
91     [ ! -d "${ROOT}/var/spool/wwwoffle/prevout${number}" ] && \
92     keepdir "${ROOT}/var/spool/wwwoffle/prevout${number}"
93     done
94     chown -R wwwoffle:wwwoffle "${ROOT}/var/spool/wwwoffle" "${ROOT}/etc/wwwoffle"
95    
96     [ -f "${T}/stopped" ] && \
97     ewarn "wwwoffled was stopped. /etc/init.d/wwwoffled start to restart AFTER etc-update"
98    
99     einfo "wwwoffled should run as an ordinary user now. The run-uid and run-gid should be set"
100     einfo "to \"wwwoffle\" in your /etc/wwwoffle/wwwoffle.conf. Please uncomment this if it hasn't been already"
101    
102     einfo "This is for your own security. Otherwise wwwoffle is run as root which is relay bad if"
103     einfo "there is an exploit in this program that allows remote/local users to execute arbitary"
104     einfo "commands as the root user."
105     }

  ViewVC Help
Powered by ViewVC 1.1.20