summaryrefslogtreecommitdiff
blob: 1a00042aecfc407eb45b88753458cc4bc85092e1 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Copyright 1999-2000 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Donny Davies <woodchip@gentoo.org>
# $Header: /var/cvsroot/gentoo-x86/net-www/squid/squid-2.4.2s.ebuild,v 1.1 2001/11/01 19:23:29 woodchip Exp $

DESCRIPTION="A caching web proxy, with advanced features"
HOMEPAGE="http://www.squid-cache.org/"

P=squid-2.4.STABLE2
S=${WORKDIR}/${P}
SRC_URI="ftp://ftp.squid-cache.org/pub/squid-2/STABLE/${P}-src.tar.gz
	ftp://sunsite.auc.dk/pub/infosystems/squid/squid-2/STABLE/${P}-src.tar.gz"

RDEPEND="virtual/glibc
	ldap? ( >=net-nds/openldap-1.2.11 )
	pam? ( >=sys-libs/pam-0.72 )"
DEPEND="$RDEPEND sys-devel/perl"

src_unpack() {
	unpack ${A} ; cd ${S}

	# lots of nice patches, thanks debian ;)
	patch -p1 < ${FILESDIR}/squid-2.4.2s-debian.diff || die
	# gentoo patches: cachedir/logfile/error/icon locs, user/group
	patch -p1 < ${FILESDIR}/squid-2.4.2s-gentoo.diff || die
}

src_compile() {
	local myconf mymodules="getpwnam,YP,NCSA,SMB"
	use pam && mymodules="PAM,${mymodules}"
	use ldap && mymodules="LDAP,${mymodules}"
	use snmp && myconf="--enable-snmp"

	./configure \
	--prefix=/ \
	--bindir=/usr/sbin \
	--exec-prefix=/usr \
	--localstatedir=/var \
	--sysconfdir=/etc/squid \
	--libexecdir=/usr/lib/squid \
	--enable-auth-modules=${mymodules} \
	--enable-storeio="ufs,diskd,coss,aufs,null" \
	--enable-removal-policies="lru,heap" \
	--enable-linux-netfilter \
	--disable-ident-lookups \
	--enable-useragent-log \
	--enable-delay-pools \
	--enable-referer-log \
	--enable-truncate \
	--enable-arp-acl \
	--with-pthreads \
	--enable-htcp \
	--enable-carp \
	--enable-icmp \
	--host=${CHOST} ${myconf} || die

	make || die "compile problem :("
}

src_install() {
	dodir /var/log /var/spool
	diropts -m 770 -o root -g squid ; dodir /var/log/squid
	diropts -m 770 -o root -g squid ; dodir /var/spool/squid

	make \
	prefix=${D}/usr \
	bindir=${D}/usr/sbin \
	localstatedir=${D}/var \
	sysconfdir=${D}/etc/squid \
	libexecdir=${D}/usr/lib/squid \
	install || die

	make -C src install-pinger libexecdir=${D}/usr/lib/squid || die

	# some cleanup action
	mv ${D}/usr/sbin/*_auth* ${D}/usr/lib/squid
	mv ${D}/etc/squid/errors ${D}/usr/lib/squid

	# pinger needs root to bind to privelaged ports
	chown root.squid ${D}/usr/lib/squid/pinger
	chmod 4750 ${D}/usr/lib/squid/pinger
	# pam_auth needs root to authenticate everybody. i think the others
	# do too so just do them all now. keep an eye on these things..
	chown root.squid ${D}/usr/lib/squid/*_auth*
	chmod 4750 ${D}/usr/lib/squid/*_auth*

	dodoc README QUICKSTART CONTRIBUTORS COPYRIGHT
	dodoc COPYING CREDITS ChangeLog TODO
	newdoc auth_modules/SMB/README SMB.auth.readme
	newdoc auth_modules/LDAP/README LDAP.auth.readme
	doman auth_modules/LDAP/*.8 doc/tree.3
	docinto txt ; dodoc doc/*.txt

	insinto /etc/pam.d ; newins ${FILESDIR}/squid.pam squid
	exeinto /etc/rc.d/init.d ; newexe ${FILESDIR}/squid.rc5 squid
}