From 3637e49a5191c0da2e699ea9e4638a563a681f20 Mon Sep 17 00:00:00 2001 From: rdobuilder Date: Jan 06 2022 14:33:02 +0000 Subject: Initial spec import of python-ssh-python Signed-off-by: James Slagle Related-to: https://review.rdoproject.org/r/q/I7bc5def5f034b604d476e548d15a2403682d5c12 --- diff --git a/.python-ssh-python.metadata b/.python-ssh-python.metadata new file mode 100644 index 0000000..1185637 --- /dev/null +++ b/.python-ssh-python.metadata @@ -0,0 +1 @@ +592172a45d4d6eef87d89761ac4ae152affd69c7 SOURCES/ssh-python-0.9.0.tar.gz diff --git a/SOURCES/.gitignore b/SOURCES/.gitignore new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/SOURCES/.gitignore diff --git a/SOURCES/0001-Set-master_doc-to-index-in-conf.py-for-sphinx.patch b/SOURCES/0001-Set-master_doc-to-index-in-conf.py-for-sphinx.patch new file mode 100644 index 0000000..95b0070 --- /dev/null +++ b/SOURCES/0001-Set-master_doc-to-index-in-conf.py-for-sphinx.patch @@ -0,0 +1,19 @@ +From c0ae7b341645958a94ced29b84ab8f66a045bd5a Mon Sep 17 00:00:00 2001 +From: James Slagle +Date: Mon, 13 Dec 2021 15:06:26 -0500 +Subject: [PATCH] Set master_doc to index in conf.py for sphinx + + +diff --git a/doc/conf.py b/doc/conf.py +index 95d8999..a28f7c2 100644 +--- a/doc/conf.py ++++ b/doc/conf.py +@@ -121,3 +121,5 @@ html_sidebars = { + htmlhelp_basename = 'ssh-pythondoc' + intersphinx_mapping = {'https://docs.python.org/': None} + autoclass_content = "both" ++ ++master_doc = "index" +-- +2.31.1 + diff --git a/SPECS/python-ssh-python.spec b/SPECS/python-ssh-python.spec new file mode 100644 index 0000000..40899b7 --- /dev/null +++ b/SPECS/python-ssh-python.spec @@ -0,0 +1,96 @@ +%{?python_enable_dependency_generator} + +%global modname ssh-python + +Name: python-%{modname} +Version: 0.9.0 +Release: 1%{?dist} +Summary: Bindings for libssh C library + +License: LGPLv2+ +URL: https://github.com/ParallelSSH/ssh-python +Source0: %{url}/archive/%{version}/%{modname}-%{version}.tar.gz + +Patch0001: 0001-Set-master_doc-to-index-in-conf.py-for-sphinx.patch + +BuildRequires: cmake +BuildRequires: gcc +BuildRequires: libssh-devel + +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-Cython +BuildRequires: python3-sphinx +BuildRequires: python3-sphinx_rtd_theme + +# test dependencies +BuildRequires: python3-pytest +BuildRequires: %{_sbindir}/sshd %{_bindir}/ssh-agent + +Recommends: python3-%{modname}-doc + +%description +%{summary}. + +%package -n python3-%{modname} +Summary: %{summary} +%{?python_provide:%python_provide python3-%{modname}} + +%description -n python3-%{modname} +%{summary}. + +Python 3 version. + + +%prep +%setup -n %{modname}-%{version} +%patch1 -p1 +# No bundled libs +rm -vrf libssh +sed -i -r 's:build_ssh[(].*:pass:' setup.py +# Remove pre-generated sources +rm $(grep -rl '/\* Generated by Cython') + +%build +%py3_build +export HAVE_AGENT_FWD=0 +# use build_ext to completely instruct cythonize options +export CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" +export LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" +export CXXFLAGS="${CXXFLAGS:-${RPM_OPT_FLAGS}}" +%{python3} setup.py build_ext --inplace +%{python3} -msphinx -M html doc _build + +%install +%py3_install +# remove 0 length files +rm -f %{buildroot}/%{python3_sitearch}/ssh/__init__.pxd +chmod 0755 %{buildroot}/%{python3_sitearch}/ssh/*.so + + +%check +# disable some options for sshd running inside mock +echo UsePrivilegeSeparation no >> tests/embedded_server/sshd_config.tmpl +echo StrictModes no >> tests/embedded_server/sshd_config.tmpl +# test_statvfs/test_fstatvfs do not seem to work in mock +rm -f tests/test_sftp.py +%pytest -v tests + +%files -n python3-%{modname} +%license COPYING LICENSE +%doc README.rst Changelog.rst +%{python3_sitearch}/ssh_python-*.egg-info/ +%{python3_sitearch}/ssh/ + +%package -n python3-%{modname}-doc +Summary: %{summary} documentation + +%description -n python3-%{modname}-doc +%{summary} documentation. + +%files -n python3-%{modname}-doc +%doc examples/ _build/html/ + +%changelog +* Wed Dec 8 2021 James Slagle - 0.9.0-1 +- Initial package