--- /usr/portage/net-proxy/squid/squid-3.1.0.15_beta-r1.ebuild 2009-11-29 12:53:09.000000000 +0400 +++ squid-3.1.5.ebuild 2010-07-15 05:56:15.766799486 +0400 @@ -1,14 +1,14 @@ -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/squid/squid-3.1.0.15_beta-r1.ebuild,v 1.1 2009/11/29 08:53:09 mrness Exp $ +# $Header: $ -EAPI="2" +EAPI="3" -inherit eutils pam toolchain-funcs +inherit base eutils pam toolchain-funcs DESCRIPTION="A full-featured web proxy cache" HOMEPAGE="http://www.squid-cache.org/" -SRC_URI="http://www.squid-cache.org/Versions/v3/3.1/${P/_beta}.tar.gz" +SRC_URI="http://www.squid-cache.org/Versions/v3/3.1/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" @@ -19,6 +19,7 @@ zero-penalty-hit \ pf-transparent ipf-transparent kqueue \ elibc_uclibc kernel_linux +epoll" + RESTRICT=test COMMON_DEPEND="caps? ( >=sys-libs/libcap-2.16 ) @@ -32,20 +33,29 @@ !x86-fbsd? ( logrotate? ( app-admin/logrotate ) ) >=sys-libs/db-4 dev-lang/perl" + DEPEND="${COMMON_DEPEND} sys-devel/automake sys-devel/autoconf sys-devel/libtool test? ( dev-util/cppunit )" + RDEPEND="${COMMON_DEPEND} samba? ( net-fs/samba ) mysql? ( dev-perl/DBD-mysql ) postgres? ( dev-perl/DBD-Pg ) sqlite? ( dev-perl/DBD-SQLite )" -S="${WORKDIR}/${P/_beta}" +PATCHES=( + "${FILESDIR}/${P}-gentoo.patch" + "${FILESDIR}/${P}-qafixes.patch" + "${FILESDIR}/${P}-libmd5.patch" + "${FILESDIR}/${P}-errorstate-leak-fix.patch" + "${FILESDIR}/${P}-range-leak-fix-1.patch" + "${FILESDIR}/${P}-range-leak-fix-2.patch" +) -pkg_setup() { +pkg_pretend() { if grep -qs '^[[:space:]]*cache_dir[[:space:]]\+coss' "${ROOT}"etc/squid/squid.conf; then eerror "coss store IO has been disabled by upstream due to stability issues!" eerror "If you want to install this version, switch the store type to something else" @@ -53,15 +63,17 @@ die "/etc/squid/squid.conf: cache_dir use a disabled store type" fi +} + +pkg_setup() { + [ ${EAPI} -lt 4 ] && pkg_pretend enewgroup squid 31 enewuser squid 31 -1 /var/cache/squid squid } src_prepare() { - epatch "${FILESDIR}"/${P}-gentoo.patch - epatch "${FILESDIR}"/${P}-qafixes.patch - epatch "${FILESDIR}"/${P}-libmd5.patch + base_src_prepare # eautoreconf breaks lib/libLtdl/libtool script ./bootstrap.sh || die "autoreconf failed" @@ -77,6 +89,7 @@ use sasl && basic_modules="SASL,${basic_modules}" use nis && ! use elibc_uclibc && basic_modules="YP,${basic_modules}" use radius && basic_modules="squid_radius_auth,${basic_modules}" + if use mysql || use postgres || use sqlite ; then basic_modules="DB,${basic_modules}" fi @@ -151,7 +164,7 @@ } src_install() { - emake DESTDIR="${D}" install || die "emake install failed" + base_src_install # need suid root for looking into /etc/shadow fowners root:squid /usr/libexec/squid/ncsa_auth @@ -172,6 +185,7 @@ newpamd "${FILESDIR}/squid.pam" squid newconfd "${FILESDIR}/squid.confd" squid + if use logrotate; then newinitd "${FILESDIR}/squid.initd-logrotate" squid insinto /etc/logrotate.d @@ -188,17 +202,17 @@ } pkg_postinst() { - echo ewarn "Squid authentication helpers have been installed suid root." - ewarn "This allows shadow based authentication (see bug #52977 for more)." - echo + ewarn "This allows for shadow based authentication (see bug #52977 for more)." + ewarn ewarn "Be careful what type of cache_dir you select!" - ewarn " 'diskd' is optimized for high levels of traffic, but it might seem slow" - ewarn "when there isn't sufficient traffic to keep squid reasonably busy." - ewarn " If your traffic level is low to moderate, use 'aufs' or 'ufs'." - echo + ewarn "'diskd' is optimized for high levels of traffic, but it might seem slow" + ewarn "where there isn't sufficient traffic to keep squid reasonably busy." + ewarn "If your traffic level is low to moderate, use 'aufs' or 'ufs'." + ewarn ewarn "Squid can be configured to run in transparent mode like this:" ewarn " ${HILITE}http_port internal-addr:3128 transparent${NORMAL}" + if use zero-penalty-hit; then echo ewarn "In order for zph_preserve_miss_tos to work, you will have to alter your kernel"