Subpackage python2-mako has been removed

Also:

 - remove manual requires
 - make the documentation only Suggest the implementation
This commit is contained in:
Miro Hrončok 2019-11-15 11:21:01 +01:00
parent 2d7238ab2e
commit 5f74222a24

View File

@ -1,20 +1,6 @@
%if 0%{?fedora} || 0%{?rhel} >= 8
%bcond_without python3
%else
%bcond_with python3
%endif
%if 0%{?rhel} > 7
%bcond_with python2
%else
%bcond_without python2
%endif
%global upname Mako
Name: python-mako
Version: 1.1.0
Release: 2%{?dist}
Release: 3%{?dist}
BuildArch: noarch
# Mostly MIT, but _ast_util.py is Python licensed.
@ -24,17 +10,7 @@ Summary: Mako template library for Python
URL: http://www.makotemplates.org/
Source0: https://github.com/sqlalchemy/mako/archive/rel_%(echo %{version} | sed "s/\./_/g").tar.gz
%if %{with python2}
BuildRequires: python2-devel
BuildRequires: python2-pytest
BuildRequires: python2-setuptools
BuildRequires: python2-markupsafe
#BuildRequires: python2-beaker
BuildRequires: python2-nose
BuildRequires: python2-mock
%endif #{with python2}
%if %{with python3}
BuildRequires: python3-devel
BuildRequires: python3-pytest
BuildRequires: python3-setuptools
@ -42,7 +18,6 @@ BuildRequires: python3-markupsafe
#BuildRequires: python3-beaker
BuildRequires: python3-mock
BuildRequires: python3-nose
%endif #{with python3}
%global _description\
Mako is a template library written in Python. It provides a familiar, non-XML\
@ -56,144 +31,72 @@ calling and scoping semantics.
%description %_description
%if %{with python2}
%package -n python2-mako
Summary: %summary
Requires: python2-markupsafe
# Beaker is the preferred caching backend, but is not strictly necessary
Recommends: python2-beaker
%{?python_provide:%python_provide python2-mako}
%description -n python2-mako %_description
%endif #{with python2}
%package doc
Summary: Documentation for the Mako template library for Python
License: (MIT and Python) and (BSD or GPLv2)
%if %{with python3}
Requires: python3-mako = %{version}-%{release}
%else
Requires: python2-mako = %{version}-%{release}
%endif #{with python3}
%description doc
Mako is a template library written in Python. It provides a familiar, non-XML
syntax which compiles into Python modules for maximum performance. Mako's
syntax and API borrows from the best ideas of many others, including Django
templates, Cheetah, Myghty, and Genshi. Conceptually, Mako is an embedded
Python (i.e. Python Server Page) language, which refines the familiar ideas of
componentized layout and inheritance to produce one of the most straightforward
and flexible models available, while also maintaining close ties to Python
calling and scoping semantics.
This package contains documentation in text and HTML formats.
%if %{with python3}
%package -n python3-mako
Summary: Mako template library for Python 3
Requires: python3-markupsafe
Summary: %{summary}
# Beaker is the preferred caching backend, but is not strictly necessary
Recommends: python3-beaker
%if 0%{?fedora} >= 32
Conflicts: python2-mako < 1.1.0-2
%endif
Obsoletes: python2-mako < 1.1.0-3
%{?python_provide:%python_provide python3-mako}
%if %{without python2}
Obsoletes: python2-mako < %{version}-%{release}
%endif #{without python2}
%description -n python3-mako
Mako is a template library written in Python. It provides a familiar, non-XML
syntax which compiles into Python modules for maximum performance. Mako's
syntax and API borrows from the best ideas of many others, including Django
templates, Cheetah, Myghty, and Genshi. Conceptually, Mako is an embedded
Python (i.e. Python Server Page) language, which refines the familiar ideas of
componentized layout and inheritance to produce one of the most straightforward
and flexible models available, while also maintaining close ties to Python
calling and scoping semantics.
%description -n python3-mako %_description
This package contains the mako module built for use with python3.
%endif #{with python3}
%package doc
Summary: Documentation for the Mako template library for Python
Suggests: python3-mako = %{version}-%{release}
%description doc %_description
This package contains documentation in text and HTML formats.
%prep
%autosetup -n mako-rel_%(echo %{version} | sed "s/\./_/g")
%build
%{?with_python2:%py2_build}
%{?with_python3:%py3_build}
%py3_build
%install
%if %{with python3}
%py3_install
mv %{buildroot}/%{_bindir}/mako-render %{buildroot}/%{_bindir}/mako-render-%{python3_version}
ln -s ./mako-render-%{python3_version} %{buildroot}/%{_bindir}/mako-render-3
%endif
%if %{with python2}
%py2_install
mv %{buildroot}/%{_bindir}/mako-render %{buildroot}/%{_bindir}/mako-render-%{python2_version}
ln -s ./mako-render-%{python2_version} %{buildroot}/%{_bindir}/mako-render-2
%if ! (%{with python3} && 0%{?fedora} >= 32)
ln -s ./mako-render-%{python2_version} %{buildroot}/%{_bindir}/mako-render
%endif
%endif
%if %{with python3} && 0%{?fedora} >= 32
ln -s ./mako-render-%{python3_version} %{buildroot}/%{_bindir}/mako-render
%endif
# These are supporting files for building the docs. No need to ship
rm -rf doc/build
%check
%if %{with python2}
py.test-2
%endif #{with python2}
%if %{with python3}
py.test-3
%endif
%if %{with python2}
%files -n python2-mako
%license LICENSE
%doc CHANGES README.rst examples
%if ! (%{with python3} && 0%{?fedora} >= 32)
%{_bindir}/mako-render
%endif
%{_bindir}/mako-render-2
%{_bindir}/mako-render-%{python2_version}
%{python2_sitelib}/*
%endif %{with python2}
%if %{with python3}
%files -n python3-mako
%license LICENSE
%doc CHANGES README.rst examples
%if %{with python3} && 0%{?fedora} >= 32
%{_bindir}/mako-render
%endif
%{_bindir}/mako-render-3
%{_bindir}/mako-render-%{python3_version}
%{python3_sitelib}/*
%endif
%{python3_sitelib}/mako/
%{python3_sitelib}/Mako-*.egg-info/
%files doc
%doc doc
%changelog
* Fri Nov 15 2019 Miro Hrončok <mhroncok@redhat.com> - 1.1.0-3
- Subpackage python2-mako has been removed
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
* Fri Oct 11 2019 Miro Hrončok <mhroncok@redhat.com> - 1.1.0-2
- Rename the Python-versioned executables not to start with "python"
- Make mako-render Python 3 on Fedora 32+