]>
Commit | Line | Data |
---|---|---|
d5986b4b JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python # CPython 3.x module and tpm2_ptool | |
4 | %bcond_with tests # unit/integration tests | |
5 | ||
74e99771 JB |
6 | Summary: PKCS#11 interface for TPM2 hardware |
7 | Summary(pl.UTF-8): Interfejs PKCS#11 do układów TPM2 | |
d5986b4b | 8 | Name: tpm2-pkcs11 |
642f4677 | 9 | Version: 1.9.0 |
d5986b4b JB |
10 | Release: 1 |
11 | License: BSD | |
12 | Group: Libraries | |
13 | #Source0Download: https://github.com/tpm2-software/tpm2-pkcs11/releases | |
14 | Source0: https://github.com/tpm2-software/tpm2-pkcs11/releases/download/%{version}/%{name}-%{version}.tar.gz | |
642f4677 | 15 | # Source0-md5: 94cc9e2795b7781f54e4a90480b4b868 |
d5986b4b JB |
16 | Patch0: %{name}-ac.patch |
17 | URL: https://github.com/tpm2-software/tpm2-pkcs11 | |
18 | BuildRequires: autoconf >= 2.50 | |
19 | BuildRequires: automake | |
20 | BuildRequires: libtool | |
21 | BuildRequires: openssl-devel >= 1.1.0 | |
22 | BuildRequires: p11-kit-devel | |
23 | BuildRequires: pkgconfig | |
24 | BuildRequires: sed >= 4.0 | |
25 | BuildRequires: sqlite3-devel >= 3 | |
26 | BuildRequires: tpm2-tss-devel >= 3.2 | |
27 | BuildRequires: yaml-devel | |
28 | %if %{with python} | |
29 | BuildRequires: python3 >= 1:3.7 | |
30 | BuildRequires: python3-setuptools | |
31 | %endif | |
32 | %if %{with tests} | |
33 | BuildRequires: expect | |
34 | # p11tool | |
35 | BuildRequires: gnutls | |
36 | # ss | |
37 | BuildRequires: iproute2 | |
38 | BuildRequires: jdk | |
39 | # certutil, modutil | |
40 | BuildRequires: nss-tools | |
41 | # pkcs11-tool | |
42 | BuildRequires: opensc | |
43 | BuildRequires: sqlite3 | |
44 | # or ibmswtpm2 | |
45 | BuildRequires: swtpm | |
46 | BuildRequires: tpm2-tools | |
47 | BuildRequires: tpm2-abrmd | |
48 | # tpm2tss-genkey, tss2_provision | |
49 | %endif | |
50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
51 | ||
52 | %description | |
74e99771 JB |
53 | PKCS#11 is a Public-Key Cryptography Standard that defines a standard |
54 | method to access cryptographic services from tokens/devices such as | |
55 | hardware security modules (HSM), smart cards, etc. This project is | |
56 | intended to use a TPM2 device as the cryptographic token. | |
d5986b4b JB |
57 | |
58 | %description -l pl.UTF-8 | |
74e99771 JB |
59 | PKCS#11 (Public-Key Cryptography Standard #11) to standard |
60 | kryptograficzny klucza publicznego, definiujący standardowy sposób | |
61 | dostępu do usług kryptograficznych tokenów/urządzeń takich jak | |
62 | sprzętowe moduły bezpieczeństwa (HSM, Hardware Security Modules), | |
63 | kart procesorowych itp. Ten projekt ma na celu używanie układów TPM2 | |
64 | jako tokenów kryptograficznych. | |
d5986b4b JB |
65 | |
66 | %package devel | |
74e99771 JB |
67 | Summary: Header files for tpm2-pkcs11 library |
68 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki tpm2-pkcs11 | |
d5986b4b JB |
69 | Group: Development/Libraries |
70 | Requires: %{name} = %{version}-%{release} | |
71 | Requires: openssl-devel | |
72 | Requires: tpm2-tss-devel | |
73 | ||
74 | %description devel | |
74e99771 | 75 | Header files for PKCS#11 interface for TPM2 hardware. |
d5986b4b JB |
76 | |
77 | %description devel -l pl.UTF-8 | |
74e99771 | 78 | Pliki nagłówkowe interfejsu PKCS#11 do układów TPM2. |
d5986b4b JB |
79 | |
80 | %package -n python3-tpm2-pkcs11 | |
81 | Summary: Command line tools for the TPM2.0 PKCS11 module | |
82 | Summary(pl.UTF-8): Narzędzia linii poleceń do modułu PKCS11 TPM2.0 | |
83 | Group: Libraries/Python | |
84 | Requires: %{name} = %{version}-%{release} | |
85 | ||
86 | %description -n python3-tpm2-pkcs11 | |
87 | This tool is used to configure and manipulate stores for the | |
88 | tpm2-pkcs11 cryptographic library. | |
89 | ||
90 | %description -n python3-tpm2-pkcs11 -l pl.UTF-8 | |
91 | To narzędzie służy do konfiguracji i operowania na danych | |
92 | przechowywanych przez bibliotekę kryptograficzną tpm2-pkcs11. | |
93 | ||
94 | %prep | |
95 | %setup -q | |
96 | %patch0 -p1 | |
97 | ||
98 | # set VERSION properly when there is no .git directory | |
99 | %{__sed} -i -e 's/m4_esyscmd_s(\[git describe --tags --always --dirty\])/%{version}/' configure.ac | |
100 | ||
101 | %build | |
102 | %{__libtoolize} | |
103 | %{__aclocal} -I m4 | |
104 | %{__autoconf} | |
105 | %{__autoheader} | |
106 | %{__automake} | |
107 | %configure \ | |
108 | %{?with_tests:--enable-integration} \ | |
109 | --disable-ptool-checks \ | |
110 | --disable-silent-rules | |
111 | %{?with_tests:--enable-unit} | |
112 | ||
113 | %{__make} | |
114 | ||
115 | %if %{with tests} | |
116 | %{__make} check | |
117 | %endif | |
118 | ||
119 | %if %{with python} | |
120 | cd tools | |
121 | %py3_build | |
122 | %endif | |
123 | ||
124 | %install | |
125 | rm -rf $RPM_BUILD_ROOT | |
126 | ||
127 | %{__make} install \ | |
128 | DESTDIR=$RPM_BUILD_ROOT | |
129 | ||
130 | # obsoleted by pkg-config | |
131 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/pkcs11/libtpm2_pkcs11.la | |
132 | ||
133 | %if %{with python} | |
134 | cd tools | |
135 | %py3_install | |
136 | %endif | |
137 | ||
138 | %clean | |
139 | rm -rf $RPM_BUILD_ROOT | |
140 | ||
141 | %files | |
142 | %defattr(644,root,root,755) | |
143 | %doc AUTHORS LICENSE docs/{ARCHITECTURE,DB_UPGRADE,EAP-TLS,FAPI,INITIALIZING,INTEROPERABILITY,OPENSSL,OPENVPN,P11,PKCS11_TOOL,README,SSH,SSH_HOSTKEYS,tpm2-pkcs11_object_auth_model}.md | |
144 | %attr(755,root,root) %{_libdir}/pkcs11/libtpm2_pkcs11.so.* | |
145 | %{_datadir}/p11-kit/modules/tpm2_pkcs11.module | |
146 | ||
147 | %files devel | |
148 | %defattr(644,root,root,755) | |
149 | %attr(755,root,root) %{_libdir}/pkcs11/libtpm2_pkcs11.so | |
150 | %{_pkgconfigdir}/tpm2-pkcs11.pc | |
151 | ||
152 | %files -n python3-tpm2-pkcs11 | |
153 | %defattr(644,root,root,755) | |
154 | %attr(755,root,root) %{_bindir}/tpm2_ptool | |
155 | %{py3_sitescriptdir}/tpm2_pkcs11 | |
156 | %{py3_sitescriptdir}/tpm2_pkcs11_tools-1.33.7-py*.egg-info |