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: rpm-pythonprov
19 BuildRequires: rpmbuild(macros) >= 1.219
21 BuildRequires: python-devel
22 BuildRequires: python-distribute
25 BuildRequires: python3-devel
26 BuildRequires: python3-distribute
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}
56 API documentation for %{module}.
58 %description apidocs -l pl.UTF-8
59 Dokumentacja API %{module}.
62 %setup -q -n %{module}-%{version}
67 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
68 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
73 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
74 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
80 rm -rf _build/html/_sources
84 rm -rf $RPM_BUILD_ROOT
87 %{__python} setup.py \
88 build --build-base build-2 \
89 install --skip-build \
91 --root=$RPM_BUILD_ROOT
97 %{__python3} setup.py \
98 build --build-base build-3 \
99 install --skip-build \
101 --root=$RPM_BUILD_ROOT
105 rm -rf $RPM_BUILD_ROOT
109 %defattr(644,root,root,755)
110 %doc HISTORY.rst README.rst
111 %dir %{py_sitedir}/maxminddb
112 %{py_sitedir}/maxminddb/*.py[co]
113 %attr(755,root,root) %{py_sitedir}/maxminddb/*.so
114 %if "%{py_ver}" > "2.4"
115 %{py_sitedir}/%{module}-%{version}-py*.egg-info
120 %files -n python3-%{module}
121 %defattr(644,root,root,755)
122 %doc HISTORY.rst README.rst
123 %{py3_sitedir}/%{module}
124 %{py3_sitedir}/%{module}-%{version}-py*.egg-info
129 %defattr(644,root,root,755)