File python-Send2Trash.spec of Package python-Send2Trash

#
# spec file for package python-Send2Trash
#
# 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
# 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-%{**}}
# test scripts missing
%bcond_with     test
%define         oldpython python
Name:           python-Send2Trash
Version:        1.4.1
Release:        0
License:        BSD-3-Clause
Summary:        Send file to trash natively under Mac OS X, Windows and Linux
Url:            https://github.com/hsoft/send2trash
Group:          Development/Languages/Python
Source:         https://files.pythonhosted.org/packages/source/S/Send2Trash/Send2Trash-%{version}.tar.gz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
Recommends:     python-gobject
%ifpython2
Obsoletes:      %{oldpython}-send2trash < %{version}
Provides:       %{oldpython}-send2trash = %{version}
%endif
BuildArch:      noarch

%python_subpackages

%description
Send2Trash is a small package that sends files to the Trash (or Recycle Bin) natively and on
all platforms. On OS X, it uses native FSMoveObjectToTrashSync Cocoa calls, on Windows, it
uses native (and ugly) SHFileOperation win32 calls. On other platforms, if PyGObject and
GIO are available, it will use this.  Otherwise, it will fallback to its own implementation
of the trash specifications from freedesktop.org.

%prep
%setup -q -n Send2Trash-%{version}

%build
%python_build

%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%if %{with test}
%check
%python_exec setup.py test
%endif

%files %{python_files}
%defattr(-,root,root,-)
%doc CHANGES.rst README.rst
%{python_sitelib}/*

%changelog
openSUSE Build Service is sponsored by