Browse code

Include Python3 compatible paramiko, ecdsa and pycrypto modules. (Bug 1820162)

Change-Id: I6f9eca1f74d018239bd0c714723db9776bd9b9c5
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/2091
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Divya Thaluru <dthaluru@vmware.com>

xiaolin-vmware authored on 2017/02/28 04:19:10
Showing 3 changed files
... ...
@@ -1,20 +1,25 @@
1
-Summary: ECDSA cryptographic signature library (pure python)
2
-Name: ecdsa
3
-Version: 0.13
4
-Release: 2%{?dist}
5
-License: MIT
6
-Group: System Environment/Security
7
-URL: https://pypi.python.org/pypi/ecdsa
1
+%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
2
+%{!?python3_sitelib: %define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
8 3
 
9
-Source0: https://pypi.python.org/packages/source/e/ecdsa/%{name}-%{version}.tar.gz
10
-%define sha1 ecdsa=7bcf6d1773d08bcc4bdd28cd05c545969f5aa162
4
+Summary:        ECDSA cryptographic signature library (pure python)
5
+Name:           ecdsa
6
+Version:        0.13
7
+Release:        3%{?dist}
8
+License:        MIT
9
+Group:          System Environment/Security
10
+Vendor:         VMware, Inc.
11
+Distribution:   Photon
12
+URL:            https://pypi.python.org/pypi/ecdsa
11 13
 
12
-BuildArch: noarch
14
+Source0:        https://pypi.python.org/packages/source/e/ecdsa/%{name}-%{version}.tar.gz
15
+%define         sha1 ecdsa=7bcf6d1773d08bcc4bdd28cd05c545969f5aa162
16
+
17
+BuildArch:      noarch
13 18
 
14 19
 BuildRequires:  python-setuptools
15 20
 BuildRequires:  python2-devel
16 21
 
17
-Requires: python2
22
+Requires:       python2
18 23
 
19 24
 %description
20 25
 This is an easy-to-use implementation of ECDSA cryptography (Elliptic Curve
... ...
@@ -24,12 +29,21 @@ key and verifying key), sign messages, and verify the signatures. The keys
24 24
 and signatures are very short, making them easy to handle and incorporate
25 25
 into other protocols.
26 26
 
27
+%package -n     python3-ecdsa
28
+Summary:        python3-ecdsa
29
+BuildRequires:  python3-devel
30
+
31
+Requires:       python3
32
+%description -n python3-ecdsa
33
+
34
+Python 3 version.
27 35
 
28 36
 %prep
29 37
 %setup -q
30 38
 
31 39
 %build
32
-easy_install ./
40
+python setup.py build
41
+python3 setup.py build
33 42
 
34 43
 %install
35 44
 %{__rm} -rf %{buildroot}
... ...
@@ -37,8 +51,13 @@ easy_install ./
37 37
     --root "%{buildroot}" \
38 38
     --single-version-externally-managed
39 39
 
40
+python3 setup.py install -O1 --skip-build \
41
+    --root "%{buildroot}" \
42
+    --single-version-externally-managed
43
+
40 44
 %check
41 45
 python setup.py test
46
+python3 setup.py test
42 47
 
43 48
 %clean
44 49
 %{__rm} -rf %{buildroot}
... ...
@@ -47,8 +66,14 @@ python setup.py test
47 47
 %defattr(-, root, root)
48 48
 %{python_sitelib}/*
49 49
 
50
+%files -n python3-ecdsa
51
+%defattr(-, root, root)
52
+%{python3_sitelib}/*
53
+
50 54
 %changelog
51
-*	Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 0.13-2
52
--	GA - Bump release of all rpms
53
-*	Tue Jan 5 2016 Xiaolin Li <xiaolinl@vmware.com> 0.13-1
54
--	Initial build.	First version
55 55
\ No newline at end of file
56
+*   Mon Feb 27 2017 Xiaolin Li <xiaolinl@vmware.com> 0.13-3
57
+-   Added python3 site-packages.
58
+*   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 0.13-2
59
+-   GA - Bump release of all rpms
60
+*   Tue Jan 5 2016 Xiaolin Li <xiaolinl@vmware.com> 0.13-1
61
+-   Initial build.  First version
... ...
@@ -1,34 +1,51 @@
1
-Summary: Python SSH module
2
-Name: paramiko
3
-Version: 1.16.0
4
-Release: 3%{?dist}
5
-License: LGPL
6
-Group: System Environment/Security
7
-URL: http://www.paramiko.org/
1
+%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
2
+%{!?python3_sitelib: %define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
3
+Summary:        Python SSH module
4
+Name:           paramiko
5
+Version:        1.16.0
6
+Release:        4%{?dist}
7
+License:        LGPL
8
+Group:          System Environment/Security
9
+Vendor:         VMware, Inc.
10
+Distribution:   Photon
11
+URL:            http://www.paramiko.org/
12
+Source0:        https://github.com/paramiko/paramiko/archive/paramiko-%{version}.tar.gz
13
+%define         sha1 paramiko=adf3afcc9e5a3f299a20639771f587a803924443
8 14
 
9
-Source0: https://github.com/paramiko/paramiko/archive/paramiko-%{version}.tar.gz
10
-%define sha1 paramiko=adf3afcc9e5a3f299a20639771f587a803924443
11
-
12
-BuildArch: noarch
15
+BuildArch:      noarch
13 16
 
14 17
 BuildRequires:  python-setuptools
15 18
 BuildRequires:  python2-devel
16 19
 BuildRequires:  ecdsa > 0.11
17
-BuildRequires: pycrypto > 2.1
20
+BuildRequires:  pycrypto > 2.1
18 21
 
19
-Requires: python2
20
-Requires: pycrypto > 2.1
21
-Requires: ecdsa > 0.11
22
+Requires:       python2
23
+Requires:       pycrypto > 2.1
24
+Requires:       ecdsa > 0.11
22 25
 
23 26
 
24 27
 %description
25 28
 "Paramiko" is a combination of the esperanto words for "paranoid" and "friend". It's a module for Python 2.6+ that implements the SSH2 protocol for secure (encrypted and authenticated) connections to remote machines. Unlike SSL (aka TLS), SSH2 protocol does not require hierarchical certificates signed by a powerful central authority.
26 29
 
30
+%package -n     python3-paramiko
31
+Summary:        python3-paramiko
32
+BuildRequires:  python3-devel
33
+BuildRequires:  python3-ecdsa > 0.11
34
+BuildRequires:  python3-pycrypto > 2.1
35
+
36
+Requires:       python3
37
+Requires:       python3-pycrypto > 2.1
38
+Requires:       python3-ecdsa > 0.11
39
+%description -n python3-paramiko
40
+
41
+Python 3 version.
42
+
27 43
 %prep
28 44
 %setup -q
29 45
 
30 46
 %build
31
-easy_install ./
47
+python setup.py build
48
+python3 setup.py build
32 49
 
33 50
 %install
34 51
 %{__rm} -rf %{buildroot}
... ...
@@ -36,8 +53,13 @@ easy_install ./
36 36
     --root "%{buildroot}" \
37 37
     --single-version-externally-managed
38 38
 
39
+python3 setup.py install -O1 --skip-build \
40
+    --root "%{buildroot}" \
41
+    --single-version-externally-managed
42
+
39 43
 %check
40 44
 %{__python}  test.py
45
+python3   test.py
41 46
 
42 47
 %clean
43 48
 %{__rm} -rf %{buildroot}
... ...
@@ -47,10 +69,17 @@ easy_install ./
47 47
 %doc *.txt
48 48
 %{python_sitelib}/*
49 49
 
50
+%files -n python3-paramiko
51
+%defattr(-, root, root)
52
+%doc *.txt
53
+%{python3_sitelib}/*
54
+
50 55
 %changelog
51
-*       Fri Oct 07 2016 ChangLee <changlee@vmware.com> 1.16.0-3
52
--       Modified %check
53
-*	Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.16.0-2
54
--	GA - Bump release of all rpms
55
-*	Tue Jan 5 2016 Xiaolin Li <xiaolinl@vmware.com> 1.16.0-1
56
--	Initial build.	First version
56
+*   Mon Feb 27 2017 Xiaolin Li <xiaolinl@vmware.com> 1.16.0-4
57
+-   Added python3 site-packages.
58
+*   Fri Oct 07 2016 ChangLee <changlee@vmware.com> 1.16.0-3
59
+-   Modified %check
60
+*   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.16.0-2
61
+-   GA - Bump release of all rpms
62
+*   Tue Jan 5 2016 Xiaolin Li <xiaolinl@vmware.com> 1.16.0-1
63
+-   Initial build.  First version
... ...
@@ -1,42 +1,64 @@
1
-Summary: The Python Cryptography Toolkit.
2
-Name:    pycrypto
3
-Version: 2.7a1
4
-Release: 3%{?dist}
5
-License: UNKNOWN
6
-URL: https://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.7a1.tar.gz
7
-Source: %{name}-%{version}.tar.gz
8
-%define sha1 pycrypto=6326136d88e9a8f6dd8a41b91d56db8490ba2873
9
-Group:      Development/Tools
10
-Vendor:     VMware, Inc.
11
-Distribution:  Photon
1
+%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
2
+%{!?python3_sitelib: %define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
3
+
4
+Summary:        The Python Cryptography Toolkit.
5
+Name:           pycrypto
6
+Version:        2.7a1
7
+Release:        3%{?dist}
8
+License:        UNKNOWN
9
+URL:            https://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.7a1.tar.gz
10
+Source:         %{name}-%{version}.tar.gz
11
+%define         sha1 pycrypto=6326136d88e9a8f6dd8a41b91d56db8490ba2873
12
+Group:          Development/Tools
13
+Vendor:         VMware, Inc.
14
+Distribution:   Photon
12 15
 
13 16
 BuildRequires:  python-setuptools
14 17
 BuildRequires:  python2-devel
15 18
 Requires:       python2
16 19
 %description
20
+This is a collection of both secure hash functions (such as SHA256 and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal, etc.). 
21
+
22
+%package -n     python3-pycrypto
23
+Summary:        python3-pycrypto
24
+BuildRequires:  python3-devel
25
+
26
+Requires:       python3
27
+%description -n python3-pycrypto
28
+
29
+Python 3 version.
17 30
 
18 31
 %prep
19 32
 %setup -q
20 33
 
21 34
 %build
22 35
 python setup.py build
36
+python3 setup.py build
23 37
 
24 38
 %install
25 39
 python setup.py install -O1 --root=%{buildroot} --prefix=/usr
40
+python3 setup.py install -O1 --root=%{buildroot} --prefix=/usr
26 41
 
27 42
 %check
28 43
 python setup.py test
44
+python3 setup.py test
29 45
 
30 46
 %files
31 47
 %defattr(-,root,root)
32
-%{_libdir}/python2.7/*
48
+%{python_sitelib}/*
49
+
50
+%files -n python3-pycrypto
51
+%defattr(-, root, root)
52
+%{python3_sitelib}/*
33 53
 
34 54
 %changelog
35
-*       Mon Oct 03 2016 ChangLee <changLee@vmware.com> 2.7a1-3
36
--       Modified %check
37
-*	Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.7a1-2
38
--	GA - Bump release of all rpms
55
+*   Mon Feb 27 2017 Xiaolin Li <xiaolinl@vmware.com> 2.7a1-4
56
+-   Added python3 site-packages.
57
+*   Mon Oct 03 2016 ChangLee <changLee@vmware.com> 2.7a1-3
58
+-   Modified %check
59
+*   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.7a1-2
60
+-   GA - Bump release of all rpms
39 61
 *   Tue Feb 23 2016 Xiaolin Li <xiaolinl@vmware.com> 2.7a1-1
40 62
 -   Updated to version 2.7a1
41
-*	Tue Dec 15 2015 Xiaolin Li <xiaolinl@vmware.com> 2.6.1-1
63
+*   Tue Dec 15 2015 Xiaolin Li <xiaolinl@vmware.com> 2.6.1-1
42 64
 -   Initial build.  First version