Blob Blame History Raw
%global srcname pycountry

Name:           python-%{srcname}
Version:        18.5.26
Release:        1%{?dist}
Summary:        ISO country, subdivision, language, currency and script definitions and their translations

License:        LGPLv2
URL:            https://bitbucket.org/flyingcircus/pycountry
Source0:        %pypi_source
# Rebased from Debian:
Patch0001:      00-use_system_iso-codes.patch

BuildArch:      noarch

BuildRequires:  iso-codes >= 3.79
BuildRequires:  python3-devel
BuildRequires:  python3dist(setuptools)
BuildRequires:  python3dist(pytest)

%description
pycountry provides the ISO databases for the standards:
* 639-3 Languages
* 3166 Countries
* 3166-3 Deleted countries
* 3166-2 Subdivisions of countries
* 4217 Currencies
* 15924 Scripts


%package -n     python3-%{srcname}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{srcname}}

Requires:       iso-codes >= 3.79

%description -n python3-%{srcname}
pycountry provides the ISO databases for the standards:
* 639-3 Languages
* 3166 Countries
* 3166-3 Deleted countries
* 3166-2 Subdivisions of countries
* 4217 Currencies
* 15924 Scripts


%prep
%autosetup -n %{srcname}-%{version} -p1

# Remove bundled egg-info
rm -rf src/%{srcname}.egg-info

# Remove bundled iso-codes data
rm -rf src/%{srcname}/{databases,locales}


%build
%py3_build


%install
%py3_install


%check
PYTHONPATH=%{buildroot}%{python3_sitelib} PYTHONDONTWRITEBYTECODE=1 \
    %{__python3} -m pytest --pyargs pycountry


%files -n python3-%{srcname}
%doc README HISTORY.txt
%license LICENSE.txt
%{python3_sitelib}/%{srcname}
%{python3_sitelib}/%{srcname}-%{version}-py?.?.egg-info


%changelog
* Tue Mar 26 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 18.5.26-1
- Drop down version to something available in Fedora 29
- Initial package.