Skip to content

Commit

Permalink
initial checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashanth Mundkur committed Sep 2, 2011
0 parents commit 308e631
Show file tree
Hide file tree
Showing 27 changed files with 5,831 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
@@ -0,0 +1,5 @@
*~
_build
dat/GeoIPCity.dat
lib/geoip_regions.ml
lib/geoip_timezones.ml
27 changes: 27 additions & 0 deletions Makefile
@@ -0,0 +1,27 @@
PYTHON = python
OCAMLBUILD = ocamlbuild

.PHONY: all test clean

# Hack to work around ocamlbuild 3.12.1 sanitation check bug.
CLEANUP_FILES = geoip.cma geoip.cmxa geoip_test.byte geoip_test.native benchmark.byte benchmark.native

all: lib/geoip_regions.ml lib/geoip_timezones.ml Makefile
-rm -f $(CLEANUP_FILES)
$(OCAMLBUILD) lib/all.otarget

lib/geoip_regions.ml: tools/gen_region_names.py dat/fips10_4.txt dat/iso3166_2.txt
$(PYTHON) $< > $@

lib/geoip_timezones.ml: tools/gen_timezones.py dat/timezone.txt
$(PYTHON) $< > $@

test: all
-rm -f $(CLEANUP_FILES)
$(OCAMLBUILD) test/all.otarget

clean:
$(OCAMLBUILD) -clean -quiet

realclean: clean
rm -f lib/geoip_regions.ml lib/geoip_timezones.ml
3 changes: 3 additions & 0 deletions README
@@ -0,0 +1,3 @@
OCaml API to the free/open GeoLite databases from MaxMind.

This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/.
4 changes: 4 additions & 0 deletions TODO
@@ -0,0 +1,4 @@
- Support for IPv6
- Support for non-free editions of MaxMind GeoIP data
- Profiling and optimization

3 changes: 3 additions & 0 deletions _tags
@@ -0,0 +1,3 @@
<**/*.ml{i,}>: annot, warn_A, warn_e, warn_r, warn_l
true: debug
<lib>: include
31 changes: 31 additions & 0 deletions dat/GEOIP_DATA_LICENSE
@@ -0,0 +1,31 @@
OPEN DATA LICENSE (GeoLite Country and GeoLite City databases)

Copyright (c) 2008 MaxMind, Inc. All Rights Reserved.

All advertising materials and documentation mentioning features or use of
this database must display the following acknowledgment:
"This product includes GeoLite data created by MaxMind, available from
http://maxmind.com/"

Redistribution and use with or without modification, are permitted provided
that the following conditions are met:
1. Redistributions must retain the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
2. All advertising materials and documentation mentioning features or use of
this database must display the following acknowledgement:
"This product includes GeoLite data created by MaxMind, available from
http://maxmind.com/"
3. "MaxMind" may not be used to endorse or promote products derived from this
database without specific prior written permission.

THIS DATABASE IS PROVIDED BY MAXMIND, INC ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL MAXMIND BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
DATABASE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Binary file added dat/GeoIP.dat
Binary file not shown.
Binary file added dat/GeoIPv6.dat
Binary file not shown.
Binary file added dat/GeoLiteCity.dat
Binary file not shown.
10 changes: 10 additions & 0 deletions dat/README
@@ -0,0 +1,10 @@
Download origins of files, as of 1 Sept, 2011. Please read the GEOIP_DATA_LICENSE.

http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz
http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz

http://geoip.cvs.sourceforge.net/viewvc/geoip/c/regioncode/fips10_4.txt
http://geoip.cvs.sourceforge.net/viewvc/geoip/c/regioncode/iso3166_2.txt
(The following needed patching in the last 3 lines to replace spaces with tab-separators.)
http://www.maxmind.com/timezone.txt

0 comments on commit 308e631

Please sign in to comment.