]>
Commit | Line | Data |
---|---|---|
bc65ae11 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without dist_kernel # without distribution kernel | |
4 | %bcond_without kernel # don't build kernel modules | |
5 | %bcond_without userspace # don't build userspace packages | |
6 | %bcond_with verbose # verbose kernel module build | |
7 | # | |
8 | %if "%{_alt_kernel}" != "%{nil}" | |
9 | %undefine with_userspace | |
10 | %endif | |
11 | %if %{without kernel} | |
12 | %undefine with_dist_kernel | |
13 | %endif | |
87c325d0 JR |
14 | |
15 | %define pname tpm_emulator | |
16 | %define rel 2 | |
bc65ae11 JB |
17 | Summary: Software-based TPM and MTM Emulator |
18 | Summary(pl.UTF-8): Programowy emulator TPM i MTM | |
bc65ae11 JB |
19 | Name: %{pname}%{_alt_kernel} |
20 | Version: 0.7.4 | |
bc65ae11 JB |
21 | Release: %{rel} |
22 | License: GPL v2+ | |
23 | Group: Applications/System | |
24 | Source0: http://downloads.sourceforge.net/tpm-emulator.berlios/%{pname}-%{version}.tar.gz | |
25 | # Source0-md5: e26becb8a6a2b6695f6b3e8097593db8 | |
f47ff032 | 26 | Patch0: %{pname}-libdir.patch |
bc65ae11 JB |
27 | URL: http://tpm-emulator.berlios.de/ |
28 | BuildRequires: cmake >= 2.4 | |
29 | BuildRequires: gmp-devel | |
30 | %if %{with dist_kernel} | |
31 | BuildRequires: kernel%{_alt_kernel}-module-build | |
32 | %endif | |
33 | Requires: %{name}-libs = %{version}-%{rel} | |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
37 | Software-based TPM and MTM Emulator. | |
38 | ||
39 | %description -l pl.UTF-8 | |
40 | Programowy emulator TPM i MTM. | |
41 | ||
42 | %package libs | |
43 | Summary: TSS-conformant device driver library for the emulator | |
44 | Summary(pl.UTF-8): Biblioteka sterownika urządzenia zgodnego z TSS dla emulatora | |
45 | Group: Libraries | |
46 | ||
47 | %description libs | |
48 | TSS-conformant device driver library for the emulator. | |
49 | ||
50 | %description libs -l pl.UTF-8 | |
51 | Biblioteka sterownika urządzenia zgodnego z TSS dla emulatora. | |
52 | ||
53 | %package devel | |
54 | Summary: Header file for TDDL library | |
55 | Summary(pl.UTF-8): Plik nagłówkowy biblioteki TDDL | |
56 | Group: Development/Libraries | |
57 | Requires: %{name}-libs = %{version}-%{rel} | |
58 | ||
59 | %description devel | |
60 | Header file for TDDL library. | |
61 | ||
62 | %description devel -l pl.UTF-8 | |
63 | Plik nagłówkowy biblioteki TDDL. | |
64 | ||
65 | %package static | |
66 | Summary: Static TDDL library | |
67 | Summary(pl.UTF-8): Statyczna biblioteka TDDL | |
68 | Group: Development/Libraries | |
69 | Requires: %{name}-devel = %{version}-%{rel} | |
70 | ||
71 | %description static | |
72 | Static TDDL library. | |
73 | ||
74 | %description static -l pl.UTF-8 | |
75 | Statyczna biblioteka TDDL. | |
76 | ||
77 | %package -n kernel%{_alt_kernel}-char-tpmd | |
78 | Summary: Kernel module that provides /dev/tpm device | |
79 | Summary(pl.UTF-8): Moduł jądra udostępniający urządzenie /dev/tpm | |
80 | Group: Base/Kernel | |
81 | %if %{with dist_kernel} | |
82 | %requires_releq_kernel | |
83 | Requires(postun): %releq_kernel | |
84 | %endif | |
85 | ||
86 | %description -n kernel%{_alt_kernel}-char-tpmd | |
87 | Kernel module that provides /dev/tpm device for backward compatibility | |
88 | and forwards the received commands to tpmd. | |
89 | ||
90 | %description -n kernel%{_alt_kernel}-char-tpmd -l pl.UTF-8 | |
91 | Moduł jądra udostępniający dla kompatybilności urządzenie /dev/tpm i | |
92 | przekazujący odebrane polecenia do tpmd. | |
93 | ||
94 | %prep | |
95 | %setup -q -n %{pname}-%{version} | |
f47ff032 | 96 | %patch0 -p1 |
bc65ae11 JB |
97 | |
98 | # separate kernel module from userspace build | |
99 | echo > tpmd_dev/CMakeLists.txt | |
100 | ||
101 | %build | |
102 | mkdir build | |
103 | cd build | |
104 | %cmake .. | |
105 | %if %{with userspace} | |
106 | %{__make} | |
107 | %endif | |
108 | cd .. | |
109 | %if %{with kernel} | |
110 | ln -sf ../../build/config.h tpmd_dev/linux/config.h | |
111 | %build_kernel_modules -m tpmd_dev -C tpmd_dev/linux | |
112 | %{__make} -C tpmd_dev/linux tpmd_dev.rules | |
113 | %endif | |
114 | ||
115 | %install | |
116 | rm -rf $RPM_BUILD_ROOT | |
117 | ||
118 | %if %{with userspace} | |
119 | %{__make} -C build install \ | |
120 | DESTDIR=$RPM_BUILD_ROOT | |
121 | %endif | |
122 | ||
123 | %if %{with kernel} | |
124 | install -d $RPM_BUILD_ROOT/lib/udev/rules.d | |
125 | cd tpmd_dev/linux | |
126 | cp -p tpmd_dev.rules $RPM_BUILD_ROOT/lib/udev/rules.d/80-tpmd_dev.rules | |
127 | %install_kernel_modules -m tpmd_dev -d misc | |
128 | %endif | |
129 | ||
130 | %clean | |
131 | rm -rf $RPM_BUILD_ROOT | |
132 | ||
133 | %post libs -p /sbin/ldconfig | |
134 | %postun libs -p /sbin/ldconfig | |
135 | ||
136 | %if %{with userspace} | |
137 | %files | |
138 | %defattr(644,root,root,755) | |
139 | %doc AUTHORS ChangeLog README | |
140 | %attr(755,root,root) %{_bindir}/tpmd | |
141 | ||
142 | %files libs | |
143 | %defattr(644,root,root,755) | |
144 | %attr(755,root,root) %{_libdir}/libtddl.so.*.*.*.* | |
145 | %attr(755,root,root) %ghost %{_libdir}/libtddl.so.1.2 | |
146 | ||
147 | %files devel | |
148 | %defattr(644,root,root,755) | |
149 | %attr(755,root,root) %{_libdir}/libtddl.so | |
150 | %{_includedir}/tddl.h | |
151 | ||
152 | %files static | |
153 | %defattr(644,root,root,755) | |
154 | %{_libdir}/libtddl.a | |
155 | %endif | |
156 | ||
157 | %if %{with kernel} | |
158 | %files -n kernel%{_alt_kernel}-char-tpmd | |
159 | %defattr(644,root,root,755) | |
160 | /lib/modules/%{_kernel_ver}/misc/tpmd_dev.ko* | |
161 | /lib/udev/rules.d/80-tpmd_dev.rules | |
162 | %endif |