]> git.pld-linux.org Git - packages/tpm_emulator.git/blob - tpm_emulator.spec
- x32 rebuild
[packages/tpm_emulator.git] / tpm_emulator.spec
1 #
2 # Conditional build:
3 %bcond_without  kernel          # don't build kernel modules
4 %bcond_without  userspace       # don't build userspace packages
5 %bcond_with     verbose         # verbose kernel module build
6 #
7 # The goal here is to have main, userspace, package built once with
8 # simple release number, and only rebuild kernel packages with kernel
9 # version as part of release number, without the need to bump release
10 # with every kernel change.
11 %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
12 %{error:kernel and userspace cannot be built at the same time on PLD builders}
13 exit 1
14 %endif
15
16 %if %{without userspace}
17 # nothing to be placed to debuginfo package
18 %define         _enable_debug_packages  0
19 %endif
20
21 %define         _duplicate_files_terminate_build        0
22
23 %define pname   tpm_emulator
24 %define rel     12
25 Summary:        Software-based TPM and MTM Emulator
26 Summary(pl.UTF-8):      Programowy emulator TPM i MTM
27 Name:           %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
28 Version:        0.7.4
29 Release:        %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
30 License:        GPL v2+
31 Group:          Applications/System
32 Source0:        http://downloads.sourceforge.net/tpm-emulator.berlios/%{pname}-%{version}.tar.gz
33 # Source0-md5:  e26becb8a6a2b6695f6b3e8097593db8
34 Patch0:         %{pname}-libdir.patch
35 URL:            http://tpm-emulator.berlios.de/
36 BuildRequires:  cmake >= 2.4
37 BuildRequires:  gmp-devel
38 BuildRequires:  rpmbuild(macros) >= 1.701
39 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
40 Requires:       %{name}-libs = %{version}-%{rel}
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %description
44 Software-based TPM and MTM Emulator.
45
46 %description -l pl.UTF-8
47 Programowy emulator TPM i MTM.
48
49 %package libs
50 Summary:        TSS-conformant device driver library for the emulator
51 Summary(pl.UTF-8):      Biblioteka sterownika urządzenia zgodnego z TSS dla emulatora
52 Group:          Libraries
53
54 %description libs
55 TSS-conformant device driver library for the emulator.
56
57 %description libs -l pl.UTF-8
58 Biblioteka sterownika urządzenia zgodnego z TSS dla emulatora.
59
60 %package devel
61 Summary:        Header file for TDDL library
62 Summary(pl.UTF-8):      Plik nagłówkowy biblioteki TDDL
63 Group:          Development/Libraries
64 Requires:       %{name}-libs = %{version}-%{rel}
65
66 %description devel
67 Header file for TDDL library.
68
69 %description devel -l pl.UTF-8
70 Plik nagłówkowy biblioteki TDDL.
71
72 %package static
73 Summary:        Static TDDL library
74 Summary(pl.UTF-8):      Statyczna biblioteka TDDL
75 Group:          Development/Libraries
76 Requires:       %{name}-devel = %{version}-%{rel}
77
78 %description static
79 Static TDDL library.
80
81 %description static -l pl.UTF-8
82 Statyczna biblioteka TDDL.
83
84 %define kernel_pkg()\
85 %package -n kernel%{_alt_kernel}-char-tpmd\
86 Summary:        Kernel module that provides /dev/tpm device\
87 Summary(pl.UTF-8):      Moduł jądra udostępniający urządzenie /dev/tpm\
88 Release:        %{rel}@%{_kernel_ver_str}\
89 Group:          Base/Kernel\
90 %requires_releq_kernel\
91 Requires(postun):       %releq_kernel\
92 \
93 %description -n kernel%{_alt_kernel}-char-tpmd\
94 Kernel module that provides /dev/tpm device for backward compatibility\
95 and forwards the received commands to tpmd.\
96 \
97 %description -n kernel%{_alt_kernel}-char-tpmd -l pl.UTF-8\
98 Moduł jądra udostępniający dla kompatybilności urządzenie /dev/tpm i\
99 przekazujący odebrane polecenia do tpmd.\
100 \
101 %if %{with kernel}\
102 %files -n kernel%{_alt_kernel}-char-tpmd\
103 %defattr(644,root,root,755)\
104 /lib/modules/%{_kernel_ver}/misc/tpmd_dev.ko*\
105 /lib/udev/rules.d/80-tpmd_dev.rules\
106 %endif\
107 \
108 %post   -n kernel%{_alt_kernel}-char-tpmd\
109 %depmod %{_kernel_ver}\
110 \
111 %postun -n kernel%{_alt_kernel}-char-tpmd\
112 %depmod %{_kernel_ver}\
113 %{nil}
114
115 %define build_kernel_pkg()\
116 %build_kernel_modules -m tpmd_dev -C tpmd_dev/linux\
117 %install_kernel_modules -D installed -m tpmd_dev/linux/tpmd_dev -d misc\
118 %{nil}
119
120 %{?with_kernel:%{expand:%create_kernel_packages}}
121
122 %prep
123 %setup -q -n %{pname}-%{version}
124 %patch0 -p1
125
126 # separate kernel module from userspace build
127 echo > tpmd_dev/CMakeLists.txt
128
129 %build
130 mkdir build
131 cd build
132 %cmake ..
133 %if %{with userspace}
134 %{__make}
135 %endif
136 cd ..
137 %if %{with kernel}
138 ln -sf ../../build/config.h tpmd_dev/linux/config.h
139 %{__make} -C tpmd_dev/linux tpmd_dev.rules
140 %{expand:%build_kernel_packages}
141 %endif
142
143 %install
144 rm -rf $RPM_BUILD_ROOT
145
146 %if %{with userspace}
147 %{__make} -C build install \
148         DESTDIR=$RPM_BUILD_ROOT
149 %endif
150
151 %if %{with kernel}
152 install -d $RPM_BUILD_ROOT/lib/udev/rules.d
153 cp -p tpmd_dev/linux/tpmd_dev.rules $RPM_BUILD_ROOT/lib/udev/rules.d/80-tpmd_dev.rules
154 cp -a installed/* $RPM_BUILD_ROOT
155 %endif
156
157 %clean
158 rm -rf $RPM_BUILD_ROOT
159
160 %post   libs -p /sbin/ldconfig
161 %postun libs -p /sbin/ldconfig
162
163 %if %{with userspace}
164 %files
165 %defattr(644,root,root,755)
166 %doc AUTHORS ChangeLog README
167 %attr(755,root,root) %{_bindir}/tpmd
168
169 %files libs
170 %defattr(644,root,root,755)
171 %attr(755,root,root) %{_libdir}/libtddl.so.*.*.*.*
172 %attr(755,root,root) %ghost %{_libdir}/libtddl.so.1.2
173
174 %files devel
175 %defattr(644,root,root,755)
176 %attr(755,root,root) %{_libdir}/libtddl.so
177 %{_includedir}/tddl.h
178
179 %files static
180 %defattr(644,root,root,755)
181 %{_libdir}/libtddl.a
182 %endif
This page took 0.083267 seconds and 3 git commands to generate.