1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils multilib flag-o-matic
11 DESCRIPTION="C Implementation of an ICAP server"
12 HOMEPAGE="http://c-icap.sourceforge.net/"
13 SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
17 KEYWORDS="amd64 ~arm x86"
18 IUSE="berkdb ipv6 ldap"
20 RDEPEND="berkdb? ( sys-libs/db )
21 ldap? ( net-nds/openldap )
27 S="${WORKDIR}/${MY_P}"
30 epatch "${FILESDIR}"/c-icap-0.2.6-fix-icap-parsing.patch
34 # some void *** pointers get casted around and can be troublesome to
36 append-flags -fno-strict-aliasing
39 --sysconfdir=/etc/${PN} \
40 --disable-dependency-tracking \
41 --disable-maintainer-mode \
43 --enable-large-files \
45 $(use_with berkdb bdb) \
50 emake LOGDIR="/var/log"
56 DESTDIR="${D}" install
58 find "${D}" -name '*.la' -delete || die
60 # Move the daemon out of the way
62 mv "${D}"/usr/bin/c-icap "${D}"/usr/libexec || die
64 # Remove the default configuration files since we have etc-update to
65 # take care of it for us.
66 rm "${D}"/etc/${PN}/c-icap.*.default || die
68 # Fix the configuration file; for some reason it's a bit messy
71 -e 's:/usr/var/:/var/:g' \
72 -e 's:/var/log/:/var/log/c-icap/:g' \
73 -e 's:/usr/etc/:/etc/c-icap/:g' \
74 -e 's:/usr/local/c-icap/etc/:/etc/c-icap/:g' \
75 -e 's:/usr/lib/:/usr/'$(get_libdir)'/:g' \
76 "${D}"/etc/${PN}/c-icap.conf \
79 dodoc AUTHORS README TODO ChangeLog
81 newinitd "${FILESDIR}/${PN}.init.3" ${PN}
82 newconfd "${FILESDIR}/${PN}.conf" ${PN}
83 keepdir /var/log/c-icap
86 insinto /etc/logrotate.d
87 newins "${FILESDIR}"/${PN}.logrotate ${PN}
89 # avoid triggering portage's symlink protection; this is handled by
90 # the init script anyway.
95 elog "To enable Squid to call the ICAP modules from a local server you should set"
96 elog "the following in your squid.conf:"
98 elog " icap_enable on"
100 elog " # not strictly needed, but some modules might make use of these"
101 elog " icap_send_client_ip on"
102 elog " icap_send_client_username on"
104 elog " icap_service service_req reqmod_precache bypass=1 icap://localhost:1344/service"
105 elog " adaptation_access service_req allow all"
107 elog " icap_service service_resp respmod_precache bypass=0 icap://localhost:1344/service"
108 elog " adaptation_access service_resp allow all"
110 elog "You obviously will have to replace \"service\" with the actual ICAP service to"