%global with_python3 1 %global srcname Send2Trash Name: python-send2trash Version: 1.3.0 Release: 1%{?dist} Summary: Python module to send files to trash natively Group: Development/Languages License: BSD URL: https://pypi.python.org/pypi/Send2Trash Source0: https://pypi.python.org/packages/source/S/Send2Trash/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools Requires: python-setuptools %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-setuptools %endif %description Send2Trash is a small package that sends files to the Trash (or Recycle Bin) natively and on all platforms. %if 0%{?with_python3} %package -n python3-%{srcname} Summary: Library for internationalizing Python applications Group: Development/Languages Requires: python3-setuptools %description -n python3-%{srcname} Send2Trash is a small package that sends files to the Trash (or Recycle Bin) natively and on all platforms. %endif %prep %setup0 -q -n %{srcname}-%{version} %if 0%{?with_python3} rm -rf %{py3dir} cp -r . %{py3dir} %endif %build %{__python} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --no-compile --root %{buildroot} popd %endif %{__python} setup.py install --skip-build --no-compile --root %{buildroot} %files %doc README.rst CHANGES.rst %{python_sitelib}/%{srcname}-%{version}-py*.egg-info %{python_sitelib}/send2trash %if 0%{?with_python3} %files -n python3-%{srcname} %doc README.rst CHANGES.rst %{python3_sitelib}/%{srcname}-%{version}-py*.egg-info %{python3_sitelib}/send2trash %endif %changelog * Thu Jan 01 2015 Christian Krause - 1.3.0-1 - Initial RPM release