diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..48cb827 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/netssh2-0.1.7.tar.gz diff --git a/python-netssh2.spec b/python-netssh2.spec new file mode 100644 index 0000000..ae37dff --- /dev/null +++ b/python-netssh2.spec @@ -0,0 +1,82 @@ +%global pypi_name netssh2 + +Name: python-%{pypi_name} +Version: 0.1.7 +Release: 1%{?dist} +Summary: Library for communicating with network devices using ssh2-python + +License: GPLv3 +URL: https://gitlab.com/jkrysl/netssh2 +Source0: https://files.pythonhosted.org/packages/source/n/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +BuildArch: noarch + +%?python_enable_dependency_generator + +BuildRequires: python3-devel +BuildRequires: python3dist(setuptools) +BuildRequires: python3dist(ssh2-python) +BuildRequires: python3dist(sphinx) +BuildRequires: python3dist(sphinx_rtd_theme) +BuildRequires: python3dist(future) +BuildRequires: python3dist(pytest-cov) +BuildRequires: python3dist(pytest) +BuildRequires: python3dist(tox) +BuildRequires: python3dist(flake8) +BuildRequires: python3dist(wheel) +BuildRequires: python3dist(sphinx-autodoc-typehints) + +%description +Library for communicating with network devices using ssh2-python. + +%package -n python3-%{pypi_name} +Summary: %{summary} +%{?python_provide:%python_provide python3-%{pypi_name}} + +Requires: python3dist(ssh2-python) +%description -n python3-%{pypi_name} +Library for communicating with network devices using ssh2-python. + +%package -n python-%{pypi_name}-doc +Summary: netssh2 documentation +%description -n python-%{pypi_name}-doc +Documentation for netssh2 + +%prep +%autosetup -n %{pypi_name}-%{version} +# Remove bundled egg-info +rm -rf %{pypi_name}.egg-info + +for lib in $(find . -type f -name "*.py"); do + sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new && + touch -r $lib $lib.new && + mv $lib.new $lib +done + +%build +%py3_build + +#PYTHONPATH=${PWD} sphinx-build-3 docs html +#rm -rf html/.{doctrees,buildinfo} + +%install +%py3_install + +#%check +#export PYTHONPATH=$RPM_BUILD_ROOT/%{python3_sitelib} +#pytest-%{python3_version} -v tests + +%files -n python3-%{pypi_name} +%license LICENSE +%doc README.rst +%{python3_sitelib}/docs +%{python3_sitelib}/%{pypi_name} +%{python3_sitelib}/tests +%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info + +%files -n python-%{pypi_name}-doc +#%doc html +%license LICENSE + +%changelog +* Wed Jun 05 2019 Luis Bazan - 0.1.7-1 +- Initial package. diff --git a/sources b/sources new file mode 100644 index 0000000..f21ce4c --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (netssh2-0.1.7.tar.gz) = 61a16ca649f6adea0e700e21258c461af26e21c0a623d62e5d7e0c10014f42d2dc9c396348ecddbd4f50d33865232949f40484a55a15d382c26803402ec5402b