Compare commits

...

No commits in common. "c8" and "c8-beta-stream-2.7" have entirely different histories.

View File

@ -1,19 +1,18 @@
%if 0%{?fedora} || 0%{?rhel} > 7
%global with_python3 0%{!?_without_python3:1}
%bcond_without python3
%endif
%if 0%{?rhel} > 7
# Disable python2 build by default
%bcond_with python36_module
# python2X and python3X are built form the same module, so we need a conditional for python2 bits
# the state of the conditional is not important in the spec, it is set in modulemd
%bcond_with python2
%else
%bcond_without python2
%endif
%global srcname docutils
Name: python-%{srcname}
Version: 0.14
Release: 7%{?dist}
Release: 12%{?dist}
Summary: System for processing plaintext documentation
Group: Development/Languages
@ -30,13 +29,19 @@ Source0: %{srcname}-%{version}.tar.gz
BuildArch: noarch
%if %{with python2}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
%endif # with python2
%if 0%{?with_python3}
%endif
%if %{with python3}
%if %{with python36_module}
BuildRequires: python36-devel
BuildRequires: python36-rpm-macros
%else
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif
%endif
%description
@ -54,7 +59,6 @@ Python inline documentation modules and packages.
%package -n python2-%{srcname}
Summary: System for processing plaintext documentation for python2
%{?python_provide:%python_provide python2-%{srcname}}
Provides: docutils = %{version}-%{release}
Obsoletes: docutils < %{version}-%{release}
%description -n python2-%{srcname}
@ -67,9 +71,9 @@ access to this functionality.
Currently, the library supports parsing rST that is in standalone files and
PEPs (Python Enhancement Proposals). Work is underway to parse rST from
Python inline documentation modules and packages.
%endif # with python2
%endif
%if 0%{?with_python3}
%if %{with python3}
%package -n python3-%{srcname}
Summary: System for processing plaintext documentation for python3
%{?python_provide:%python_provide python3-%{srcname}}
@ -87,7 +91,7 @@ PEPs (Python Enhancement Proposals). Work is underway to parse rST from
Python inline documentation modules and packages.
This package contains the module, ported to run under python3.
%endif # with_python3
%endif # with python3
%prep
%setup -q -n %{srcname}-%{version}
@ -100,21 +104,19 @@ done
iconv -f ISO88592 -t UTF8 tools/editors/emacs/IDEAS.rst > tmp
mv tmp tools/editors/emacs/IDEAS.rst
%if 0%{?with_python3}
%if %{with python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
%if %{with python2}
%py2_build
%endif # with python2
%{?with_python2:%py2_build}
%if 0%{?with_python3}
%if %{with python3}
pushd %{py3dir}
%py3_build
popd
%endif # with_python3
%endif # with python3
%install
@ -122,21 +124,18 @@ popd
%if %{with python2}
%py2_install
for file in %{buildroot}/%{_bindir}/*.py; do
mv $file `dirname $file`/`basename $file .py`-2
done
# We only want to ship the Python 3 executables, delete these
rm -f %{buildroot}/%{_bindir}/*.py
%endif
# We want the licenses but don't need this build file
rm -f licenses/docutils.conf
# Flash file is used for testing docutils but shouldn't be in the installed package.
mv docs/user/rst/images/biohazard.swf ./biohazard.swf
%endif # with python2
# Must do the python3 install first because the scripts in /usr/bin are
# overwritten by setup.py install (and we want the python2 version to be the
# default for now).
%if 0%{?with_python3}
%if %{with python3}
pushd %{py3dir}
%py3_install
@ -151,16 +150,14 @@ done
mv docs/user/rst/images/biohazard.swf ./biohazard.swf
popd
%endif # with_python3
%endif # with python3
%check
%if %{with python2}
mv biohazard.swf docs/user/rst/images/biohazard.swf
%{__python2} test/alltests.py
%{?with_python2:%{__python2} test/alltests.py}
rm docs/user/rst/images/biohazard.swf
%endif # with python2
%if 0%{?with_python3}
%if %{with python3}
pushd %{py3dir}
mv biohazard.swf docs/user/rst/images/biohazard.swf
%{__python3} test3/alltests.py
@ -173,34 +170,49 @@ popd
%license COPYING.txt licenses/*
%doc BUGS.txt COPYING.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt
%doc THANKS.txt docs tools/editors
%{_bindir}/*-2
%{python2_sitelib}/*
%endif # with python2
%endif
%if 0%{?with_python3}
%if %{with python3}
%files -n python3-%{srcname}
%license COPYING.txt licenses/*
%doc BUGS.txt FAQ.txt HISTORY.txt README.txt RELEASE-NOTES.txt
%doc THANKS.txt docs tools/editors
%{_bindir}/*[!'-2']
%{_bindir}/*
%{python3_sitelib}/*
%endif
%changelog
* Sun Jul 22 2018 Charalampos Stratakis <cstratak@redhat.com> - 0.14-7
- Conditionalize the python2 subpackage
* Thu Apr 25 2019 Tomas Orsava <torsava@redhat.com> - 0.14-12
- Bumping due to problems with modular RPM upgrade path
- Resolves: rhbz#1695587
* Tue Jul 10 2018 Charalampos Stratakis <cstratak@redhat.com> - 0.14-6
* Tue Dec 11 2018 Tomas Orsava <torsava@redhat.com> - 0.14-11
- Remove python2 executables - they are functionally identical to the python3
executables, so we're only going to ship them in the python3 subpackage
- Resolves: rhbz#1656477
* Tue Oct 09 2018 Lumír Balhar <lbalhar@redhat.com> - 0.14-10
- Remove unversioned provides
- Resolves: rhbz#1628242
* Thu Aug 02 2018 Charalampos Stratakis <cstratak@redhat.com> - 0.14-9
- Change the binaries to python3 as default
* Mon Jun 25 2018 Petr Viktorin <pviktori@redhat.com> - 0.14-5
- Fix specfile typos and oversights
- Fix python3-setuptools dependency
- Export RHEL workaround variables
- Use {__python2} as RPM macro, not shell variable
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 0.14-8
- Switch python3 coditions to bcond
* Mon Jun 25 2018 Petr Viktorin <pviktori@redhat.com> - 0.14-4
- Allow Python 2 for build
* Wed Jul 18 2018 Tomas Orsava <torsava@redhat.com> - 0.14-7
- BuildRequire also python36-rpm-macros as part of the python36 module build
* Wed Jul 04 2018 Miro Hrončok <mhroncok@redhat.com> - 0.14-6
- Add a bcond for python2
* Mon Jun 25 2018 Tomas Orsava <torsava@redhat.com> - 0.14-5
- Fix the invocation of Python
* Mon Apr 30 2018 Tomas Orsava <torsava@redhat.com> - 0.14-4
- Require the python36-devel package when building for the python36 module
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.14-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild