Blob Blame History Raw
%{!?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.1
Release:        10%{?dist}
Summary:        Python bindings for the GeoIP geographical lookup libraries

Group:          Development/Languages
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

%description
This package contains the Python bindings for the GeoIP API, allowing IP to
location lookups to country, city and organization level within Python code.

%prep
%setup -q -n GeoIP-Python-%{version}
%patch0 -p1 -b .ccodes

%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
# To avoid adding un-needed dependencies
chmod -x test*.py

%install
rm -rf %{buildroot}
%{__python} setup.py install -O1 --skip-build --root %{buildroot}

 
%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,-)
%doc LICENSE README ChangeLog test*.py
%{python_sitearch}/GeoIP.so


%changelog
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.2.1-10
- Autorebuild for GCC 4.3

* Thu Sep 13 2007 Michael Fleming <mfleming+rpm@enlartenment.com> 1.2.1-9
- Add patch to expose country codes courtesy of Ignacio Vazquez-Adams
  (bz #243696)
- Update License tag per new guidelines
- Fix requires per python packaging guidelines.

* Sat Dec 9 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.2.1-6
- Rebuild for python 2.5

* Mon Sep 4 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.2.1-5
- Rebuild

* Mon Jun 19 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.2.1-4
- Bump to create sane distro upgrade paths

* Mon Feb 21 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.2.1-3
- Trivial spec tweaks
- Removed redundant GeoIP Requires: (rpm picks it up automatically)

* Mon Feb 20 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.2.1-2
- Change name to -GeoIP in keeping with naming conventions.
- Fix dependency issues caused by the test scripts in %%doc.

* Sat Feb 18 2006 Michael Fleming <mfleming+rpm@enlartenment.com> 1.2.1-1
- Initial version.