Browse Source

python-paramiko build updates (include python3 support)

Signed-off-by: basebuilder_pel7ppc64bebuilder0 <basebuilder@powerel.org>
master
basebuilder_pel7ppc64bebuilder0 5 years ago
parent
commit
ccecd2ad62
  1. 18
      SPECS/python-paramiko.spec

18
SPECS/python-paramiko.spec

@ -29,7 +29,7 @@ Requires: python2-pyasn1
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: python-setuptools BuildRequires: python-setuptools
BuildRequires: python-cryptography BuildRequires: python-cryptography
BuildRequires: python2-pyasn1 BuildRequires: python-pyasn1
%global paramiko_desc \ %global paramiko_desc \
Paramiko (a combination of the esperanto words for "paranoid" and "friend") is\ Paramiko (a combination of the esperanto words for "paranoid" and "friend") is\
a module for python 2.3 or greater that implements the SSH2 protocol for secure\ a module for python 2.3 or greater that implements the SSH2 protocol for secure\
@ -47,7 +47,6 @@ encrypted tunnel. (This is how sftp works, for example.)\
Recommends: python-gssapi Recommends: python-gssapi
%endif %endif


%if %{with python3}
%package -n python%{python3_pkgversion}-%{srcname} %package -n python%{python3_pkgversion}-%{srcname}
Summary: SSH2 protocol library for python Summary: SSH2 protocol library for python
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
@ -63,7 +62,6 @@ Recommends: python%{python3_pkgversion}-gssapi
%{paramiko_desc} %{paramiko_desc}


Python 3 version. Python 3 version.
%endif


%package doc %package doc
Summary: Docs and demo for SSH2 protocol library for python Summary: Docs and demo for SSH2 protocol library for python
@ -84,24 +82,18 @@ sed -i -e '/^#!/,1d' demos/*


%build %build
CFLAGS="%{optflags}" %{__python} setup.py %{?py_setup_args} build --executable="%{__python2} -s" CFLAGS="%{optflags}" %{__python} setup.py %{?py_setup_args} build --executable="%{__python2} -s"
%if %{with python3} CFLAGS="%{optflags}" %{__python3} setup.py %{?py_setup_args} build --executable="%{__python3} -s"
%py3_build
%endif


%install %install
CFLAGS="%{optflags}" %{__python} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot} CFLAGS="%{optflags}" %{__python} setup.py %{?py_setup_args} install -O2 --skip-build --root %{buildroot}
%if %{with python3} CFLAGS="%{optflags}" %{__python3} setup.py %{?py_setup_args} install -O2 --skip-build --root %{buildroot}
%py3_install
%endif


sphinx-build -b html sites/docs/ html/ sphinx-build -b html sites/docs/ html/
rm -f html/.buildinfo rm -f html/.buildinfo


%check %check
%{__python2} ./test.py --no-sftp --no-big-file %{__python2} ./test.py --no-sftp --no-big-file
%if %{with python3}
%{__python3} ./test.py --no-sftp --no-big-file %{__python3} ./test.py --no-sftp --no-big-file
%endif


%files -n python-%{srcname} %files -n python-%{srcname}
%license LICENSE %license LICENSE
@ -109,13 +101,11 @@ rm -f html/.buildinfo
%{python2_sitelib}/%{srcname}-*.egg-info/ %{python2_sitelib}/%{srcname}-*.egg-info/
%{python2_sitelib}/%{srcname}/ %{python2_sitelib}/%{srcname}/


%if %{with python3}
%files -n python%{python3_pkgversion}-%{srcname} %files -n python%{python3_pkgversion}-%{srcname}
%license LICENSE %license LICENSE
%doc NEWS README.rst %doc NEWS README.rst
%{python3_sitelib}/%{srcname}-*.egg-info/ %{python3_sitelib}/%{srcname}-*.egg-info/
%{python3_sitelib}/%{srcname}/ %{python3_sitelib}/%{srcname}/
%endif


%files doc %files doc
%doc html/ demos/ %doc html/ demos/

Loading…
Cancel
Save