Blob Blame History Raw
%{?python_enable_dependency_generator}

%global modname ssh2-python

Name:           python-%{modname}
Version:        0.26.0
Release:        1%{?dist}
Summary:        Super fast SSH library - bindings for libssh2

License:        LGPLv2+
URL:            https://github.com/ParallelSSH/ssh2-python
Source0:        %{url}/archive/%{version}/%{modname}-%{version}.tar.gz
Source1:        conftest.py

BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  libssh2-devel

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-Cython
BuildRequires:  python3-sphinx

# test dependencies
BuildRequires:  python3-pytest
BuildRequires:  python3-mock-ssh-server

%description
%{summary}.

%package -n python3-%{modname}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{modname}}

%description -n python3-%{modname}
%{summary}.

Python 3 version.


%prep
%autosetup -n %{modname}-%{version}
# No bundled libs
rm -vrf libssh2
# Remove pre-generated sources
rm $(grep -rl '/\* Generated by Cython')

%build
export HAVE_AGENT_FWD=0
export SYSTEM_LIBSSH2=1
#%%py3_build
# use build_ext to completely instruct cythonize options
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" \
%{__python3} setup.py build_ext --inplace
%{__python3} -msphinx -M html doc _build

%install
export SYSTEM_LIBSSH2=1
%py3_install

%check
# use mocked sshd
cp {SOURCE1} tests
sed -i -r "s:.*start_server:\#\0" tests/base_test.py
pytest

%files -n python3-%{modname}
%license COPYING LICENSE
%doc README.rst Changelog.rst
%doc examples/ _build/html/
%{python3_sitearch}/ssh2_python-*.egg-info/
#%{python3_sitearch}/ssh2/

%changelog
* Tue Jul 28 2021 Raphael Groner <raphgro@fedoraproject.org> - 0.26.0-1
- bump to v0.26.0
- generate and ship documentation incl. examples
- try to execute some tests without need for sshd server

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.15.0-12
- Rebuilt for Python 3.10

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.15.0-9
- Rebuilt for Python 3.9

* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.15.0-7
- Rebuilt for Python 3.8.0rc1 (#1748018)

* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.15.0-6
- Rebuilt for Python 3.8

* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Oct 12 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.15.0-3
- Python2 binary package has been removed
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Sat Jul 07 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.15.0-1
- Initial package