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