]> git.pld-linux.org Git - packages/python-maxminddb.git/blame - python-maxminddb.spec
rel 16; disable python3 here. Now in python3-maxminddb.spec
[packages/python-maxminddb.git] / python-maxminddb.spec
CommitLineData
d11597d7
AM
1#
2# Conditional build:
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
0574dee1 6%bcond_with python3 # CPython 3.x module
d11597d7
AM
7
8%define module maxminddb
9Summary: Python extension for reading the MaxMind DB format
10Name: python-%{module}
11Version: 1.1.1
0574dee1 12Release: 16
d11597d7
AM
13License: APL
14Group: Libraries/Python
15Source0: https://pypi.python.org/packages/source/m/maxminddb/maxminddb-%{version}.tar.gz
16# Source0-md5: 70a6d2a4b70f08e5b509fbb83f239795
17URL: https://pypi.python.org/pypi/maxminddb
cc558049 18BuildRequires: libmaxminddb-devel
d11597d7 19BuildRequires: rpm-pythonprov
5d71afa8 20BuildRequires: rpmbuild(macros) >= 1.710
d11597d7
AM
21%if %{with python2}
22BuildRequires: python-devel
23BuildRequires: python-distribute
24%endif
25%if %{with python3}
26BuildRequires: python3-devel
d11597d7
AM
27BuildRequires: python3-modules
28%endif
29Requires: python-ipaddr
30Requires: python-modules
31BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33%description
34This is a Python module for reading MaxMind DB files.
35
36MaxMind DB is a binary file format that stores data indexed by IP
37address subnets (IPv4 or IPv6).
38
39%package -n python3-%{module}
40Summary: Python extension for reading the MaxMind DB format
41Group: Libraries/Python
42Requires: python3-modules
43
44%description -n python3-%{module}
45This is a Python module for reading MaxMind DB files.
46
47MaxMind DB is a binary file format that stores data indexed by IP
48address subnets (IPv4 or IPv6).
49
50%package apidocs
51Summary: %{module} API documentation
52Summary(pl.UTF-8): Dokumentacja API %{module}
53Group: Documentation
ef558b1b 54BuildArch: noarch
d11597d7
AM
55
56%description apidocs
57API documentation for %{module}.
58
59%description apidocs -l pl.UTF-8
60Dokumentacja API %{module}.
61
62%prep
63%setup -q -n %{module}-%{version}
64
65%build
66%if %{with python2}
67CC="%{__cc}" \
68CFLAGS="%{rpmcppflags} %{rpmcflags}" \
d23282ad 69%py_build %{?with_tests:test}
d11597d7
AM
70%endif
71
72%if %{with python3}
73CC="%{__cc}" \
74CFLAGS="%{rpmcppflags} %{rpmcflags}" \
d23282ad 75%py3_build %{?with_tests:test}
d11597d7
AM
76%endif
77
78%if %{with doc}
79cd docs
80%{__make} -j1 html
81rm -rf _build/html/_sources
82%endif
83
84%install
85rm -rf $RPM_BUILD_ROOT
86
87%if %{with python2}
d23282ad 88%py_install
d11597d7
AM
89
90%py_postclean
91%endif
92
93%if %{with python3}
d23282ad 94%py3_install
d11597d7
AM
95%endif
96
97%clean
98rm -rf $RPM_BUILD_ROOT
99
100%if %{with python2}
101%files
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
109%endif
110%endif
111
112%if %{with python3}
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
118%endif
119
120%if %{with doc}
121%files apidocs
122%defattr(644,root,root,755)
123%doc docs/html/*
124%endif
This page took 0.176038 seconds and 4 git commands to generate.