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
14 Summary: Software-based TPM and MTM Emulator
15 Summary(pl.UTF-8): Programowy emulator TPM i MTM
16 %define pname tpm_emulator
17 Name: %{pname}%{_alt_kernel}
22 Group: Applications/System
23 Source0: http://downloads.sourceforge.net/tpm-emulator.berlios/%{pname}-%{version}.tar.gz
24 # Source0-md5: e26becb8a6a2b6695f6b3e8097593db8
25 Patch0: %{pname}-libdir.patch
26 URL: http://tpm-emulator.berlios.de/
27 BuildRequires: cmake >= 2.4
28 BuildRequires: gmp-devel
29 %if %{with dist_kernel}
30 BuildRequires: kernel%{_alt_kernel}-module-build
32 Requires: %{name}-libs = %{version}-%{rel}
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 Software-based TPM and MTM Emulator.
38 %description -l pl.UTF-8
39 Programowy emulator TPM i MTM.
42 Summary: TSS-conformant device driver library for the emulator
43 Summary(pl.UTF-8): Biblioteka sterownika urządzenia zgodnego z TSS dla emulatora
47 TSS-conformant device driver library for the emulator.
49 %description libs -l pl.UTF-8
50 Biblioteka sterownika urządzenia zgodnego z TSS dla emulatora.
53 Summary: Header file for TDDL library
54 Summary(pl.UTF-8): Plik nagłówkowy biblioteki TDDL
55 Group: Development/Libraries
56 Requires: %{name}-libs = %{version}-%{rel}
59 Header file for TDDL library.
61 %description devel -l pl.UTF-8
62 Plik nagłówkowy biblioteki TDDL.
65 Summary: Static TDDL library
66 Summary(pl.UTF-8): Statyczna biblioteka TDDL
67 Group: Development/Libraries
68 Requires: %{name}-devel = %{version}-%{rel}
73 %description static -l pl.UTF-8
74 Statyczna biblioteka TDDL.
76 %package -n kernel%{_alt_kernel}-char-tpmd
77 Summary: Kernel module that provides /dev/tpm device
78 Summary(pl.UTF-8): Moduł jądra udostępniający urządzenie /dev/tpm
80 %if %{with dist_kernel}
81 %requires_releq_kernel
82 Requires(postun): %releq_kernel
85 %description -n kernel%{_alt_kernel}-char-tpmd
86 Kernel module that provides /dev/tpm device for backward compatibility
87 and forwards the received commands to tpmd.
89 %description -n kernel%{_alt_kernel}-char-tpmd -l pl.UTF-8
90 Moduł jądra udostępniający dla kompatybilności urządzenie /dev/tpm i
91 przekazujący odebrane polecenia do tpmd.
94 %setup -q -n %{pname}-%{version}
97 # separate kernel module from userspace build
98 echo > tpmd_dev/CMakeLists.txt
104 %if %{with userspace}
109 ln -sf ../../build/config.h tpmd_dev/linux/config.h
110 %build_kernel_modules -m tpmd_dev -C tpmd_dev/linux
111 %{__make} -C tpmd_dev/linux tpmd_dev.rules
115 rm -rf $RPM_BUILD_ROOT
117 %if %{with userspace}
118 %{__make} -C build install \
119 DESTDIR=$RPM_BUILD_ROOT
123 install -d $RPM_BUILD_ROOT/lib/udev/rules.d
125 cp -p tpmd_dev.rules $RPM_BUILD_ROOT/lib/udev/rules.d/80-tpmd_dev.rules
126 %install_kernel_modules -m tpmd_dev -d misc
130 rm -rf $RPM_BUILD_ROOT
132 %post libs -p /sbin/ldconfig
133 %postun libs -p /sbin/ldconfig
135 %if %{with userspace}
137 %defattr(644,root,root,755)
138 %doc AUTHORS ChangeLog README
139 %attr(755,root,root) %{_bindir}/tpmd
142 %defattr(644,root,root,755)
143 %attr(755,root,root) %{_libdir}/libtddl.so.*.*.*.*
144 %attr(755,root,root) %ghost %{_libdir}/libtddl.so.1.2
147 %defattr(644,root,root,755)
148 %attr(755,root,root) %{_libdir}/libtddl.so
149 %{_includedir}/tddl.h
152 %defattr(644,root,root,755)
157 %files -n kernel%{_alt_kernel}-char-tpmd
158 %defattr(644,root,root,755)
159 /lib/modules/%{_kernel_ver}/misc/tpmd_dev.ko*
160 /lib/udev/rules.d/80-tpmd_dev.rules