3 %bcond_without tests # unit tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 Summary: ISO country, subdivision, language, currency and script definitions and their translations
8 Summary(pl.UTF-8): Definicje ISO dla krajów, podziału, języków, walut i pisma wraz z tłumaczeniami
10 # keep 18.x here for python2 support
14 Group: Libraries/Python
15 #Source0Download: https://pypi.org/simple/pycountry/
16 Source0: https://files.pythonhosted.org/packages/source/p/pycountry/pycountry-%{version}.tar.gz
17 # Source0-md5: 46223fa49c45c304083de7d5b1870fb7
18 URL: https://pypi.org/project/pycountry/
20 BuildRequires: python-modules >= 1:2.6
21 BuildRequires: python-setuptools
23 BuildRequires: python-pytest
27 BuildRequires: python3-modules >= 1:3.3
28 BuildRequires: python3-setuptools
30 BuildRequires: python3-pytest
33 BuildRequires: rpm-pythonprov
34 BuildRequires: rpmbuild(macros) >= 1.714
35 Requires: python-modules >= 1:2.6
37 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 ISO country, subdivision, language, currency and script definitions
41 and their translations.
43 %description -l pl.UTF-8
44 Definicje ISO dla krajów, podziału, języków, walut i pisma wraz z
47 %package -n python3-pycountry
48 Summary: ISO country, subdivision, language, currency and script definitions and their translations
49 Summary(pl.UTF-8): Definicje ISO dla krajów, podziału, języków, walut i pisma wraz z tłumaczeniami
50 Group: Libraries/Python
51 Requires: python3-modules >= 1:3.3
53 %description -n python3-pycountry
54 ISO country, subdivision, language, currency and script definitions
55 and their translations.
57 %description -n python3-pycountry -l pl.UTF-8
58 Definicje ISO dla krajów, podziału, języków, walut i pisma wraz z
62 %setup -q -n pycountry-%{version}
69 PYTHONPATH=$(pwd)/src \
70 %{__python} -m pytest src/pycountry/tests
78 PYTHONPATH=$(pwd)/src \
79 %{__python3} -m pytest src/pycountry/tests
84 rm -rf $RPM_BUILD_ROOT
89 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pycountry/tests
92 find $RPM_BUILD_ROOT%{py_sitescriptdir}/pycountry/locales -type d -maxdepth 1 | \
93 %{__sed} -ne "s,$RPM_BUILD_ROOT\(.*locales/\([a-z]\+\(_[A-Z][A-Z]\)\?\).*\),%%lang(\2) \1,p" > py2.lang
99 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/pycountry/tests
101 find $RPM_BUILD_ROOT%{py3_sitescriptdir}/pycountry/locales -type d -maxdepth 1 | \
102 %{__sed} -ne "s,$RPM_BUILD_ROOT\(.*locales/\([a-z]\+\(_[A-Z][A-Z]\)\?\).*\),%%lang(\2) \1,p" > py3.lang
106 rm -rf $RPM_BUILD_ROOT
110 %defattr(644,root,root,755)
111 %doc HISTORY.txt README TODO.txt
112 %dir %{py_sitescriptdir}/pycountry
113 %{py_sitescriptdir}/pycountry/*.py[co]
114 %{py_sitescriptdir}/pycountry/databases
115 %dir %{py_sitescriptdir}/pycountry/locales
116 %{py_sitescriptdir}/pycountry-%{version}-py*.egg-info
120 %files -n python3-pycountry -f py3.lang
121 %defattr(644,root,root,755)
122 %doc HISTORY.txt README TODO.txt
123 %dir %{py3_sitescriptdir}/pycountry
124 %{py3_sitescriptdir}/pycountry/*.py
125 %{py3_sitescriptdir}/pycountry/__pycache__
126 %{py3_sitescriptdir}/pycountry/databases
127 %dir %{py3_sitescriptdir}/pycountry/locales
128 %{py3_sitescriptdir}/pycountry-%{version}-py*.egg-info