/[gentoo-x86]/net-proxy/squid/squid-2.7.9.ebuild
Gentoo

Contents of /net-proxy/squid/squid-2.7.9.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Fri Oct 1 14:54:33 2010 UTC (4 years ago) by ranger
Branch: MAIN
Changes since 1.6: +2 -2 lines
Marking squid-2.7.9 ppc64 for bug 301828
(Portage version: 2.1.8.3/cvs/Linux ppc64)

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/squid-2.7.9.ebuild,v 1.6 2010/09/04 14:45:59 armin76 Exp $
4
5 EAPI="2"
6
7 inherit eutils pam toolchain-funcs autotools
8
9 #lame archive versioning scheme..
10 S_PMV="${PV%%.*}"
11 S_PV="${PV%.*}"
12 S_PL="${PV##*.}"
13 S_PL="${S_PL/_rc/-RC}"
14 S_PP="${PN}-${S_PV}.STABLE${S_PL}"
15
16 DESCRIPTION="A full-featured web proxy cache"
17 HOMEPAGE="http://www.squid-cache.org/"
18 SRC_URI="http://www.squid-cache.org/Versions/v${S_PMV}/${S_PV}/${S_PP}.tar.gz"
19
20 LICENSE="GPL-2"
21 SLOT="0"
22 KEYWORDS="alpha amd64 ~arm hppa ia64 ~mips ppc ppc64 sparc x86 ~x86-fbsd"
23 IUSE="caps pam ldap samba sasl kerberos nis ssl snmp selinux logrotate \
24 mysql postgres sqlite \
25 zero-penalty-hit \
26 pf-transparent ipf-transparent kqueue \
27 elibc_uclibc kernel_linux +epoll tproxy"
28
29 DEPEND="caps? ( >=sys-libs/libcap-2.16 )
30 pam? ( virtual/pam )
31 ldap? ( net-nds/openldap )
32 kerberos? ( virtual/krb5 )
33 ssl? ( dev-libs/openssl )
34 sasl? ( dev-libs/cyrus-sasl )
35 selinux? ( sec-policy/selinux-squid )
36 !x86-fbsd? ( logrotate? ( app-admin/logrotate ) )
37 >=sys-libs/db-4
38 dev-lang/perl"
39 RDEPEND="${DEPEND}
40 samba? ( net-fs/samba )
41 mysql? ( dev-perl/DBD-mysql )
42 postgres? ( dev-perl/DBD-Pg )
43 sqlite? ( dev-perl/DBD-SQLite )"
44
45 S="${WORKDIR}/${S_PP}"
46
47 pkg_setup() {
48 if use tproxy && ! use caps; then
49 eerror "libcap is required by Transparent Proxy support for Netfilter TPROXY!"
50 eerror "Please enable caps USE flag and try again."
51
52 die "invalid combination of USE flags"
53 fi
54
55 if use zero-penalty-hit; then
56 ewarn "This version supports natively IP TOS/Priority mangling,"
57 ewarn "but it does not support zph_preserve_miss_tos."
58 ewarn "If you need that, please use >=${CATEGORY}/${PN}-3 ."
59 fi
60 enewgroup squid 31
61 enewuser squid 31 -1 /var/cache/squid squid
62 }
63
64 src_prepare() {
65 epatch "${FILESDIR}"/${P}-gentoo.patch
66 has_version app-crypt/mit-krb5 || epatch "${FILESDIR}"/${PN}-2-heimdal.patch
67 eautoreconf
68 }
69
70 src_configure() {
71 local basic_modules="getpwnam,NCSA,MSNT"
72 use samba && basic_modules="SMB,multi-domain-NTLM,${basic_modules}"
73 use ldap && basic_modules="LDAP,${basic_modules}"
74 use pam && basic_modules="PAM,${basic_modules}"
75 use sasl && basic_modules="SASL,${basic_modules}"
76 use nis && ! use elibc_uclibc && basic_modules="YP,${basic_modules}"
77 if use mysql || use postgres || use sqlite ; then
78 basic_modules="DB,${basic_modules}"
79 fi
80
81 local ext_helpers="ip_user,session,unix_group"
82 use samba && ext_helpers="wbinfo_group,${ext_helpers}"
83 use ldap && ext_helpers="ldap_group,${ext_helpers}"
84
85 local ntlm_helpers="fakeauth"
86 use samba && ntlm_helpers="SMB,${ntlm_helpers}"
87
88 local negotiate_helpers=
89 use kerberos && local negotiate_helpers="squid_kerb_auth"
90
91 local myconf=""
92
93 # Support for uclibc #61175
94 if use elibc_uclibc; then
95 myconf="${myconf} --enable-storeio=ufs,diskd,aufs,null"
96 myconf="${myconf} --disable-async-io"
97 else
98 myconf="${myconf} --enable-storeio=ufs,diskd,coss,aufs,null"
99 myconf="${myconf} --enable-async-io"
100 fi
101
102 if use kernel_linux; then
103 myconf="${myconf} --enable-linux-netfilter
104 $(use_enable tproxy linux-tproxy)
105 $(use_enable epoll)"
106 elif use kernel_FreeBSD || use kernel_OpenBSD || use kernel_NetBSD ; then
107 myconf="${myconf} $(use_enable kqueue)"
108 if use pf-transparent; then
109 myconf="${myconf} --enable-pf-transparent"
110 elif use ipf-transparent; then
111 myconf="${myconf} --enable-ipf-transparent"
112 fi
113 fi
114
115 export CC=$(tc-getCC)
116
117 econf \
118 --sysconfdir=/etc/squid \
119 --libexecdir=/usr/libexec/squid \
120 --localstatedir=/var \
121 --datadir=/usr/share/squid \
122 --enable-auth="basic,digest,ntlm,negotiate" \
123 --enable-removal-policies="lru,heap" \
124 --enable-digest-auth-helpers="password" \
125 --enable-basic-auth-helpers="${basic_modules}" \
126 --enable-external-acl-helpers="${ext_helpers}" \
127 --enable-ntlm-auth-helpers="${ntlm_helpers}" \
128 --enable-negotiate-auth-helpers="${negotiate_helpers}" \
129 --enable-ident-lookups \
130 --enable-useragent-log \
131 --enable-cache-digests \
132 --enable-delay-pools \
133 --enable-referer-log \
134 --enable-arp-acl \
135 --with-pthreads \
136 --with-large-files \
137 --enable-htcp \
138 --enable-carp \
139 --enable-follow-x-forwarded-for \
140 --with-maxfd=8192 \
141 $(use_with libcap) \
142 $(use_enable snmp) \
143 $(use_enable ssl) \
144 ${myconf} || die "econf failed"
145 }
146
147 src_install() {
148 make DESTDIR="${D}" install || die "make install failed"
149
150 # need suid root for looking into /etc/shadow
151 fowners root:squid /usr/libexec/squid/ncsa_auth
152 fowners root:squid /usr/libexec/squid/pam_auth
153 fperms 4750 /usr/libexec/squid/ncsa_auth
154 fperms 4750 /usr/libexec/squid/pam_auth
155
156 # some cleanups
157 rm -f "${D}"/usr/bin/Run*
158
159 dodoc CONTRIBUTORS CREDITS ChangeLog QUICKSTART SPONSORS doc/*.txt \
160 helpers/ntlm_auth/no_check/README.no_check_ntlm_auth
161 newdoc helpers/basic_auth/SMB/README README.auth_smb
162 dohtml helpers/basic_auth/MSNT/README.html RELEASENOTES.html
163 newdoc helpers/basic_auth/LDAP/README README.auth_ldap
164 doman helpers/basic_auth/LDAP/*.8
165 dodoc helpers/basic_auth/SASL/squid_sasl_auth*
166
167 newpamd "${FILESDIR}/squid.pam" squid
168 newconfd "${FILESDIR}/squid.confd" squid
169 if use logrotate; then
170 newinitd "${FILESDIR}/squid.initd-logrotate" squid
171 insinto /etc/logrotate.d
172 newins "${FILESDIR}/squid.logrotate" squid
173 else
174 newinitd "${FILESDIR}/squid.initd" squid
175 exeinto /etc/cron.weekly
176 newexe "${FILESDIR}/squid.cron" squid.cron
177 fi
178
179 rm -rf "${D}"/var
180 diropts -m0755 -o squid -g squid
181 keepdir /var/cache/squid /var/log/squid
182 }
183
184 pkg_postinst() {
185 echo
186 ewarn "Squid authentication helpers have been installed suid root."
187 ewarn "This allows shadow based authentication (see bug #52977 for more)."
188 echo
189 ewarn "Be careful what type of cache_dir you select!"
190 ewarn " 'diskd' is optimized for high levels of traffic, but it might seem slow"
191 ewarn "when there isn't sufficient traffic to keep squid reasonably busy."
192 ewarn " If your traffic level is low to moderate, use 'aufs' or 'ufs'."
193 echo
194 ewarn "Squid can be configured to run in transparent mode like this:"
195 ewarn " ${HILITE}http_port internal-addr:3128 transparent${NORMAL}"
196 }

  ViewVC Help
Powered by ViewVC 1.1.20