[packages/python-paramiko] Release 1. python3.

matkor matkor at pld-linux.org
Fri Nov 7 12:58:45 CET 2014


commit 43d4f0853eb6461f47bdfcfbc9c16eacfe16ad98
Author: Mateusz Korniak <matkor at pld-linux.org>
Date:   Fri Nov 7 12:58:30 2014 +0100

    Release 1. python3.

 python-paramiko.spec | 90 +++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 78 insertions(+), 12 deletions(-)
---
diff --git a/python-paramiko.spec b/python-paramiko.spec
index c999fa3..b5065bb 100644
--- a/python-paramiko.spec
+++ b/python-paramiko.spec
@@ -3,24 +3,38 @@
 # Conditional build:
 %bcond_without	apidocs		# do not build and package API docs
 %bcond_without	tests	# do not perform "make test"
+%bcond_without	tests	# do not perform "make test"
+%bcond_without	python2 # CPython 2.x module
+%bcond_without	python3 # CPython 3.x module
+
 
 %define 	module	paramiko
 Summary:	SSH2 protocol for Python
 Summary(pl.UTF-8):	Obsługa protokołu SSH2 w Pythonie
 Name:		python-%{module}
 Version:	1.15.1
-Release:	0.1
+Release:	1
 License:	LGPL
 Group:		Libraries/Python
-Source0:        http://pypi.python.org/packages/source/p/paramiko/paramiko-%{version}.tar.gz
+Source0:	http://pypi.python.org/packages/source/p/paramiko/paramiko-%{version}.tar.gz
 # Source0-md5:	48c274c3f9b1282932567b21f6acf3b5
-URL:            https://github.com/paramiko/paramiko/
-BuildRequires:	python-Crypto >= 1.9
-BuildRequires:	python-devel >= 2.3
+URL:		https://github.com/paramiko/paramiko/
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.219
-%pyrequires_eq	python-modules
+%if %{with python2}
+BuildRequires:	python-Crypto >= 1.9
+BuildRequires:	python-devel >= 2.3
+BuildRequires:	python-ecdsa >=0.11
+%endif
+%if %{with python3}
+BuildRequires:	python3-Crypto >= 1.9
+BuildRequires:	python3-devel
+BuildRequires:	python3-ecdsa >=0.11
+%endif
+
+
 Requires:	python-Crypto
+Requires:	python-modules
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -34,9 +48,25 @@ Moduł dla języka Python 2.3 (lub wyższego) implementujący protokół
 SSH2 dla uzyskania bezpiecznych (szyfrowanych i autoryzowanych)
 połączeń ze zdalnymi maszynami.
 
+%package -n python3-%{module}
+Summary:	SSH2 protocol for Python
+Summary(pl.UTF-8):	Obsługa protokołu SSH2 w Pythonie
+Group:		Libraries/Python
+Requires:	python3-modules
+
+%description -n python3-%{module}
+A module for Python 3 (or higher) that implements the SSH2 protocol
+for secure (encrypted and authenticated) connections to remote
+machines.
+
+%description -n python3-%{module} -l pl.UTF-8
+Moduł dla języka Python 3 (lub wyższego) implementujący protokół SSH2
+dla uzyskania bezpiecznych (szyfrowanych i autoryzowanych) połączeń ze
+zdalnymi maszynami.
+
 %package apidocs
-Summary:	paramiko API documentation
-Summary(pl.UTF-8):	Dokumentacja API biblioteki paramiko
+Summary:	%{module} API documentation
+Summary(pl.UTF-8):	Dokumentacja API %{module}
 Group:		Documentation
 
 %description apidocs
@@ -48,25 +78,50 @@ API and internal documentation for paramiko library.
 find demos -name '*.py' -type f | xargs sed -i -e '1s|#!.*python.*|#!%{_bindir}/python|'
 
 %build
-%{__python} setup.py build
+%if %{with python2}
+%{__python} setup.py build --build-base build-2 %{?with_tests:test}
+%endif
 
-%{?with_tests:%{__python} setup.py test}
+%if %{with python3}
+%{__python3} setup.py build --build-base build-3 %{?with_tests:test}
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install \
-	--skip-build \
+
+%if %{with python2}
+%{__python} setup.py \
+	build --build-base build-2 \
+	install --skip-build \
 	--optimize=2 \
 	--root=$RPM_BUILD_ROOT
 
 %py_postclean
+%endif
+
+%if %{with python3}
+%{__python3} setup.py \
+	build --build-base build-3 \
+	install --skip-build \
+	--optimize=2 \
+	--root=$RPM_BUILD_ROOT
+%endif
 
+%if %{with python2}
 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 cp -a demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+%endif
+%if %{with python3}
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
+cp -a demos/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
+find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
+	| xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
 %doc README
@@ -75,6 +130,17 @@ rm -rf $RPM_BUILD_ROOT
 %{py_sitescriptdir}/%{module}-*.egg-info
 %endif
 %{_examplesdir}/%{name}-%{version}
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc README
+%{py3_sitescriptdir}/%{module}
+%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
+%{_examplesdir}/python3-%{module}-%{version}
+%endif
+
 
 %if %{with apidocs}
 %files apidocs
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-paramiko.git/commitdiff/43d4f0853eb6461f47bdfcfbc9c16eacfe16ad98



More information about the pld-cvs-commit mailing list