1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00

- Update to 060708

PR:		ports/130633
Submitted by:	Vladimir Kondratiev <wulf@mail.mipt.ru>
Approved by:	Tofig Suleymanov <tofig@freebsd.az> (maintainer)
This commit is contained in:
Pav Lucistnik 2009-03-26 13:59:35 +00:00
parent 2224ba3107
commit 91215539c1
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=231065
11 changed files with 75 additions and 253 deletions

View File

@ -6,14 +6,12 @@
#
PORTNAME= c-icap
PORTVERSION= 030606
PORTREVISION= 5
PORTVERSION= 060708
PORTEPOCH= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \
http://bio3k.softboard.ru/uploads/arch/
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
DISTNAME= c_icap-${PORTVERSION}rc1
DISTNAME= c_icap-${PORTVERSION}
MAINTAINER= tofig@freebsd.az
COMMENT= An implementation of an ICAP server
@ -28,14 +26,11 @@ SUB_FILES= pkg-install pkg-deinstall
OPTIONS= CLAMAV "Build with srv_clamav service" on \
LARGE_FILES "Enable large files support" off \
IPV6 "Enable IPv6 support" off
# PERL "With Perl support" off
IPV6 "Enable IPv6 support" off \
PERL "With Perl support" off
.include <bsd.port.pre.mk>
# Perl support not ready yet. Try to contact author or hack it by yourself.
WITHOUT_PERL= yes
LOG_DIR= /var/log/c_icap
TMP_DIR= /var/tmp
RUN_DIR= /var/run
@ -76,29 +71,24 @@ CONFIGURE_ARGS+= --enable-ipv6
CONFIGURE_ARGS+= --disable-ipv6
.endif
post-extract:
@${MV} ${WRKSRC}/c-icap.conf ${WRKSRC}/c-icap.conf.default
@${MV} ${WRKSRC}/c-icap.conf.in ${WRKSRC}/c-icap.conf.default.in
@${MV} ${WRKSRC}/c-icap.magic ${WRKSRC}/c-icap.magic.default
post-patch:
@${REINPLACE_CMD} -e 's|User wwwrun|User cicap|g' \
-e 's|Group nobody|Group cicap|g' \
-e 's|/var/run|${RUN_DIR}|g' \
-e 's|/var/tmp|${TMP_DIR}|g' \
-e 's|/var/log/c_icap|${LOG_DIR}|g' \
${WRKSRC}/c-icap.conf.default ${WRKSRC}/c-icap.conf.default.in
${WRKSRC}/c-icap.conf ${WRKSRC}/c-icap.conf.in
@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' \
-e 's|icap_stretch_CFLAGS = -Iinclude/|icap_stretch_CFLAGS = -Iinclude/ ${PTHREAD_CFLAGS}|g' \
${WRKSRC}/Makefile.in ${WRKSRC}/Makefile.am
.if !defined(WITH_PERL)
@${REINPLACE_CMD} -e 's|\(^Module perl\)|\#\1|g' \
${WRKSRC}/c-icap.conf.default.in
${WRKSRC}/c-icap.conf.in
.endif
.if !defined(WITH_CLAMAV)
@${REINPLACE_CMD} -e 's|\(^Service antivirus\)|\#\1|g' \
-e 's|\(^srv_clamav\)|\#\1|g' \
${WRKSRC}/c-icap.conf.default.in
${WRKSRC}/c-icap.conf.in
.endif
pre-install:

View File

@ -1,3 +1,3 @@
MD5 (c_icap-030606rc1.tar.gz) = 4e851db7fb03570b2420cf8a78b48223
SHA256 (c_icap-030606rc1.tar.gz) = bcf7e3fa6461cdcba66b61e035ab00a41a3652b3c4a46025a36a1e625c991471
SIZE (c_icap-030606rc1.tar.gz) = 413570
MD5 (c_icap-060708.tar.gz) = 3f66d0647a9f8494b341e275f23cb194
SHA256 (c_icap-060708.tar.gz) = 45348651329ef31770cbcd259187acca5fb22bd9c40f472e460edbb11192b7e0
SIZE (c_icap-060708.tar.gz) = 481338

View File

@ -1,67 +1,17 @@
--- Makefile.in.bak Sat Jun 10 17:27:22 2006
+++ Makefile.in Sat Jun 10 17:31:14 2006
@@ -44,7 +44,7 @@
icap-stretch$(EXEEXT)
DIST_COMMON = README $(am__configure_deps) $(pkginclude_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/c-icap.conf.in $(srcdir)/config.h.in \
+ $(srcdir)/c-icap.conf.default.in $(srcdir)/config.h.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
TODO compile config.guess config.sub depcomp install-sh \
ltmain.sh missing
@@ -57,7 +57,7 @@
configure.lineno configure.status.lineno
mkinstalldirs = $(mkdir_p)
CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = c-icap.conf
+CONFIG_CLEAN_FILES = c-icap.conf.default
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sysconfdir)" "$(DESTDIR)$(pkgincludedir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
@@ -321,8 +321,8 @@
ALL_INCS = $(INCS:%.h=include/%.h)
pkginclude_HEADERS = $(ALL_INCS)
-sysconf_DATA = c-icap.conf c-icap.magic
-EXTRA_DIST = RECONF INSTALL.txt config-w32.h makefile.w32 c-icap.conf c_icap_dll.mak c-icap.conf.in c-icap.magic c_icap.mak c_icap.def \
+sysconf_DATA = c-icap.conf.default c-icap.magic.default
+EXTRA_DIST = RECONF INSTALL.txt config-w32.h makefile.w32 c-icap.conf.default c_icap_dll.mak c-icap.conf.default.in c-icap.magic.default c_icap.mak c_icap.def \
contrib/get_file.pl contrib/convert_old_magic.pl \
winnt_server.c os/win32/dll_entry.c os/win32/makefile.w32 os/win32/net_io.c os/win32/proc_mutex.c\
os/win32/shared_mem.c os/win32/threads.c os/win32/utilfunc.c
@@ -382,7 +382,7 @@
distclean-hdr:
-rm -f config.h stamp-h1
-c-icap.conf: $(top_builddir)/config.status $(srcdir)/c-icap.conf.in
+c-icap.conf.default: $(top_builddir)/config.status $(srcdir)/c-icap.conf.default.in
cd $(top_builddir) && $(SHELL) ./config.status $@
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
@@ -1518,7 +1518,7 @@
info-am:
-install-data-am: install-data-local install-pkgincludeHEADERS
+install-data-am: install-pkgincludeHEADERS
install-exec-am: install-binPROGRAMS install-libLTLIBRARIES \
install-sysconfDATA
@@ -1564,7 +1564,7 @@
distclean-recursive distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-binPROGRAMS install-data \
- install-data-am install-data-local install-exec \
+ install-data-am install-exec \
install-exec-am install-info install-info-am \
install-libLTLIBRARIES install-man install-pkgincludeHEADERS \
install-strip install-sysconfDATA installcheck installcheck-am \
@@ -1578,8 +1578,6 @@
uninstall-sysconfDATA
-install-data-local:
- $(mkinstalldirs) $(LOGDIR); chgrp nobody $(LOGDIR);chmod 775 $(LOGDIR)
--- Makefile.in.bak 2008-07-07 00:31:50.000000000 +0400
+++ Makefile.in 2009-01-15 23:15:56.000000000 +0300
@@ -1302,14 +1302,6 @@
$(mkinstalldirs) $(DESTDIR)$(CONFIGDIR);
$(INSTALL) c-icap.conf $(DESTDIR)$(CONFIGDIR)/c-icap.conf.default
$(INSTALL) c-icap.magic $(DESTDIR)$(CONFIGDIR)/c-icap.magic.default
- if test ! -f $(DESTDIR)$(CONFIGDIR)/c-icap.conf; then $(INSTALL) c-icap.conf $(DESTDIR)$(CONFIGDIR)/c-icap.conf; fi
- if test ! -f $(DESTDIR)$(CONFIGDIR)/c-icap.magic; then $(INSTALL) c-icap.magic $(DESTDIR)$(CONFIGDIR)/c-icap.magic; fi
- $(mkinstalldirs) $(DESTDIR)$(LOGDIR);
- $(mkinstalldirs) $(DESTDIR)$(SOCKDIR);
- chgrp nobody $(DESTDIR)$(LOGDIR)
- chmod 775 $(DESTDIR)$(LOGDIR)
- chgrp nobody $(DESTDIR)$(SOCKDIR)
- chmod 775 $(DESTDIR)$(SOCKDIR)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,5 +1,5 @@
--- c-icap.conf.default.in.bak Wed Mar 29 08:24:29 2006
+++ c-icap.conf.default.in Wed Mar 29 08:25:58 2006
--- c-icap.conf.in.bak Wed Mar 29 08:24:29 2006
+++ c-icap.conf.in Wed Mar 29 08:25:58 2006
@@ -28,8 +28,8 @@
TmpDir /var/tmp
MaxMemObject 131072

View File

@ -1,41 +1,32 @@
--- configure.bak Mon Jun 12 22:20:15 2006
+++ configure Thu Jun 15 15:34:49 2006
@@ -19441,7 +19441,7 @@
--- configure.orig Mon Jul 7 00:22:15 2008
+++ configure Tue Nov 18 21:51:12 2008
@@ -20258,7 +20258,7 @@
THREADS_LDADD="-lpthread"
THREADS_LDFLAGS=""
;;
- freebsd5.*)
+ freebsd4.*)
- freebsd5*)
+ freebsd[45]*)
## If I understand how all those threading models works correctly
## in FreeBSD I will make an option in configure script
## --with-freebsd-threads={c_r,pthreads,linuxthreads,thr}
@@ -19454,9 +19454,9 @@
# THREADS_LDADD="-llthread -lgcc_r"
# THREADS_LDFLAGS="-L/usr/local/lib"
@@ -20273,7 +20273,7 @@
-## FreeBSD Standard threads
+## FreeBSD 4.x Standard threads
## FreeBSD Standard threads
CFLAGS="-pthread -D_THREAD_SAFE $CFLAGS"
- THREADS_LDADD="-XCClinker -lc_r"
+ THREADS_LDADD="-lc_r"
THREADS_LDFLAGS=""
## FreeBSD has pthreads rwlocks from version 3 (I think)
# AC_DEFINE(HAVE_PTHREADS_RWLOCK,1,[Define HAVE_PTHREADS_RWLOCK if pthreads library supports rwlocks])
@@ -20284,9 +20284,9 @@
## 1:1 threads
@@ -21574,7 +21574,7 @@
fi
;;
- freebsd6*)
+ freebsd*)
CFLAGS="-D_THREAD_SAFE $CFLAGS"
- THREADS_LDADD="-XCClinker -lthr"
+ THREADS_LDADD="-lthr"
THREADS_LDFLAGS=""
;;
- ac_config_files="$ac_config_files Makefile c-icap.conf services/Makefile services/echo/Makefile services/url_check/Makefile services/clamav/Makefile modules/Makefile"
+ ac_config_files="$ac_config_files Makefile c-icap.conf.default services/Makefile services/echo/Makefile services/url_check/Makefile services/clamav/Makefile modules/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -22160,7 +22160,7 @@
case "$ac_config_target" in
# Handling of arguments.
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "c-icap.conf" ) CONFIG_FILES="$CONFIG_FILES c-icap.conf" ;;
+ "c-icap.conf.default" ) CONFIG_FILES="$CONFIG_FILES c-icap.conf.default" ;;
"services/Makefile" ) CONFIG_FILES="$CONFIG_FILES services/Makefile" ;;
"services/echo/Makefile" ) CONFIG_FILES="$CONFIG_FILES services/echo/Makefile" ;;
"services/url_check/Makefile" ) CONFIG_FILES="$CONFIG_FILES services/url_check/Makefile" ;;

View File

@ -1,29 +1,32 @@
--- configure.in.bak Mon Jun 12 22:19:56 2006
+++ configure.in Thu Jun 15 15:35:07 2006
@@ -51,7 +51,7 @@
--- configure.in.orig Mon Jul 7 00:21:51 2008
+++ configure.in Tue Nov 18 21:50:26 2008
@@ -52,7 +52,7 @@
THREADS_LDADD="-lpthread"
THREADS_LDFLAGS=""
;;
- freebsd5.*)
+ freebsd4.*)
- freebsd5*)
+ freebsd[[45]]*)
## If I understand how all those threading models works correctly
## in FreeBSD I will make an option in configure script
## --with-freebsd-threads={c_r,pthreads,linuxthreads,thr}
@@ -64,9 +64,9 @@
# THREADS_LDADD="-llthread -lgcc_r"
# THREADS_LDFLAGS="-L/usr/local/lib"
@@ -67,7 +67,7 @@
-## FreeBSD Standard threads
+## FreeBSD 4.x Standard threads
## FreeBSD Standard threads
CFLAGS="-pthread -D_THREAD_SAFE $CFLAGS"
- THREADS_LDADD="-XCClinker -lc_r"
+ THREADS_LDADD="-lc_r"
THREADS_LDFLAGS=""
## FreeBSD has pthreads rwlocks from version 3 (I think)
# AC_DEFINE(HAVE_PTHREADS_RWLOCK,1,[Define HAVE_PTHREADS_RWLOCK if pthreads library supports rwlocks])
@@ -78,9 +78,9 @@
## 1:1 threads
@@ -328,4 +328,4 @@
AM_CONDITIONAL(USEPERL,[test a"$perlcore" != a])
AM_CONDITIONAL(USECLAMAV,[test a"$clamav" != ano])
;;
- freebsd6*)
+ freebsd*)
CFLAGS="-D_THREAD_SAFE $CFLAGS"
- THREADS_LDADD="-XCClinker -lthr"
+ THREADS_LDADD="-lthr"
THREADS_LDFLAGS=""
;;
-AC_OUTPUT([Makefile c-icap.conf services/Makefile services/echo/Makefile services/url_check/Makefile services/clamav/Makefile modules/Makefile])
+AC_OUTPUT([Makefile c-icap.conf.default services/Makefile services/echo/Makefile services/sguard/Makefile services/clamav/Makefile modules/Makefile])

View File

@ -1,75 +0,0 @@
--- filetype.bak.c Sat May 13 22:51:32 2006
+++ filetype.c Thu Aug 3 09:23:35 2006
@@ -66,8 +66,9 @@
}
#define CHECK_SIZE(db,array,type,size) if(db->array##_num >= db->array##_size){\
- if((newdata=realloc(db->array,db->array##_size+size*sizeof(type)))==NULL)\
+ if((newdata=realloc(db->array,(db->array##_size+size)*sizeof(type)))==NULL)\
return -1;\
+ db->array##_size +=size; \
db->array =newdata;\
}
@@ -80,7 +81,7 @@
struct ci_data_type *newdata;
int indx,i;
- CHECK_SIZE(db,types,struct ci_data_type,50);
+ CHECK_SIZE(db,types,struct ci_data_type,50)
indx=db->types_num;
db->types_num++;
@@ -113,7 +114,7 @@
int indx;
CHECK_SIZE(db,magics,struct ci_magic,50)
-
+
indx=db->magics_num;
db->magics_num++;
@@ -308,6 +309,10 @@
}
groups[i]=-1;
type=types_add(db,record.type,record.descr,groups);
+ if(type<0){
+ ret=-2;
+ break;
+ }
}
magics_add(db,record.offset,record.magic,record.len,type);
@@ -459,10 +464,13 @@
int endian=0;
/*check for utf8 ........*/
for(i=0;i<buflen;i+=ret){
- if(!(ret=isUTF8(buf+i,buflen-i)))
+ if((ret=isUTF8(buf+i,buflen-i)) <= 0)
break;
}
+ if(ret < 0 && i == 0)
+ ret=0;/*Not enough data to check*/
+
if(ret) /*Even if the last char is unknown ret!=0 mean is utf*/
return CI_UTF_DATA; /*... but what about if buflen is about 2 or 3 bytes long ?*/
@@ -500,7 +508,7 @@
if((ret=check_magics(db,buf,buflen))>=0)
return ret;
-
+
/*At the feature the check_ascii and check_unicode must be merged ....*/
if((ret=check_ascii((unsigned char *)buf,buflen))>0)
return ret;
@@ -508,7 +516,7 @@
if((ret=check_unicode((unsigned char *)buf,buflen))>0){
return CI_UTF_DATA;
}
-
+
return CI_BIN_DATA; /*binary data*/
}

View File

@ -1,11 +0,0 @@
--- request_common.c.orig Thu Jun 15 10:13:10 2006
+++ request_common.c Thu Jun 15 10:13:16 2006
@@ -654,7 +654,7 @@
int client_parse_icap_header(request_t *req,ci_headers_list_t *h){
- int readed=0,eoh=0;;
+ int readed=0,eoh=0;
char *buf,*end;
if(req->pstrblock_read_len<4)/*we need 4 bytes for the end of headers "\r\n\r\n" string*/
return CI_NEEDS_MORE;

View File

@ -1,35 +0,0 @@
diff -ruN work/c_icap-030606rc1/services/clamav/srv_clamav.c work.patched/c_icap-030606rc1/services/clamav/srv_clamav.c
--- services/clamav/srv_clamav.c 2006-06-06 22:08:13.000000000 +0500
+++ services/clamav/srv_clamav.c 2009-02-13 11:33:57.000000000 +0400
@@ -137,17 +137,18 @@
int srvclamav_init_service(service_module_t *this,struct icap_server_conf *server_conf){
- int ret,no=0,i;
+ int ret,i;
+ unsigned int no = 0;
+ unsigned int options = 0;
+ options = options | CL_DB_STDOPT;
magic_db=server_conf->MAGIC_DB;
scantypes=(int *)malloc(ci_magic_types_num(magic_db)*sizeof(int));
scangroups=(int *)malloc(ci_magic_groups_num(magic_db)*sizeof(int));
for(i=0;i<ci_magic_types_num(magic_db);i++) scantypes[i]=0;
for(i=0;i<ci_magic_groups_num(magic_db);i++) scangroups[i]=0;
-
-
ci_debug_printf(10,"Going to initialize srvclamav\n");;
- if((ret = cl_loaddbdir(cl_retdbdir(), &root, &no))) {
+ if((ret = cl_load(cl_retdbdir(), &root, &no, options))) {
ci_debug_printf(1,"cl_loaddbdir: %s\n", cl_perror(ret));
return 0;
}
@@ -161,7 +162,7 @@
limits.maxfiles = 0/*1000*/; /* max files */
limits.maxfilesize = 100 * 1048576; /* maximal archived file size == 100 Mb */
limits.maxreclevel = 5; /* maximal recursion level */
- limits.maxratio = 200; /* maximal compression ratio */
+ //limits.maxratio = 200; /* maximal compression ratio */
limits.archivememlim = 0; /* disable memory limit for bzip2 scanner */
return 1;
}

View File

@ -34,7 +34,6 @@ if [ "$2" = "PRE-INSTALL" ]; then
elif [ "$2" = "POST-INSTALL" ]; then
if [ ! -d "$LOG_DIR" ]; then
mkdir -p "$LOG_DIR" || exit 1
touch "$LOG_DIR/access.log" "$LOG_DIR/server.log" || exit 1
chown -R "$CICAP_USER:$CICAP_GROUP" "$LOG_DIR" || exit 1
fi
@ -47,6 +46,11 @@ elif [ "$2" = "POST-INSTALL" ]; then
mkdir -p "$RUN_DIR" || exit 1
chown "$CICAP_USER:$CICAP_GROUP" "$RUN_DIR" || exit 1
fi
if [ ! -d "$RUN_DIR/c-icap" ]; then
mkdir -p "$RUN_DIR/c-icap" || exit 1
chown "$CICAP_USER:$CICAP_GROUP" "$RUN_DIR/c-icap" || exit 1
fi
fi
exit 0

View File

@ -12,12 +12,16 @@ etc/c-icap.magic.default
include/c_icap/access.h
include/c_icap/body.h
include/c_icap/c-icap.h
include/c_icap/c-icap-conf.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/header.h
include/c_icap/log.h
include/c_icap/mem.h
include/c_icap/module.h
include/c_icap/net_io.h
include/c_icap/proc_mutex.h
@ -48,4 +52,5 @@ lib/libicapapi.a
lib/libicapapi.la
lib/libicapapi.so.0
lib/libicapapi.so
@unexec rmdir %%RUN_DIR%%/c-icap 2>/dev/null || true
@unexec rmdir %%LOG_DIR%% 2>/dev/null || true