d4965dd
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
d4965dd
d4965dd
%if 0%{?fedora}
d4965dd
%global with_python3 1
d4965dd
%endif
d4965dd
ac62a95
%if 0%{?rhel} && 0%{?rhel} <= 6
ac62a95
%{!?__python2: %global __python2 /usr/bin/python2}
ac62a95
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
ac62a95
%endif
ac62a95
ac62a95
%global pkgname remoto
ac62a95
ac62a95
Name:           python-%{pkgname}
5c6f58f
Version:        0.0.25
f80048b
Release:        1%{?dist}
ac62a95
Summary:        Execute remote commands or processes
d4965dd
Group:          Development/Languages
ac62a95
ac62a95
License:        MIT
01c5f46
URL:            https://github.com/alfredodeza/remoto
ac62a95
01c5f46
Source0:        https://pypi.python.org/packages/source/r/%{pkgname}/%{pkgname}-%{version}.tar.gz
ac62a95
ac62a95
BuildArch:      noarch
d4965dd
BuildRequires:  pytest
ac62a95
BuildRequires:  python2-devel
d4965dd
BuildRequires:  python-execnet >= 1.2.0
d4965dd
BuildRequires:  python-mock
ac62a95
BuildRequires:  python-setuptools
d4965dd
%if 0%{?with_python3}
d4965dd
BuildRequires:  python3-devel
d4965dd
BuildRequires:  python3-pytest
d4965dd
BuildRequires:  python3-execnet >= 1.2.0
d4965dd
BuildRequires:  python3-mock
d4965dd
BuildRequires:  python3-setuptools
d4965dd
%endif # with_python3
ac62a95
ac62a95
Requires:       python-execnet >= 1.2.0
ac62a95
ac62a95
%description
ac62a95
Execute remote commands or processes.
ac62a95
d4965dd
%if 0%{?with_python3}
d4965dd
%package -n python3-remoto
d4965dd
Summary:        Execute remote commands or processes
d4965dd
Group:          Development/Languages
d4965dd
Requires:       python3
d4965dd
Requires:       python3-execnet >= 1.2.0
d4965dd
d4965dd
%description -n python3-remoto
d4965dd
Execute remote commands or processes.
d4965dd
%endif # with_python3
ac62a95
ac62a95
%prep
ac62a95
%setup -q -n %{pkgname}-%{version}
ac62a95
5c6f58f
# https://github.com/alfredodeza/remoto/issues/17
5c6f58f
find . -name '*.pyc' -print0 | xargs -0 rm
5c6f58f
d4965dd
%if 0%{?with_python3}
d4965dd
cp -a . %{py3dir}
d4965dd
%endif # with_python3
ac62a95
ac62a95
%build
ac62a95
REMOTO_NO_VENDOR=1 %{__python2} setup.py build
ac62a95
d4965dd
%if 0%{?with_python3}
d4965dd
pushd %{py3dir}
d4965dd
REMOTO_NO_VENDOR=1 %{__python3} setup.py build
d4965dd
popd
d4965dd
%endif # with_python3
ac62a95
ac62a95
%install
ac62a95
REMOTO_NO_VENDOR=1 %{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
ac62a95
d4965dd
%if 0%{?with_python3}
d4965dd
pushd %{py3dir}
d4965dd
REMOTO_NO_VENDOR=1 %{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
d4965dd
popd
d4965dd
%endif # with_python3
d4965dd
d4965dd
d4965dd
%check
d4965dd
export REMOTO_NO_VENDOR=1
d4965dd
export PYTHONPATH=$(pwd)
d4965dd
d4965dd
py.test-%{python_version} -v remoto/tests
d4965dd
d4965dd
%if 0%{?with_python3}
d4965dd
pushd %{py3dir}
d4965dd
py.test-%{python3_version} -v remoto/tests
d4965dd
popd
d4965dd
%endif # with_python3
ac62a95
ac62a95
%files
ac62a95
%doc LICENSE README.rst
ac62a95
%{python2_sitelib}/*
ac62a95
d4965dd
%if 0%{?with_python3}
d4965dd
%files -n python3-remoto
d4965dd
%{python3_sitelib}/*
d4965dd
%doc LICENSE README.rst
d4965dd
%endif # with_python3
d4965dd
ac62a95
ac62a95
%changelog
5c6f58f
* Tue Apr 21 2015 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.0.25-1
5c6f58f
- Update to remoto-0.0.25
5c6f58f
- rm python3_version compat macro; this has been defined since F13
5c6f58f
- Remove pre-existing .pyc files during %%prep
5c6f58f
d4965dd
* Mon Jan 05 2015 Ken Dreyer <ktdreyer@ktdreyer.com> - 0.0.24-1
d4965dd
- Update to remoto-0.0.24
d4965dd
- Add Group tag
d4965dd
- Enable tests during %%check (RHBZ #1178930)
d4965dd
- Add python3 subpackage
d4965dd
01c5f46
* Fri Dec 12 2014 Ken Dreyer <kdreyer@redhat.com> - 0.0.23-1
01c5f46
- Update to remoto-0.0.23 (RHBZ #1146478)
01c5f46
- Use pypi URL for Source0 (requires LICENSE file to be shipped separately)
01c5f46
- Use HTTPS for homepage
01c5f46
5f7d869
* Fri Sep 12 2014 Federico Simoncelli <fsimonce@redhat.com> 0.0.21-1
5f7d869
- update remoto-0.0.21
5f7d869
f80048b
* Fri Aug  1 2014 Federico Simoncelli <fsimonce@redhat.com> 0.0.19-1
f80048b
- update to remoto-0.0.19
f80048b
ac62a95
* Fri Jun 27 2014 Federico Simoncelli <fsimonce@redhat.com> 0.0.17-2
ac62a95
- specfile cleanups
ac62a95
ac62a95
* Sun Jun 22 2014 Federico Simoncelli <fsimonce@redhat.com> 0.0.17-1
ac62a95
- initial build