diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2010-11-22 15:44:41 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2010-11-22 15:44:41 +0000 |
commit | a72f2c77b38149d012ee1adb11cc8214cf6bdd8e (patch) | |
tree | 3db2fb1b83eb8802c50dae7da81ac0c3695ac18e /net-proxy/c-icap | |
parent | Version bump (diff) | |
download | gentoo-2-a72f2c77b38149d012ee1adb11cc8214cf6bdd8e.tar.gz gentoo-2-a72f2c77b38149d012ee1adb11cc8214cf6bdd8e.tar.bz2 gentoo-2-a72f2c77b38149d012ee1adb11cc8214cf6bdd8e.zip |
Initial import of the c-icap server to be used with Squid and SquidClamav 6.
(Portage version: 2.2.0_alpha4/cvs/Linux x86_64)
Diffstat (limited to 'net-proxy/c-icap')
-rw-r--r-- | net-proxy/c-icap/ChangeLog | 11 | ||||
-rw-r--r-- | net-proxy/c-icap/c-icap-0.1.3.ebuild | 100 | ||||
-rw-r--r-- | net-proxy/c-icap/files/c-icap-0.1.3-asneeded.patch | 24 | ||||
-rw-r--r-- | net-proxy/c-icap/files/c-icap-0.1.3-implicit.patch | 21 | ||||
-rw-r--r-- | net-proxy/c-icap/files/c-icap.init | 35 | ||||
-rw-r--r-- | net-proxy/c-icap/metadata.xml | 9 |
6 files changed, 200 insertions, 0 deletions
diff --git a/net-proxy/c-icap/ChangeLog b/net-proxy/c-icap/ChangeLog new file mode 100644 index 000000000000..c43c6ca1296c --- /dev/null +++ b/net-proxy/c-icap/ChangeLog @@ -0,0 +1,11 @@ +# ChangeLog for net-proxy/c-icap +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/c-icap/ChangeLog,v 1.1 2010/11/22 15:44:41 flameeyes Exp $ + +*c-icap-0.1.3 (22 Nov 2010) + + 22 Nov 2010; Diego E. Pettenò <flameeyes@gentoo.org> +c-icap-0.1.3.ebuild, + +files/c-icap-0.1.3-asneeded.patch, +files/c-icap-0.1.3-implicit.patch, + +files/c-icap.init, +metadata.xml: + Initial import of the c-icap server to be used with Squid and SquidClamav 6. + diff --git a/net-proxy/c-icap/c-icap-0.1.3.ebuild b/net-proxy/c-icap/c-icap-0.1.3.ebuild new file mode 100644 index 000000000000..f9b50e087807 --- /dev/null +++ b/net-proxy/c-icap/c-icap-0.1.3.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/c-icap/c-icap-0.1.3.ebuild,v 1.1 2010/11/22 15:44:41 flameeyes Exp $ + +EAPI=2 + +inherit eutils multilib autotools + +MY_PN=${PN/-/_} +MY_P=${MY_PN}-${PV} + +DESCRIPTION="C Implementation of an ICAP server" +HOMEPAGE="http://c-icap.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64" +IUSE="berkdb ldap ipv6 ldap" + +RDEPEND="berkdb? ( sys-libs/db ) + ldap? ( net-nds/openldap ) + sys-libs/zlib" +DEPEND="${RDEPEND}" + +S="${WORKDIR}/${MY_P}" + +src_prepare() { + epatch "${FILESDIR}/${P}-asneeded.patch" + epatch "${FILESDIR}/${P}-implicit.patch" + 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_compile() { + emake LOGDIR="/var/log" || die +} + +src_install() { + emake \ + LOGDIR="/var/log" \ + DESTDIR="${D}" install || die + + find "${D}" -name '*.la' -delete || die + + # Move the daemon out of the way + dodir /usr/libexec + mv "${D}"/usr/bin/c-icap "${D}"/usr/libexec || die + + # Remove the default configuration files since we have etc-update to + # take care of it for us. + rm "${D}"/etc/${PN}/c-icap.*.default || die + + # Fix the configuration file; for some reason it's a bit messy + # around. + sed -i \ + -e 's:/usr/var/:/var/:g' \ + -e 's:/var/log/:/var/log/c-icap/:g' \ + -e 's:/usr/etc/:/etc/c-icap/:g' \ + -e 's:/usr/local/c-icap/etc/:/etc/c-icap/:g' \ + -e 's:/usr/lib/:/usr/'$(get_libdir)'/:g' \ + "${D}"/etc/${PN}/c-icap.conf \ + || die + + dodoc AUTHORS README TODO ChangeLog || die + + newinitd "${FILESDIR}/${PN}.init" ${PN} || die + keepdir /var/log/c-icap || die +} + +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." +} diff --git a/net-proxy/c-icap/files/c-icap-0.1.3-asneeded.patch b/net-proxy/c-icap/files/c-icap-0.1.3-asneeded.patch new file mode 100644 index 000000000000..44adca98fa7f --- /dev/null +++ b/net-proxy/c-icap/files/c-icap-0.1.3-asneeded.patch @@ -0,0 +1,24 @@ +Index: c_icap-0.1.3/Makefile.am +=================================================================== +--- c_icap-0.1.3.orig/Makefile.am ++++ c_icap-0.1.3/Makefile.am +@@ -37,8 +37,8 @@ c_icap_SOURCES = aserver.c request.c cfg + # libicapapi ...... + libicapapi_la_CFLAGS= -Iinclude/ @ZLIB_ADD_FLAG@ -DCI_BUILD_LIB + +-libicapapi_la_LIBADD = @ZLIB_ADD_LDFLAG@ +-libicapapi_la_LDFLAGS= -shared -version-info @CICAPLIB_VERSION@ ++libicapapi_la_LIBADD = @ZLIB_ADD_LDFLAG@ @THREADS_LDADD@ @DL_ADD_FLAG@ ++libicapapi_la_LDFLAGS= -shared -version-info @CICAPLIB_VERSION@ @THREADS_LDFLAGS@ + + + #c_icap the main server +@@ -47,7 +47,7 @@ c_icap_CFLAGS= -Iinclude/ -DCONFDIR=\"$( + -DSERVDIR=\"$(SERVICESDIR)\" -DLOGDIR=\"$(LOGDIR)\" \ + -DDATADIR=\"$(DATADIR)\" + +-c_icap_LDADD = @THREADS_LDADD@ libicapapi.la @DL_ADD_FLAG@ ++c_icap_LDADD = libicapapi.la + c_icap_LDFLAGS = -rdynamic -rpath @libdir@ @THREADS_LDFLAGS@ + + diff --git a/net-proxy/c-icap/files/c-icap-0.1.3-implicit.patch b/net-proxy/c-icap/files/c-icap-0.1.3-implicit.patch new file mode 100644 index 000000000000..64c9eaddef2d --- /dev/null +++ b/net-proxy/c-icap/files/c-icap-0.1.3-implicit.patch @@ -0,0 +1,21 @@ +Index: c_icap-0.1.3/cfg_param.c +=================================================================== +--- c_icap-0.1.3.orig/cfg_param.c ++++ c_icap-0.1.3/cfg_param.c +@@ -30,6 +30,7 @@ + #include "cfg_param.h" + #include "commands.h" + #include "acl.h" ++#include "txtTemplate.h" + + #define LINESIZE 8192 + #define MAX_DIRECTIVE_SIZE 80 +@@ -870,6 +871,8 @@ void system_shutdown() + ci_txt_template_close(); + } + ++extern void reset_http_auth(); ++ + int system_reconfigure() + { + int old_port; diff --git a/net-proxy/c-icap/files/c-icap.init b/net-proxy/c-icap/files/c-icap.init new file mode 100644 index 000000000000..9b3623add2d4 --- /dev/null +++ b/net-proxy/c-icap/files/c-icap.init @@ -0,0 +1,35 @@ +#!/sbin/runscript +# Copyright 2010-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/c-icap/files/c-icap.init,v 1.1 2010/11/22 15:44:40 flameeyes Exp $ + +depend() { + need localmount net +} + +start() { + # Find the currently-configured pid file and command socket + pidfile=$(awk '$1 == "PidFile" { print $2 }' /etc/c-icap/c-icap.conf) + cmdsocket=$(awk '$1 == "CommandsSocket" { print $2 }' /etc/c-icap/c-icap.conf) + + if ! [ -d "$(dirname "${pidfile}")" ] || ! [ -d "$(dirname "${cmdsocket}")" ]; then + mkdir -p "$(dirname "${pidfile}")" "$(dirname "${cmdsocket}")" + fi + + ebegin "Starting c-icap daemon" + start-stop-daemon \ + --start --pidfile ${pidfile} \ + --exec /usr/libexec/c-icap -- ${EXTRA_OPTS} + eend $? +} + +stop() { + # Find the currently-configured pid file + pidfile=$(awk '$1 == "PidFile" { print $2 }' /etc/c-icap/c-icap.conf) + + ebegin "Stopping c-icap daemon" + start-stop-daemon \ + --stop --pidfile ${pidfile} \ + --exec /usr/libexec/c-icap + eend $? +} diff --git a/net-proxy/c-icap/metadata.xml b/net-proxy/c-icap/metadata.xml new file mode 100644 index 000000000000..eb2f0eae9292 --- /dev/null +++ b/net-proxy/c-icap/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>flameeyes@gentoo.org</email> + <description>Co-maintainer, not trying to call for exclusive</description> + </maintainer> + <herd>net-proxy</herd> +</pkgmetadata> |