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 URL: http://tpm-emulator.berlios.de/
26 BuildRequires: cmake >= 2.4
27 BuildRequires: gmp-devel
28 %if %{with dist_kernel}
29 BuildRequires: kernel%{_alt_kernel}-module-build
31 Requires: %{name}-libs = %{version}-%{rel}
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 Software-based TPM and MTM Emulator.
37 %description -l pl.UTF-8
38 Programowy emulator TPM i MTM.
41 Summary: TSS-conformant device driver library for the emulator
42 Summary(pl.UTF-8): Biblioteka sterownika urządzenia zgodnego z TSS dla emulatora
46 TSS-conformant device driver library for the emulator.
48 %description libs -l pl.UTF-8
49 Biblioteka sterownika urządzenia zgodnego z TSS dla emulatora.
52 Summary: Header file for TDDL library
53 Summary(pl.UTF-8): Plik nagłówkowy biblioteki TDDL
54 Group: Development/Libraries
55 Requires: %{name}-libs = %{version}-%{rel}
58 Header file for TDDL library.
60 %description devel -l pl.UTF-8
61 Plik nagłówkowy biblioteki TDDL.
64 Summary: Static TDDL library
65 Summary(pl.UTF-8): Statyczna biblioteka TDDL
66 Group: Development/Libraries
67 Requires: %{name}-devel = %{version}-%{rel}
72 %description static -l pl.UTF-8
73 Statyczna biblioteka TDDL.
75 %package -n kernel%{_alt_kernel}-char-tpmd
76 Summary: Kernel module that provides /dev/tpm device
77 Summary(pl.UTF-8): Moduł jądra udostępniający urządzenie /dev/tpm
79 %if %{with dist_kernel}
80 %requires_releq_kernel
81 Requires(postun): %releq_kernel
84 %description -n kernel%{_alt_kernel}-char-tpmd
85 Kernel module that provides /dev/tpm device for backward compatibility
86 and forwards the received commands to tpmd.
88 %description -n kernel%{_alt_kernel}-char-tpmd -l pl.UTF-8
89 Moduł jądra udostępniający dla kompatybilności urządzenie /dev/tpm i
90 przekazujący odebrane polecenia do tpmd.
93 %setup -q -n %{pname}-%{version}
95 # separate kernel module from userspace build
96 echo > tpmd_dev/CMakeLists.txt
102 %if %{with userspace}
107 ln -sf ../../build/config.h tpmd_dev/linux/config.h
108 %build_kernel_modules -m tpmd_dev -C tpmd_dev/linux
109 %{__make} -C tpmd_dev/linux tpmd_dev.rules
113 rm -rf $RPM_BUILD_ROOT
115 %if %{with userspace}
116 %{__make} -C build install \
117 DESTDIR=$RPM_BUILD_ROOT
121 install -d $RPM_BUILD_ROOT/lib/udev/rules.d
123 cp -p tpmd_dev.rules $RPM_BUILD_ROOT/lib/udev/rules.d/80-tpmd_dev.rules
124 %install_kernel_modules -m tpmd_dev -d misc
128 rm -rf $RPM_BUILD_ROOT
130 %post libs -p /sbin/ldconfig
131 %postun libs -p /sbin/ldconfig
133 %if %{with userspace}
135 %defattr(644,root,root,755)
136 %doc AUTHORS ChangeLog README
137 %attr(755,root,root) %{_bindir}/tpmd
140 %defattr(644,root,root,755)
141 %attr(755,root,root) %{_libdir}/libtddl.so.*.*.*.*
142 %attr(755,root,root) %ghost %{_libdir}/libtddl.so.1.2
145 %defattr(644,root,root,755)
146 %attr(755,root,root) %{_libdir}/libtddl.so
147 %{_includedir}/tddl.h
150 %defattr(644,root,root,755)
155 %files -n kernel%{_alt_kernel}-char-tpmd
156 %defattr(644,root,root,755)
157 /lib/modules/%{_kernel_ver}/misc/tpmd_dev.ko*
158 /lib/udev/rules.d/80-tpmd_dev.rules