]> git.pld-linux.org Git - packages/python-GeoIP2.git/blob - python-GeoIP2.spec
e42d302ac3160820589b2ca67370a9fabd67f632
[packages/python-GeoIP2.git] / python-GeoIP2.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_with     python3 # CPython 3.x module
7
8 %define         module  GeoIP2
9 Summary:        GeoIP2 webservice client and database reader
10 Name:           python-%{module}
11 Version:        2.1.0
12 Release:        1
13 License:        LGPL v2.1
14 Group:          Libraries/Python
15 Source0:        https://github.com/maxmind/GeoIP2-python/archive/v%{version}.tar.gz
16 # Source0-md5:  daa61c5cd1b3bc45e03aada0466978aa
17 URL:            http://geoip2.readthedocs.org/en/latest/
18 BuildRequires:  libmaxminddb-devel
19 BuildRequires:  rpm-pythonprov
20 BuildRequires:  rpmbuild(macros) >= 1.710
21 %{?with_doc:BuildRequires:      sphinx-pdg}
22 %if %{with python2}
23 BuildRequires:  python-devel
24 BuildRequires:  python-distribute
25 BuildRequires:  python-httpretty >= 0.6.1
26 BuildRequires:  python-maxminddb
27 %endif
28 %if %{with python3}
29 BuildRequires:  python3-devel
30 BuildRequires:  python3-distribute
31 BuildRequires:  python3-httpretty >= 0.6.1
32 BuildRequires:  python3-maxminddb
33 BuildRequires:  python3-modules
34 %endif
35 Requires:       python-ipaddr
36 Requires:       python-modules
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 %description
40 This package provides an API for the GeoIP2 web services and
41 databases. The API also works with MaxMind's free GeoLite2 databases.
42
43 %package -n python3-%{module}
44 Summary:        GeoIP2 webservice client and database reader
45 Group:          Libraries/Python
46 Requires:       python3-modules
47
48 %description -n python3-%{module}
49 This package provides an API for the GeoIP2 web services and
50 databases. The API also works with MaxMind's free GeoLite2 databases.
51
52 %package apidocs
53 Summary:        %{module} API documentation
54 Summary(pl.UTF-8):      Dokumentacja API %{module}
55 Group:          Documentation
56
57 %description apidocs
58 API documentation for %{module}.
59
60 %description apidocs -l pl.UTF-8
61 Dokumentacja API %{module}.
62
63 %prep
64 %setup -q -n %{module}-python-%{version}
65
66 %build
67 %if %{with python2}
68 CC="%{__cc}" \
69 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
70 %py_build %{?with_tests:test}
71 %endif
72
73 %if %{with python3}
74 CC="%{__cc}" \
75 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
76 %py3_build %{?with_tests:test}
77 %endif
78
79 %if %{with doc}
80 cd docs
81 %{__make} -j1 html
82 rm -rf _build/html/_sources
83 %endif
84
85 %install
86 rm -rf $RPM_BUILD_ROOT
87
88 %if %{with python2}
89 %py_install
90
91 %py_postclean
92 %endif
93
94 %if %{with python3}
95 %py3_install
96 %endif
97
98 %clean
99 rm -rf $RPM_BUILD_ROOT
100
101 %if %{with python2}
102 %files
103 %defattr(644,root,root,755)
104 %doc HISTORY.rst README.rst
105 %{py_sitescriptdir}/geoip2
106 %if "%{py_ver}" > "2.4"
107 %{py_sitescriptdir}/geoip2-%{version}-py*.egg-info
108 %endif
109 %endif
110
111 %if %{with python3}
112 %files -n python3-%{module}
113 %defattr(644,root,root,755)
114 %doc HISTORY.rst README.rst
115 %{py3_sitescriptdir}/geoip2
116 %{py3_sitescriptdir}/geoip2-%{version}-py*.egg-info
117 %endif
118
119 %if %{with doc}
120 %files apidocs
121 %defattr(644,root,root,755)
122 %doc docs/_build/html/*
123 %endif
This page took 0.080392 seconds and 2 git commands to generate.