diff options
author | ache <ache@FreeBSD.org> | 2004-07-24 05:12:38 +0800 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2004-07-24 05:12:38 +0800 |
commit | 142f05020390f0edf292fa5cde7f5d4ed9588822 (patch) | |
tree | 1357b25bd08e0ef98815dcfc048a11cbae34164b /www | |
parent | 08fbb981d46eeae5d2f78099806caf5f6f11816d (diff) | |
download | freebsd-ports-gnome-142f05020390f0edf292fa5cde7f5d4ed9588822.tar.gz freebsd-ports-gnome-142f05020390f0edf292fa5cde7f5d4ed9588822.tar.zst freebsd-ports-gnome-142f05020390f0edf292fa5cde7f5d4ed9588822.zip |
Webalizer+GeoIP
Diffstat (limited to 'www')
-rw-r--r-- | www/Makefile | 1 | ||||
-rw-r--r-- | www/geolizer/Makefile | 42 | ||||
-rw-r--r-- | www/geolizer/distinfo | 4 | ||||
-rw-r--r-- | www/geolizer/files/patch-aa | 17 | ||||
-rw-r--r-- | www/geolizer/files/patch-ab | 65 | ||||
-rw-r--r-- | www/geolizer/files/patch-ac | 71 | ||||
-rw-r--r-- | www/geolizer/files/patch-ad | 42 | ||||
-rw-r--r-- | www/geolizer/files/patch-linklist | 42 | ||||
-rw-r--r-- | www/geolizer/files/patch-lowercase-url-bug | 32 | ||||
-rw-r--r-- | www/geolizer/pkg-descr | 7 |
10 files changed, 323 insertions, 0 deletions
diff --git a/www/Makefile b/www/Makefile index 16e24265946e..c008c00c82af 100644 --- a/www/Makefile +++ b/www/Makefile @@ -129,6 +129,7 @@ SUBDIR += gallery SUBDIR += gatling SUBDIR += geeklog + SUBDIR += geolizer SUBDIR += gforge SUBDIR += glibwww SUBDIR += gnuinfo diff --git a/www/geolizer/Makefile b/www/geolizer/Makefile new file mode 100644 index 000000000000..5286f47bef56 --- /dev/null +++ b/www/geolizer/Makefile @@ -0,0 +1,42 @@ +# New ports collection makefile for: geolizer +# Date created: 23 July 2004 +# Whom: ache@FreeBSD.org +# +# $FreeBSD$ +# + +CONFLICTS= webalizer-2* + +MASTERDIR= ${.CURDIR}/../webalizer + +PATCH_SITES+= http://sysd.org/proj/ +PATCHFILES+= geolizer_2.01-10-patch.20040216.tar.bz2 +PATCH_DIST_STRIP= -p1 +PATCHDIR= ${.CURDIR}/files +MD5_FILE= ${.CURDIR}/distinfo +DESCR= ${.CURDIR}/pkg-descr +DOCSDIR= ${PREFIX}/share/doc/webalizer +EXAMPLESDIR= ${PREFIX}/share/examples/webalizer + +WEBALIZER_LANG=english + +CFLAGS+= -I${LOCALBASE}/include +CONFIGURE_ARGS+= --enable-geoip \ + --with-geoip-lib=${LOCALBASE} \ + --with-geoip-inc=${LOCALBASE} + +LIB_DEPENDS= gd.4:${PORTSDIR}/graphics/gd \ + GeoIP.4:${PORTSDIR}/net/GeoIP + +MAINTAINER= ports@FreeBSD.org + +.include "${MASTERDIR}/Makefile" + +# Overwrite section, can't be placed before + +PORTNAME= geolizer +PORTREVISION= 0 +DISTNAME= webalizer-2.01-10-src + +COMMENT= A web server log file analysis program, using GeoIP library + diff --git a/www/geolizer/distinfo b/www/geolizer/distinfo new file mode 100644 index 000000000000..f1df75ba561f --- /dev/null +++ b/www/geolizer/distinfo @@ -0,0 +1,4 @@ +MD5 (webalizer-2.01-10-src.tar.bz2) = 26d0a3c142423678daed2d6f579525d8 +SIZE (webalizer-2.01-10-src.tar.bz2) = 252664 +MD5 (geolizer_2.01-10-patch.20040216.tar.bz2) = fa2e960702c72a16707854537053a966 +SIZE (geolizer_2.01-10-patch.20040216.tar.bz2) = 27688 diff --git a/www/geolizer/files/patch-aa b/www/geolizer/files/patch-aa new file mode 100644 index 000000000000..37e6eb36db24 --- /dev/null +++ b/www/geolizer/files/patch-aa @@ -0,0 +1,17 @@ +--- linklist.c.bak Fri Sep 29 07:51:02 2000 ++++ linklist.c Sat Oct 14 17:22:16 2000 +@@ -197,12 +197,12 @@ + strncpy(temp_buf,str,79); + temp_buf[79]=0; + +- while (!isspace((int)*name)&&*name!=0) name++; ++ while (!isspace((unsigned char)*name)&&*name!=0) name++; + if (*name==0) name=temp_buf; + else + { + *name++=0; +- while (isspace((int)*name)&&*name!=0) name++; ++ while (isspace((unsigned char)*name)&&*name!=0) name++; + if (*name==0) name=temp_buf; + } + diff --git a/www/geolizer/files/patch-ab b/www/geolizer/files/patch-ab new file mode 100644 index 000000000000..f8f53e94cdc3 --- /dev/null +++ b/www/geolizer/files/patch-ab @@ -0,0 +1,65 @@ +--- preserve.c.bak Fri Sep 29 07:51:32 2000 ++++ preserve.c Sat Oct 14 17:34:03 2000 +@@ -492,7 +492,7 @@ + tmp_buf[strlen(tmp_buf)-1]=0; + + if ((fgets(buffer,BUFSIZE,fp)) == NULL) return 10; /* error exit */ +- if (!isdigit((int)buffer[0])) return 10; /* error exit */ ++ if (!isdigit((unsigned char)buffer[0])) return 10; /* error exit */ + + /* load temporary node data */ + sscanf(buffer,"%d %lu %lu %lf %lu %lu", +@@ -523,7 +523,7 @@ + tmp_buf[strlen(buffer)-1]=0; + + if ((fgets(buffer,BUFSIZE,fp)) == NULL) return 8; /* error exit */ +- if (!isdigit((int)buffer[0])) return 8; /* error exit */ ++ if (!isdigit((unsigned char)buffer[0])) return 8; /* error exit */ + + /* load temporary node data */ + sscanf(buffer,"%d %lu %lu %lf %lu %lu", +@@ -563,7 +563,7 @@ + tmp_buf[strlen(buffer)-1]=0; + + if ((fgets(buffer,BUFSIZE,fp)) == NULL) return 9; /* error exit */ +- if (!isdigit((int)buffer[0])) return 9; /* error exit */ ++ if (!isdigit((unsigned char)buffer[0])) return 9; /* error exit */ + + /* load temporary node data */ + sscanf(buffer,"%d %lu %lu %lf %lu %lu", +@@ -602,7 +602,7 @@ + tmp_buf[strlen(buffer)-1]=0; + + if ((fgets(buffer,BUFSIZE,fp)) == NULL) return 11; /* error exit */ +- if (!isdigit((int)buffer[0])) return 11; /* error exit */ ++ if (!isdigit((unsigned char)buffer[0])) return 11; /* error exit */ + + /* load temporary node data */ + sscanf(buffer,"%d %lu",&t_rnode.flag,&t_rnode.count); +@@ -627,7 +627,7 @@ + tmp_buf[strlen(buffer)-1]=0; + + if ((fgets(buffer,BUFSIZE,fp)) == NULL) return 12; /* error exit */ +- if (!isdigit((int)buffer[0])) return 12; /* error exit */ ++ if (!isdigit((unsigned char)buffer[0])) return 12; /* error exit */ + + /* load temporary node data */ + sscanf(buffer,"%d %lu",&t_anode.flag,&t_anode.count); +@@ -652,7 +652,7 @@ + tmp_buf[strlen(buffer)-1]=0; + + if ((fgets(buffer,BUFSIZE,fp)) == NULL) return 13; /* error exit */ +- if (!isdigit((int)buffer[0])) return 13; /* error exit */ ++ if (!isdigit((unsigned char)buffer[0])) return 13; /* error exit */ + + /* load temporary node data */ + sscanf(buffer,"%lu",&t_snode.count); +@@ -677,7 +677,7 @@ + tmp_buf[strlen(buffer)-1]=0; + + if ((fgets(buffer,BUFSIZE,fp)) == NULL) return 14; /* error exit */ +- if (!isdigit((int)buffer[0])) return 14; /* error exit */ ++ if (!isdigit((unsigned char)buffer[0])) return 14; /* error exit */ + + /* load temporary node data */ + sscanf(buffer,"%d %lu %lu %lf %lu %lu", diff --git a/www/geolizer/files/patch-ac b/www/geolizer/files/patch-ac new file mode 100644 index 000000000000..2723bff29eb1 --- /dev/null +++ b/www/geolizer/files/patch-ac @@ -0,0 +1,71 @@ +--- webalizer.c.orig Wed Oct 24 10:24:51 2001 ++++ webalizer.c Tue Feb 12 05:29:59 2002 +@@ -231,7 +231,7 @@ + int main(int argc, char *argv[]) + { + int i; /* generic counter */ +- char *cp1, *cp2, *cp3, *str; /* generic char pointers */ ++ unsigned char *cp1, *cp2, *cp3, *str; /* generic char pointers */ + NLISTPTR lptr; /* generic list pointer */ + + extern char *optarg; /* used for command line */ +@@ -569,7 +569,7 @@ + + /* convert month name to lowercase */ + for (i=4;i<7;i++) +- log_rec.datetime[i]=tolower(log_rec.datetime[i]); ++ log_rec.datetime[i]=tolower((unsigned char)log_rec.datetime[i]); + + /* get year/month/day/hour/min/sec values */ + for (i=0;i<12;i++) +@@ -713,7 +713,7 @@ + { + if ((cp1=strstr(log_rec.url,lptr->string))!=NULL) + { +- if ((cp1==log_rec.url)||(*(cp1-1)=='/')) ++ if ((cp1==(unsigned char *)log_rec.url)||(*(cp1-1)=='/')) + { + *cp1='\0'; + if (log_rec.url[0]=='\0') +@@ -1466,19 +1466,19 @@ + while ( (fgets(buffer,BUFSIZE,fp)) != NULL) + { + /* skip comments and blank lines */ +- if ( (buffer[0]=='#') || isspace((int)buffer[0]) ) continue; ++ if ( (buffer[0]=='#') || isspace((unsigned char)buffer[0]) ) continue; + + /* Get keyword */ + cp1=buffer;cp2=keyword; +- while ( isalnum((int)*cp1) ) *cp2++ = *cp1++; ++ while ( isalnum((unsigned char)*cp1) ) *cp2++ = *cp1++; + *cp2='\0'; + + /* Get value */ + cp2=value; +- while ( (*cp1!='\n')&&(*cp1!='\0')&&(isspace((int)*cp1)) ) cp1++; ++ while ( (*cp1!='\n')&&(*cp1!='\0')&&(isspace((unsigned char)*cp1)) ) cp1++; + while ( (*cp1!='\n')&&(*cp1!='\0') ) *cp2++ = *cp1++; + *cp2--='\0'; +- while ( (isspace((int)*cp2)) && (cp2 != value) ) *cp2--='\0'; ++ while ( (isspace((unsigned char)*cp2)) && (cp2 != value) ) *cp2--='\0'; + + /* check if blank keyword/value */ + if ( (keyword[0]=='\0') || (value[0]=='\0') ) continue; +@@ -1820,7 +1820,7 @@ + if (*cp1=='+') *cp1=' '; /* change + to space */ + if (sp_flg && *cp1==' ') { cp1++; continue; } /* compress spaces */ + if (*cp1==' ') sp_flg=1; else sp_flg=0; /* (flag spaces here) */ +- *cp2++=tolower(*cp1); /* normal character */ ++ *cp2++= *cp1; /* normal character */ + cp1++; + } + } +@@ -1855,7 +1855,7 @@ + int i=group_domains+1; + + cp = str+strlen(str)-1; +- if (isdigit((int)*cp)) return NULL; /* ignore IP addresses */ ++ if (isdigit((unsigned char)*cp)) return NULL; /* ignore IP addresses */ + + while (cp!=str) + { diff --git a/www/geolizer/files/patch-ad b/www/geolizer/files/patch-ad new file mode 100644 index 000000000000..b0d97e824a8a --- /dev/null +++ b/www/geolizer/files/patch-ad @@ -0,0 +1,42 @@ +--- output.c.orig Fri Jul 23 23:13:47 2004 ++++ output.c Sat Jul 24 00:26:37 2004 +@@ -1543,10 +1543,17 @@ + rptr=*pointer++; + if (rptr->flag == OBJ_REG) + { +- fprintf(out_fp,"%-8lu %6.02f%% %s\n", +- rptr->count, +- (t_hit==0)?0:((float)rptr->count/t_hit)*100.0, +- rptr->string); ++ if (strstr(rptr->string,"://")!=NULL) ++ fprintf(out_fp,"%-8lu %6.02f%% <A HREF=\"%s\">%s</A>\n", ++ rptr->count, ++ (t_hit==0)?0:((float)rptr->count/t_hit)*100.0, ++ rptr->string, ++ rptr->string); ++ else ++ fprintf(out_fp,"%-8lu %6.02f%% %s\n", ++ rptr->count, ++ (t_hit==0)?0:((float)rptr->count/t_hit)*100.0, ++ rptr->string); + r_reg--; + } + } +@@ -2033,7 +2040,7 @@ + while ( (*domain!='.')&&(domain!=hptr->string)) domain--; + if (domain==hptr->string) + country=NULL; +- else if (isdigit((int)*++domain)) ++ else if (isdigit((unsigned char)*++domain)) + { + #ifdef USE_GEOIP + if (use_geoip) +@@ -2918,7 +2925,7 @@ + static char warpbuf[32][32]; + static int index = -1; + +- if (index<0 || index>32) ++ if (index<0 || index>=32) + index=0; + + while (n>=base && usesuf<=10) diff --git a/www/geolizer/files/patch-linklist b/www/geolizer/files/patch-linklist new file mode 100644 index 000000000000..7320ad7233a5 --- /dev/null +++ b/www/geolizer/files/patch-linklist @@ -0,0 +1,42 @@ +--- linklist.c.orig Sat Jun 23 11:12:40 2001 ++++ linklist.c Sat Jun 23 11:19:54 2001 +@@ -190,12 +190,12 @@ + int add_glist(char *str, GLISTPTR *list) + { + GLISTPTR newptr,cptr,pptr; +- char temp_buf[80]; ++ char temp_buf[LINKLIST_MAX_STRING]; + char *name=temp_buf; + + /* make local copy of string */ +- strncpy(temp_buf,str,79); +- temp_buf[79]=0; ++ strncpy(temp_buf,str,LINKLIST_MAX_STRING - 1); ++ temp_buf[LINKLIST_MAX_STRING - 1]=0; + + while (!isspace((unsigned char)*name)&&*name!=0) name++; + if (*name==0) name=temp_buf; +--- linklist.h.orig Fri Sep 29 05:50:30 2000 ++++ linklist.h Sat Jun 23 11:15:57 2001 +@@ -1,12 +1,18 @@ + #ifndef _LINKLIST_H + #define _LINKLIST_H + +-struct nlist { char string[80]; /* list struct for HIDE items */ ++#ifndef LINKLIST_MAX_STRING ++#define LINKLIST_MAX_STRING 80 ++#endif ++ ++struct nlist { /* list struct for HIDE items */ ++ char string[LINKLIST_MAX_STRING]; + struct nlist *next; }; + typedef struct nlist *NLISTPTR; + +-struct glist { char string[80]; /* list struct for GROUP items */ +- char name[80]; ++struct glist { /* list struct for GROUP items */ ++ char string[LINKLIST_MAX_STRING]; ++ char name[LINKLIST_MAX_STRING]; + struct glist *next; }; + typedef struct glist *GLISTPTR; + diff --git a/www/geolizer/files/patch-lowercase-url-bug b/www/geolizer/files/patch-lowercase-url-bug new file mode 100644 index 000000000000..29d7ac8710ef --- /dev/null +++ b/www/geolizer/files/patch-lowercase-url-bug @@ -0,0 +1,32 @@ +--- webalizer.c 2002-04-16 18:11:31.000000000 -0400 ++++ webalizer.c.new 2003-07-07 12:35:45.000000000 -0400 +@@ -688,6 +688,14 @@ + /* un-escape URL */ + unescape(log_rec.url); + ++ /* strip query portion of cgi scripts */ ++ cp1 = log_rec.url; ++ while (*cp1 != '\0') ++ if (!isurlchar(*cp1)) { *cp1 = '\0'; break; } ++ else cp1++; ++ if (log_rec.url[0]=='\0') ++ { log_rec.url[0]='/'; log_rec.url[1]='\0'; } ++ + /* check for service (ie: http://) and lowercase if found */ + if ( (cp2=strstr(log_rec.url,"://")) != NULL) + { +@@ -699,14 +707,6 @@ + } + } + +- /* strip query portion of cgi scripts */ +- cp1 = log_rec.url; +- while (*cp1 != '\0') +- if (!isurlchar(*cp1)) { *cp1 = '\0'; break; } +- else cp1++; +- if (log_rec.url[0]=='\0') +- { log_rec.url[0]='/'; log_rec.url[1]='\0'; } +- + /* strip off index.html (or any aliases) */ + lptr=index_alias; + while (lptr!=NULL) diff --git a/www/geolizer/pkg-descr b/www/geolizer/pkg-descr new file mode 100644 index 000000000000..d24c25e196fe --- /dev/null +++ b/www/geolizer/pkg-descr @@ -0,0 +1,7 @@ +Patch for Webalizer to generate faster and more reliable geographic +statistics than using default DNS suffix method. It uses GeoIP library to +do that. In fact, if you disable DNS reversal on your HTTP server, it will +work faster and your stats get more accuracy when processed by patched +Webalizer. + +WWW: http://sysd.org/proj/log.php#glzr |