You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
105 lines
3.2 KiB
105 lines
3.2 KiB
3 years ago
|
# Copyright 1999-2021 Gentoo Authors
|
||
13 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
3 years ago
|
EAPI=7
|
||
13 years ago
|
|
||
|
DESCRIPTION="Web caching proxy suitable for non-permanent Internet connections"
|
||
7 years ago
|
HOMEPAGE="https://www.gedanken.org.uk/software/wwwoffle/"
|
||
|
SRC_URI="https://www.gedanken.org.uk/software/${PN}/download/${P}.tgz"
|
||
13 years ago
|
|
||
12 years ago
|
KEYWORDS="amd64 ppc ppc64 sparc x86"
|
||
13 years ago
|
SLOT="0"
|
||
|
LICENSE="GPL-2"
|
||
|
IUSE="gnutls ipv6 zlib"
|
||
|
|
||
3 years ago
|
RDEPEND="
|
||
|
acct-group/wwwoffle
|
||
|
acct-user/wwwoffle
|
||
|
gnutls? ( net-libs/gnutls )
|
||
|
zlib? ( sys-libs/zlib )
|
||
|
"
|
||
|
DEPEND="
|
||
|
dev-lang/perl
|
||
13 years ago
|
sys-devel/flex
|
||
3 years ago
|
${RDEPEND}
|
||
|
"
|
||
13 years ago
|
# Unsure whether to depend on >=www-misc/htdig-3.1.6-r4 or not
|
||
|
|
||
3 years ago
|
PATCHES=( "${FILESDIR}"/${PN}-2.9i-define.patch )
|
||
|
|
||
13 years ago
|
src_prepare() {
|
||
9 years ago
|
default
|
||
3 years ago
|
sed -e 's#$(TAR) xpf #$(TAR) --no-same-owner -xpf #' -i cache/Makefile.in || die
|
||
13 years ago
|
}
|
||
|
|
||
|
src_configure() {
|
||
3 years ago
|
local myeconfargs=(
|
||
|
$(use_with gnutls)
|
||
|
$(use_with ipv6)
|
||
12 years ago
|
$(use_with zlib)
|
||
3 years ago
|
)
|
||
|
|
||
|
econf "${myeconfargs[@]}"
|
||
13 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
12 years ago
|
default
|
||
13 years ago
|
|
||
|
# documentation fix
|
||
|
# del empty doc dirs
|
||
12 years ago
|
rmdir "${D}/usr/doc/${PN}"/{it,nl,ru} || die
|
||
13 years ago
|
dodir /usr/share/doc
|
||
12 years ago
|
mv "${D}/usr/doc/${PN}" "${D}/usr/share/doc/${PF}" || die
|
||
|
rmdir "${D}/usr/doc" || die
|
||
13 years ago
|
|
||
|
# install the wwwoffled init script
|
||
|
newinitd "${FILESDIR}/${PN}.initd" wwwoffled
|
||
|
newinitd "${FILESDIR}/${PN}-online.initd" wwwoffled-online
|
||
|
newconfd "${FILESDIR}/${PN}-online.confd" wwwoffled-online
|
||
|
|
||
|
keepdir /var/spool/wwwoffle/{http,outgoing,monitor,lasttime,lastout,local}
|
||
|
for number in 1 2 3 4 5 6 7 8 9; do
|
||
|
keepdir "/var/spool/wwwoffle/prevtime${number}" "/var/spool/wwwoffle/prevout${number}"
|
||
|
done
|
||
|
|
||
|
# empty dirs are removed during update
|
||
3 years ago
|
keepdir /var/spool/wwwoffle/search/{mnogosearch/db,htdig/tmp,htdig/db-lasttime,htdig/db,namazu/db}
|
||
13 years ago
|
|
||
3 years ago
|
touch "${D}/var/spool/wwwoffle/search/htdig/wwwoffle-htdig.log"
|
||
|
touch "${D}/var/spool/wwwoffle/search/mnogosearch/wwwoffle-mnogosearch.log"
|
||
|
touch "${D}/var/spool/wwwoffle/search/namazu/wwwoffle-namazu.log"
|
||
13 years ago
|
|
||
|
# TODO htdig indexing as part of initscripts
|
||
|
|
||
|
# robots.txt modification - /var/spool/wwwoffle/html/en
|
||
3 years ago
|
# - remove Disallow: /index
|
||
|
sed -e "s|Disallow:.*/index|#Disallow: /index|" -i "${D}/var/spool/wwwoffle/html/en/robots.txt" || die
|
||
13 years ago
|
}
|
||
|
|
||
|
pkg_preinst() {
|
||
|
# Changing the user:group to wwwoffle:woffle
|
||
|
fowners -R wwwoffle:wwwoffle /var/spool/wwwoffle /etc/wwwoffle
|
||
3 years ago
|
sed -e 's/^[# \t]\(run-[gu]id[ \t]*=[ \t]*\)[a-zA-Z0-9]*[ \t]*$/ \1wwwoffle/g' -i "${D}/etc/wwwoffle/wwwoffle.conf" || die
|
||
13 years ago
|
|
||
|
}
|
||
|
|
||
|
pkg_postinst() {
|
||
|
# fix permissions for those upgrading
|
||
|
for number in 1 2 3 4 5 6 7 8 9;
|
||
|
do
|
||
|
[ ! -d "${ROOT}/var/spool/wwwoffle/prevtime${number}" ] && \
|
||
|
keepdir "${ROOT}/var/spool/wwwoffle/prevtime${number}"
|
||
|
[ ! -d "${ROOT}/var/spool/wwwoffle/prevout${number}" ] && \
|
||
|
keepdir "${ROOT}/var/spool/wwwoffle/prevout${number}"
|
||
|
done
|
||
|
|
||
3 years ago
|
[ -f "${T}/stopped" ] && ewarn "wwwoffled was stopped. /etc/init.d/wwwoffled start to restart AFTER etc-update"
|
||
13 years ago
|
|
||
|
einfo "wwwoffled should run as an ordinary user now. The run-uid and run-gid should be set"
|
||
|
einfo "to \"wwwoffle\" in your /etc/wwwoffle/wwwoffle.conf. Please uncomment this if it hasn't been already"
|
||
|
|
||
|
einfo "This is for your own security. Otherwise wwwoffle is run as root which is relay bad if"
|
||
|
einfo "there is an exploit in this program that allows remote/local users to execute arbitary"
|
||
|
einfo "commands as the root user."
|
||
|
}
|