%if 0%{?fedora} %global with_python3 1 %endif Name: python-invoke Version: 0.9.0 Release: 4%{?dist} Summary: A Python task execution tool and library License: BSD URL: http://pyinvoke.org Source0: https://pypi.python.org/packages/source/i/invoke/invoke-%{version}.tar.gz # https://github.com/pyinvoke/invoke/issues/204 Patch0: invoke-0.9.0-remove-bundled-libs.patch BuildArch: noarch Requires: python-six python-pexpect Requires: python-fluidity-sm python-lexicon BuildRequires: python-devel python-setuptools %global invoke_desc \ Invoke is a Python (2.6+ and 3.2+) task execution tool and library,\ drawing inspiration from various sources to arrive at a powerful\ and clean feature set.\ %description %{invoke_desc} %if 0%{?with_python3} %package -n python3-invoke Summary: A Python task execution tool and library Requires: python3-six python3-pexpect Requires: python3-fluidity-sm python3-lexicon BuildRequires: python3-devel python3-setuptools %description -n python3-invoke %{invoke_desc} This package contains python3 build. %endif %prep %setup -q -n invoke-%{version} # Remove bundled libs %patch0 -p1 rm -fr invoke/vendor/ rm -fr invoke.egg-info/ %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %{__python2} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install rm -rf $RPM_BUILD_ROOT %{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT %if 0%{?with_python3} pushd %{py3dir} # Replace binaries name to avoid conflict with python2 variant sed -i 's/invoke\ =\ invoke\.cli:main/invoke3\ =\ invoke\.cli:main/' setup.py sed -i 's/inv\ =\ invoke\.cli:main/inv3\ =\ invoke\.cli:main/' setup.py %{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT popd %endif %files %doc LICENSE README.* %{_bindir}/inv %{_bindir}/invoke %{python_sitelib}/invoke/ %{python_sitelib}/invoke-%{version}-*.egg-info/ %if 0%{?with_python3} %files -n python3-invoke %doc LICENSE README.* %{_bindir}/inv3 %{_bindir}/invoke3 %{python3_sitelib}/invoke/ %{python3_sitelib}/invoke-%{version}-*.egg-info/ %endif %changelog * Sun Jan 11 2015 Athmane Madjoudj 0.9.0-4 - Update deps * Mon Dec 01 2014 Athmane Madjoudj 0.9.0-3 - Update BR - Minor fixes in files and install sections. * Sat Nov 29 2014 Athmane Madjoudj 0.9.0-2 - Remove bundled libs. - Remove .egg-info dir - Restrict files section - Add some build options * Fri Nov 14 2014 Athmane Madjoudj 0.9.0-1 - Initial spec