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
Version: 2.8
Release: 6%{?dist}
Release: 7%{?dist}
Summary: General purpose template engine
Group: Development/Languages
License: BSD
@ -17,15 +17,12 @@ Source0: http://pypi.python.org/packages/source/J/Jinja2/Jinja2-%{version
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python2-setuptools
BuildRequires: python-markupsafe
BuildRequires: pytest
BuildRequires: python2-pytest
%if 0%{?with_docs}
BuildRequires: python-sphinx
%endif # with_docs
Requires: python-babel >= 0.8
Requires: python-markupsafe
Requires: python-setuptools
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
@ -46,15 +43,34 @@ principles and adding functionality useful for templating
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}
%package -n python3-jinja2
Summary: General purpose template engine
Summary: General purpose template engine for python3
Group: Development/Languages
Requires: python3-markupsafe
Requires: python3-setuptools
# babel isn't py3k ready yet, and is only a weak dependency
#Requires: python3-babel >= 0.8
%{?python_provide:%python_provide python3-jinja2}
%description -n python3-jinja2
Jinja2 is a template engine written in pure Python. It provides a
@ -70,86 +86,57 @@ environments.
%prep
%setup -qc -n Jinja2-%{version}
mv Jinja2-%{version} python2
pushd python2
%setup -q -n Jinja2-%{version}
# cleanup
find . -name '*.pyo' -o -name '*.pyc' -delete
# fix EOL
sed -i 's|\r$||g' LICENSE
popd
%if 0%{?with_python3}
cp -a python2 python3
%endif # with_python3
%build
pushd python2
%{__python2} setup.py build
%py2_build
# for now, we build docs using Python 2.x and use that for both
# packages.
%if 0%{?with_docs}
make -C docs html PYTHONPATH=$(pwd)
%endif # with_docs
popd
%if 0%{?with_python3}
pushd python3
%{__python3} setup.py build
popd
%py3_build
%endif # with_python3
%install
pushd python2
%{__python2} setup.py install -O1 --skip-build \
--root %{buildroot}
%py2_install
# remove hidden file
rm -rf docs/_build/html/.buildinfo
popd
%if 0%{?with_python3}
pushd python3
%{__python3} setup.py install -O1 --skip-build \
--root %{buildroot}
popd
%py3_install
%endif # with_python3
%check
pushd python2
# there are currently no tests in the jinja2 tarball
# make test
popd
%if 0%{?with_python3}
pushd python3
# there are currently no tests in the jinja2 tarball
# make test
popd
%endif # with_python3
%files
%doc python2/AUTHORS
%doc python2/CHANGES
%if 0%{?_licensedir:1}
%license python2/LICENSE
%else
%doc python2/LICENSE
%endif # licensedir
%files -n python2-jinja2
%doc AUTHORS
%doc CHANGES
%license LICENSE
%if 0%{?with_docs}
%doc python2/docs/_build/html
%doc docs/_build/html
%endif # with_docs
%doc python2/ext
%doc python2/examples
%doc ext
%doc examples
%{python2_sitelib}/jinja2
%{python2_sitelib}/Jinja2-%{version}-py?.?.egg-info
%exclude %{python2_sitelib}/jinja2/_debugsupport.c
@ -157,19 +144,15 @@ popd
%if 0%{?with_python3}
%files -n python3-jinja2
%doc python3/AUTHORS
%doc python3/CHANGES
%if 0%{?_licensedir:1}
%license python3/LICENSE
%else
%doc python3/LICENSE
%endif # licensedir
%doc AUTHORS
%doc CHANGES
%license LICENSE
%if 0%{?with_docs}
# docs are built with python2
%doc python2/docs/_build/html
%doc docs/_build/html
%endif # with_docs
%doc python3/ext
%doc python3/examples
%doc ext
%doc examples
%{python3_sitelib}/jinja2
%{python3_sitelib}/Jinja2-%{version}-py?.?.egg-info
%exclude %{python3_sitelib}/jinja2/_debugsupport.c
@ -177,6 +160,10 @@ popd
%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
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages