| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/net-proxy/c-icap/c-icap-0.2.1.ebuild,v 1.1 2012/06/29 14:09:12 flameeyes Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
inherit eutils multilib flag-o-matic autotools
|
| 8 |
|
| 9 |
MY_PN=${PN/-/_}
|
| 10 |
MY_P=${MY_PN}-${PV}
|
| 11 |
|
| 12 |
DESCRIPTION="C Implementation of an ICAP server"
|
| 13 |
HOMEPAGE="http://c-icap.sourceforge.net/"
|
| 14 |
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
|
| 15 |
|
| 16 |
LICENSE="LGPL-2.1"
|
| 17 |
SLOT="0"
|
| 18 |
KEYWORDS="~amd64 ~arm ~x86"
|
| 19 |
IUSE="berkdb ipv6 ldap"
|
| 20 |
|
| 21 |
RDEPEND="berkdb? ( sys-libs/db )
|
| 22 |
ldap? ( net-nds/openldap )
|
| 23 |
sys-libs/zlib"
|
| 24 |
DEPEND="${RDEPEND}"
|
| 25 |
RDEPEND="${RDEPEND}
|
| 26 |
sys-apps/openrc"
|
| 27 |
|
| 28 |
S="${WORKDIR}/${MY_P}"
|
| 29 |
|
| 30 |
src_prepare() {
|
| 31 |
epatch "${FILESDIR}/${PN}-0.2.1-asneeded.patch"
|
| 32 |
epatch "${FILESDIR}/${PN}-0.1.3+db-5.0.patch"
|
| 33 |
epatch "${FILESDIR}/${PN}-0.1.4-crosscompile.patch"
|
| 34 |
epatch "${FILESDIR}/${PN}-0.1.6-implicit.patch"
|
| 35 |
eautoreconf
|
| 36 |
}
|
| 37 |
|
| 38 |
src_configure() {
|
| 39 |
# some void *** pointers get casted around and can be troublesome to
|
| 40 |
# fix properly.
|
| 41 |
append-flags -fno-strict-aliasing
|
| 42 |
|
| 43 |
econf \
|
| 44 |
--sysconfdir=/etc/${PN} \
|
| 45 |
--disable-dependency-tracking \
|
| 46 |
--disable-maintainer-mode \
|
| 47 |
--disable-static \
|
| 48 |
--enable-large-files \
|
| 49 |
$(use_enable ipv6) \
|
| 50 |
$(use_with berkdb bdb) \
|
| 51 |
$(use_with ldap)
|
| 52 |
}
|
| 53 |
|
| 54 |
src_compile() {
|
| 55 |
emake LOGDIR="/var/log" || die
|
| 56 |
}
|
| 57 |
|
| 58 |
src_install() {
|
| 59 |
emake \
|
| 60 |
LOGDIR="/var/log" \
|
| 61 |
DESTDIR="${D}" install || die
|
| 62 |
|
| 63 |
find "${D}" -name '*.la' -delete || die
|
| 64 |
|
| 65 |
# Move the daemon out of the way
|
| 66 |
dodir /usr/libexec
|
| 67 |
mv "${D}"/usr/bin/c-icap "${D}"/usr/libexec || die
|
| 68 |
|
| 69 |
# Remove the default configuration files since we have etc-update to
|
| 70 |
# take care of it for us.
|
| 71 |
rm "${D}"/etc/${PN}/c-icap.*.default || die
|
| 72 |
|
| 73 |
# Fix the configuration file; for some reason it's a bit messy
|
| 74 |
# around.
|
| 75 |
sed -i \
|
| 76 |
-e 's:/usr/var/:/var/:g' \
|
| 77 |
-e 's:/var/log/:/var/log/c-icap/:g' \
|
| 78 |
-e 's:/usr/etc/:/etc/c-icap/:g' \
|
| 79 |
-e 's:/usr/local/c-icap/etc/:/etc/c-icap/:g' \
|
| 80 |
-e 's:/usr/lib/:/usr/'$(get_libdir)'/:g' \
|
| 81 |
"${D}"/etc/${PN}/c-icap.conf \
|
| 82 |
|| die
|
| 83 |
|
| 84 |
dodoc AUTHORS README TODO ChangeLog || die
|
| 85 |
|
| 86 |
newinitd "${FILESDIR}/${PN}.init.2" ${PN} || die
|
| 87 |
keepdir /var/log/c-icap || die
|
| 88 |
|
| 89 |
insopts -m0644
|
| 90 |
insinto /etc/logrotate.d
|
| 91 |
newins "${FILESDIR}"/${PN}.logrotate ${PN}
|
| 92 |
}
|
| 93 |
|
| 94 |
pkg_postinst() {
|
| 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:"
|
| 97 |
elog ""
|
| 98 |
elog " icap_enable on"
|
| 99 |
elog ""
|
| 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"
|
| 103 |
elog ""
|
| 104 |
elog " icap_service service_req reqmod_precache bypass=1 icap://localhost:1344/service"
|
| 105 |
elog " adaptation_access service_req allow all"
|
| 106 |
elog ""
|
| 107 |
elog " icap_service service_resp respmod_precache bypass=0 icap://localhost:1344/service"
|
| 108 |
elog " adaptation_access service_resp allow all"
|
| 109 |
elog ""
|
| 110 |
elog "You obviously will have to replace \"service\" with the actual ICAP service to"
|
| 111 |
elog "use."
|
| 112 |
}
|