-
Notifications
You must be signed in to change notification settings - Fork 2
/
c-icap-9999.ebuild
101 lines (83 loc) · 2.38 KB
/
c-icap-9999.ebuild
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
97
98
99
100
101
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit autotools
DESCRIPTION="an implementation of an ICAP server written in C"
HOMEPAGE="http://c-icap.sourceforge.net/"
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/c-icap/c-icap-server"
EGIT_BRANCH="master"
else
SRC_URI="https://github.com/c-icap/c-icap-server/archive/refs/tags/C_ICAP_${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="amd64 ~arm ~x86"
S="${WORKDIR}/c-icap-server-C_ICAP_${PV}"
fi
LICENSE="LGPL-2.1"
SLOT="0"
IUSE="berkdb ldap ipv6 logrotate"
DEPEND="
acct-group/cicap
acct-user/cicap
berkdb? ( sys-libs/db:* )
ldap? ( net-nds/openldap )
"
RDEPEND="${DEPEND}"
BDEPEND=""
src_prepare() {
eapply_user
if [[ ${PV} == 9999 ]]; then
git branch --list -v | grep -e '^\*' | awk '{print $2"-"$3}'> VERSION.m4 || die
else
echo ${PV} > VERSION.m4 || die
fi
eautoreconf
}
src_configure() {
econf \
--sysconfdir=/etc/${PN} \
--disable-dependency-tracking \
--disable-maintainer-mode \
--disable-static \
--enable-large-files \
$(use_enable ipv6) \
$(use_with berkdb bdb) \
$(use_with ldap)
}
src_install() {
default
# perfrom some cleanups of log and run dirs
rm -r "${ED}/var" || die
find "${ED}" -name '*.la' -delete || die
keepdir /var/log/c-icap
fowners cicap:cicap /var/log/c-icap
insinto /etc/${PN}
doins "${FILESDIR}"/${PN}.conf
newinitd "${FILESDIR}/${PN}-init" ${PN}
newconfd "${FILESDIR}/${PN}-confd" ${PN}
if use logrotate ; then
insopts -m0644
insinto /etc/logrotate.d
newins "${FILESDIR}"/${PN}.logrotate ${PN}
fi
dodoc AUTHORS README TODO ChangeLog
}
pkg_postinst() {
elog "To enable Squid to call the ICAP modules from a local server you should set"
elog "the following in your squid.conf:"
elog ""
elog " icap_enable on"
elog ""
elog " # not strictly needed, but some modules might make use of these"
elog " icap_send_client_ip on"
elog " icap_send_client_username on"
elog ""
elog " icap_service service_req reqmod_precache bypass=1 icap://localhost:1344/service"
elog " adaptation_access service_req allow all"
elog ""
elog " icap_service service_resp respmod_precache bypass=0 icap://localhost:1344/service"
elog " adaptation_access service_resp allow all"
elog ""
elog "You obviously will have to replace \"service\" with the actual ICAP service to"
elog "use."
}