rpms/python-GeoIP/EL-5 GeoIP-Python-1.2.1-ccodes.patch, NONE, 1.1 python-GeoIP.spec, 1.3, 1.4

Michael G. Fleming (mfleming) fedora-extras-commits at redhat.com
Thu Sep 13 12:29:40 UTC 2007


Author: mfleming

Update of /cvs/extras/rpms/python-GeoIP/EL-5
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv30574

Modified Files:
	python-GeoIP.spec 
Added Files:
	GeoIP-Python-1.2.1-ccodes.patch 
Log Message:
* Thu Sep 13 2007 Michael Fleming <mfleming+rpm at enlartenment.com> 1.2.1-6
- Add patch to expose country codes courtesy of Ignacio Vazquez-Adams
  (bz #243696)
- Update License tag per guidelines.


GeoIP-Python-1.2.1-ccodes.patch:

--- NEW FILE GeoIP-Python-1.2.1-ccodes.patch ---
diff -up GeoIP-Python-1.2.1/py_GeoIP.c.ccodes GeoIP-Python-1.2.1/py_GeoIP.c
--- GeoIP-Python-1.2.1/py_GeoIP.c.ccodes	2005-06-28 09:28:37.000000000 -0400
+++ GeoIP-Python-1.2.1/py_GeoIP.c	2007-09-04 19:00:51.000000000 -0400
@@ -306,6 +306,28 @@ initGeoIP(void) 
   m = Py_InitModule("GeoIP", GeoIP_Class_methods);
   d = PyModule_GetDict(m);
 
+  int total_ccodes = 251;
+
+  PyObject *ccode = PyTuple_New(total_ccodes);
+  PyObject *cname = PyDict_New();
+  PyObject *ccont = PyDict_New();
+  PyObject *s;
+
+  int i = 0;
+  for (; i<total_ccodes; i++)
+  {
+    s = PyString_FromString(GeoIP_country_code[i]);
+    PyTuple_SET_ITEM(ccode, i, s);
+    Py_INCREF(s);
+    PyDict_SetItem(cname, s, PyString_FromString(GeoIP_country_name[i]));
+    Py_INCREF(s);
+    PyDict_SetItem(ccont, s, PyString_FromString(GeoIP_country_continent[i]));
+  };
+
+  PyDict_SetItemString(d, "country_codes", ccode);
+  PyDict_SetItemString(d, "country_names", cname);
+  PyDict_SetItemString(d, "country_continents", ccont);
+
   tmp = PyInt_FromLong(0);
   PyDict_SetItemString(d, "GEOIP_STANDARD", tmp);
   Py_DECREF(tmp);


Index: python-GeoIP.spec
===================================================================
RCS file: /cvs/extras/rpms/python-GeoIP/EL-5/python-GeoIP.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- python-GeoIP.spec	4 Sep 2006 10:14:12 -0000	1.3
+++ python-GeoIP.spec	13 Sep 2007 12:29:08 -0000	1.4
@@ -2,17 +2,17 @@
 
 Name:           python-GeoIP
 Version:        1.2.1
-Release:        5%{?dist}
+Release:        6%{?dist}
 Summary:        Python bindings for the GeoIP geographical lookup libraries
 
 Group:          Development/Languages
 License:        GPL
 URL:            http://www.maxmind.com/download/geoip/api/python/
 Source0:        http://www.maxmind.com/download/geoip/api/python/GeoIP-Python-%{version}.tar.gz
+Patch0:		GeoIP-Python-1.2.1-ccodes.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  python-devel GeoIP-devel
-Requires: python-abi = %(%{__python} -c "import sys ; print sys.version[:3]")
 
 %description
 This package contains the Python bindings for the GeoIP API, allowing IP to
@@ -20,7 +20,7 @@
 
 %prep
 %setup -q -n GeoIP-Python-%{version}
-
+%patch0 -p1 -b .ccodes
 
 %build
 CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
@@ -43,6 +43,11 @@
 
 
 %changelog
+* Thu Sep 13 2007 Michael Fleming <mfleming+rpm at enlartenment.com> 1.2.1-6
+- Add patch to expose country codes courtesy of Ignacio Vazquez-Adams
+  (bz #243696)
+- Update License tag per guidelines.
+
 * Mon Sep 4 2006 Michael Fleming <mfleming+rpm at enlartenment.com> 1.2.1-5
 - Rebuild
 




More information about the fedora-extras-commits mailing list