From 6a85e2952ddff0edd593ee9dacfe15075d03d2cf Mon Sep 17 00:00:00 2001 From: shirely Date: Fri, 29 Jul 2022 14:42:20 +0800 Subject: [PATCH] build python2-pyyaml only for scap-security-guide building --- PyYAML.spec | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/PyYAML.spec b/PyYAML.spec index 0c91574..1d4b256 100644 --- a/PyYAML.spec +++ b/PyYAML.spec @@ -1,7 +1,8 @@ +%bcond_without python2 Name: pyyaml Version: 5.3.1 -Release: 5 +Release: 6 Summary: YAML parser and emitter for Python License: MIT URL: https://github.com/yaml/pyyaml @@ -12,6 +13,10 @@ Patch0002: backport-fix-float-resolver.patch BuildRequires: gcc libyaml-devel +%if %{with python2} +BuildRequires: python2-devel python2-setuptools python2-Cython +%endif + BuildRequires: python3-devel python3-setuptools python3-Cython %description @@ -27,6 +32,32 @@ arbitrary Python object. PyYAML is applicable for a broad range of tasks from complex configuration files to object serialization and persistence. +%if %{with python2} +%package -n python2-pyyaml +Summary: %summary +Provides: python-yaml = %{version}-%{release} +Provides: python-yaml%{?_isa} = %{version}-%{release} +Provides: python2-yaml = %{version}-%{release} +Provides: python2-yaml%{?_isa} = %{version}-%{release} +%{?python_provide:%python_provide python2-pyyaml} +Provides: PyYAML = %{version}-%{release} +Provides: PyYAML%{?_isa} = %{version}-%{release} +Obsoletes: PyYAML < %{version}-%{release} + +%description -n python2-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. + +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 persistence. +%endif + %package -n python3-pyyaml Summary: %summary Provides: python3-yaml = %{version}-%{release} @@ -56,20 +87,38 @@ files to object serialization and persistence. %patch0002 -p1 %build +%if %{with python2} +%py2_build +%endif + %py3_build %install +%if %{with python2} +%py2_install +%endif + %py3_install %check %{__python3} setup.py test +%if %{with python2} +%files -n python2-pyyaml +%license LICENSE +%doc CHANGES README examples +%{python2_sitearch}/* +%endif + %files -n python3-pyyaml %license LICENSE %doc CHANGES README examples %{python3_sitearch}/* %changelog +* Fri Jul 29 2022 renhongxun - 5.3.1-6 +- build python2-pyyaml only for scap-security-guide building + * Sat Dec 18 2021 tianwei - 5.3.1-5 - Fix float resolver for '.'and'._' -- Gitee