Apply updates Python packaging guidelines.

- Mark LICENSE with %license.
This commit is contained in:
Thomas Moschny 2015-07-27 08:05:27 +02:00
parent be6461fcd9
commit 3a17bd4443

View File

@ -2,14 +2,13 @@
%global with_python3 1
%endif
%global pypi_name jinja2
# Enable building without docs to avoid a circular dependency between this
# and python-sphinx:
%global with_docs 1
Name: python-jinja2
Version: 2.8
Release: 1%{?dist}
Release: 2%{?dist}
Summary: General purpose template engine
Group: Development/Languages
License: BSD
@ -71,7 +70,10 @@ environments.
%prep
%setup -q -n Jinja2-%{version}
%setup -qc -n Jinja2-%{version}
mv Jinja2-%{version} python2
pushd python2
# cleanup
find . -name '*.pyo' -o -name '*.pyc' -delete
@ -79,12 +81,15 @@ find . -name '*.pyo' -o -name '*.pyc' -delete
# fix EOL
sed -i 's|\r$||g' LICENSE
popd
%if 0%{?with_python3}
cp -a . %{py3dir}
cp -a python2 python3
%endif # with_python3
%build
pushd python2
%{__python2} setup.py build
# for now, we build docs using Python 2.x and use that for both
@ -92,23 +97,26 @@ cp -a . %{py3dir}
%if 0%{?with_docs}
make -C docs html PYTHONPATH=$(pwd)
%endif # with_docs
popd
%if 0%{?with_python3}
pushd %{py3dir}
pushd python3
%{__python3} setup.py build
popd
%endif # with_python3
%install
pushd python2
%{__python2} setup.py install -O1 --skip-build \
--root %{buildroot}
# remove hidden file
rm -rf docs/_build/html/.buildinfo
popd
%if 0%{?with_python3}
pushd %{py3dir}
pushd python3
%{__python3} setup.py install -O1 --skip-build \
--root %{buildroot}
popd
@ -116,23 +124,30 @@ popd
%check
pushd python2
make test
popd
%if 0%{?with_python3}
pushd %{py3dir}
pushd python3
make test
popd
%endif # with_python3
%files
%doc AUTHORS CHANGES LICENSE
%doc python2/AUTHORS
%doc python2/CHANGES
%if 0%{?_licensedir:1}
%license python2/LICENSE
%else
%doc python2/LICENSE
%endif # licensedir
%if 0%{?with_docs}
%doc docs/_build/html
%doc python2/docs/_build/html
%endif # with_docs
%doc ext
%doc examples
%doc python2/ext
%doc python2/examples
%{python2_sitelib}/jinja2
%{python2_sitelib}/Jinja2-%{version}-py?.?.egg-info
%exclude %{python2_sitelib}/jinja2/_debugsupport.c
@ -140,12 +155,19 @@ popd
%if 0%{?with_python3}
%files -n python3-jinja2
%doc AUTHORS CHANGES LICENSE
%doc python3/AUTHORS
%doc python3/CHANGES
%if 0%{?_licensedir:1}
%license python3/LICENSE
%else
%doc python3/LICENSE
%endif # licensedir
%if 0%{?with_docs}
%doc docs/_build/html
# docs are built with python2
%doc python2/docs/_build/html
%endif # with_docs
%doc ext
%doc examples
%doc python3/ext
%doc python3/examples
%{python3_sitelib}/jinja2
%{python3_sitelib}/Jinja2-%{version}-py?.?.egg-info
%exclude %{python3_sitelib}/jinja2/_debugsupport.c
@ -153,6 +175,10 @@ popd
%changelog
* Mon Jul 27 2015 Thomas Moschny <thomas.moschny@gmx.de> - 2.8-2
- Apply updates Python packaging guidelines.
- Mark LICENSE with %%license.
* Sun Jul 26 2015 Haïkel Guémar <hguemar@fedoraproject.org> - 2.8-1
- Upstream 2.8