#5 Add bcond for Python 2 subpackage
Merged 2 months ago by jeckersb. Opened 2 months ago by lbalhar.
rpms/ lbalhar/PyYAML master  into  master

file modified
+15 -1

@@ -1,3 +1,6 @@ 

+ # Prepared for Python 2 removal

+ %bcond_without python2

+ 

  Name:           PyYAML

  Version:        5.1.2

  Release:        3%{?dist}

@@ -11,8 +14,10 @@ 

  BuildRequires:  gcc

  BuildRequires:  libyaml-devel

  

+ %if %{with python2}

  BuildRequires:  python2-devel

  BuildRequires:  python2-setuptools

+ %endif

  

  BuildRequires:  python3-devel

  BuildRequires:  python3-setuptools

@@ -35,6 +40,7 @@ 

  %description %_description

  

  

+ %if %{with python2}

  %package -n python2-pyyaml

  Summary:        %summary

  Provides:       python-yaml = %{version}-%{release}

@@ -44,7 +50,7 @@ 

  %{?python_provide:%python_provide python2-pyyaml}

  

  %description -n python2-pyyaml %_description

- 

+ %endif

  

  %package -n python3-pyyaml

  Summary:        %summary

@@ -70,24 +76,32 @@ 

  %build

  %py3_build

  

+ %if %{with python2}

  # py2_build reuses Cython output from py3_build

  %py2_build

+ %endif

  

  

  %install

+ %if %{with python2}

  %py2_install

+ %endif

  %py3_install

  

  

  %check

+ %if %{with python2}

  %{__python2} setup.py test

+ %endif

  %{__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

no initial comment

Pull-Request has been merged by jeckersb

2 months ago
Metadata