# sitelib for noarch packages, sitearch for others (remove the unneeded one) %{!?__python2: %global __python2 %__python} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %if 0%{?fedora} %bcond_without python3 %else %bcond_with python3 %endif %global pkgname poyo Name: python-poyo Version: 0.4.1 Release: 1%{?dist} Summary: A lightweight YAML Parser for Python License: MIT URL: https://github.com/hackebrot/poyo Source0: https://github.com/hackebrot/%{pkgname}/archive/%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel %if %{with python3} BuildRequires: python3-devel %endif # with python3 %description A lightweight YAML Parser for Python Please note that Poyo supports only a chosen subset of the YAML format. It can only read but not write and is not compatible with JSON. Poyo does not allow deserialization of arbitrary Python objects. Supported types are str, bool, int, float, NoneType as well as dict and list values. Please see the examples below to get an idea of what Poyo understands. %package -n python2-%{pkgname} Summary: %{summary} %{?python_provide:%python_provide python2-%{pkgname}} %description -n python2-%{pkgname} A lightweight YAML Parser for Python Please note that Poyo supports only a chosen subset of the YAML format. It can only read but not write and is not compatible with JSON. Poyo does not allow deserialization of arbitrary Python objects. Supported types are str, bool, int, float, NoneType as well as dict and list values. Please see the examples below to get an idea of what Poyo understands. %if %{with python3} %package -n python3-%{pkgname} Summary: %{summary} %{?python_provide:%python_provide python3-%{pkgname}} %description -n python3-%{pkgname} A lightweight YAML Parser for Python Please note that Poyo supports only a chosen subset of the YAML format. It can only read but not write and is not compatible with JSON. Poyo does not allow deserialization of arbitrary Python objects. Supported types are str, bool, int, float, NoneType as well as dict and list values. Please see the examples below to get an idea of what Poyo understands. %endif # with python3 %prep %autosetup -n %{pkgname}-%{version} %build %{py2_build} %if %{with python3} %{py3_build} %endif # with python3 %install %{py2_install} %if %{with python3} %{py3_install} %endif # with python3 %check %{__python2} setup.py test %if %{with python3} %{__python3} setup.py test %endif %files -n python2-%{pkgname} %license LICENSE %doc *.rst %doc *.md %{python2_sitelib}/* %if %{with python3} %files -n python3-%{pkgname} %license LICENSE %doc *.rst %doc *.md %{python3_sitelib}/* %endif # with python3 %changelog * Tue Mar 6 2018 Brett Lentz - 0.4.1-1 - initial package