]> git.pld-linux.org Git - packages/tpm_emulator.git/blob - tpm_emulator.spec
efe40b97810c45842f7d3e2d5d3729a86e663933
[packages/tpm_emulator.git] / tpm_emulator.spec
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
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}
18 Version:        0.7.4
19 %define rel     1
20 Release:        %{rel}
21 License:        GPL v2+
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
30 %endif
31 Requires:       %{name}-libs = %{version}-%{rel}
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %description
35 Software-based TPM and MTM Emulator.
36
37 %description -l pl.UTF-8
38 Programowy emulator TPM i MTM.
39
40 %package libs
41 Summary:        TSS-conformant device driver library for the emulator
42 Summary(pl.UTF-8):      Biblioteka sterownika urządzenia zgodnego z TSS dla emulatora
43 Group:          Libraries
44
45 %description libs
46 TSS-conformant device driver library for the emulator.
47
48 %description libs -l pl.UTF-8
49 Biblioteka sterownika urządzenia zgodnego z TSS dla emulatora.
50
51 %package devel
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}
56
57 %description devel
58 Header file for TDDL library.
59
60 %description devel -l pl.UTF-8
61 Plik nagłówkowy biblioteki TDDL.
62
63 %package static
64 Summary:        Static TDDL library
65 Summary(pl.UTF-8):      Statyczna biblioteka TDDL
66 Group:          Development/Libraries
67 Requires:       %{name}-devel = %{version}-%{rel}
68
69 %description static
70 Static TDDL library.
71
72 %description static -l pl.UTF-8
73 Statyczna biblioteka TDDL.
74
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
78 Group:          Base/Kernel
79 %if %{with dist_kernel}
80 %requires_releq_kernel
81 Requires(postun):       %releq_kernel
82 %endif
83
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.
87
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.
91
92 %prep
93 %setup -q -n %{pname}-%{version}
94
95 # separate kernel module from userspace build
96 echo > tpmd_dev/CMakeLists.txt
97
98 %build
99 mkdir build
100 cd build
101 %cmake ..
102 %if %{with userspace}
103 %{__make}
104 %endif
105 cd ..
106 %if %{with kernel}
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
110 %endif
111
112 %install
113 rm -rf $RPM_BUILD_ROOT
114
115 %if %{with userspace}
116 %{__make} -C build install \
117         DESTDIR=$RPM_BUILD_ROOT
118 %endif
119
120 %if %{with kernel}
121 install -d $RPM_BUILD_ROOT/lib/udev/rules.d
122 cd tpmd_dev/linux
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
125 %endif
126
127 %clean
128 rm -rf $RPM_BUILD_ROOT
129
130 %post   libs -p /sbin/ldconfig
131 %postun libs -p /sbin/ldconfig
132
133 %if %{with userspace}
134 %files
135 %defattr(644,root,root,755)
136 %doc AUTHORS ChangeLog README
137 %attr(755,root,root) %{_bindir}/tpmd
138
139 %files libs
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
143
144 %files devel
145 %defattr(644,root,root,755)
146 %attr(755,root,root) %{_libdir}/libtddl.so
147 %{_includedir}/tddl.h
148
149 %files static
150 %defattr(644,root,root,755)
151 %{_libdir}/libtddl.a
152 %endif
153
154 %if %{with kernel}
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
159 %endif
This page took 0.045325 seconds and 2 git commands to generate.