%if 0%{?fedora} || 0%{?rhel} >= 8
%bcond_without python3
%global py2pkg_suffix 2
%else # 0#{?fedora} || 0#{?rhel} >= 8
%bcond_with python3
%endif # 0#{?fedora} || 0#{?rhel} >= 8
%global pypi_name jcconv
%global common_desc \
%{summary} - inter-convert hiragana, katakana, \
half-width kana.
Name: python-%{pypi_name}
Version: 0.2.4
Release: 6%{?dist}
Summary: JapaneseCharacterCONVerter
License: MIT
URL: https://pypi.python.org/pypi/%{pypi_name}
Source0: https://github.com/besser82/jcconv/archive/v%{version}.tar.gz#/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
%description
%{common_desc}
%package -n python2-%{pypi_name}
Summary:%{summary}
BuildRequires: python%{?py2pkg_suffix}-devel
BuildRequires: python%{?py2pkg_suffix}-setuptools
BuildRequires: python%{?py2pkg_suffix}-six
Requires: python%{?py2pkg_suffix}-six
%{?python_provide:%python_provide python2-%{pypi_name}}
%description -n python2-%{pypi_name}
%{common_desc}
%if %{with python3}
%package -n python3-%{pypi_name}
Summary:%{summary}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-six
Requires: python3-six
%{?python_provide:%python_provide python3-%{pypi_name}}
%description -n python3-%{pypi_name}
%{common_desc}
%endif # with python3
%prep
%autosetup -n %{pypi_name}-%{version}
%build
%py2_build
%if %{with python3}
%py3_build
%endif # with python3
%install
%if %{with python3}
%py3_install
%endif # with python3
%py2_install
%check
%{__python2} setup.py test -vv
%if %{with python3}
%{__python3} setup.py test -vv
%endif
%files -n python2-%{pypi_name}
%license LICENSE.txt
%doc %{pypi_name}.egg-info/PKG-INFO README.rst
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info
%if %{with python3}
%files -n python3-%{pypi_name}
%license LICENSE.txt
%doc %{pypi_name}.egg-info/PKG-INFO README.rst
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
%endif # with python3
%changelog
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.4-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.2.4-3
- Rebuild for Python 3.6
* Mon Oct 03 2016 Björn Esser <fedora@besser82.io> - 0.2.4-2
- Add py2pkg_suffix to support epel <= 7
* Mon Oct 03 2016 Björn Esser <fedora@besser82.io> - 0.2.4-1
- Initial import (rhbz 1380671)
* Sat Oct 01 2016 Björn Esser <fedora@besser82.io> - 0.2.4-0.1
- Update to new release
* Fri Sep 30 2016 Björn Esser <fedora@besser82.io> - 0.2.3-0.2
- Add Python 3 support
- Informed upstream of missing license
* Thu Sep 29 2016 Björn Esser <fedora@besser82.io> - 0.2.3-0.1
- Initial package (rhbz 1380671)