Rename python3-PyYAML to python3-pyyaml

- Modernize spec
- Fix python2 invocation
This commit is contained in:
Miro Hrončok 2018-07-13 01:11:58 +02:00
parent bcbfc05067
commit 8dad75a729

View File

@ -1,28 +1,23 @@
%global _name pyyaml
%if 0%{?fedora} || 0%{?rhel} >= 8
%global with_python3 1
%else
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif
Name: PyYAML
Version: 4.1
Release: 4%{?dist}
Release: 5%{?dist}
Summary: YAML parser and emitter for Python
Group: Development/Libraries
License: MIT
URL: https://github.com/yaml/pyyaml
Source0: https://github.com/yaml/pyyaml/archive/%{_name}-%{version}.tar.gz
BuildRequires: python2-devel, python2-setuptools, libyaml-devel
BuildRequires: Cython
BuildRequires: libyaml-devel
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-Cython
%endif
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-Cython
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-Cython
%global _description\
YAML is a data serialization format designed for human readability and\
@ -39,8 +34,9 @@ configuration files to object serialization and persistance.
%description %_description
%package -n python2-pyyaml
Summary: %summary
Summary: %summary
Provides: python-yaml = %{version}-%{release}
Provides: python-yaml%{?_isa} = %{version}-%{release}
Provides: python2-yaml = %{version}-%{release}
@ -53,26 +49,18 @@ Obsoletes: PyYAML < %{version}-%{release}
%description -n python2-pyyaml %_description
%if 0%{?with_python3}
%package -n python3-PyYAML
Summary: YAML parser and emitter for Python
Group: Development/Libraries
Provides: python3-yaml = %{version}-%{release}
Provides: python3-yaml%{?_isa} = %{version}-%{release}
%description -n python3-PyYAML
YAML is a data serialization format designed for human readability and
interaction with scripting languages. PyYAML is a YAML parser and
emitter for Python.
%package -n python3-pyyaml
Summary: %summary
Provides: python3-yaml = %{version}-%{release}
Provides: python3-yaml%{?_isa} = %{version}-%{release}
%{?python_provide:%python_provide python3-pyyaml}
# Remove before F31
Provides: python3-PyYAML = %{version}-%{release}
Provides: python3-PyYAML%{?_isa} = %{version}-%{release}
Obsoletes: python3-PyYAML < 4.1-5
PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
support, capable extension API, and sensible error messages. PyYAML
supports standard YAML tags and provides Python-specific tags that
allow to represent an arbitrary Python object.
PyYAML is applicable for a broad range of tasks from complex
configuration files to object serialization and persistance.
%endif
%description -n python3-pyyaml %_description
%prep
@ -84,57 +72,37 @@ rm -rf ext/_yaml.c
%build
# regenerate ext/_yaml.c
CFLAGS="${RPM_OPT_FLAGS}" %{__python} setup.py --with-libyaml build_ext
%if 0%{?with_python3}
rm -rf %{py3dir}
# ext/_yaml.c is needed
cp -a . %{py3dir}
pushd %{py3dir}
CFLAGS="${RPM_OPT_FLAGS}" %{__python3} setup.py --with-libyaml build
popd
%endif
CFLAGS="${RPM_OPT_FLAGS}" %{__python} setup.py --with-libyaml build
%py2_build
%py3_build
%install
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
popd
%endif
%py2_install
%py3_install
%check
%{__python} setup.py test
%if 0%{?with_python3}
pushd %{py3dir}
%{__python2} setup.py test
%{__python3} setup.py test
popd
%endif
%files -n python2-pyyaml
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc CHANGES README examples
%{python_sitearch}/*
%{python2_sitearch}/*
%if 0%{?with_python3}
%files -n python3-PyYAML
%{!?_licensedir:%global license %%doc}
%files -n python3-pyyaml
%license LICENSE
%doc CHANGES README examples
%{python3_sitearch}/*
%endif
%changelog
* Thu Jul 12 2018 Miro Hrončok <mhroncok@redhat.com> - 4.1-5
- Rename python3-PyYAML to python3-pyyaml
- Modernize spec
- Fix python2 invocation
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild