diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..48d1b1a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/ssh-python-0.9.0.tar.gz diff --git a/0001-Set-master_doc-to-index-in-conf.py-for-sphinx.patch b/0001-Set-master_doc-to-index-in-conf.py-for-sphinx.patch new file mode 100644 index 0000000..95b0070 --- /dev/null +++ b/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/python-ssh-python.spec b/python-ssh-python.spec new file mode 100644 index 0000000..40899b7 --- /dev/null +++ b/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 diff --git a/sources b/sources new file mode 100644 index 0000000..f9a3321 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (ssh-python-0.9.0.tar.gz) = 5fa080f36032edc27fd33f69aca46983ae5ec951f7e05e658aba5d06f992a0b7d51ff8288943ca20ea0ccc20f337d8411a4e199d2a3eb7ec17ea95f8e641b389