python-invoke/python-invoke.spec

99 lines
2.6 KiB
RPMSpec

#
# spec file for package python-invoke
#
# Copyright (c) 2018 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
# 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 http://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%bcond_without test
%else
%bcond_with test
%endif
Version: 1.1.1
Release: 0
Summary: Pythonic Task Execution
License: BSD-2-Clause
Group: Development/Languages/Python
URL: http://www.pyinvoke.org
Source: https://files.pythonhosted.org/packages/source/i/invoke/invoke-%{version}.tar.gz
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module invocations >= 1.4}
BuildRequires: %{python_module invoke = %{version}}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pytest-relaxed}
BuildRequires: %{python_module pytest}
%endif
%if %{with test}
Name: python-invoke-%{flavor}
%else
Name: python-invoke
%endif
%python_subpackages
%description
Invoke is a Python (2.7 and 3.4+) task execution tool & library, drawing
inspiration from various sources to arrive at a powerful & clean feature set.
%prep
%setup -q -n invoke-%{version}
%build
%python_build
%install
%if !%{with test}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/inv
%python_clone -a %{buildroot}%{_bindir}/invoke
%endif
%if %{with test}
%check
%{python_expand export PYTHONPATH=%{$python_sitelib}
py.test-%{$python_bin_suffix}
%{_bindir}/inv-%{$python_bin_suffix} -l
}
%endif
%if !%{with test}
%post
%{python_install_alternative inv invoke}
%postun
%python_uninstall_alternative inv
%endif
%files %{python_files}
%license LICENSE
%doc README.rst
%if !%{with test}
%python_alternative %{_bindir}/inv
%python_alternative %{_bindir}/invoke
%{python_sitelib}/invoke/
%{python_sitelib}/invoke-%{version}-py*
%endif
%changelog