diff options
-rw-r--r-- | net/GeoIP/DESCR | 2 | ||||
-rw-r--r-- | net/GeoIP/Makefile | 8 | ||||
-rw-r--r-- | net/GeoIP/distinfo | 14 | ||||
-rw-r--r-- | net/GeoIP/patches/patch-aa | 10 | ||||
-rw-r--r-- | net/GeoIP/patches/patch-ab | 21 | ||||
-rw-r--r-- | net/GeoIP/patches/patch-ac | 59 | ||||
-rw-r--r-- | net/GeoIP/patches/patch-ad | 18 |
7 files changed, 114 insertions, 18 deletions
diff --git a/net/GeoIP/DESCR b/net/GeoIP/DESCR index b78981a3139..36d116642eb 100644 --- a/net/GeoIP/DESCR +++ b/net/GeoIP/DESCR @@ -1,6 +1,6 @@ GeoIP is a C library that enables the user to find the country that any IP address or hostname originates from. It uses a file based database that is -accurate as of September 2005. This database simply contains IP blocks as keys, +accurate as of January 2008. This database simply contains IP blocks as keys, and countries as values. It should be more complete and accurate than using reverse DNS lookups. diff --git a/net/GeoIP/Makefile b/net/GeoIP/Makefile index c1882f65eb9..bdac16e91ff 100644 --- a/net/GeoIP/Makefile +++ b/net/GeoIP/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.18 2007/04/04 15:03:06 tv Exp $ +# $NetBSD: Makefile,v 1.19 2008/02/06 23:27:02 heinz Exp $ # -DISTNAME= GeoIP-1.4.0 +DISTNAME= GeoIP-1.4.4 CATEGORIES= net MASTER_SITES= http://www.maxmind.com/download/geoip/api/c/ @@ -9,6 +9,10 @@ MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= http://www.maxmind.com/download/geoip/api/c/ COMMENT= Find the country from any IP address +#LICENSE= gnu-lgpl-v2.1 +#LICENSE+= gnu-gpl-v2 # md5.c and types.h, from GNUPG + +PKG_DESTDIR_SUPPORT= user-destdir PKG_INSTALLATION_TYPES= overwrite pkgviews GNU_CONFIGURE= yes diff --git a/net/GeoIP/distinfo b/net/GeoIP/distinfo index a2f8546ce40..c0cfbbeac40 100644 --- a/net/GeoIP/distinfo +++ b/net/GeoIP/distinfo @@ -1,7 +1,9 @@ -$NetBSD: distinfo,v 1.9 2006/09/05 21:03:58 tv Exp $ +$NetBSD: distinfo,v 1.10 2008/02/06 23:27:02 heinz Exp $ -SHA1 (GeoIP-1.4.0.tar.gz) = a108e33661db98a43a9c7334816c1dce6d759c46 -RMD160 (GeoIP-1.4.0.tar.gz) = 54779bae497d6032a35c1c1de8c97461db9b7075 -Size (GeoIP-1.4.0.tar.gz) = 808314 bytes -SHA1 (patch-aa) = 5a1c82ce58945a645354fffbe598e4d1c853e519 -SHA1 (patch-ab) = b25dec12477c7b198b3a57764abdc8ac1deb52fb +SHA1 (GeoIP-1.4.4.tar.gz) = 4a2937e7a8fc7c26aa88c0678791246b58d81d02 +RMD160 (GeoIP-1.4.4.tar.gz) = 4aa31840ec6496647551c6e12c9c5e32dceed426 +Size (GeoIP-1.4.4.tar.gz) = 944698 bytes +SHA1 (patch-aa) = 0b40dd16471e6e94d04493dfb61bc1270161d2b1 +SHA1 (patch-ab) = 5b229ed08c66580d50965cbfa6b7af76154a6a60 +SHA1 (patch-ac) = 4705cdce7f4dc1eb5d814f0d2101dc95d948522c +SHA1 (patch-ad) = 3d9235f7978d3bfff2d37fcb6c97c467998ba37e diff --git a/net/GeoIP/patches/patch-aa b/net/GeoIP/patches/patch-aa index 68dc0689f67..df806db654e 100644 --- a/net/GeoIP/patches/patch-aa +++ b/net/GeoIP/patches/patch-aa @@ -1,6 +1,12 @@ -$NetBSD: patch-aa,v 1.3 2006/06/05 16:38:40 tv Exp $ +$NetBSD: patch-aa,v 1.4 2008/02/06 23:27:02 heinz Exp $ ---- conf/Makefile.in.orig 2006-05-14 15:04:19.000000000 -0400 + - pkgsrc patch: put configuration file into examples directory so CONF_FILES + can use it as a reference. + + - pkgsrc patch: do not install the configuration file (in target + install-data-hook), let CONF_FILES handle it. + +--- conf/Makefile.in.orig 2008-01-22 04:14:24.000000000 +0100 +++ conf/Makefile.in @@ -23,7 +23,7 @@ bindir = @bindir@ sbindir = @sbindir@ diff --git a/net/GeoIP/patches/patch-ab b/net/GeoIP/patches/patch-ab index 87710ff2ca4..17ac27c8266 100644 --- a/net/GeoIP/patches/patch-ab +++ b/net/GeoIP/patches/patch-ab @@ -1,13 +1,16 @@ -$NetBSD: patch-ab,v 1.1 2005/10/22 21:50:59 heinz Exp $ +$NetBSD: patch-ab,v 1.2 2008/02/06 23:27:02 heinz Exp $ ---- man/geoiplookup.1.orig Thu Nov 21 07:12:38 2002 + - synchronize man page with the code + http://sourceforge.net/tracker/index.php?func=detail&aid=1888355&group_id=66844&atid=515957 + +--- man/geoiplookup.1.orig 2007-08-16 01:09:29.000000000 +0200 +++ man/geoiplookup.1 -@@ -3,23 +3,19 @@ +@@ -3,27 +3,24 @@ .SH NAME geoiplookup - look up country using IP Address or hostname .SH SYNOPSIS -geoiplookup [-lv] <ipaddress|hostname> -+geoiplookup [-v] <ipaddress|hostname> ++geoiplookup [-d directory] [-f filename] [-v] <ipaddress|hostname> .SH DESCRIPTION geoiplookup uses the GeoIP library and database to find the Country that an IP address or hostname originates from. @@ -18,15 +21,19 @@ $NetBSD: patch-ab,v 1.1 2005/10/22 21:50:59 heinz Exp $ +.I geoiplookup 80.60.233.195 .PP -will find the Country that 80.60.233.195 originates from, in long format: --.PP --.I Netherlands +will find the Country that 80.60.233.195 originates from, in the following format: .PP +-.I Netherlands +.I NL, Netherlands + .PP .SH OPTIONS + .IP "-f" + Specify a custom path to a single GeoIP datafile. + .IP "-d" + Specify a custom directory containing GeoIP datafile(s). By default geoiplookup looks in DATADIR -.IP "-l" -By default, geoiplookup returns the ISO 3166 country code. By specifying this -option, geoiplookup prints the long format, namely the full country name. .IP "-v" - Lists the GeoIP database date and build number. + Lists the date and build number for the GeoIP datafile(s). .SH AUTHOR diff --git a/net/GeoIP/patches/patch-ac b/net/GeoIP/patches/patch-ac new file mode 100644 index 00000000000..e72b5238789 --- /dev/null +++ b/net/GeoIP/patches/patch-ac @@ -0,0 +1,59 @@ +$NetBSD: patch-ac,v 1.1 2008/02/06 23:27:02 heinz Exp $ + + - probably a typo + http://sourceforge.net/tracker/index.php?func=detail&aid=1888390&group_id=66844&atid=515957 + + - move call of GeoIP_database_edition() to where it is actually needed. + Otherwise a segmentation fault may occur because gi may be NULL (see + GeoIP_open()). + http://sourceforge.net/tracker/index.php?func=detail&aid=1888390&group_id=66844&atid=515957 + + - GeoIP_country_code[] does not contain NULL, so the test for NULL can + never succeed. In order to change this we steal the assignment to + country_code from GeoIP_country_code_by_name(); while here move the + assignment to country_name where it is actually needed. + http://sourceforge.net/tracker/index.php?func=detail&aid=1888390&group_id=66844&atid=515957 + + +--- apps/geoiplookup.c.orig 2007-08-16 01:06:28.000000000 +0200 ++++ apps/geoiplookup.c +@@ -64,22 +64,22 @@ int main (int argc, char *argv[]) { + exit(1); + } + +- if (custom_file != NULL) { ++ if (custom_directory != NULL) { + GeoIP_setup_custom_directory(custom_directory); + } + _GeoIP_setup_dbfilename(); + + if (custom_file != NULL) { + gi = GeoIP_open(custom_file, GEOIP_STANDARD); +- i = GeoIP_database_edition(gi); + if (NULL == gi) { +- printf("%s not available, skipping...\n", GeoIPDBDescription[i]); ++ printf("%s not available, skipping...\n", custom_file); + } else { + if (version_flag == 1) { + db_info = GeoIP_database_info(gi); + printf("%s: %s\n",GeoIPDBDescription[i],db_info); + free(db_info); + } else { ++ i = GeoIP_database_edition(gi); + geoiplookup(gi,hostname,i); + } + } +@@ -126,11 +126,11 @@ void geoiplookup(GeoIP* gi,char *hostnam + } + if (GEOIP_COUNTRY_EDITION == i) { + country_id = GeoIP_id_by_name(gi, hostname); +- country_code = GeoIP_country_code[country_id]; +- country_name = GeoIP_country_name[country_id]; ++ country_code = (country_id > 0) ? GeoIP_country_code[country_id] : NULL; + if (country_code == NULL) { + printf("%s: IP Address not found\n", GeoIPDBDescription[i]); + } else { ++ country_name = GeoIP_country_name[country_id]; + printf("%s: %s, %s\n", GeoIPDBDescription[i], country_code, country_name); + } + } else if (GEOIP_REGION_EDITION_REV0 == i || GEOIP_REGION_EDITION_REV1 == i) { diff --git a/net/GeoIP/patches/patch-ad b/net/GeoIP/patches/patch-ad new file mode 100644 index 00000000000..8ccdd6751f9 --- /dev/null +++ b/net/GeoIP/patches/patch-ad @@ -0,0 +1,18 @@ +$NetBSD: patch-ad,v 1.1 2008/02/06 23:27:03 heinz Exp $ + + - test for success of _GeoIP_seek_record(). 0 is a valid return value. + http://sourceforge.net/tracker/index.php?func=detail&aid=1888390&group_id=66844&atid=515957 + +--- libGeoIP/GeoIP.c.orig 2007-11-25 04:27:25.000000000 +0100 ++++ libGeoIP/GeoIP.c +@@ -707,8 +707,8 @@ int GeoIP_id_by_name (GeoIP* gi, const c + } + if (!(ipnum = _GeoIP_lookupaddress(name))) + return 0; +- ret = _GeoIP_seek_record(gi, ipnum) - COUNTRY_BEGIN; +- return ret; ++ ret = _GeoIP_seek_record(gi, ipnum); ++ return (ret != 0) ? ret - COUNTRY_BEGIN : 0 ; + + } + |