diff --git a/www/c-icap/Makefile b/www/c-icap/Makefile new file mode 100644 index 00000000000..e9e13d414ca --- /dev/null +++ b/www/c-icap/Makefile @@ -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 diff --git a/www/c-icap/Makefile.inc b/www/c-icap/Makefile.inc new file mode 100644 index 00000000000..59c9072f245 --- /dev/null +++ b/www/c-icap/Makefile.inc @@ -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 + +# 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 diff --git a/www/c-icap/c-icap/Makefile b/www/c-icap/c-icap/Makefile new file mode 100644 index 00000000000..3c6ee3939ef --- /dev/null +++ b/www/c-icap/c-icap/Makefile @@ -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 diff --git a/www/c-icap/c-icap/distinfo b/www/c-icap/c-icap/distinfo new file mode 100644 index 00000000000..8130643639b --- /dev/null +++ b/www/c-icap/c-icap/distinfo @@ -0,0 +1,2 @@ +SHA256 (c_icap-0.2.5.tar.gz) = El8AL24rxwwdB7K0SuDRfug7l2D0y+NSeGXe7Nr4d7g= +SIZE (c_icap-0.2.5.tar.gz) = 582223 diff --git a/www/c-icap/c-icap/patches/patch-c-icap_conf_in b/www/c-icap/c-icap/patches/patch-c-icap_conf_in new file mode 100644 index 00000000000..5c0a76a2fea --- /dev/null +++ b/www/c-icap/c-icap/patches/patch-c-icap_conf_in @@ -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 diff --git a/www/c-icap/c-icap/patches/patch-cfg_param_c b/www/c-icap/c-icap/patches/patch-cfg_param_c new file mode 100644 index 00000000000..8390ff8e53b --- /dev/null +++ b/www/c-icap/c-icap/patches/patch-cfg_param_c @@ -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 */ diff --git a/www/c-icap/c-icap/patches/patch-docs_man_c-icap_8_in b/www/c-icap/c-icap/patches/patch-docs_man_c-icap_8_in new file mode 100644 index 00000000000..ba156f4d5bf --- /dev/null +++ b/www/c-icap/c-icap/patches/patch-docs_man_c-icap_8_in @@ -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. diff --git a/www/c-icap/c-icap/pkg/DESCR-db b/www/c-icap/c-icap/pkg/DESCR-db new file mode 100644 index 00000000000..30ac5283753 --- /dev/null +++ b/www/c-icap/c-icap/pkg/DESCR-db @@ -0,0 +1 @@ +Berkeley DB support for c-icap. diff --git a/www/c-icap/c-icap/pkg/DESCR-ldap b/www/c-icap/c-icap/pkg/DESCR-ldap new file mode 100644 index 00000000000..73b8240ed3a --- /dev/null +++ b/www/c-icap/c-icap/pkg/DESCR-ldap @@ -0,0 +1 @@ +LDAP support for c-icap. diff --git a/www/c-icap/c-icap/pkg/DESCR-main b/www/c-icap/c-icap/pkg/DESCR-main new file mode 100644 index 00000000000..4efa90a91bc --- /dev/null +++ b/www/c-icap/c-icap/pkg/DESCR-main @@ -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. diff --git a/www/c-icap/c-icap/pkg/PLIST-db b/www/c-icap/c-icap/pkg/PLIST-db new file mode 100644 index 00000000000..0b7e46b1840 --- /dev/null +++ b/www/c-icap/c-icap/pkg/PLIST-db @@ -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 diff --git a/www/c-icap/c-icap/pkg/PLIST-ldap b/www/c-icap/c-icap/pkg/PLIST-ldap new file mode 100644 index 00000000000..baaba2cc3ac --- /dev/null +++ b/www/c-icap/c-icap/pkg/PLIST-ldap @@ -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 diff --git a/www/c-icap/c-icap/pkg/PLIST-main b/www/c-icap/c-icap/pkg/PLIST-main new file mode 100644 index 00000000000..5fb226f6d44 --- /dev/null +++ b/www/c-icap/c-icap/pkg/PLIST-main @@ -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 diff --git a/www/c-icap/c-icap/pkg/c_icap.rc b/www/c-icap/c-icap/pkg/c_icap.rc new file mode 100644 index 00000000000..41a37579757 --- /dev/null +++ b/www/c-icap/c-icap/pkg/c_icap.rc @@ -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 diff --git a/www/c-icap/modules/Makefile b/www/c-icap/modules/Makefile new file mode 100644 index 00000000000..c802853f920 --- /dev/null +++ b/www/c-icap/modules/Makefile @@ -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 diff --git a/www/c-icap/modules/distinfo b/www/c-icap/modules/distinfo new file mode 100644 index 00000000000..59a608b7bcc --- /dev/null +++ b/www/c-icap/modules/distinfo @@ -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 diff --git a/www/c-icap/modules/patches/patch-services_virus_scan_clamav_support_c b/www/c-icap/modules/patches/patch-services_virus_scan_clamav_support_c new file mode 100644 index 00000000000..0094abd1c73 --- /dev/null +++ b/www/c-icap/modules/patches/patch-services_virus_scan_clamav_support_c @@ -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 ++#include + #include + #include + #endif diff --git a/www/c-icap/modules/patches/patch-services_virus_scan_virus_scan_conf b/www/c-icap/modules/patches/patch-services_virus_scan_virus_scan_conf new file mode 100644 index 00000000000..f0f21d91396 --- /dev/null +++ b/www/c-icap/modules/patches/patch-services_virus_scan_virus_scan_conf @@ -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 diff --git a/www/c-icap/modules/pkg/DESCR-main b/www/c-icap/modules/pkg/DESCR-main new file mode 100644 index 00000000000..6bff828c1c0 --- /dev/null +++ b/www/c-icap/modules/pkg/DESCR-main @@ -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. diff --git a/www/c-icap/modules/pkg/DESCR-urlcheck b/www/c-icap/modules/pkg/DESCR-urlcheck new file mode 100644 index 00000000000..821cfb86d01 --- /dev/null +++ b/www/c-icap/modules/pkg/DESCR-urlcheck @@ -0,0 +1 @@ +Basic URL filtering service for c-icap. diff --git a/www/c-icap/modules/pkg/PLIST-main b/www/c-icap/modules/pkg/PLIST-main new file mode 100644 index 00000000000..c5b138992a1 --- /dev/null +++ b/www/c-icap/modules/pkg/PLIST-main @@ -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 diff --git a/www/c-icap/modules/pkg/PLIST-urlcheck b/www/c-icap/modules/pkg/PLIST-urlcheck new file mode 100644 index 00000000000..ebb50d1f305 --- /dev/null +++ b/www/c-icap/modules/pkg/PLIST-urlcheck @@ -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