15
0

Accepting request 526690 from home:bruno_friedmann:branches:devel:languages:python

- Packaging : 
  + Move to singlespec
  + Spec-cleanup
  + Split documentation to speedup rebuild
 
- Update to version 3.1

OBS-URL: https://build.opensuse.org/request/show/526690
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Chameleon?expand=0&rev=20
This commit is contained in:
2017-09-17 19:53:21 +00:00
committed by Git OBS Bridge
parent 0b4ae7e1c3
commit b020987ad3
6 changed files with 419 additions and 26 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-Chameleon
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,28 +16,27 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-Chameleon
Version: 2.22
Version: 3.1
Release: 0
Url: http://www.pagetemplates.org/
Summary: Fast HTML/XML Template Compiler
License: BSD-3-Clause and BSD-4-Clause and Python-2.0 and ZPL-2.1
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/C/Chameleon/Chameleon-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-Sphinx
BuildRequires: python-devel
BuildRequires: python-setuptools
Source: https://files.pythonhosted.org/packages/source/C/Chameleon/Chameleon-%{version}.tar.gz
BuildRequires: %{python_module Sphinx}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
# seems like Chamelon needs pkg_resources on runtime
# it invalidates its template cache based on your combined package versions
Requires: python-setuptools
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
BuildRequires: python-ordereddict
BuildRequires: python-unittest2
%else
BuildArch: noarch
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%python_subpackages
%description
Chameleon is an HTML/XML template engine for Python. It uses the
@@ -50,22 +49,28 @@ version of Python (2.5 and up, including 3.x and pypy).
%setup -q -n Chameleon-%{version}
%build
python setup.py build
# Build HTML documentation
PYTHONPATH=`pwd`/src make html && rm -rf _build/html/.buildinfo
%python_build
%python_exec setup.py build_sphinx && rm build/sphinx/html/.buildinfo
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%python_install
# Don't ship testsuite
rm -rf %{buildroot}%{python_sitelib}/chameleon/tests
%python_expand rm -rvf %{buildroot}%{python_sitelib}/chameleon/tests
%python_expand %fdupes -s %{buildroot}%{$python_sitelib}
%check
python setup.py test
%python_exec setup.py test
# Delete again any output produced here
%python_expand rm -rvf %{buildroot}%{python_sitelib}/chameleon/tests
%files
%files %python_files
%defattr(-,root,root,-)
%doc COPYRIGHT.txt LICENSE.txt README.rst _build/html
%{python_sitelib}/chameleon/
%{python_sitelib}/Chameleon-%{version}-py%{py_ver}.egg-info
%if 0%{?leap_version} >= 420200 || 0%{?suse_version} > 1320
%license LICENSE.txt
%else
%doc LICENSE.txt
%endif
%doc COPYRIGHT.txt README.rst
%{python_sitelib}/*
%changelog