SPECS/python-cryptography/python-cryptography.spec
39990f70
 %{!?python2_sitelib: %define python2_sitelib %(python2 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
fda4104f
 %{!?python3_sitelib: %define python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib;print(get_python_lib())")}
 
279fb934
 Summary:        Python cryptography library
 Name:           python-cryptography
39990f70
 Version:        1.8.1
a848bcf8
 Release:        3%{?dist}
fda4104f
 Url:            https://pypi.python.org/pypi/cryptography
279fb934
 License:        ASL 2.0
 Group:          Development/Languages/Python
fda4104f
 Vendor:         VMware, Inc.
 Distribution:   Photon
 Source0:        https://pypi.io/packages/source/c/cryptography/cryptography-%{version}.tar.gz
39990f70
 %define sha1    cryptography=d15ffd42ca41260a61bc80cbeccf24e2dbf44253
fda4104f
 BuildRequires:  python2
 BuildRequires:  python2-libs
 BuildRequires:  python2-devel
 BuildRequires:  python-setuptools
 BuildRequires:  python-cffi
 BuildRequires:  openssl-devel
279fb934
 
fda4104f
 Requires:       python-cffi
 Requires:       openssl
279fb934
 Requires:       python2
 Requires:       python2-libs
39990f70
 Requires:       python-idna
 Requires:       python-pyasn1
 Requires:       python-ipaddress
 Requires:       python-setuptools
 Requires:       python-packaging
29dd855c
 Requires:       python-enum
 Requires:       python-asn1crypto
279fb934
 
 %description
 Cryptography is a Python library which exposes cryptographic recipes and primitives.
 
fda4104f
 %package -n     python3-cryptography
 Summary:        python-cryptography
 BuildRequires:  python3
 BuildRequires:  python3-devel
 BuildRequires:  python3-libs
 BuildRequires:  python3-cffi
a848bcf8
 BuildRequires:  python3-setuptools
 BuildRequires:  python3-xml
fda4104f
 
 Requires:       python3
 Requires:       python3-libs
 Requires:       python3-cffi
39990f70
 Requires:       python3-idna
 Requires:       python3-pyasn1
 Requires:       python3-six
 Requires:       python3-packaging
29dd855c
 Requires:       python3-asn1crypto
fda4104f
 
 %description -n python3-cryptography
 
 Python 3 version.
279fb934
 
 %prep
 %setup -q -n cryptography-%{version}
39990f70
 rm -rf ../p3dir
 cp -a . ../p3dir
279fb934
 
 %build
39990f70
 python2 setup.py build
 pushd ../p3dir
fda4104f
 python3 setup.py build
39990f70
 popd
279fb934
 
 %install
39990f70
 python2 setup.py install --prefix=%{_prefix} --root=%{buildroot}
 pushd ../p3dir
fda4104f
 python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
39990f70
 popd
279fb934
 
dd9fa153
 %check
 openssl req \
     -new \
     -newkey rsa:4096 \
     -days 365 \
     -nodes \
     -x509 \
     -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=photon.com" \
     -keyout photon.key \
     -out photon.cert
 openssl rsa -in photon.key -out photon.pem
 mv photon.pem /etc/ssl/certs
39990f70
 python2 setup.py test
fda4104f
 python3 setup.py test
dd9fa153
 
279fb934
 %files
 %defattr(-,root,root)
39990f70
 %{python2_sitelib}/*
279fb934
 
fda4104f
 %files -n python3-cryptography
 %defattr(-,root,root,-)
 %{python3_sitelib}/*
 
279fb934
 %changelog
a848bcf8
 *   Wed Jun 07 2017 Xiaolin Li <xiaolinl@vmware.com> 1.8.1-3
 -   Add python3-setuptools and python3-xml to python3 sub package Buildrequires.
29dd855c
 *   Fri May 05 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.8.1-2
 -   Added missing requires python-enum
39990f70
 *   Tue Apr 04 2017 Xiaolin Li <xiaolinl@vmware.com> 1.8.1-1
 -   Updated to version 1.8.1.
fda4104f
 *   Thu Feb 02 2017 Xiaolin Li <xiaolinl@vmware.com> 1.7.2-1
 -   Updated to version 1.7.2 and added python3 package.
 *   Mon Oct 03 2016 ChangLee <changLee@vmware.com> 1.2.3-3
 -   Modified %check
 *   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.3-2
 -   GA - Bump release of all rpms
 *   Mon Mar 07 2016 Anish Swaminathan <anishs@vmware.com> 1.2.3-1
 -   Upgrade to 1.2.3
 *   Fri Feb 26 2016 Anish Swaminathan <anishs@vmware.com> 1.2.2-1
 -   Upgrade version to 1.2.2
 *   Thu Jan 21 2016 Anish Swaminathan <anishs@vmware.com> 1.2.1-1
 -   Upgrade version
 *   Wed Nov 18 2015 Divya Thaluru <dthaluru@vmware.com> 1.1-1
 -   Initial packaging for Photon