Apply updates Python packaging guidelines.
- Mark LICENSE with %license.
This commit is contained in:
parent
be6461fcd9
commit
3a17bd4443
@ -2,14 +2,13 @@
|
|||||||
%global with_python3 1
|
%global with_python3 1
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%global pypi_name jinja2
|
|
||||||
# Enable building without docs to avoid a circular dependency between this
|
# Enable building without docs to avoid a circular dependency between this
|
||||||
# and python-sphinx:
|
# and python-sphinx:
|
||||||
%global with_docs 1
|
%global with_docs 1
|
||||||
|
|
||||||
Name: python-jinja2
|
Name: python-jinja2
|
||||||
Version: 2.8
|
Version: 2.8
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
Summary: General purpose template engine
|
Summary: General purpose template engine
|
||||||
Group: Development/Languages
|
Group: Development/Languages
|
||||||
License: BSD
|
License: BSD
|
||||||
@ -71,7 +70,10 @@ environments.
|
|||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n Jinja2-%{version}
|
%setup -qc -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
|
||||||
@ -79,12 +81,15 @@ 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}
|
%if 0%{?with_python3}
|
||||||
cp -a . %{py3dir}
|
cp -a python2 python3
|
||||||
%endif # with_python3
|
%endif # with_python3
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
pushd python2
|
||||||
%{__python2} setup.py 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
|
||||||
@ -92,23 +97,26 @@ cp -a . %{py3dir}
|
|||||||
%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 %{py3dir}
|
pushd python3
|
||||||
%{__python3} setup.py build
|
%{__python3} setup.py build
|
||||||
popd
|
popd
|
||||||
%endif # with_python3
|
%endif # with_python3
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
pushd python2
|
||||||
%{__python2} setup.py install -O1 --skip-build \
|
%{__python2} setup.py install -O1 --skip-build \
|
||||||
--root %{buildroot}
|
--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 %{py3dir}
|
pushd python3
|
||||||
%{__python3} setup.py install -O1 --skip-build \
|
%{__python3} setup.py install -O1 --skip-build \
|
||||||
--root %{buildroot}
|
--root %{buildroot}
|
||||||
popd
|
popd
|
||||||
@ -116,23 +124,30 @@ popd
|
|||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
|
pushd python2
|
||||||
make test
|
make test
|
||||||
|
popd
|
||||||
|
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
pushd %{py3dir}
|
pushd python3
|
||||||
make test
|
make test
|
||||||
popd
|
popd
|
||||||
%endif # with_python3
|
%endif # with_python3
|
||||||
|
|
||||||
|
|
||||||
%files
|
%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}
|
%if 0%{?with_docs}
|
||||||
%doc docs/_build/html
|
%doc python2/docs/_build/html
|
||||||
%endif # with_docs
|
%endif # with_docs
|
||||||
%doc ext
|
%doc python2/ext
|
||||||
%doc examples
|
%doc python2/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
|
||||||
@ -140,12 +155,19 @@ popd
|
|||||||
|
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
%files -n python3-jinja2
|
%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}
|
%if 0%{?with_docs}
|
||||||
%doc docs/_build/html
|
# docs are built with python2
|
||||||
|
%doc python2/docs/_build/html
|
||||||
%endif # with_docs
|
%endif # with_docs
|
||||||
%doc ext
|
%doc python3/ext
|
||||||
%doc examples
|
%doc python3/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
|
||||||
@ -153,6 +175,10 @@ popd
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%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
|
* Sun Jul 26 2015 Haïkel Guémar <hguemar@fedoraproject.org> - 2.8-1
|
||||||
- Upstream 2.8
|
- Upstream 2.8
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user