File python-PasteScript.spec of Package python-PasteScript

# spec file for package python-PasteScript
# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

# Namespace package issues break tests on Factory
%if 0%{?suse_version} > 1320
%bcond_with tests
%bcond_without tests

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define oldpython python
Name:           python-PasteScript
Version:        2.0.2
Release:        0
Summary:        A pluggable command-line frontend to setup package file layouts
License:        MIT
Group:          Development/Languages/Python
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module six}
BuildRequires:  %{python_module Paste >= 1.3}
BuildRequires:  %{python_module PasteDeploy}
%if %{with tests}
# Test requirements
BuildRequires:  %{python_module nose >= 0.11}
BuildRequires:  python-Cheetah
BuildRequires:  python-unittest2
Requires:       python-Paste >= 1.3
Requires:       python-PasteDeploy
Requires:       python-setuptools
Requires:       python-six
Recommends:     python-Cheetah
Provides:       %{oldpython}-pastescript = %{version}
Obsoletes:      %{oldpython}-pastescript < %{version}
Requires(post): update-alternatives
Requires(preun): update-alternatives
BuildArch:      noarch

This is a pluggable command-line tool. It includes some built-in features:

  * Create file layouts for packages.
  * Serving up web applications, with configuration based on paste.deploy

%setup -q -n PasteScript-%{version}
mv docs/_build docs/html # Proper name for HTML docs
sed -i "1d" tests/ # Fix non-executable script


%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_expand rm -rf %{buildroot}%{$python_sitelib}/tests # Remove wrongly installed tests

# Prepare for update-alternatives usage
%python_clone -a %{buildroot}%{_bindir}/paster

%if %{with tests}
%python_expand nosetests-%{$python_bin_suffix} -v tests/

%python_install_alternative paster

%python_uninstall_alternative paster

%files %{python_files}
%doc README.rst docs/license.txt docs/news.txt
%doc docs/html/
%python_alternative %{_bindir}/paster

openSUSE Build Service is sponsored by