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
8 %if "%{_alt_kernel}" != "%{nil}"
9 %undefine with_userspace
12 %undefine with_dist_kernel
15 %define pname tpm_emulator
17 Summary: Software-based TPM and MTM Emulator
18 Summary(pl.UTF-8): Programowy emulator TPM i MTM
19 Name: %{pname}%{_alt_kernel}
23 Group: Applications/System
24 Source0: http://downloads.sourceforge.net/tpm-emulator.berlios/%{pname}-%{version}.tar.gz
25 # Source0-md5: e26becb8a6a2b6695f6b3e8097593db8
26 Patch0: %{pname}-libdir.patch
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
33 Requires: %{name}-libs = %{version}-%{rel}
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 Software-based TPM and MTM Emulator.
39 %description -l pl.UTF-8
40 Programowy emulator TPM i MTM.
43 Summary: TSS-conformant device driver library for the emulator
44 Summary(pl.UTF-8): Biblioteka sterownika urządzenia zgodnego z TSS dla emulatora
48 TSS-conformant device driver library for the emulator.
50 %description libs -l pl.UTF-8
51 Biblioteka sterownika urządzenia zgodnego z TSS dla emulatora.
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}
60 Header file for TDDL library.
62 %description devel -l pl.UTF-8
63 Plik nagłówkowy biblioteki TDDL.
66 Summary: Static TDDL library
67 Summary(pl.UTF-8): Statyczna biblioteka TDDL
68 Group: Development/Libraries
69 Requires: %{name}-devel = %{version}-%{rel}
74 %description static -l pl.UTF-8
75 Statyczna biblioteka TDDL.
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
81 %if %{with dist_kernel}
82 %requires_releq_kernel
83 Requires(postun): %releq_kernel
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.
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.
95 %setup -q -n %{pname}-%{version}
98 # separate kernel module from userspace build
99 echo > tpmd_dev/CMakeLists.txt
105 %if %{with userspace}
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
116 rm -rf $RPM_BUILD_ROOT
118 %if %{with userspace}
119 %{__make} -C build install \
120 DESTDIR=$RPM_BUILD_ROOT
124 install -d $RPM_BUILD_ROOT/lib/udev/rules.d
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
131 rm -rf $RPM_BUILD_ROOT
133 %post libs -p /sbin/ldconfig
134 %postun libs -p /sbin/ldconfig
136 %if %{with userspace}
138 %defattr(644,root,root,755)
139 %doc AUTHORS ChangeLog README
140 %attr(755,root,root) %{_bindir}/tpmd
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
148 %defattr(644,root,root,755)
149 %attr(755,root,root) %{_libdir}/libtddl.so
150 %{_includedir}/tddl.h
153 %defattr(644,root,root,755)
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