1fa0d9
# Python 2 removal, RHBZ#1775075
1fa0d9
%if 0%{?fedora} >= 32 || 0%{?rhel} >= 9
1fa0d9
%bcond_with     python2
1fa0d9
%else
1fa0d9
%bcond_without  python2
1fa0d9
%endif
1fa0d9
1fa0d9
Name:           PyYAML
1fa0d9
Version:        5.4.1
1fa0d9
Release:        6%{?dist}
1fa0d9
%global uversion %{version}
1fa0d9
Summary:        YAML parser and emitter for Python
1fa0d9
1fa0d9
License:        MIT
1fa0d9
URL:            https://github.com/yaml/pyyaml
1fa0d9
Source0:        https://github.com/yaml/pyyaml/archive/%{uversion}.tar.gz
1fa0d9
1fa0d9
BuildRequires:  gcc
1fa0d9
BuildRequires:  libyaml-devel
1fa0d9
1fa0d9
%if %{with python2}
1fa0d9
BuildRequires:  python2-devel
1fa0d9
BuildRequires:  python2-setuptools
1fa0d9
%endif
1fa0d9
1fa0d9
BuildRequires:  python3-devel
1fa0d9
BuildRequires:  python3-setuptools
1fa0d9
BuildRequires:  python3-Cython
1fa0d9
1fa0d9
1fa0d9
%global _description\
1fa0d9
YAML is a data serialization format designed for human readability and\
1fa0d9
interaction with scripting languages.  PyYAML is a YAML parser and\
1fa0d9
emitter for Python.\
1fa0d9
\
1fa0d9
PyYAML features a complete YAML 1.1 parser, Unicode support, pickle\
1fa0d9
support, capable extension API, and sensible error messages.  PyYAML\
1fa0d9
supports standard YAML tags and provides Python-specific tags that\
1fa0d9
allow to represent an arbitrary Python object.\
1fa0d9
\
1fa0d9
PyYAML is applicable for a broad range of tasks from complex\
1fa0d9
configuration files to object serialization and persistence.
1fa0d9
1fa0d9
%description %_description
1fa0d9
1fa0d9
1fa0d9
%if %{with python2}
1fa0d9
%package -n python2-pyyaml
1fa0d9
Summary:        %summary
1fa0d9
Provides:       python-yaml = %{version}-%{release}
1fa0d9
Provides:       python-yaml%{?_isa} = %{version}-%{release}
1fa0d9
Provides:       python2-yaml = %{version}-%{release}
1fa0d9
Provides:       python2-yaml%{?_isa} = %{version}-%{release}
1fa0d9
Provides:       PyYAML = %{version}-%{release}
1fa0d9
Provides:       PyYAML%{?_isa} = %{version}-%{release}
1fa0d9
%{?python_provide:%python_provide python2-pyyaml}
1fa0d9
1fa0d9
%description -n python2-pyyaml %_description
1fa0d9
%endif
1fa0d9
1fa0d9
%package -n python3-pyyaml
1fa0d9
Summary:        %summary
1fa0d9
%py_provides    python3-yaml
1fa0d9
%py_provides    python3-PyYAML
1fa0d9
1fa0d9
%description -n python3-pyyaml %_description
1fa0d9
1fa0d9
1fa0d9
%prep
1fa0d9
%setup -q -n pyyaml-%{uversion}
1fa0d9
chmod a-x examples/yaml-highlight/yaml_hl.py
1fa0d9
1fa0d9
# remove pre-generated file
1fa0d9
rm -rf ext/_yaml.c
1fa0d9
1fa0d9
1fa0d9
%build
1fa0d9
%py3_build
1fa0d9
1fa0d9
%if %{with python2}
1fa0d9
# py2_build reuses Cython output from py3_build
1fa0d9
%py2_build
1fa0d9
%endif
1fa0d9
1fa0d9
1fa0d9
%install
1fa0d9
%if %{with python2}
1fa0d9
%py2_install
1fa0d9
%endif
1fa0d9
%py3_install
1fa0d9
1fa0d9
1fa0d9
%check
1fa0d9
%if %{with python2}
1fa0d9
%{__python2} setup.py test
1fa0d9
%endif
1fa0d9
%{__python3} setup.py test
1fa0d9
1fa0d9
1fa0d9
%if %{with python2}
1fa0d9
%files -n python2-pyyaml
1fa0d9
%license LICENSE
1fa0d9
%doc CHANGES README examples
1fa0d9
%{python2_sitearch}/*
1fa0d9
%endif
1fa0d9
1fa0d9
%files -n python3-pyyaml
1fa0d9
%license LICENSE
1fa0d9
%doc CHANGES README examples
1fa0d9
%{python3_sitearch}/*
1fa0d9
1fa0d9
1fa0d9
%changelog
1fa0d9
* Tue Feb 08 2022 Miro Hrončok <mhroncok@redhat.com> - 5.4.1-6
1fa0d9
- Remove some outdated Obsoletes and Provides,
1fa0d9
  but keep providing python3-yaml and python3-PyYAML for users
1fa0d9
- Related: rhbz#1990421
1fa0d9
1fa0d9
* Tue Feb 08 2022 Tomas Orsava <torsava@redhat.com> - 5.4.1-5
1fa0d9
- Add automatically generated Obsoletes tag with the python39- prefix
1fa0d9
  for smoother upgrade from RHEL8
1fa0d9
- Related: rhbz#1990421
1fa0d9
1fa0d9
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 5.4.1-4
1fa0d9
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
1fa0d9
  Related: rhbz#1991688
1fa0d9
1fa0d9
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 5.4.1-3
1fa0d9
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
1fa0d9
1fa0d9
* Mon Jan 25 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.1-2
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
1fa0d9
1fa0d9
* Thu Jan 21 2021 John Eckersberg <jeckersb@redhat.com> - 5.4.1-1
1fa0d9
- New upstream release 5.4.1 (rhbz#1918523)
1fa0d9
1fa0d9
* Wed Jan 20 2021 John Eckersberg <jeckersb@redhat.com> - 5.4-1
1fa0d9
- New upstream release 5.4
1fa0d9
- Fixes CVE-2020-14343
1fa0d9
1fa0d9
* Fri Jan 15 2021 John Eckersberg <jeckersb@redhat.com> - 5.4-0.1.b2
1fa0d9
- New upstream beta release 5.4b2 (rhbz#1916496)
1fa0d9
1fa0d9
* Thu Jan 14 2021 John Eckersberg <jeckersb@redhat.com> - 5.4-0.1.b1
1fa0d9
- New upstream beta release 5.4b1 (rhbz#1916034)
1fa0d9
1fa0d9
* Mon Nov 23 2020 Miro Hrončok <mhroncok@redhat.com> - 5.3.1-5
1fa0d9
- Disable Python 2 build on RHEL 9+
1fa0d9
1fa0d9
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.1-4
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
1fa0d9
1fa0d9
* Fri May 22 2020 Miro Hrončok <mhroncok@redhat.com> - 5.3.1-3
1fa0d9
- Rebuilt for Python 3.9
1fa0d9
1fa0d9
* Mon May 18 2020 John Eckersberg <eck@redhat.com> - 5.3.1-2
1fa0d9
- Fix fedora conditional macro (rhbz#1836656)
1fa0d9
1fa0d9
* Thu Mar 19 2020 John Eckersberg <eck@redhat.com> - 5.3.1-1
1fa0d9
- New upstream release 5.3.1 (rhbz#1814882)
1fa0d9
- Fixes CVE-2020-1747 (rhbz#1807367,1809011)
1fa0d9
1fa0d9
* Tue Mar 10 2020 Kalev Lember <klember@redhat.com> - 5.3-4
1fa0d9
- Add back PyYAML provides on F31 and older
1fa0d9
1fa0d9
* Mon Mar  2 2020 John Eckersberg <eck@redhat.com> - 5.3-3
1fa0d9
- Fix python2 on Fedora < 32 (rhbz#1808812)
1fa0d9
1fa0d9
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.3-2
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
1fa0d9
1fa0d9
* Mon Jan  6 2020 John Eckersberg <eck@redhat.com> - 5.3-1
1fa0d9
- New upstream release 5.3
1fa0d9
1fa0d9
* Tue Dec  3 2019 John Eckersberg <eck@redhat.com> - 5.2-1
1fa0d9
- New upstream release 5.2
1fa0d9
1fa0d9
* Fri Nov 22 2019 John Eckersberg <eck@redhat.com> - 5.1.2-4
1fa0d9
- Build without python2 by default (rhbz#1775075)
1fa0d9
1fa0d9
* Thu Sep 19 2019 Miro Hrončok <mhroncok@redhat.com> - 5.1.2-3
1fa0d9
- Stop providing PyYAML from python2-pyyaml, Python now means Python 3
1fa0d9
1fa0d9
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 5.1.2-2
1fa0d9
- Rebuilt for Python 3.8
1fa0d9
1fa0d9
* Wed Jul 31 2019 John Eckersberg <eck@redhat.com> - 5.1.2-1
1fa0d9
- New upstream release 5.1.2
1fa0d9
1fa0d9
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.1.1-3
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
1fa0d9
1fa0d9
* Mon Jul 15 2019 Petr Viktorin <pviktori@redhat.com> - 5.1.1-2
1fa0d9
- Remove build dependency on python2-Cython
1fa0d9
1fa0d9
* Fri Jun  7 2019 John Eckersberg <eck@redhat.com> - 5.1.1-1
1fa0d9
- New upstream release 5.1.1 (rhbz#1718110)
1fa0d9
1fa0d9
* Wed Mar 13 2019 John Eckersberg <eck@redhat.com> - 5.1-1
1fa0d9
- New upstream release 5.1 (rhbz#1688414)
1fa0d9
- Fixes CVE-2017-18342 (rhbz#1595744)
1fa0d9
1fa0d9
* Fri Mar  8 2019 John Eckersberg <eck@redhat.com> - 5.1-0.1.b6
1fa0d9
- New upstream beta release 5.1b6 (rhbz#1686643)
1fa0d9
1fa0d9
* Thu Feb 28 2019 John Eckersberg <eck@redhat.com> - 5.1-0.1.b3
1fa0d9
- New upstream beta release 5.1b3 (rhbz#1683884)
1fa0d9
1fa0d9
* Mon Feb 25 2019 John Eckersberg <eck@redhat.com> - 5.1-0.1.b1
1fa0d9
- New upstream beta release 5.1b1 (rhbz#1680457)
1fa0d9
- Typo fix (rhbz#1680463)
1fa0d9
1fa0d9
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.2-0.2.b4
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
1fa0d9
1fa0d9
* Fri Jul 13 2018 John Eckersberg <eck@redhat.com> - 4.2-0.1.b4
1fa0d9
- New upstream beta release 4.2b4
1fa0d9
- Replaces 4.1 which was retracted upstream
1fa0d9
  See https://mail.python.org/pipermail/python-announce-list/2018-June/011977.html
1fa0d9
- Add BuildRequires for gcc
1fa0d9
  See https://fedoraproject.org/wiki/Changes/Remove_GCC_from_BuildRoot
1fa0d9
1fa0d9
* Thu Jul 12 2018 Miro Hrončok <mhroncok@redhat.com> - 4.1-5
1fa0d9
- Rename python3-PyYAML to python3-pyyaml
1fa0d9
- Modernize spec
1fa0d9
- Fix python2 invocation
1fa0d9
1fa0d9
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-4
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
1fa0d9
1fa0d9
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 4.1-3
1fa0d9
- Rebuilt for Python 3.7
1fa0d9
1fa0d9
* Mon Jul 02 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 4.1-2
1fa0d9
- Rebuilt for Python 3.7
1fa0d9
1fa0d9
* Wed Jun 27 2018 John Eckersberg <eck@redhat.com> - 4.1-1
1fa0d9
- New upstream release 4.1
1fa0d9
1fa0d9
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 3.12-11
1fa0d9
- Rebuilt for Python 3.7
1fa0d9
1fa0d9
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.12-10
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
1fa0d9
1fa0d9
* Mon Dec 11 2017 Iryna Shcherbina <ishcherb@redhat.com> - 3.12-9
1fa0d9
- Fix ambiguous Python 2 dependency declarations
1fa0d9
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
1fa0d9
1fa0d9
* Wed Sep 27 2017 Troy Dawson <tdawson@redhat.com> - 3.12-8
1fa0d9
- Cleanup spec file conditionals
1fa0d9
1fa0d9
* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.12-7
1fa0d9
- Add Provides for the old name without %%_isa
1fa0d9
1fa0d9
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.12-6
1fa0d9
- Python 2 binary package renamed to python2-pyyaml
1fa0d9
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
1fa0d9
1fa0d9
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.12-5
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
1fa0d9
1fa0d9
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.12-4
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
1fa0d9
1fa0d9
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.12-3
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
1fa0d9
1fa0d9
* Mon Dec 12 2016 Charalampos Stratakis <cstratak@redhat.com> - 3.12-2
1fa0d9
- Rebuild for Python 3.6
1fa0d9
1fa0d9
* Mon Aug 29 2016 John Eckersberg <eck@redhat.com> - 3.12-1
1fa0d9
- New upstream release 3.12 (RHBZ#1371150)
1fa0d9
1fa0d9
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.11-13
1fa0d9
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
1fa0d9
1fa0d9
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.11-12
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
1fa0d9
1fa0d9
* Tue Dec  8 2015 John Eckersberg <eck@redhat.com> - 3.11-11
1fa0d9
- Add provides for python3-yaml (RHBZ#1288807)
1fa0d9
1fa0d9
* Tue Nov 03 2015 Robert Kuska <rkuska@redhat.com> - 3.11-10
1fa0d9
- Rebuilt for Python3.5 rebuild
1fa0d9
1fa0d9
* Fri Jul 17 2015 John Eckersberg <eck@redhat.com> - 3.11-9
1fa0d9
- Add provides for python2-yaml (RHBZ#1241678)
1fa0d9
1fa0d9
* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.11-8
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
1fa0d9
1fa0d9
* Mon Mar 23 2015 John Eckersberg <eck@redhat.com> - 3.11-7
1fa0d9
- Add patch for CVE-2014-9130 (bug 1204829)
1fa0d9
1fa0d9
* Mon Sep 15 2014 Jakub Čajka <jcajka@redhat.com> - 3.11-6
1fa0d9
- fixed typecast issues using debian patch(int->size_t)(BZ#1140189)
1fa0d9
- spec file cleanup
1fa0d9
1fa0d9
* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.11-5
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
1fa0d9
1fa0d9
* Mon Aug  4 2014 Tom Callaway <spot@fedoraproject.org> - 3.11-4
1fa0d9
- fix license handling
1fa0d9
1fa0d9
* Fri Jun 06 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.11-3
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
1fa0d9
1fa0d9
* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 3.11-2
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
1fa0d9
1fa0d9
* Mon Apr 21 2014 John Eckersberg <jeckersb@redhat.com> - 3.11-1
1fa0d9
- New upstream release 3.11 (BZ#1081521)
1fa0d9
1fa0d9
* Thu Aug  8 2013 John Eckersberg <jeckersb@redhat.com> - 3.10-9
1fa0d9
- Add check section and run test suite
1fa0d9
1fa0d9
* Fri Aug 02 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10-8
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
1fa0d9
1fa0d9
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10-7
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
1fa0d9
1fa0d9
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 3.10-6
1fa0d9
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
1fa0d9
1fa0d9
* Wed Aug  1 2012 David Malcolm <dmalcolm@redhat.com> - 3.10-5
1fa0d9
- remove rhel logic from with_python3 conditional
1fa0d9
1fa0d9
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10-4
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
1fa0d9
1fa0d9
* Fri Apr 27 2012 John Eckersberg <jeckersb@redhat.com> - 3.10-3
1fa0d9
- Add Provides for python-yaml (BZ#740390)
1fa0d9
1fa0d9
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10-2
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
1fa0d9
1fa0d9
* Thu Jun 23 2011 John Eckersberg <jeckersb@redhat.com> - 3.10-1
1fa0d9
- New upstream release 3.10
1fa0d9
1fa0d9
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.09-8
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
1fa0d9
1fa0d9
* Wed Feb  2 2011 John Eckersberg <jeckersb@redhat.com> - 3.09-7
1fa0d9
- Add support to build for python 3
1fa0d9
1fa0d9
* Tue Jul 27 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 3.09-6
1fa0d9
- Bump release number for upgrade path
1fa0d9
1fa0d9
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 3.09-3
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
1fa0d9
1fa0d9
* Fri Oct 02 2009 John Eckersberg <jeckersb@redhat.com> - 3.09-1
1fa0d9
- New upstream release 3.09
1fa0d9
1fa0d9
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.08-6
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
1fa0d9
1fa0d9
* Wed Jul 22 2009 - John Eckersberg <jeckersb@redhat.com> - 3.08-5
1fa0d9
- Minor tweaks to spec file aligning with latest Fedora packaging guidelines
1fa0d9
- Enforce inclusion of libyaml in build with --with-libyaml option to setup.py
1fa0d9
- Deliver to %%{python_sitearch} instead of %%{python_sitelib} due to _yaml.so
1fa0d9
- Thanks to Gareth Armstrong <gareth.armstrong@hp.com>
1fa0d9
1fa0d9
* Tue Mar 3 2009 John Eckersberg <jeckersb@redhat.com> - 3.08-4
1fa0d9
- Correction, change libyaml to libyaml-devel in BuildRequires
1fa0d9
1fa0d9
* Mon Mar 2 2009 John Eckersberg <jeckersb@redhat.com> - 3.08-3
1fa0d9
- Add libyaml to BuildRequires
1fa0d9
1fa0d9
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.08-2
1fa0d9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
1fa0d9
1fa0d9
* Wed Feb 18 2009 John Eckersberg <jeckersb@redhat.com> - 3.08-1
1fa0d9
- New upstream release
1fa0d9
1fa0d9
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 3.06-2
1fa0d9
- Rebuild for Python 2.6
1fa0d9
1fa0d9
* Fri Oct 24 2008 John Eckersberg <jeckersb@redhat.com> - 3.06-1
1fa0d9
- New upstream release
1fa0d9
1fa0d9
* Wed Jan 02 2008 John Eckersberg <jeckersb@redhat.com> - 3.05-2
1fa0d9
- Remove explicit dependency on python >= 2.3
1fa0d9
- Remove executable on example script in docs
1fa0d9
1fa0d9
* Mon Dec 17 2007 John Eckersberg <jeckersb@redhat.com> - 3.05-1
1fa0d9
- Initial packaging for Fedora