Ship python2-jijna2 (bug #1378519)

- Modernize spec
This commit is contained in:
Orion Poplawski 2016-09-22 10:19:11 -06:00
parent f06b630631
commit 62d3143b31

View File

@ -8,7 +8,7 @@
Name: python-jinja2 Name: python-jinja2
Version: 2.8 Version: 2.8
Release: 6%{?dist} Release: 7%{?dist}
Summary: General purpose template engine Summary: General purpose template engine
Group: Development/Languages Group: Development/Languages
License: BSD License: BSD
@ -17,15 +17,12 @@ Source0: http://pypi.python.org/packages/source/J/Jinja2/Jinja2-%{version
BuildArch: noarch BuildArch: noarch
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: python-setuptools BuildRequires: python2-setuptools
BuildRequires: python-markupsafe BuildRequires: python-markupsafe
BuildRequires: pytest BuildRequires: python2-pytest
%if 0%{?with_docs} %if 0%{?with_docs}
BuildRequires: python-sphinx BuildRequires: python-sphinx
%endif # with_docs %endif # with_docs
Requires: python-babel >= 0.8
Requires: python-markupsafe
Requires: python-setuptools
%if 0%{?with_python3} %if 0%{?with_python3}
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
@ -46,15 +43,34 @@ principles and adding functionality useful for templating
environments. environments.
%package -n python2-jinja2
Summary: General purpose template engine for python2
Group: Development/Languages
Requires: python2-babel >= 0.8
Requires: python-markupsafe
Requires: python2-setuptools
%{?python_provide:%python_provide python2-jinja2}
%description -n python2-jinja2
Jinja2 is a template engine written in pure Python. It provides a
Django inspired non-XML syntax but supports inline expressions and an
optional sandboxed environment.
If you have any exposure to other text-based template languages, such
as Smarty or Django, you should feel right at home with Jinja2. It's
both designer and developer friendly by sticking to Python's
principles and adding functionality useful for templating
environments.
%if 0%{?with_python3} %if 0%{?with_python3}
%package -n python3-jinja2 %package -n python3-jinja2
Summary: General purpose template engine Summary: General purpose template engine for python3
Group: Development/Languages Group: Development/Languages
Requires: python3-markupsafe Requires: python3-markupsafe
Requires: python3-setuptools Requires: python3-setuptools
# babel isn't py3k ready yet, and is only a weak dependency # babel isn't py3k ready yet, and is only a weak dependency
#Requires: python3-babel >= 0.8 #Requires: python3-babel >= 0.8
%{?python_provide:%python_provide python3-jinja2}
%description -n python3-jinja2 %description -n python3-jinja2
Jinja2 is a template engine written in pure Python. It provides a Jinja2 is a template engine written in pure Python. It provides a
@ -70,86 +86,57 @@ environments.
%prep %prep
%setup -qc -n Jinja2-%{version} %setup -q -n Jinja2-%{version}
mv Jinja2-%{version} python2
pushd python2
# cleanup # cleanup
find . -name '*.pyo' -o -name '*.pyc' -delete find . -name '*.pyo' -o -name '*.pyc' -delete
# fix EOL # fix EOL
sed -i 's|\r$||g' LICENSE sed -i 's|\r$||g' LICENSE
popd
%if 0%{?with_python3}
cp -a python2 python3
%endif # with_python3
%build %build
pushd python2 %py2_build
%{__python2} setup.py build
# for now, we build docs using Python 2.x and use that for both # for now, we build docs using Python 2.x and use that for both
# packages. # packages.
%if 0%{?with_docs} %if 0%{?with_docs}
make -C docs html PYTHONPATH=$(pwd) make -C docs html PYTHONPATH=$(pwd)
%endif # with_docs %endif # with_docs
popd
%if 0%{?with_python3} %if 0%{?with_python3}
pushd python3 %py3_build
%{__python3} setup.py build
popd
%endif # with_python3 %endif # with_python3
%install %install
pushd python2 %py2_install
%{__python2} setup.py install -O1 --skip-build \
--root %{buildroot}
# remove hidden file # remove hidden file
rm -rf docs/_build/html/.buildinfo rm -rf docs/_build/html/.buildinfo
popd
%if 0%{?with_python3} %if 0%{?with_python3}
pushd python3 %py3_install
%{__python3} setup.py install -O1 --skip-build \
--root %{buildroot}
popd
%endif # with_python3 %endif # with_python3
%check %check
pushd python2
# there are currently no tests in the jinja2 tarball # there are currently no tests in the jinja2 tarball
# make test # make test
popd
%if 0%{?with_python3} %if 0%{?with_python3}
pushd python3
# there are currently no tests in the jinja2 tarball # there are currently no tests in the jinja2 tarball
# make test # make test
popd
%endif # with_python3 %endif # with_python3
%files %files -n python2-jinja2
%doc python2/AUTHORS %doc AUTHORS
%doc python2/CHANGES %doc CHANGES
%if 0%{?_licensedir:1} %license LICENSE
%license python2/LICENSE
%else
%doc python2/LICENSE
%endif # licensedir
%if 0%{?with_docs} %if 0%{?with_docs}
%doc python2/docs/_build/html %doc docs/_build/html
%endif # with_docs %endif # with_docs
%doc python2/ext %doc ext
%doc python2/examples %doc examples
%{python2_sitelib}/jinja2 %{python2_sitelib}/jinja2
%{python2_sitelib}/Jinja2-%{version}-py?.?.egg-info %{python2_sitelib}/Jinja2-%{version}-py?.?.egg-info
%exclude %{python2_sitelib}/jinja2/_debugsupport.c %exclude %{python2_sitelib}/jinja2/_debugsupport.c
@ -157,19 +144,15 @@ popd
%if 0%{?with_python3} %if 0%{?with_python3}
%files -n python3-jinja2 %files -n python3-jinja2
%doc python3/AUTHORS %doc AUTHORS
%doc python3/CHANGES %doc CHANGES
%if 0%{?_licensedir:1} %license LICENSE
%license python3/LICENSE
%else
%doc python3/LICENSE
%endif # licensedir
%if 0%{?with_docs} %if 0%{?with_docs}
# docs are built with python2 # docs are built with python2
%doc python2/docs/_build/html %doc docs/_build/html
%endif # with_docs %endif # with_docs
%doc python3/ext %doc ext
%doc python3/examples %doc examples
%{python3_sitelib}/jinja2 %{python3_sitelib}/jinja2
%{python3_sitelib}/Jinja2-%{version}-py?.?.egg-info %{python3_sitelib}/Jinja2-%{version}-py?.?.egg-info
%exclude %{python3_sitelib}/jinja2/_debugsupport.c %exclude %{python3_sitelib}/jinja2/_debugsupport.c
@ -177,6 +160,10 @@ popd
%changelog %changelog
* Thu Sep 22 2016 Orion Poplawski <orion@cora.nwra.com> - 2.8-7
- Ship python2-jinja2 (bug #1378519)
- Modernize spec
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8-6 * Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8-6
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages