%if 0%{?rhel} && 0%{?rhel} <= 7
%global with_python3 0
%else
%global with_python3 1
%endif
# Created by pyp2rpm-1.1.1
%global pypi_name anymarkup
%global srcname anymarkup
%global modulename anymarkup
Name: python-%{srcname}
Version: 0.5.0
Release: 12%{?dist}
Summary: Parse or serialize any markup in Python
License: BSD
URL: https://github.com/bkabrda/anymarkup
Source0: https://pypi.python.org/packages/source/a/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-pytest
BuildRequires: python2-configobj python2-anymarkup-core python2-xmltodict python2-pyyaml
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pytest
%endif
%description
%{summary}
Currently supports ini, json, xml and yaml.
%package -n python2-%{srcname}
Summary: %{summary}
Requires: python2-configobj python2-anymarkup-core python2-xmltodict python2-pyyaml
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python2-%{srcname}
%{summary}
Currently supports ini, json, xml and yaml.
%if 0%{?with_python3}
%package -n python3-%{srcname}
Summary: %{summary}
BuildRequires: python3-configobj
BuildRequires: python3-anymarkup-core
BuildRequires: python3-xmltodict
BuildRequires: python3-PyYAML
Requires: python3
Requires: python3-configobj
Requires: python3-anymarkup-core
Requires: python3-xmltodict
Requires: python3-PyYAML
%{?python_provide:%python_provide python3-%{srcname}}
%description -n python3-%{srcname}
%{summary}
Currently supports ini, json, xml and yaml.
%endif
%prep
%setup -q -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
%if 0%{?with_python3}
echo %{py3dir}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
%{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%install
%{__python2} setup.py install --skip-build --root %{buildroot}
%if 0%{?with_python3}
%py_byte_compile %{__python2} %{buildroot}%{python_sitelib}/%{srcname}
%else
# py_byte_compile is only defined in python3-devel
%{__python2} -m compileall %{buildroot}%{python_sitelib}/%{srcname}
%endif
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/%{srcname}
popd
%endif
%check
%{__python2} -m pytest
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} -m pytest
popd
%endif
%files -n python2-%{srcname}
%license LICENSE
%doc README.rst
%{python2_sitelib}/%{modulename}
%{python2_sitelib}/%{modulename}-%{version}-py?.?.egg-info
%if 0%{?with_python3}
%files -n python3-%{srcname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{modulename}-%{version}-py%{python3_version}.egg-info
%{python3_sitelib}/%{modulename}/
%endif
%changelog
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.5.0-10
- Rebuilt for Python 3.7
* Wed Feb 07 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.5.0-9
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Mon Jul 03 2017 Petr Viktorin <pviktori@redhat.com> - 0.5.0-7
- Rename the python-anymarkup subpackage to python2-anymarkup
- Change available python- Requires to python2-
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.5.0-5
- Rebuild for Python 3.6
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Tue Oct 20 2015 jchaloup <jchaloup@redhat.com> - 0.5.0-1
- Update to 0.5.0
resolves: #1273011
* Mon Jul 27 2015 jchaloup <jchaloup@redhat.com> - 0.4.3-2
- Tests are not shipped in rpm => no need for pytest as a runtime dependency
resolves: #1247079
* Wed Jun 17 2015 jchaloup <jchaloup@redhat.com> - 0.4.3-1
- Update to 0.4.3
resolves: #1232519
* Thu May 21 2015 jchaloup <jchaloup@redhat.com> - 0.4.2-1
- Initial package
resolves: #1223843