View | Details | Raw Unified | Return to bug 101296
Collapse All | Expand All

(-)/usr/home/bio3k/my_proj/ports/c-icap/c-icap/Makefile (-2 / +13 lines)
Lines 7-13 Link Here
7
7
8
PORTNAME=	c-icap
8
PORTNAME=	c-icap
9
PORTVERSION=	030606
9
PORTVERSION=	030606
10
PORTREVISION=	1
10
PORTREVISION=	2
11
PORTEPOCH=	1
11
PORTEPOCH=	1
12
CATEGORIES=	www
12
CATEGORIES=	www
13
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE} \
13
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE} \
Lines 20-26 Link Here
20
20
21
GNU_CONFIGURE=	yes
21
GNU_CONFIGURE=	yes
22
INSTALLS_SHLIB=	yes
22
INSTALLS_SHLIB=	yes
23
USE_RC_SUBR=	c_icap.sh
23
USE_RC_SUBR=	c_icap
24
USE_AUTOTOOLS=	libtool:15
24
USE_AUTOTOOLS=	libtool:15
25
CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
25
CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
26
LDCONFIG_DIRS=	%%PREFIX%%/lib %%PREFIX%%/lib/c_icap
26
LDCONFIG_DIRS=	%%PREFIX%%/lib %%PREFIX%%/lib/c_icap
Lines 37-42 Link Here
37
# Perl support not ready yet. Try to contact author or hack it by yourself.
37
# Perl support not ready yet. Try to contact author or hack it by yourself.
38
WITHOUT_PERL=	yes
38
WITHOUT_PERL=	yes
39
39
40
LOG_DIR=	/var/log/c_icap
41
TMP_DIR=	/var/tmp
42
RUN_DIR=	/var/run
43
PLIST_SUB+=	LOG_DIR=${LOG_DIR} RUN_DIR=${RUN_DIR}
44
45
SUB_FILES=	pkg-install pkg-deinstall
46
SUB_LIST=	LOG_DIR=${LOG_DIR} TMP_DIR=${TMP_DIR} RUN_DIR=${RUN_DIR}
47
40
.if defined(WITH_PERL)
48
.if defined(WITH_PERL)
41
USE_PERL5=	yes
49
USE_PERL5=	yes
42
PLIST_SUB+=	PERL=""
50
PLIST_SUB+=	PERL=""
Lines 77-82 Link Here
77
post-patch:
85
post-patch:
78
	@${REINPLACE_CMD} -e 's|User wwwrun|User cicap|g' \
86
	@${REINPLACE_CMD} -e 's|User wwwrun|User cicap|g' \
79
		-e 's|Group nobody|Group cicap|g' \
87
		-e 's|Group nobody|Group cicap|g' \
88
		-e 's|/var/run|${RUN_DIR}|g' \
89
		-e 's|/var/tmp|${TMP_DIR}|g' \
90
		-e 's|/var/log/c_icap|${LOG_DIR}|g' \
80
		${WRKSRC}/c-icap.conf.default ${WRKSRC}/c-icap.conf.default.in
91
		${WRKSRC}/c-icap.conf.default ${WRKSRC}/c-icap.conf.default.in
81
	@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' \
92
	@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' \
82
		-e 's|icap_stretch_CFLAGS = -Iinclude/|icap_stretch_CFLAGS = -Iinclude/ ${PTHREAD_CFLAGS}|g' \
93
		-e 's|icap_stretch_CFLAGS = -Iinclude/|icap_stretch_CFLAGS = -Iinclude/ ${PTHREAD_CFLAGS}|g' \
(-)/usr/home/bio3k/my_proj/ports/c-icap/c-icap/files/c_icap.in (+35 lines)
Line 0 Link Here
1
#!/bin/sh
2
#
3
# $FreeBSD: ports/www/c-icap/files/c_icap.sh.in,v 1.2 2006/06/11 08:33:03 pav Exp $
4
#
5
6
# PROVIDE: c-icap
7
# REQUIRE: DAEMON cleanvar
8
# BEFORE: LOGIN
9
10
#
11
# Add the following lines to /etc/rc.conf to enable c-icap:
12
#
13
# c_icap_enable="YES"
14
#
15
# See '%%PREFIX%%/bin/c-icap --help' for flags
16
#
17
18
. %%RC_SUBR%%
19
20
name="c_icap"
21
rcvar=`set_rcvar`
22
23
command="%%PREFIX%%/bin/c-icap"
24
pidfile="%%RUN_DIR%%/c-icap.pid"
25
required_dirs="%%TMP_DIR%%"
26
required_files="%%PREFIX%%/etc/c-icap.conf"
27
28
stop_postcmd="rm -f $pidfile"
29
30
# read settings, set default values
31
load_rc_config "$name"
32
: ${c_icap_enable="NO"}
33
: ${c_icap_flags=""}
34
35
run_rc_command "$1"
(-)/usr/home/bio3k/my_proj/ports/c-icap/c-icap/files/c_icap.sh.in (-35 lines)
Lines 1-35 Link Here
1
#!/bin/sh
2
#
3
# $FreeBSD: ports/www/c-icap/files/c_icap.sh.in,v 1.2 2006/06/11 08:33:03 pav Exp $
4
#
5
6
# PROVIDE: c-icap
7
# REQUIRE: DAEMON cleanvar
8
# BEFORE: LOGIN
9
10
#
11
# Add the following lines to /etc/rc.conf to enable c-icap:
12
#
13
# c_icap_enable="YES"
14
#
15
# See '%%PREFIX%%/bin/c-icap --help' for flags
16
#
17
18
. %%RC_SUBR%%
19
20
name="c_icap"
21
rcvar=`set_rcvar`
22
23
command="%%PREFIX%%/bin/c-icap"
24
pidfile="/var/run/c-icap.pid"
25
required_dirs="/var/tmp"
26
required_files="%%PREFIX%%/etc/c-icap.conf"
27
28
stop_postcmd="rm -f $pidfile"
29
30
# read settings, set default values
31
load_rc_config "$name"
32
: ${c_icap_enable="NO"}
33
: ${c_icap_flags=""}
34
35
run_rc_command "$1"
(-)/usr/home/bio3k/my_proj/ports/c-icap/c-icap/files/patch-filetype.c (+75 lines)
Line 0 Link Here
1
--- filetype.bak.c	Sat May 13 22:51:32 2006
2
+++ filetype.c	Thu Aug  3 09:23:35 2006
3
@@ -66,8 +66,9 @@
4
                                                     }
5
 
6
 #define CHECK_SIZE(db,array,type,size)   if(db->array##_num >= db->array##_size){\
7
-	                                           if((newdata=realloc(db->array,db->array##_size+size*sizeof(type)))==NULL)\
8
+	                                           if((newdata=realloc(db->array,(db->array##_size+size)*sizeof(type)))==NULL)\
9
 	                                                     return -1;\
10
+                                                    db->array##_size +=size; \
11
 	                                            db->array =newdata;\
12
                                         }
13
 
14
@@ -80,7 +81,7 @@
15
      struct ci_data_type *newdata;
16
      int indx,i;
17
 
18
-     CHECK_SIZE(db,types,struct ci_data_type,50);
19
+     CHECK_SIZE(db,types,struct ci_data_type,50)
20
      
21
      indx=db->types_num;
22
      db->types_num++;
23
@@ -113,7 +114,7 @@
24
      int indx;
25
 
26
      CHECK_SIZE(db,magics,struct ci_magic,50)
27
-
28
+	  
29
      indx=db->magics_num;
30
      db->magics_num++;
31
 
32
@@ -308,6 +309,10 @@
33
 	       }
34
 	       groups[i]=-1;
35
 	       type=types_add(db,record.type,record.descr,groups);
36
+	       if(type<0){
37
+		    ret=-2;
38
+		    break;
39
+	       }
40
 	  }
41
 	  
42
 	  magics_add(db,record.offset,record.magic,record.len,type);
43
@@ -459,10 +464,13 @@
44
      int endian=0;
45
      /*check for utf8 ........*/
46
      for(i=0;i<buflen;i+=ret){ 
47
-	  if(!(ret=isUTF8(buf+i,buflen-i)))
48
+	  if((ret=isUTF8(buf+i,buflen-i)) <= 0)
49
 	       break;
50
      }
51
 
52
+     if(ret < 0 && i == 0)
53
+	 ret=0;/*Not enough data to check*/
54
+
55
      if(ret) /*Even if the last char is unknown ret!=0 mean is utf*/
56
 	  return CI_UTF_DATA; /*... but what about if buflen is about 2 or 3 bytes long ?*/
57
      
58
@@ -500,7 +508,7 @@
59
 
60
      if((ret=check_magics(db,buf,buflen))>=0)
61
 	  return ret;
62
-     
63
+
64
 /*At the feature the check_ascii and check_unicode must be merged ....*/
65
      if((ret=check_ascii((unsigned char *)buf,buflen))>0)
66
 	  return ret;
67
@@ -508,7 +516,7 @@
68
      if((ret=check_unicode((unsigned char *)buf,buflen))>0){
69
 	  return CI_UTF_DATA;
70
      }
71
-     
72
+
73
      return CI_BIN_DATA; /*binary data*/
74
 }
75
 
(-)/usr/home/bio3k/my_proj/ports/c-icap/c-icap/files/pkg-install.in (-5 / +21 lines)
Lines 1-13 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
# $FreeBSD: ports/www/c-icap/files/pkg-install.in,v 1.3 2006/06/11 08:33:03 pav Exp $
2
# $FreeBSD: ports/www/c-icap/files/pkg-install.in,v 1.3 2006/06/11 08:33:03 pav Exp $
3
3
4
DEST_DIR=${PKG_DESTDIR:-}
5
4
CICAP_USER=cicap
6
CICAP_USER=cicap
5
CICAP_GROUP=cicap
7
CICAP_GROUP=cicap
6
8
7
LOG_PATH=/var/log/c_icap
9
LOG_DIR=$DEST_DIR%%LOG_DIR%%
10
TMP_DIR=$DEST_DIR%%TMP_DIR%%
11
RUN_DIR=$DEST_DIR%%RUN_DIR%%
8
12
9
if [ "$2" = "PRE-INSTALL" ]; then
13
if [ "$2" = "PRE-INSTALL" ]; then
10
	if ! pw groupshow "$CICAP_USER" 2>/dev/null 1>&2; then
14
	if ! pw groupshow "$CICAP_GROUP" 2>/dev/null 1>&2; then
11
		if pw groupadd $CICAP_GROUP; then
15
		if pw groupadd $CICAP_GROUP; then
12
			echo "=> Added group \"$CICAP_GROUP\"."
16
			echo "=> Added group \"$CICAP_GROUP\"."
13
		else
17
		else
Lines 28-36 Link Here
28
		fi
32
		fi
29
	fi
33
	fi
30
elif [ "$2" = "POST-INSTALL" ]; then
34
elif [ "$2" = "POST-INSTALL" ]; then
31
	[ -d "$LOG_PATH" ] || mkdir -p "$LOG_PATH" || exit 1
35
	if [ ! -d "$LOG_DIR" ]; then 
32
	touch "$LOG_PATH/access.log" "$LOG_PATH/server.log" || exit 1
36
		mkdir -p "$LOG_DIR" || exit 1
33
	chown -R "$CICAP_USER:$CICAP_GROUP" "$LOG_PATH" || exit 1
37
		touch "$LOG_DIR/access.log" "$LOG_DIR/server.log" || exit 1
38
		chown -R "$CICAP_USER:$CICAP_GROUP" "$LOG_DIR" || exit 1
39
	fi
40
41
	if [ ! -d "$TMP_DIR" ]; then
42
		mkdir -p "$TMP_DIR" || exit 1
43
		chown "$CICAP_USER:$CICAP_GROUP" "$TMP_DIR" || exit 1
44
	fi
45
46
	if [ ! -d "$RUN_DIR" ]; then
47
		mkdir -p "$RUN_DIR" || exit 1
48
		chown "$CICAP_USER:$CICAP_GROUP" "$RUN_DIR" || exit 1
49
	fi
34
fi
50
fi
35
51
36
exit 0
52
exit 0
(-)/usr/home/bio3k/my_proj/ports/c-icap/c-icap/pkg-descr (-3 lines)
Lines 5-10 Link Here
5
authentication methods or access controlers.
5
authentication methods or access controlers.
6
6
7
WWW: http://www.chtsanti.net/c-icap
7
WWW: http://www.chtsanti.net/c-icap
8
9
- Elisey Savateev
10
b3k@mail.ru
(-)/usr/home/bio3k/my_proj/ports/c-icap/c-icap/pkg-plist (-3 / +2 lines)
Lines 8-14 Link Here
8
@unexec if cmp -s %D/etc/c-icap.magic %D/etc/c-icap.magic.default; then rm -f %D/etc/c-icap.magic; fi
8
@unexec if cmp -s %D/etc/c-icap.magic %D/etc/c-icap.magic.default; then rm -f %D/etc/c-icap.magic; fi
9
etc/c-icap.magic.default
9
etc/c-icap.magic.default
10
@exec [ -f %B/c-icap.magic ] || cp -p %%PREFIX%%/%F %B/c-icap.magic
10
@exec [ -f %B/c-icap.magic ] || cp -p %%PREFIX%%/%F %B/c-icap.magic
11
@unexec [ ! -f /var/run/c-icap.pid ] || %D/etc/rc.d/c_icap stop
11
@unexec [ ! -f %%RUN_DIR%%/c-icap.pid ] || %D/etc/rc.d/c_icap stop
12
include/c_icap/access.h
12
include/c_icap/access.h
13
include/c_icap/body.h
13
include/c_icap/body.h
14
include/c_icap/c-icap.h
14
include/c_icap/c-icap.h
Lines 48-52 Link Here
48
lib/libicapapi.la
48
lib/libicapapi.la
49
lib/libicapapi.so.0
49
lib/libicapapi.so.0
50
lib/libicapapi.so
50
lib/libicapapi.so
51
@cwd /
51
@unexec rmdir %%LOG_DIR%% 2>/dev/null || true
52
@dirrmtry var/log/c_icap

Return to bug 101296