import c-icap, ok benoit@

c-icap is an implementation of an ICAP server. It can be used with HTTP
proxies that support the ICAP protocol to implement content adaptation
and filtering services. Squid 3.x and most commercial HTTP proxies
support the ICAP protocol.
This commit is contained in:
sthen 2013-04-16 09:59:35 +00:00
parent 5f69c88792
commit e297eb4781
22 changed files with 378 additions and 0 deletions

8
www/c-icap/Makefile Normal file
View File

@ -0,0 +1,8 @@
# $OpenBSD: Makefile,v 1.1.1.1 2013/04/16 09:59:35 sthen Exp $
SUBDIR =
SUBDIR += c-icap
SUBDIR += modules
SUBDIR += squidclamav
.include <bsd.port.subdir.mk>

26
www/c-icap/Makefile.inc Normal file
View File

@ -0,0 +1,26 @@
# $OpenBSD: Makefile.inc,v 1.1.1.1 2013/04/16 09:59:35 sthen Exp $
SHARED_ONLY?= Yes
CATEGORIES+= www
HOMEPAGE?= http://c-icap.sourceforge.net/
MAINTAINER?= Stuart Henderson <sthen@openbsd.org>
# LGPLv2.1+
PERMIT_PACKAGE_CDROM?= Yes
PERMIT_PACKAGE_FTP?= Yes
PERMIT_DISTFILES_CDROM?= Yes
PERMIT_DISTFILES_FTP?= Yes
MASTER_SITES?= ${MASTER_SITE_SOURCEFORGE:=c-icap/}
CONFIGURE_STYLE?= gnu
USE_LIBTOOL= Yes
LIBTOOL_FLAGS= --tag=disable-static
SYSCONFDIR= ${BASESYSCONFDIR}/c-icap
post-install:
rm ${PREFIX}/lib/c_icap/*.la

View File

@ -0,0 +1,44 @@
# $OpenBSD: Makefile,v 1.1.1.1 2013/04/16 09:59:35 sthen Exp $
MULTI_PACKAGES= -main -db -ldap
COMMENT-main= ICAP server for use with web proxies
COMMENT-db= Berkeley DB module for c-icap
COMMENT-ldap= LDAP module for c-icap
V= 0.2.5
DISTNAME= c_icap-$V
PKGNAME-main= c-icap-$V
PKGNAME-db= c-icap-db-$V
PKGNAME-ldap= c-icap-ldap-$V
SHARED_LIBS += icapapi 0.0 # 2.5
WANTLIB += c pthread z
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include/db4 -I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
# ipv6 not yet supported in *BSD.
CONFIGURE_ARGS= --disable-ipv6 \
--enable-large-files
FAKE_FLAGS= CONFIGDIR=${PREFIX}/share/examples/c-icap
.for i in ${MULTI_PACKAGES:N-main}
RUN_DEPENDS$i = ${BASE_PKGPATH}
.endfor
LIB_DEPENDS-db= databases/db/v4
WANTLIB-db= ${WANTLIB} db icapapi
LIB_DEPENDS-ldap= databases/openldap \
${BASE_PKGPATH}
WANTLIB-ldap= asn1 com_err crypto gssapi icapapi krb5 ssl
WANTLIB-ldap+= lber-2.4 ldap-2.4 pthread sasl2 z
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/c-icap/
${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/c-icap/
rm -f ${PREFIX}/lib/c_icap/*.la
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (c_icap-0.2.5.tar.gz) = El8AL24rxwwdB7K0SuDRfug7l2D0y+NSeGXe7Nr4d7g=
SIZE (c_icap-0.2.5.tar.gz) = 582223

View File

@ -0,0 +1,57 @@
$OpenBSD: patch-c-icap_conf_in,v 1.1.1.1 2013/04/16 09:59:35 sthen Exp $
--- c-icap.conf.in.orig Tue Oct 9 12:35:38 2012
+++ c-icap.conf.in Tue Mar 26 23:30:13 2013
@@ -222,7 +222,7 @@ TemplateDefaultLanguage en
# It can be used more than once to use multiple magic files.
# Default:
# LoadMagicFile @prefix@/etc/c-icap.magic
-LoadMagicFile @prefix@/etc/c-icap.magic
+LoadMagicFile @sysconfdir@/c-icap.magic
# TAG: RemoteProxyUsers
# Format: RemoteProxyUsers onoff
@@ -289,7 +289,7 @@ RemoteProxyUserHeaderEncoded on
# Default:
# No value
# Example:
-# basic_simple_db.UsersDB hash:/usr/local/c-icap/etc/c-icap-users.txt
+# basic_simple_db.UsersDB hash:@sysconfdir@/c-icap-users.txt
# TAG: GroupSourceByGroup
# Format: GroupSourceByGroup LookupTable
@@ -301,7 +301,7 @@ RemoteProxyUserHeaderEncoded on
# Default:
# No set
# Example:
-# GroupSourceByGroup hash:/usr/local/c-icap/etc/c-icap-groups.txt
+# GroupSourceByGroup hash:@sysconfdir@/c-icap-groups.txt
# TAG: GroupSourceByUser
# Format: GroupSourceByUser LookupTable
@@ -313,7 +313,7 @@ RemoteProxyUserHeaderEncoded on
# Default:
# No set
# Example:
-# GroupSourceByUser hash:/usr/local/c-icap/etc/c-icap-user-groups.txt
+# GroupSourceByUser hash:@sysconfdir@/c-icap-user-groups.txt
# TAG: acl
# Format: acl name type[{param}] value1 [value2] [...]
@@ -447,7 +447,7 @@ RemoteProxyUserHeaderEncoded on
# information about the c-icap server.
# Default:
# ServerLog @prefix@/var/log/server.log
-ServerLog @prefix@/var/log/server.log
+ServerLog /var/log/c-icap/server.log
# TAG: AccessLog
# Format: AccessLog LogFile [LogFormat] [[!]acl1] [[!]acl2] [...]
@@ -462,7 +462,7 @@ ServerLog @prefix@/var/log/server.log
# AccessLog @prefix@/var/log/access.log
# Example:
# AccessLog @prefix@/var/log/access.log MyFormat all
-AccessLog @prefix@/var/log/access.log
+AccessLog /var/log/c-icap/access.log
# TAG: Logger
# Format: Logger LoggerName

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-cfg_param_c,v 1.1.1.1 2013/04/16 09:59:35 sthen Exp $
--- cfg_param.c.orig Fri Mar 8 02:53:48 2013
+++ cfg_param.c Fri Mar 8 02:53:51 2013
@@ -45,8 +45,8 @@ struct ci_server_conf CONF = {
#else
"/var/tmp/", /*TMPDIR*/ "/var/run/c-icap/c-icap.pid", /*PIDFILE*/ "/var/run/c-icap/c-icap.ctl", /*COMMANDS_SOCKET; */
#endif
- NULL, /* RUN_USER */
- NULL, /* RUN_GROUP */
+ "_c-icap", /* RUN_USER */
+ "_c-icap", /* RUN_GROUP */
#ifdef _WIN32
CONFDIR "\\c-icap.conf", /*cfg_file */
CONFDIR "\\c-icap.magic", /*magics_file */

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-docs_man_c-icap_8_in,v 1.1.1.1 2013/04/16 09:59:35 sthen Exp $
--- docs/man/c-icap.8.in.orig Wed Apr 10 14:44:52 2013
+++ docs/man/c-icap.8.in Wed Apr 10 14:45:44 2013
@@ -36,11 +36,11 @@ The main configuration file
.RS
In this file defined the types of files and the groups of file types.
.RE
-.I /var/run/c-icap.pid
+.I /var/run/c-icap/c-icap.pid
.RS
By default c-icap writes its pid in this file. The path of this file can changed using the PidFile configuration parameter in the c-icap.conf file
.RE
-.I /var/run/c-icap.ctl
+.I /var/run/c-icap/c-icap.ctl
.RS
The commands socket. This file used to send commands to the icap server from command line. For informations about implemented commands look below in the "Implemented commands" sub-section
.SH NOTES
@@ -65,10 +65,10 @@ Services and modules can define their own commands.
.PP
\fBExamples:\fR
.IP "To reconfigure c-icap:"
- echo -n "reconfigure" > /var/run/c-icap.ctl
+ echo -n "reconfigure" > /var/run/c-icap/c-icap.ctl
.IP "To rotate access log:"
mv /var/log/c-icap/access.log /var/log/c-icap/access.log.1
- echo -n "relog" > /var/run/c-icap.ctl
+ echo -n "relog" > /var/run/c-icap/c-icap.ctl
.RE
.SS Lookup tables
Lookup tables are simple read-only databases.

View File

@ -0,0 +1 @@
Berkeley DB support for c-icap.

View File

@ -0,0 +1 @@
LDAP support for c-icap.

View File

@ -0,0 +1,13 @@
c-icap is an implementation of an ICAP server. It can be used with HTTP
proxies that support the ICAP protocol to implement content adaptation
and filtering services. Squid 3.x and most commercial HTTP proxies
support the ICAP protocol.
Major features:
basic C API for developing custom content adaptation and filtering services
plugin interface
LDAP integration (in the c-icap-ldap package)
simple ICAP client API
See the c-icap-modules package for additional services using this.

View File

@ -0,0 +1,4 @@
@comment $OpenBSD: PLIST-db,v 1.1.1.1 2013/04/16 09:59:35 sthen Exp $
@bin bin/c-icap-mkbdb
lib/c_icap/bdb_tables.so
@man man/man8/c-icap-mkbdb.8

View File

@ -0,0 +1,2 @@
@comment $OpenBSD: PLIST-ldap,v 1.1.1.1 2013/04/16 09:59:35 sthen Exp $
lib/c_icap/ldap_module.so

View File

@ -0,0 +1,69 @@
@comment $OpenBSD: PLIST-main,v 1.1.1.1 2013/04/16 09:59:35 sthen Exp $
@newgroup _c-icap:716
@newuser _c-icap:716:_c-icap:daemon:c-icap user:/nonexistent:/sbin/nologin
@extraunexec rm -rf /var/log/c-icap/*
@extraunexec rm -rf /var/run/c-icap/*
@bin bin/c-icap
@bin bin/c-icap-client
bin/c-icap-config
bin/c-icap-libicapapi-config
@bin bin/c-icap-stretch
include/c_icap/
include/c_icap/access.h
include/c_icap/acl.h
include/c_icap/array.h
include/c_icap/body.h
include/c_icap/c-icap-conf.h
include/c_icap/c-icap.h
include/c_icap/cache.h
include/c_icap/cfg_param.h
include/c_icap/ci_threads.h
include/c_icap/commands.h
include/c_icap/debug.h
include/c_icap/dlib.h
include/c_icap/filetype.h
include/c_icap/hash.h
include/c_icap/header.h
include/c_icap/log.h
include/c_icap/lookup_table.h
include/c_icap/mem.h
include/c_icap/module.h
include/c_icap/net_io.h
include/c_icap/proc_mutex.h
include/c_icap/proc_threads_queues.h
include/c_icap/request.h
include/c_icap/service.h
include/c_icap/shared_mem.h
include/c_icap/simple_api.h
include/c_icap/stats.h
include/c_icap/txtTemplate.h
include/c_icap/txt_format.h
include/c_icap/types_ops.h
include/c_icap/util.h
lib/c_icap/
lib/c_icap/dnsbl_tables.so
lib/c_icap/srv_echo.so
lib/c_icap/srv_ex206.so
lib/c_icap/sys_logger.so
lib/libicapapi.la
@lib lib/libicapapi.so.${LIBicapapi_VERSION}
@man man/man8/c-icap-client.8
@man man/man8/c-icap-config.8
@man man/man8/c-icap-libicapapi-config.8
@man man/man8/c-icap-stretch.8
@man man/man8/c-icap.8
share/doc/c-icap/
share/doc/c-icap/README
share/examples/c-icap/
@sample ${SYSCONFDIR}/
share/examples/c-icap/c-icap.conf
@sample ${SYSCONFDIR}/c-icap.conf
@comment share/examples/c-icap/c-icap.conf.default
share/examples/c-icap/c-icap.magic
@sample ${SYSCONFDIR}/c-icap.magic
@owner _c-icap
@sample /var/log/c-icap/
@sample /var/run/c-icap/
@comment share/examples/c-icap/c-icap.magic.default
@owner
@rcscript ${RCDIR}/c_icap

View File

@ -0,0 +1,13 @@
#!/bin/sh
#
# $OpenBSD: c_icap.rc,v 1.1.1.1 2013/04/16 09:59:35 sthen Exp $
daemon="${TRUEPREFIX}/bin/c-icap"
. /etc/rc.d/rc.subr
rc_pre() {
install -d -o _c-icap /var/run/c-icap
}
rc_cmd $1

View File

@ -0,0 +1,40 @@
# $OpenBSD: Makefile,v 1.1.1.1 2013/04/16 09:59:35 sthen Exp $
MULTI_PACKAGES= -main -urlcheck
COMMENT-main= libclamav-based virus scanner for c-icap
COMMENT-urlcheck= basic URL filtering service for c-icap
V= 0.2.4
DISTNAME= c_icap_modules-$V
PKGNAME-main= c-icap-clamav-$V
PKGNAME-urlcheck= c-icap-urlcheck-$V
CONFIGURE_STYLE= gnu
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include/db4 -I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
CONFIGURE_ARGS= --with-c-icap=${LOCALBASE}
FAKE_FLAGS= CONFIGDIR=${PREFIX}/share/examples/c-icap
.for i in ${MULTI_PACKAGES}
RUN_DEPENDS$i = www/c-icap/c-icap
.endfor
MODULES= converters/libiconv
WANTLIB= pthread z
LIB_DEPENDS-main= security/clamav
WANTLIB-main= bz2 clamav ltdl m pthread z ${WANTLIB}
LIB_DEPENDS-urlcheck= databases/db/v4 \
www/c-icap/c-icap
WANTLIB-urlcheck= c db icapapi pthread z
pre-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/c-icap/
post-install:
rm ${PREFIX}/lib/c_icap/*.la
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (c_icap_modules-0.2.4.tar.gz) = YxCN+8Nq+fRM++BztCSNNo62TJ02Eq6rDUYXG+XBVxM=
SIZE (c_icap_modules-0.2.4.tar.gz) = 373120

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-services_virus_scan_clamav_support_c,v 1.1.1.1 2013/04/16 09:59:35 sthen Exp $
--- services/virus_scan/clamav_support.c.orig Fri Mar 8 02:21:38 2013
+++ services/virus_scan/clamav_support.c Fri Mar 8 02:21:26 2013
@@ -26,6 +26,7 @@
#ifdef HAVE_FD_PASSING
#include <sys/socket.h>
+#include <sys/uio.h>
#include <sys/un.h>
#include <errno.h>
#endif

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-services_virus_scan_virus_scan_conf,v 1.1.1.1 2013/04/16 09:59:35 sthen Exp $
--- services/virus_scan/virus_scan.conf.orig Mon Apr 8 22:43:53 2013
+++ services/virus_scan/virus_scan.conf Mon Apr 8 22:44:50 2013
@@ -121,6 +121,8 @@ virus_scan.MaxObjectSize 5M
# Default:
# virus_scan.UseClamd off
virus_scan.UseClamd off
+# "off" uses libclamav rather than passing the file to clamd.
+# "on" is not supported with current clamd versions.
# TAG: virus_scan.ClamdSocket
# Format: virus_scan.ClamdSocket path

View File

@ -0,0 +1,2 @@
ClamAV-based virus scanner for c-icap. This uses libclamav to scan;
for an alternative using clamd, see the squidclamav package.

View File

@ -0,0 +1 @@
Basic URL filtering service for c-icap.

View File

@ -0,0 +1,14 @@
@comment $OpenBSD: PLIST-main,v 1.1.1.1 2013/04/16 09:59:35 sthen Exp $
lib/c_icap/virus_scan.so
share/c_icap/
share/c_icap/templates/
share/c_icap/templates/virus_scan/
share/c_icap/templates/virus_scan/en/
share/c_icap/templates/virus_scan/en/VIRUS_FOUND
share/c_icap/templates/virus_scan/en/VIR_MODE_HEAD
share/c_icap/templates/virus_scan/en/VIR_MODE_PROGRESS
share/c_icap/templates/virus_scan/en/VIR_MODE_TAIL
share/c_icap/templates/virus_scan/en/VIR_MODE_VIRUS_FOUND
share/examples/c-icap/virus_scan.conf
@sample ${SYSCONFDIR}/virus_scan.conf
@comment share/examples/c-icap/virus_scan.conf.default

View File

@ -0,0 +1,12 @@
@comment $OpenBSD: PLIST-urlcheck,v 1.1.1.1 2013/04/16 09:59:35 sthen Exp $
@bin bin/c-icap-mods-sguardDB
lib/c_icap/srv_url_check.so
@man man/man8/c-icap-mods-sguardDB.8
share/c_icap/
share/c_icap/templates/
share/c_icap/templates/srv_url_check/
share/c_icap/templates/srv_url_check/en/
share/c_icap/templates/srv_url_check/en/DENY
share/examples/c-icap/srv_url_check.conf
@sample ${SYSCONFDIR}/srv_url_check.conf
@comment share/examples/c-icap/srv_url_check.conf.default