]> git.pld-linux.org Git - packages/python-maxminddb.git/blob - python-maxminddb.spec
a9d279c7e8f6de9c705d9203d4f019de80ecf2f9
[packages/python-maxminddb.git] / python-maxminddb.spec
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
6 %bcond_without  python3 # CPython 3.x module
7
8 %define         module  maxminddb
9 Summary:        Python extension for reading the MaxMind DB format
10 Name:           python-%{module}
11 Version:        1.1.1
12 Release:        2
13 License:        APL
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
20 %if %{with python2}
21 BuildRequires:  python-devel
22 BuildRequires:  python-distribute
23 %endif
24 %if %{with python3}
25 BuildRequires:  python3-devel
26 BuildRequires:  python3-distribute
27 BuildRequires:  python3-modules
28 %endif
29 Requires:       python-ipaddr
30 Requires:       python-modules
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 This is a Python module for reading MaxMind DB files.
35
36 MaxMind DB is a binary file format that stores data indexed by IP
37 address subnets (IPv4 or IPv6).
38
39 %package -n python3-%{module}
40 Summary:        Python extension for reading the MaxMind DB format
41 Group:          Libraries/Python
42 Requires:       python3-modules
43
44 %description -n python3-%{module}
45 This is a Python module for reading MaxMind DB files.
46
47 MaxMind DB is a binary file format that stores data indexed by IP
48 address subnets (IPv4 or IPv6).
49
50 %package apidocs
51 Summary:        %{module} API documentation
52 Summary(pl.UTF-8):      Dokumentacja API %{module}
53 Group:          Documentation
54
55 %description apidocs
56 API documentation for %{module}.
57
58 %description apidocs -l pl.UTF-8
59 Dokumentacja API %{module}.
60
61 %prep
62 %setup -q -n %{module}-%{version}
63
64 %build
65 %if %{with python2}
66 CC="%{__cc}" \
67 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
68 %{__python} setup.py build --build-base build-2 %{?with_tests:test}
69 %endif
70
71 %if %{with python3}
72 CC="%{__cc}" \
73 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
74 %{__python3} setup.py build --build-base build-3 %{?with_tests:test}
75 %endif
76
77 %if %{with doc}
78 cd docs
79 %{__make} -j1 html
80 rm -rf _build/html/_sources
81 %endif
82
83 %install
84 rm -rf $RPM_BUILD_ROOT
85
86 %if %{with python2}
87 %{__python} setup.py \
88         build --build-base build-2 \
89         install --skip-build \
90         --optimize=2 \
91         --root=$RPM_BUILD_ROOT
92
93 %py_postclean
94 %endif
95
96 %if %{with python3}
97 %{__python3} setup.py \
98         build --build-base build-3 \
99         install --skip-build \
100         --optimize=2 \
101         --root=$RPM_BUILD_ROOT
102 %endif
103
104 %clean
105 rm -rf $RPM_BUILD_ROOT
106
107 %if %{with python2}
108 %files
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
116 %endif
117 %endif
118
119 %if %{with python3}
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
125 %endif
126
127 %if %{with doc}
128 %files apidocs
129 %defattr(644,root,root,755)
130 %doc docs/html/*
131 %endif
This page took 0.08557 seconds and 2 git commands to generate.