summaryrefslogtreecommitdiff
blob: e221fd7813950073e25ea23a16cf569d9f1c8894 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-www/wwwoffle/wwwoffle-2.7h.ebuild,v 1.6 2004/04/25 00:44:10 dragonheart Exp $

S=${WORKDIR}/${P}

DESCRIPTION="wwwoffle = WWW Offline Explorer, an adv. caching proxy especially suitable for nonpermanent (e.g. dialup) Internet connections"

SRC_URI="ftp://ftp.demon.co.uk/pub/unix/httpd/${P}.tgz
	 ftp://ftp.ibiblio.org/pub/Linux/apps/www/servers/${P}.tgz"

HOMEPAGE="http://www.gedanken.demon.co.uk/"
KEYWORDS="~x86 ~sparc ~ppc ppc64"
SLOT="0"
LICENSE="GPL-2"

DEPEND="sys-devel/flex
	sys-libs/zlib
	sys-devel/gcc
	virtual/glibc
	>=sys-apps/sed-4"

RDEPEND="sys-libs/zlib
	virtual/glibc"

src_compile() {
	local myconf
	use ipv6	&& myconf="$myconf --with-ipv6" 	|| myconf="$myconf --without-ipv6"
	./configure $myconf --prefix=/usr --with-confdir=/etc	|| die

	emake || die
}

src_install() {

	sed -i -e 's#$(TAR) xpf #$(TAR) --no-same-owner -xpf #' cache/Makefile

	# Install the files
	make prefix=${D}/usr SPOOLDIR=${D}/var/spool/wwwoffle CONFDIR=${D}/etc install || die

	cd ${D}/etc
	mv wwwoffle.conf 1
	sed -e "s:${D}::" 1 > wwwoffle.conf
	rm 1

	# Install the wwwoffled init script
	exeinto /etc/init.d
	doexe ${FILESDIR}/{wwwoffled-online,wwwoffled}

	# someday i'll make it use the file in /etc. for now we at least get
	# config file protection this way.
	dosym /etc/wwwoffle.conf /var/spool/wwwoffle/wwwoffle.conf
}

pkg_preinst() {
	source /etc/init.d/functions.sh
	if [ -L ${svcdir}/started/wwwoffled ]; then
		einfo "The wwwoffled init script is running. I'll stop it, merge the new files and
		restart the script."
		/etc/init.d/wwwoffled stop
		touch ${T}/restart
	fi
}

pkg_postinst() {
	if [ -f "${T}/restart" ]; then
		einfo "Starting the wwwoffled initscript again..."
		/etc/init.d/wwwoffled start
		rm ${T}/restart
	fi
}