-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython-cryptography.spec
More file actions
77 lines (63 loc) · 2.29 KB
/
python-cryptography.spec
File metadata and controls
77 lines (63 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
%undefine _debugsource_template
%define module cryptography
Name: python-cryptography
Summary: Crytographic recipes for python
Version: 46.0.6
Release: 1
License: LGPLv2
Group: Development/Python
URL: https://github.com/pyca/cryptography
Source0: https://github.com/pyca/cryptography/archive/%{version}/%{module}-%{version}.tar.gz
# Generate using vendor_rust.py (Source100) with network on
Source1: cryptography-%{version}-vendor.tar.bz2
Source100: https://src.fedoraproject.org/rpms/python-cryptography/raw/rawhide/f/vendor_rust.py
Source1000: %{name}.rpmlintrc
# Patch0 for 46.0.6: https://github.com/pyca/cryptography/commit/43eb178ee3aae8d0060221118437b03c23570a41
# Patch0 should be able to be dropped in the next release (> 46.0.6) as it has been merged upstream.
Patch0: https://github.com/pyca/cryptography/commit/43eb178ee3aae8d0060221118437b03c23570a41.patch#/fix-installing-stray-files-into-site-packages.patch
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(python)
BuildRequires: python%{pyver}dist(pip)
BuildRequires: python%{pyver}dist(cffi)
BuildRequires: python%{pyver}dist(maturin)
BuildRequires: python%{pyver}dist(setuptools)
BuildRequires: python%{pyver}dist(setuptools-rust) >= 1.8.0
BuildRequires: python%{pyver}dist(wheel)
BuildRequires: python-six
BuildRequires: python-distribute
BuildRequires: rust-packaging
BuildRequires: cargo
Requires: python-pkg-resources
%description
%{name} is a package which provides cryptographic recipes
and primitives to Python developers.
%{name} includes both high level recipes, and low level
interfaces to common cryptographic algorithms such as symmetric
ciphers, message digests and key derivation functions.
%package doc
Summary: Documentation for %{name}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%autosetup -n %{module}-%{version} -p1
tar xf %{SOURCE1}
%cargo_prep -v vendor/
cat >> .cargo/config << EOF
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"
EOF
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
export RUSTFLAGS="-lpython%{pyver}"
%py_build
%install
%py_install
%files
%{py_platsitedir}/%{module}/
%{py_platsitedir}/%{module}-%{version}.dist-info/
%files doc
%doc README.rst CHANGELOG.rst