]>
Commit | Line | Data |
---|---|---|
625810ec JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # API documentation | |
4 | %bcond_with tests # unit tests (fapi tests fail) | |
5 | ||
6 | %define module template | |
7 | Summary: TPM 2.0 TSS Bindings for Python | |
8 | Summary(pl.UTF-8): Wiązania TPM 2.0 TSS dla Pythona | |
9 | Name: python3-tpm2-pytss | |
f8d84ea1 | 10 | Version: 2.1.0 |
625810ec JB |
11 | Release: 1 |
12 | License: BSD | |
13 | Group: Libraries/Python | |
14 | #Source0Download: https://pypi.org/simple/tpm2-pytss/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/t/tpm2-pytss/tpm2-pytss-%{version}.tar.gz | |
f8d84ea1 | 16 | # Source0-md5: a629a192cd5a42b8d1e7ffab391de231 |
625810ec JB |
17 | URL: https://github.com/tpm2-software/tpm2-pytss |
18 | BuildRequires: python3-asn1crypto | |
19 | BuildRequires: python3-cffi >= 1.0.0 | |
20 | BuildRequires: python3-cryptography >= 3.0 | |
21 | BuildRequires: python3-devel >= 1:3.7 | |
22 | BuildRequires: python3-packaging | |
23 | BuildRequires: python3-pkgconfig | |
f8d84ea1 | 24 | BuildRequires: python3-pycparser |
625810ec JB |
25 | BuildRequires: python3-setuptools >= 1:44 |
26 | BuildRequires: python3-setuptools_scm >= 3.4.3 | |
27 | BuildRequires: python3-toml | |
28 | %if %{with tests} | |
29 | # or swtpm | |
30 | BuildRequires: ibmswtpm2 | |
31 | BuildRequires: python3-PyYAML | |
32 | BuildRequires: python3-pytest | |
33 | %endif | |
34 | BuildRequires: rpm-build >= 4.6 | |
35 | BuildRequires: rpm-pythonprov | |
36 | BuildRequires: rpmbuild(macros) >= 1.714 | |
37 | BuildRequires: sed >= 4.0 | |
f8d84ea1 JB |
38 | # 3.3/4.0 when available in PLD |
39 | BuildRequires: tpm2-tss-devel >= 2.4 | |
625810ec JB |
40 | %if %{with doc} |
41 | BuildRequires: python3-myst_parser | |
42 | BuildRequires: python3-sphinx_rtd_theme | |
43 | BuildRequires: sphinx-pdg-3 | |
44 | %endif | |
45 | Requires: python3-modules >= 1:3.7 | |
46 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
47 | ||
48 | %description | |
49 | TPM2 TSS Python bindings for Enhanced System API (ESYS), Feature API | |
50 | (FAPI), Marshaling (MU), TCTI Loader (TCTILdr) and RC Decoding | |
51 | (rcdecode) libraries. It also contains utility methods for wrapping | |
52 | keys to TPM 2.0 data structures for importation into the TPM, | |
53 | unwrapping keys and exporting them from the TPM, TPM-less | |
54 | makecredential command and name calculations, TSS2 PEM Key format | |
55 | support, importing Keys from PEM, DER and SSH formats, conversion from | |
56 | tpm2-tools based command line strings and loading tpm2-tools context | |
57 | files. | |
58 | ||
59 | %description -l pl.UTF-8 | |
60 | Wiązania Pythona TPM2 TSS do bibliotek Enhanced System API (ESYS), | |
61 | Feature API (FAPI), Marshaling (MU), TCTI Loader (TCTILdr) oraz RC | |
62 | Decoding (rcdecode). Zawiera także metody narzędziowe do opakowywania | |
63 | kluczy w struktury danych TPM 2.0 w celu importu do TPM, | |
64 | rozpakowywania kluczy i eksportowania ich z TPM, obliczeń poleceń i | |
65 | nazw makecredential bez użycia TPM, obsługi formatu kluczy TSS2 PEM, | |
66 | importu kluczy z formatów PEM, DER i SSH, konwersji z linii poleceń | |
67 | tpm2-tools oraz ładowania plików kontekstu tpm2-tools. | |
68 | ||
69 | %package apidocs | |
70 | Summary: API documentation for Python tpm2-pytss module | |
71 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona tpm2-pytss | |
72 | Group: Documentation | |
73 | BuildArch: noarch | |
74 | ||
75 | %description apidocs | |
76 | API documentation for Python tpm2-pytss module. | |
77 | ||
78 | %description apidocs -l pl.UTF-8 | |
79 | Dokumentacja API modułu Pythona tpm2-pytss. | |
80 | ||
81 | %prep | |
82 | %setup -q -n tpm2-pytss-%{version} | |
83 | ||
f8d84ea1 | 84 | # broken and not used (as of 2.1.0) |
625810ec JB |
85 | %{__sed} -i -e '/^\(version\|release\) = /d' docs/conf.py |
86 | ||
87 | %build | |
88 | %py3_build | |
89 | ||
90 | %if %{with tests} | |
91 | # test_fapi fail for me (as of 1.2.0) with ibmswtpms2 | |
92 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
93 | PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \ | |
94 | %{__python3} -m pytest test -k 'not test_fapi' | |
95 | %endif | |
96 | ||
97 | %if %{with doc} | |
98 | PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \ | |
99 | sphinx-build-3 -b html docs docs/_build/html | |
100 | %endif | |
101 | ||
102 | %install | |
103 | rm -rf $RPM_BUILD_ROOT | |
104 | ||
105 | %py3_install | |
106 | ||
107 | %clean | |
108 | rm -rf $RPM_BUILD_ROOT | |
109 | ||
110 | %files | |
111 | %defattr(644,root,root,755) | |
112 | %doc CHANGELOG.md LICENSE README.md | |
113 | %dir %{py3_sitedir}/tpm2_pytss | |
114 | %{py3_sitedir}/tpm2_pytss/*.py | |
115 | %attr(755,root,root) %{py3_sitedir}/tpm2_pytss/_libtpm2_pytss.abi3.so | |
116 | %{py3_sitedir}/tpm2_pytss/__pycache__ | |
117 | %{py3_sitedir}/tpm2_pytss/internal | |
118 | %{py3_sitedir}/tpm2_pytss-%{version}-py*.egg-info | |
119 | ||
120 | %if %{with doc} | |
121 | %files apidocs | |
122 | %defattr(644,root,root,755) | |
123 | %doc docs/_build/html/{_modules,_static,*.html,*.js} | |
124 | %endif |