]>
Commit | Line | Data |
---|---|---|
7d09d443 MK |
1 | # Conditional build: |
2 | %bcond_with doc # don't build doc | |
3 | %bcond_with tests # do not perform "make test" | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
4e9f3ba5 AM |
7 | %define module geopy |
8 | Summary: A Geocoding Toolbox for Python | |
9 | Name: python-%{module} | |
98b84bca | 10 | Version: 1.23.0 |
f9ca9c62 | 11 | Release: 4 |
4e9f3ba5 AM |
12 | License: MIT |
13 | Group: Development/Languages/Python | |
b34bfc80 | 14 | Source0: https://pypi.python.org/packages/source/g/geopy/geopy-%{version}.tar.gz |
98b84bca | 15 | # Source0-md5: e8b7d678665fab26ce3e8ff97f352ee8 |
b34bfc80 | 16 | URL: https://pypi.python.org/pypi/geopy |
8e675dbd | 17 | BuildRequires: rpmbuild(macros) >= 1.710 |
7d09d443 MK |
18 | |
19 | %if %{with python2} | |
20 | ## BuildRequires: pylint | |
4e9f3ba5 | 21 | BuildRequires: python-devel |
568c3ec1 | 22 | BuildRequires: python-setuptools |
7d09d443 MK |
23 | %endif |
24 | %if %{with python3} | |
25 | ## BuildRequires: pylint-python3 | |
26 | BuildRequires: python3-devel | |
7d09d443 MK |
27 | BuildRequires: python3-modules |
28 | %endif | |
29 | ||
4e9f3ba5 AM |
30 | BuildArch: noarch |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
34 | geopy makes it easy for developers to locate the coordinates of | |
35 | addresses, cities, countries, and landmarks across the globe using | |
36 | third-party geocoders and other data sources, such as wikis. | |
37 | ||
38 | geopy currently includes support for six geocoders: Google Maps, | |
39 | Yahoo! Maps, Windows Local Live (Virtual Earth), geocoder.us, | |
40 | GeoNames, MediaWiki pages (with the GIS extension), and Semantic | |
41 | MediaWiki pages. | |
42 | ||
7d09d443 MK |
43 | |
44 | %package -n python3-%{module} | |
45 | Summary: - | |
46 | Summary(pl.UTF-8): - | |
47 | Group: Libraries/Python | |
48 | Requires: python3-modules | |
49 | ||
50 | %description -n python3-%{module} | |
51 | geopy makes it easy for developers to locate the coordinates of | |
52 | addresses, cities, countries, and landmarks across the globe using | |
53 | third-party geocoders and other data sources, such as wikis. | |
54 | ||
55 | geopy currently includes support for six geocoders: Google Maps, | |
56 | Yahoo! Maps, Windows Local Live (Virtual Earth), geocoder.us, | |
57 | GeoNames, MediaWiki pages (with the GIS extension), and Semantic | |
58 | MediaWiki pages. | |
59 | ||
60 | ## %description -n python3-%{module} -l pl.UTF-8 | |
61 | ||
62 | %package apidocs | |
63 | Summary: %{module} API documentation | |
64 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
65 | Group: Documentation | |
66 | ||
67 | %description apidocs | |
68 | API documentation for %{module}. | |
69 | ||
70 | %description apidocs -l pl.UTF-8 | |
71 | Dokumentacja API %{module}. | |
72 | ||
4e9f3ba5 AM |
73 | %prep |
74 | %setup -q -n %{module}-%{version} | |
75 | ||
76 | %build | |
7d09d443 | 77 | %if %{with python2} |
178ae869 | 78 | %py_build %{?with_tests:test} |
7d09d443 MK |
79 | %endif |
80 | ||
81 | %if %{with python3} | |
178ae869 | 82 | %py3_build %{?with_tests:test} |
7d09d443 MK |
83 | %endif |
84 | ||
85 | %if %{with doc} | |
86 | cd docs | |
87 | %{__make} -j1 html | |
88 | rm -rf _build/html/_sources | |
89 | %endif | |
90 | ||
4e9f3ba5 AM |
91 | |
92 | %install | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
7d09d443 | 95 | %if %{with python2} |
178ae869 | 96 | %py_install |
4e9f3ba5 | 97 | |
4e9f3ba5 | 98 | %py_postclean |
7d09d443 MK |
99 | %endif |
100 | ||
101 | %if %{with python3} | |
178ae869 | 102 | %py3_install |
7d09d443 MK |
103 | %endif |
104 | ||
4e9f3ba5 AM |
105 | |
106 | %clean | |
107 | rm -rf $RPM_BUILD_ROOT | |
108 | ||
109 | %files | |
110 | %defattr(644,root,root,755) | |
7d09d443 MK |
111 | %dir %{py_sitescriptdir}/%{module} |
112 | %{py_sitescriptdir}/%{module}/*.py[co] | |
113 | %dir %{py_sitescriptdir}/%{module}/geocoders | |
114 | %{py_sitescriptdir}/%{module}/geocoders/*.py[co] | |
4e9f3ba5 | 115 | %if "%{py_ver}" > "2.4" |
7d09d443 | 116 | %{py_sitescriptdir}/%{module}-*.egg-info |
4e9f3ba5 | 117 | %endif |
7d09d443 MK |
118 | |
119 | %if %{with python3} | |
120 | %files -n python3-%{module} | |
121 | %defattr(644,root,root,755) | |
122 | ## %doc AUTHORS CHANGES LICENSE | |
123 | %{py3_sitescriptdir}/%{module} | |
124 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
125 | %endif | |
126 |