Blame SPECS/python-ssh-python.spec

rdobuilder 3637e4
%{?python_enable_dependency_generator}
rdobuilder 3637e4
rdobuilder 3637e4
%global modname ssh-python
rdobuilder 3637e4
rdobuilder 3637e4
Name:           python-%{modname}
rdobuilder 3637e4
Version:        0.9.0
rdobuilder 3637e4
Release:        1%{?dist}
rdobuilder 3637e4
Summary:        Bindings for libssh C library
rdobuilder 3637e4
rdobuilder 3637e4
License:        LGPLv2+
rdobuilder 3637e4
URL:            https://github.com/ParallelSSH/ssh-python
rdobuilder 3637e4
Source0:        %{url}/archive/%{version}/%{modname}-%{version}.tar.gz
rdobuilder 3637e4
rdobuilder 3637e4
Patch0001:      0001-Set-master_doc-to-index-in-conf.py-for-sphinx.patch
rdobuilder 3637e4
rdobuilder 3637e4
BuildRequires:  cmake
rdobuilder 3637e4
BuildRequires:  gcc
rdobuilder 3637e4
BuildRequires:  libssh-devel
rdobuilder 3637e4
rdobuilder 3637e4
BuildRequires:  python3-devel
rdobuilder 3637e4
BuildRequires:  python3-setuptools
rdobuilder 3637e4
BuildRequires:  python3-Cython
rdobuilder 3637e4
BuildRequires:  python3-sphinx
rdobuilder 3637e4
BuildRequires:  python3-sphinx_rtd_theme
rdobuilder 3637e4
rdobuilder 3637e4
# test dependencies
rdobuilder 3637e4
BuildRequires:  python3-pytest
rdobuilder 3637e4
BuildRequires:  %{_sbindir}/sshd %{_bindir}/ssh-agent
rdobuilder 3637e4
rdobuilder 3637e4
Recommends: python3-%{modname}-doc
rdobuilder 3637e4
rdobuilder 3637e4
%description
rdobuilder 3637e4
%{summary}.
rdobuilder 3637e4
rdobuilder 3637e4
%package -n python3-%{modname}
rdobuilder 3637e4
Summary:        %{summary}
rdobuilder 3637e4
%{?python_provide:%python_provide python3-%{modname}}
rdobuilder 3637e4
rdobuilder 3637e4
%description -n python3-%{modname}
rdobuilder 3637e4
%{summary}.
rdobuilder 3637e4
rdobuilder 3637e4
Python 3 version.
rdobuilder 3637e4
rdobuilder 3637e4
rdobuilder 3637e4
%prep
rdobuilder 3637e4
%setup -n %{modname}-%{version}
rdobuilder 3637e4
%patch1 -p1
rdobuilder 3637e4
# No bundled libs
rdobuilder 3637e4
rm -vrf libssh
rdobuilder 3637e4
sed -i -r 's:build_ssh[(].*:pass:' setup.py
rdobuilder 3637e4
# Remove pre-generated sources
rdobuilder 3637e4
rm $(grep -rl '/\* Generated by Cython')
rdobuilder 3637e4
rdobuilder 3637e4
%build
rdobuilder 3637e4
%py3_build
rdobuilder 3637e4
export HAVE_AGENT_FWD=0
rdobuilder 3637e4
# use build_ext to completely instruct cythonize options
rdobuilder 3637e4
export CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}"
rdobuilder 3637e4
export LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"
rdobuilder 3637e4
export CXXFLAGS="${CXXFLAGS:-${RPM_OPT_FLAGS}}"
rdobuilder 3637e4
%{python3} setup.py build_ext --inplace
rdobuilder 3637e4
%{python3} -msphinx -M html doc _build
rdobuilder 3637e4
rdobuilder 3637e4
%install
rdobuilder 3637e4
%py3_install
rdobuilder 3637e4
# remove 0 length files
rdobuilder 3637e4
rm -f %{buildroot}/%{python3_sitearch}/ssh/__init__.pxd
rdobuilder 3637e4
chmod 0755 %{buildroot}/%{python3_sitearch}/ssh/*.so
rdobuilder 3637e4
rdobuilder 3637e4
rdobuilder 3637e4
%check
rdobuilder 3637e4
# disable some options for sshd running inside mock
rdobuilder 3637e4
echo UsePrivilegeSeparation no >> tests/embedded_server/sshd_config.tmpl
rdobuilder 3637e4
echo StrictModes no >> tests/embedded_server/sshd_config.tmpl
rdobuilder 3637e4
# test_statvfs/test_fstatvfs do not seem to work in mock
rdobuilder 3637e4
rm -f tests/test_sftp.py
rdobuilder 3637e4
%pytest -v tests
rdobuilder 3637e4
rdobuilder 3637e4
%files -n python3-%{modname}
rdobuilder 3637e4
%license COPYING LICENSE
rdobuilder 3637e4
%doc README.rst Changelog.rst
rdobuilder 3637e4
%{python3_sitearch}/ssh_python-*.egg-info/
rdobuilder 3637e4
%{python3_sitearch}/ssh/
rdobuilder 3637e4
rdobuilder 3637e4
%package -n python3-%{modname}-doc
rdobuilder 3637e4
Summary:        %{summary} documentation
rdobuilder 3637e4
rdobuilder 3637e4
%description -n python3-%{modname}-doc
rdobuilder 3637e4
%{summary} documentation.
rdobuilder 3637e4
rdobuilder 3637e4
%files -n python3-%{modname}-doc
rdobuilder 3637e4
%doc examples/ _build/html/
rdobuilder 3637e4
rdobuilder 3637e4
%changelog
rdobuilder 3637e4
* Wed Dec 8 2021 James Slagle <jslagle@redhat.com> - 0.9.0-1
rdobuilder 3637e4
- Initial package