3 %bcond_without doc # don't build doc
4 %bcond_with tests # do not perform "make test"
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 %define module maxminddb
9 Summary: Python extension for reading the MaxMind DB format
10 Name: python-%{module}
14 Group: Libraries/Python
15 Source0: https://pypi.python.org/packages/source/m/maxminddb/maxminddb-%{version}.tar.gz
16 # Source0-md5: 70a6d2a4b70f08e5b509fbb83f239795
17 URL: https://pypi.python.org/pypi/maxminddb
18 BuildRequires: libmaxminddb-devel
19 BuildRequires: rpm-pythonprov
20 BuildRequires: rpmbuild(macros) >= 1.710
22 BuildRequires: python-devel
23 BuildRequires: python-distribute
26 BuildRequires: python3-devel
27 BuildRequires: python3-modules
29 Requires: python-ipaddr
30 Requires: python-modules
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 This is a Python module for reading MaxMind DB files.
36 MaxMind DB is a binary file format that stores data indexed by IP
37 address subnets (IPv4 or IPv6).
39 %package -n python3-%{module}
40 Summary: Python extension for reading the MaxMind DB format
41 Group: Libraries/Python
42 Requires: python3-modules
44 %description -n python3-%{module}
45 This is a Python module for reading MaxMind DB files.
47 MaxMind DB is a binary file format that stores data indexed by IP
48 address subnets (IPv4 or IPv6).
51 Summary: %{module} API documentation
52 Summary(pl.UTF-8): Dokumentacja API %{module}
57 API documentation for %{module}.
59 %description apidocs -l pl.UTF-8
60 Dokumentacja API %{module}.
63 %setup -q -n %{module}-%{version}
68 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
69 %py_build %{?with_tests:test}
74 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
75 %py3_build %{?with_tests:test}
81 rm -rf _build/html/_sources
85 rm -rf $RPM_BUILD_ROOT
98 rm -rf $RPM_BUILD_ROOT
102 %defattr(644,root,root,755)
103 %doc HISTORY.rst README.rst
104 %dir %{py_sitedir}/maxminddb
105 %{py_sitedir}/maxminddb/*.py[co]
106 %attr(755,root,root) %{py_sitedir}/maxminddb/*.so
107 %if "%{py_ver}" > "2.4"
108 %{py_sitedir}/%{module}-%{version}-py*.egg-info
113 %files -n python3-%{module}
114 %defattr(644,root,root,755)
115 %doc HISTORY.rst README.rst
116 %{py3_sitedir}/%{module}
117 %{py3_sitedir}/%{module}-%{version}-py*.egg-info
122 %defattr(644,root,root,755)