%define real_name PyYAML Name: python-yaml Version: 3.10 Release: %mkrel 7 Epoch: 0 Summary: Python package implementing YAML parser and emitter License: MIT Group: Development/Python URL: http://pyyaml.org/ Source0: http://pyyaml.org/download/pyyaml/PyYAML-%{version}.tar.gz Provides: %{real_name} = %{epoch}:%{version}-%{release} BuildRequires: pkgconfig(python) BuildRequires: python-setuptools BuildRequires: yaml-devel %description PyYAML is a YAML parser and emitter for the Python programming language. YAML is a data serialization format designed for human readability and interaction with scripting languages. %package -n python3-yaml Summary: YAML parser and emitter for Python Group: Development/Python BuildRequires: pkgconfig(python3) BuildRequires: python3-setuptools %description -n python3-yaml PyYAML is a YAML parser and emitter for the Python programming language. YAML is a data serialization format designed for human readability and interaction with scripting languages. %prep %setup -q -n %{real_name}-%{version} chmod a-x examples/yaml-highlight/yaml_hl.py cp -a . %{py3dir} %build CFLAGS="%{optflags}" %{__python} setup.py build pushd %{py3dir} CFLAGS="%{optflags}" %{__python3} setup.py build popd %install %{__python} setup.py install -O2 --skip-build --root=%{buildroot} --prefix=%{_prefix} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root %{buildroot} popd %files %doc LICENSE README examples %{python_sitearch}/yaml %{python_sitearch}/*.so %{python_sitearch}/*.egg-info %files -n python3-yaml %doc LICENSE README examples %{python3_sitearch}/*