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