rpms/python-GeoIP/devel python-GeoIP-1.2.4-ipv6.patch, NONE, 1.1 python-GeoIP.spec, 1.15, 1.16

Matt Domsch mdomsch at fedoraproject.org
Tue Sep 1 12:38:29 UTC 2009


Author: mdomsch

Update of /cvs/extras/rpms/python-GeoIP/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv7030

Modified Files:
	python-GeoIP.spec 
Added Files:
	python-GeoIP-1.2.4-ipv6.patch 
Log Message:
add IPv6 functions from CVS HEAD, do prerelease

python-GeoIP-1.2.4-ipv6.patch:
 ChangeLog  |    7 ++++++-
 py_GeoIP.c |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 test.py    |    2 +-
 test_v6.py |   13 +++++++++++++
 4 files changed, 68 insertions(+), 2 deletions(-)

--- NEW FILE python-GeoIP-1.2.4-ipv6.patch ---
diff -urNp --minimal --exclude-from=/home/mdomsch/excludes /home/mdomsch/cvs/fedora-extras/python-GeoIP/devel/GeoIP-Python-1.2.4/ChangeLog python/ChangeLog
--- /home/mdomsch/cvs/fedora-extras/python-GeoIP/devel/GeoIP-Python-1.2.4/ChangeLog	2008-12-16 07:22:45.000000000 -0600
+++ python/ChangeLog	2009-08-30 21:21:59.000000000 -0500
@@ -1,5 +1,10 @@
+	* Add IPv6 glue *** needs libGeoIP 1.4.7 ***
+		country_code_by_name_v6	
+		country_name_by_name_v6
+		country_code_by_addr_v6
+		country_name_by_addr_v6 ( Boris Zentner )
 1.2.4	2008-12-16
-	* Add charset and set_charset methods , as well as 
+	* Add charset and set_charset methods, as well as 
 		the new attributes GeoIP.GEOIP_CHARSET_ISO_8859_1 and
 		GeoIP.GEOIP_CHARSET_UTF8 ( Boris Zentner )
 	* Add test_city_charset.py script showing howto use
diff -urNp --minimal --exclude-from=/home/mdomsch/excludes /home/mdomsch/cvs/fedora-extras/python-GeoIP/devel/GeoIP-Python-1.2.4/py_GeoIP.c python/py_GeoIP.c
--- /home/mdomsch/cvs/fedora-extras/python-GeoIP/devel/GeoIP-Python-1.2.4/py_GeoIP.c	2009-08-30 14:05:06.000000000 -0500
+++ python/py_GeoIP.c	2009-08-30 21:21:59.000000000 -0500
@@ -83,6 +83,50 @@ GeoIP_GeoIP_dealloc(PyObject* self)
   PyObject_Del(self);
 }
 
+static PyObject * GeoIP_country_code_by_name_v6_Py(PyObject *self, PyObject *args) {
+  char * name;
+  const char * retval;
+  GeoIP_GeoIPObject* GeoIP = (GeoIP_GeoIPObject*)self;
+  if (!PyArg_ParseTuple(args, "s", &name)) {
+    return NULL;
+  }
+  retval = GeoIP_country_code_by_name_v6(GeoIP->gi, name);
+  return Py_BuildValue("s", retval);
+}
+
+static PyObject * GeoIP_country_name_by_name_v6_Py(PyObject *self, PyObject *args) {
+  char * name;
+  const char * retval;
+  GeoIP_GeoIPObject* GeoIP = (GeoIP_GeoIPObject*)self;
+  if (!PyArg_ParseTuple(args, "s", &name)) {
+    return NULL;
+  }
+  retval = GeoIP_country_name_by_name_v6(GeoIP->gi, name);
+  return Py_BuildValue("s", retval);
+}
+
+static PyObject * GeoIP_country_code_by_addr_v6_Py(PyObject *self, PyObject *args) {
+  char * name;
+  const char * retval;
+  GeoIP_GeoIPObject* GeoIP = (GeoIP_GeoIPObject*)self;
+  if (!PyArg_ParseTuple(args, "s", &name)) {
+    return NULL;
+  }
+  retval = GeoIP_country_code_by_addr_v6(GeoIP->gi, name);
+  return Py_BuildValue("s", retval);
+}
+
+static PyObject * GeoIP_country_name_by_addr_v6_Py(PyObject *self, PyObject *args) {
+  char * name;
+  const char * retval;
+  GeoIP_GeoIPObject* GeoIP = (GeoIP_GeoIPObject*)self;
+  if (!PyArg_ParseTuple(args, "s", &name)) {
+    return NULL;
+  }
+  retval = GeoIP_country_name_by_addr_v6(GeoIP->gi, name);
+  return Py_BuildValue("s", retval);
+}
+
 static PyObject * GeoIP_country_code_by_name_Py(PyObject *self, PyObject *args) {
   char * name;
   const char * retval;
@@ -343,6 +387,10 @@ static PyMethodDef GeoIP_Object_methods[
   {"charset", GeoIP_charset_Py, 1, "Return the current charset ( either GEOIP_CHARSET_ISO_8859_1 or GEOIP_CHARSET_UTF8 )"},
   {"set_charset", GeoIP_set_charset_Py, 1, "Set the charset for city records"},
   {"last_netmask", GeoIP_last_netmask_Py, 1, "return the netmask depth of the last lookup"},
+  {"country_code_by_name_v6", GeoIP_country_code_by_name_v6_Py, 1, "Lookup IPv6 Country Code By Name"},
+  {"country_name_by_name_v6", GeoIP_country_name_by_name_v6_Py, 1, "Lookup IPv6 Country Name By Name"},
+  {"country_code_by_addr_v6", GeoIP_country_code_by_addr_v6_Py, 1, "Lookup IPv6 Country Code By IP Address"},
+  {"country_name_by_addr_v6", GeoIP_country_name_by_addr_v6_Py, 1, "Lookup IPv6 Country Name By IP Address"},
   {NULL, NULL, 0, NULL}
 };
 
diff -urNp --minimal --exclude-from=/home/mdomsch/excludes /home/mdomsch/cvs/fedora-extras/python-GeoIP/devel/GeoIP-Python-1.2.4/test.py python/test.py
--- /home/mdomsch/cvs/fedora-extras/python-GeoIP/devel/GeoIP-Python-1.2.4/test.py	2008-12-16 07:22:45.000000000 -0600
+++ python/test.py	2009-08-30 21:21:59.000000000 -0500
@@ -4,7 +4,7 @@ import GeoIP
 
 #gi = GeoIP.new(GeoIP.GEOIP_STANDARD)
 gi = GeoIP.new(GeoIP.GEOIP_MEMORY_CACHE)
-#gi = GeoIP.open("/usr/local/share/GeoIP/GeoIP.data",GeoIP.GEOIP_STANDARD)
+#gi = GeoIP.open("/usr/local/share/GeoIP/GeoIP.dat",GeoIP.GEOIP_STANDARD)
 
 print gi.country_code_by_name("yahoo.com")
 print gi.last_netmask()
diff -urNp --minimal --exclude-from=/home/mdomsch/excludes /home/mdomsch/cvs/fedora-extras/python-GeoIP/devel/GeoIP-Python-1.2.4/test_v6.py python/test_v6.py
--- /home/mdomsch/cvs/fedora-extras/python-GeoIP/devel/GeoIP-Python-1.2.4/test_v6.py	1969-12-31 18:00:00.000000000 -0600
+++ python/test_v6.py	2009-08-30 21:21:59.000000000 -0500
@@ -0,0 +1,13 @@
+#!/usr/bin/python
+
+import GeoIP
+
+#gi = GeoIP.new(GeoIP.GEOIP_STANDARD)
+#gi = GeoIP.new(GeoIP.GEOIP_MEMORY_CACHE)
+gi = GeoIP.open("/usr/local/share/GeoIP/GeoIPv6.dat",GeoIP.GEOIP_STANDARD)
+
+print gi.country_code_by_name_v6("ipv6.google.com")
+print gi.country_name_by_name_v6("ipv6.google.com")
+print gi.country_code_by_addr_v6("2001:4860:0:1001::68")
+print gi.country_name_by_addr_v6("2001:4860:0:1001::68")
+


Index: python-GeoIP.spec
===================================================================
RCS file: /cvs/extras/rpms/python-GeoIP/devel/python-GeoIP.spec,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -p -r1.15 -r1.16
--- python-GeoIP.spec	26 Jul 2009 20:03:20 -0000	1.15
+++ python-GeoIP.spec	1 Sep 2009 12:38:29 -0000	1.16
@@ -1,17 +1,19 @@
 %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
 
 Name:           python-GeoIP
-Version:        1.2.4
-Release:        3%{?dist}
+Version:        1.2.5
+Release:        0.1.20090931cvs%{?dist}
 Summary:        Python bindings for the GeoIP geographical lookup libraries
 
 Group:          Development/Languages
-License:        LGPL
+License:        LGPLv2+
 URL:            http://www.maxmind.com/download/geoip/api/python/
 Source0:        http://www.maxmind.com/download/geoip/api/python/GeoIP-Python-%{version}.tar.gz
+Patch0:         python-GeoIP-1.2.4-ipv6.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-BuildRequires:  python-devel GeoIP-devel
+# GeoIP 1.4.7 needed for IPv6 lookup functions
+BuildRequires:  python-devel, GeoIP-devel >= 1.4.7
 
 %description
 This package contains the Python bindings for the GeoIP API, allowing IP to
@@ -19,6 +21,7 @@ location lookups to country, city and or
 
 %prep
 %setup -q -n GeoIP-Python-%{version}
+%patch0 -p1
 
 %build
 CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
@@ -42,6 +45,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Mon Aug 31 2009 Matt Domsch <mdomsch at fedoraproject.org> - 1.2.5-0.1.20090931cvs
+- add IPv6 functions from CVS HEAD
+
 * Sun Jul 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.2.4-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 




More information about the fedora-extras-commits mailing list