rpms/python-GeoIP/F-7 GeoIP-Python-1.2.1-ccodes.patch, NONE, 1.1 python-GeoIP.spec, 1.4, 1.5
Michael G. Fleming (mfleming)
fedora-extras-commits at redhat.com
Thu Sep 13 12:15:01 UTC 2007
Author: mfleming
Update of /cvs/extras/rpms/python-GeoIP/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29738
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-7
- 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/F-7/python-GeoIP.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- python-GeoIP.spec 9 Dec 2006 05:09:32 -0000 1.4
+++ python-GeoIP.spec 13 Sep 2007 12:14:27 -0000 1.5
@@ -2,13 +2,14 @@
Name: python-GeoIP
Version: 1.2.1
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: Python bindings for the GeoIP geographical lookup libraries
Group: Development/Languages
-License: GPL
+License: GPLv2+
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
@@ -21,6 +22,7 @@
%prep
%setup -q -n GeoIP-Python-%{version}
+%patch0 -p1 -b .ccodes
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
@@ -43,6 +45,11 @@
%changelog
+* Thu Sep 13 2007 Michael Fleming <mfleming+rpm at enlartenment.com> 1.2.1-7
+- Add patch to expose country codes courtesy of Ignacio Vazquez-Adams
+ (bz #243696)
+- Update License tag per guidelines.
+
* Sat Dec 9 2006 Michael Fleming <mfleming+rpm at enlartenment.com> 1.2.1-6
- Rebuild for python 2.5
More information about the fedora-extras-commits
mailing list