]> git.pld-linux.org Git - SPECS.git/blob - python3-pycountry.spec
SPECS updated Sun 1 Aug 20:28:02 CEST 2021
[SPECS.git] / python3-pycountry.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit tests
4
5 Summary:        ISO country, subdivision, language, currency and script definitions and their translations
6 Summary(pl.UTF-8):      Definicje ISO dla krajów, podziału, języków, walut i pisma wraz z tłumaczeniami
7 Name:           python3-pycountry
8 Version:        19.8.18
9 Release:        2
10 License:        LGPL v2.1
11 Group:          Libraries/Python
12 #Source0Download: https://pypi.org/simple/pycountry/
13 Source0:        https://files.pythonhosted.org/packages/source/p/pycountry/pycountry-%{version}.tar.gz
14 # Source0-md5:  533d51dbd38ed4bd928f7f6e8ad923d0
15 URL:            https://pypi.org/project/pycountry/
16 BuildRequires:  python3-modules >= 1:3.3
17 BuildRequires:  python3-setuptools
18 %if %{with tests}
19 BuildRequires:  python3-pytest
20 %endif
21 BuildRequires:  rpm-pythonprov
22 BuildRequires:  rpmbuild(macros) >= 1.714
23 Requires:       python3-modules >= 1:3.3
24 BuildArch:      noarch
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %description
28 ISO country, subdivision, language, currency and script definitions
29 and their translations.
30
31 %description -l pl.UTF-8
32 Definicje ISO dla krajów, podziału, języków, walut i pisma wraz z
33 tłumaczeniami.
34
35 %prep
36 %setup -q -n pycountry-%{version}
37
38 %build
39 %py3_build
40
41 %if %{with tests}
42 PYTHONPATH=$(pwd)/src \
43 %{__python3} -m pytest src/pycountry/tests
44 %endif
45
46 %install
47 rm -rf $RPM_BUILD_ROOT
48
49 %py3_install
50
51 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/pycountry/tests
52
53 find $RPM_BUILD_ROOT%{py3_sitescriptdir}/pycountry/locales -type d -maxdepth 1 | \
54         %{__sed} -ne "s,$RPM_BUILD_ROOT\(.*locales/\([a-z]\+\(_[A-Z][A-Z]\)\?\).*\),%%lang(\2) \1,p" > py3.lang
55
56 %clean
57 rm -rf $RPM_BUILD_ROOT
58
59 %files -f py3.lang
60 %defattr(644,root,root,755)
61 %doc HISTORY.txt README.rst TODO.txt
62 %dir %{py3_sitescriptdir}/pycountry
63 %{py3_sitescriptdir}/pycountry/*.py
64 %{py3_sitescriptdir}/pycountry/__pycache__
65 %{py3_sitescriptdir}/pycountry/databases
66 %dir %{py3_sitescriptdir}/pycountry/locales
67 %{py3_sitescriptdir}/pycountry-%{version}-py*.egg-info
This page took 0.637938 seconds and 3 git commands to generate.