RHEL 9.0.0 Alpha bootstrap

The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/python-cryptography#e3b20e8f2628b1bfea819f71e5ded8bd039711fc
This commit is contained in:
Troy Dawson 2021-02-10 09:54:40 -08:00
parent 3f1c840083
commit 514b618f10
4 changed files with 146 additions and 95 deletions

8
.gitignore vendored
View File

@ -25,3 +25,11 @@
/cryptography-3.2.1.tar.gz.asc /cryptography-3.2.1.tar.gz.asc
/cryptography-3.3.1.tar.gz /cryptography-3.3.1.tar.gz
/cryptography-3.3.1.tar.gz.asc /cryptography-3.3.1.tar.gz.asc
/cryptography-3.4.tar.gz
/cryptography-3.4.tar.gz.asc
/cryptography-3.4.1.tar.gz
/cryptography-3.4.1.tar.gz.asc
/cryptography-3.4.2.tar.gz
/cryptography-3.4.2.tar.gz.asc
/cryptography-3.4.4.tar.gz
/cryptography-3.4.4.tar.gz.asc

98
README.md Normal file
View File

@ -0,0 +1,98 @@
# PyCA cryptography
https://cryptography.io/en/latest/
## Packaging python-cryptography
The example assumes
* Fedora Rawhide (f34)
* PyCA cryptography release ``3.4``
* Update Bugzilla issues are ``RHBZ#00000001`` and ``RHBZ#00000002``
* Build side tag is ``f34-build-side-12345``
### Request a side tag for building
python-cryptography builds depend on python-cryptography-vectors
package. Both packages must be build in a side tag.
```shell
fedpkg request-side-tag --base-tag f34-build
```
### Build new python-cryptography-vectors first
```shell
pushd ../python-cryptography-vectors
```
Switch and update branch
```shell
fedpkg switch-branch rawhide
fedpkg pull
```
Bump version and get sources
```shell
rpmdev-bumpspec -c "Update to 3.4 (#00000001)" -n 3.4 python-cryptography-vectors.spec
spectool -gf python-cryptography-vectors.spec
```
Upload sources
```shell
fedpkg new-sources cryptography_vectors-3.4.tar.gz
```
Commit changes
```shell
git add sources .gitignore python-cryptography-vectors.spec
fedpkg commit --clog
fedpkg push
```
Build and wait for repo to regenerate
```shell
fedpkg build --target=f34-build-side-12345
koji wait-repo --build python-cryptography-vectors-3.4-1 f34-build-side-12345
```
### Build new python-cryptography
Switch and update branch
```shell
fedpkg switch-branch rawhide
fedpkg pull
```
Bump version and get sources
```shell
rpmdev-bumpspec -c "Update to 3.4 (#00000002)" -n 3.4 python-cryptography.spec
spectool -gf python-cryptography.spec
```
Upload new sources (**two files!**)
```shell
fedpkg new-sources cryptography-3.4.tar.gz cryptography-3.4.tar.gz.asc
```
Commit changes
```shell
git add sources .gitignore python-cryptography.spec
fedpkg commit --clog
fedpkg push
```
Build
```shell
fedpkg build --target=f34-build-side-12345
```

View File

@ -1,26 +1,13 @@
%if 0%{?fedora} || 0%{?rhel} > 7
# Enable python3 build by default
%bcond_without python3
%else
%bcond_with python3
%endif
%if 0%{?fedora} > 31 || 0%{?rhel} > 7
# Disable python2 build by default
%bcond_with python2
%else
%bcond_without python2
%endif
%bcond_without tests %bcond_without tests
%{!?python3_pkgversion:%global python3_pkgversion 3} %{!?python3_pkgversion:%global python3_pkgversion 3}
%global srcname cryptography %global srcname cryptography
%global pyo3_version 0.13.1
Name: python-%{srcname} Name: python-%{srcname}
Version: 3.3.1 Version: 3.4.4
Release: 2%{?dist} Release: 1%{?dist}
Summary: PyCA's cryptography library Summary: PyCA's cryptography library
License: ASL 2.0 or BSD License: ASL 2.0 or BSD
@ -36,31 +23,12 @@ Source2: gpgkey-05FD_9FA1_6CF7_5735_0D91_A560_235A_E5F1_29F9_ED98.gpg
BuildRequires: openssl-devel BuildRequires: openssl-devel
BuildRequires: gcc BuildRequires: gcc
BuildRequires: gnupg2 BuildRequires: gnupg2
BuildRequires: rust-packaging
%if 0%{?with_python2}
BuildRequires: python2-cffi >= 1.7
BuildRequires: python2-cryptography-vectors = %{version}
BuildRequires: python2-devel
BuildRequires: python2-enum34
BuildRequires: python2-idna >= 2.1
BuildRequires: python2-ipaddress
BuildRequires: python2-setuptools
BuildRequires: python2-six >= 1.4.1
%if %{with tests}
BuildRequires: python2-hypothesis >= 1.11.4
BuildRequires: python2-iso8601
BuildRequires: python2-pretend
BuildRequires: python2-pytest >= 3.2.1
BuildRequires: python2-pytz
%endif
%endif
%if 0%{?with_python3}
BuildRequires: python%{python3_pkgversion}-cffi >= 1.7 BuildRequires: python%{python3_pkgversion}-cffi >= 1.7
BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-idna >= 2.1
BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-setuptools-rust >= 0.11.3
BuildRequires: python%{python3_pkgversion}-six >= 1.4.1 BuildRequires: python%{python3_pkgversion}-six >= 1.4.1
%if %{with tests} %if %{with tests}
@ -68,108 +36,85 @@ BuildRequires: python%{python3_pkgversion}-cryptography-vectors = %{version}
BuildRequires: python%{python3_pkgversion}-hypothesis >= 1.11.4 BuildRequires: python%{python3_pkgversion}-hypothesis >= 1.11.4
BuildRequires: python%{python3_pkgversion}-iso8601 BuildRequires: python%{python3_pkgversion}-iso8601
BuildRequires: python%{python3_pkgversion}-pretend BuildRequires: python%{python3_pkgversion}-pretend
BuildRequires: python%{python3_pkgversion}-pytest >= 3.2.1 BuildRequires: python%{python3_pkgversion}-pytest >= 6.0
BuildRequires: python%{python3_pkgversion}-pytest-subtests >= 0.3.2
BuildRequires: python%{python3_pkgversion}-pytest-xdist
BuildRequires: python%{python3_pkgversion}-pytz BuildRequires: python%{python3_pkgversion}-pytz
%endif %endif
%endif
%description %description
cryptography is a package designed to expose cryptographic primitives and cryptography is a package designed to expose cryptographic primitives and
recipes to Python developers. recipes to Python developers.
%if 0%{?with_python2}
%package -n python2-%{srcname}
Summary: PyCA's cryptography library
%if 0%{?with_python3}
%{?python_provide:%python_provide python2-%{srcname}}
%else
Provides: python-%{srcname}
%endif
Requires: openssl-libs
Requires: python2-idna >= 2.1
Requires: python2-six >= 1.4.1
Requires: python2-cffi >= 1.7
Requires: python2-enum34
Requires: python2-ipaddress
%description -n python2-%{srcname}
cryptography is a package designed to expose cryptographic primitives and
recipes to Python developers.
%endif
%if 0%{?with_python3}
%package -n python%{python3_pkgversion}-%{srcname} %package -n python%{python3_pkgversion}-%{srcname}
Summary: PyCA's cryptography library Summary: PyCA's cryptography library
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
Requires: openssl-libs Requires: openssl-libs
Requires: python%{python3_pkgversion}-idna >= 2.1
Requires: python%{python3_pkgversion}-six >= 1.4.1 Requires: python%{python3_pkgversion}-six >= 1.4.1
Requires: python%{python3_pkgversion}-cffi >= 1.7 Requires: python%{python3_pkgversion}-cffi >= 1.7
%description -n python%{python3_pkgversion}-%{srcname} %description -n python%{python3_pkgversion}-%{srcname}
cryptography is a package designed to expose cryptographic primitives and cryptography is a package designed to expose cryptographic primitives and
recipes to Python developers. recipes to Python developers.
%endif
%prep %prep
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%autosetup -p1 -n %{srcname}-%{version} %autosetup -p1 -n %{srcname}-%{version}
%cargo_prep
rm -f src/rust/Cargo.lock
%generate_buildrequires
cd src/rust
%cargo_generate_buildrequires
cd ../..
%build %build
%if 0%{?with_python2}
%py2_build
%endif
%if 0%{?with_python3}
%py3_build %py3_build
%endif
%install %install
# Actually other *.c and *.h are appropriate # Actually other *.c and *.h are appropriate
# see https://github.com/pyca/cryptography/issues/1463 # see https://github.com/pyca/cryptography/issues/1463
find . -name .keep -print -delete find . -name .keep -print -delete
%if 0%{?with_python2}
%py2_install
%endif
%if 0%{?with_python3}
%py3_install %py3_install
%endif
%check %check
%if %{with tests} %if %{with tests}
%if 0%{?with_python2}
# see https://github.com/pyca/cryptography/issues/4885 and # see https://github.com/pyca/cryptography/issues/4885 and
# see https://bugzilla.redhat.com/show_bug.cgi?id=1761194 for deselected tests # see https://bugzilla.redhat.com/show_bug.cgi?id=1761194 for deselected tests
PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} -m pytest -k "not (test_buffer_protocol_alternate_modes or test_dh_parameters_supported or test_load_ecdsa_no_named_curve)"
%endif
%if 0%{?with_python3}
PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest -k "not (test_buffer_protocol_alternate_modes or test_dh_parameters_supported or test_load_ecdsa_no_named_curve)" PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest -k "not (test_buffer_protocol_alternate_modes or test_dh_parameters_supported or test_load_ecdsa_no_named_curve)"
%endif %endif
%endif
%if 0%{?with_python2}
%files -n python2-%{srcname}
%doc LICENSE LICENSE.APACHE LICENSE.BSD README.rst docs
%{python2_sitearch}/%{srcname}
%{python2_sitearch}/%{srcname}-%{version}-py*.egg-info
%endif
%if 0%{?with_python3}
%files -n python%{python3_pkgversion}-%{srcname} %files -n python%{python3_pkgversion}-%{srcname}
%doc README.rst docs %doc README.rst docs
%license LICENSE LICENSE.APACHE LICENSE.BSD %license LICENSE LICENSE.APACHE LICENSE.BSD
%{python3_sitearch}/%{srcname} %{python3_sitearch}/%{srcname}
%{python3_sitearch}/%{srcname}-%{version}-py*.egg-info %{python3_sitearch}/%{srcname}-%{version}-py*.egg-info
%endif
%changelog %changelog
* Wed Feb 10 2021 Christian Heimes <cheimes@redhat.com> - 3.4.4-1
- Update to 3.4.4 (#1927044)
* Mon Feb 08 2021 Christian Heimes <cheimes@redhat.com> - 3.4.2-1
- Update to 3.4.2 (#1926339)
- Package no longer depends on Rust (#1926181)
* Mon Feb 08 2021 Fabio Valentini <decathorpe@gmail.com> - 3.4.1-2
- Use dynamically generated BuildRequires for PyO3 Rust module.
- Drop unnecessary CARGO_NET_OFFLINE environment variable.
* Sun Feb 07 2021 Christian Heimes <cheimes@redhat.com> - 3.4.1-1
- Update to 3.4.1 (#1925953)
* Sun Feb 07 2021 Christian Heimes <cheimes@redhat.com> - 3.4-2
- Add missing abi3 and pytest dependencies
* Sun Feb 07 2021 Christian Heimes <cheimes@redhat.com> - 3.4-1
- Update to 3.4 (#1925953)
- Remove Python 2 support
- Remove unused python-idna dependency
- Add Rust support
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.1-2 * Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

View File

@ -1,2 +1,2 @@
SHA512 (cryptography-3.3.1.tar.gz) = 62192fe0fd3bb8844ccc0056ab72a42b038db2a4ecb0928543c520b85e1de93066dab0d604acf23d37395d68172b9618f81c6022a59ec49725bc1862096d15d1 SHA512 (cryptography-3.4.4.tar.gz) = 3c94cb3eccc67cd1d7be9d16353f94a08019534517bbe9cd97ee75f05631418d1688fa7efc7284a62482d22b731de524f45268cf357d47a37a2fb033f1b9b3fc
SHA512 (cryptography-3.3.1.tar.gz.asc) = 5ec77aa93142cafc7b8c4d2ba355da477ac403e73b30740bf4ef42ab8065efb7cc1efa6c007ae67a13b44cf43f715f1cc7fee005bfa89b5a490c0f968a7373ff SHA512 (cryptography-3.4.4.tar.gz.asc) = 395c8af891a2ae9c2a5954291e58d223fb5a9157794f22cf83bb798dd13534277d44846edca723b44dcbcb609e5db55e3fca7416fd452f23c5bb6e126c4c5284