~ubuntu-branches/ubuntu/karmic/libsmbios/karmic

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# we don't currently package all files under buildroot. This is required so
# rpm doesn't complain.
%define _unpackaged_files_terminate_build	0

# automatically determine if we should build xml
%define build_xml %( ([ -e /usr/include/xercesc/ ] && echo 1) || echo 0 )

# automatically determine if we should build docs
%define build_docs %( ( which doxygen > /dev/null 2>&1 && echo 1) || echo 0 )

# build rpm containing everything statically linked
%define build_static 0

# build bios update tools rpm
%define build_butrpm 0

# allow --with[out] <feature> at rpm command line build, to override the above
# e.g. --with xml    ...or...   --without xml 
%{?_without_xml: %{expand: %%define build_xml 0}}
%{?_with_xml: %{expand: %%define build_xml 1}}
%{?_without_static: %{expand: %%define build_static 0}}
%{?_with_static: %{expand: %%define build_static 1}}
%{?_without_docs: %{expand: %%define build_docs 0}}
%{?_with_docs: %{expand: %%define build_docs 1}}
%{?_without_butrpm: %{expand: %%define build_butrpm 0}}
%{?_with_butrpm: %{expand: %%define build_butrpm 1}}

# if passed a "dist" variable, use it. Otherwise, not.
%{!?dist: %{expand: %%define relver 1}}
%{?dist:  %{expand: %%define relver 1.%{dist}}}

Name: libsmbios
Version: 0.10.6
Release: %{relver}
License: Dell Proprietary
Packager: Michael E Brown <Michael_E_Brown@dell.com>
Source: libsmbios-0.10.6.tar.bz2
Summary: Open BIOS parsing libs
Group: Applications/Libraries
Buildroot: %{_tmppath}/libsmbios

%description
Libsmbios is a library and utilites that can be used by client programs 
to get information from standard BIOS tables, such as the SMBIOS table.

%package -n bios_update_tools
Summary: Scripts to manage firmware updates
Group: Applications/Binaries
Requires: libsmbios-bin

%package libs
Summary: Libsmbios shared libraries.
Group: Applications/Libraries

%package -n libsmbiosxml-libs
Summary: Libsmbiosxml shared libraries.
Group: Applications/Libraries

%package bin
Summary: The "supported" sample binaries that use libsmbios
Group: Applications/Binaries

%package unsupported-bin
Summary: Unsupported sample binaries using libsmbios
Group: Applications/Binaries

%package -n libsmbiosxml-bin
Summary: sample binaries that use libsmbiosxml
Group: Applications/Binaries

%package devel
Summary: development headers and archives
Group: Applications/Development

%package static
Summary: All of the libsmbios binaries that can be statically built
Group: Applications/Binaries

%description -n bios_update_tools
Scripts and tools to manage firmware and BIOS updates.

%description libs
Libsmbios is a library and utilites that can be used by client programs 
to get information from standard BIOS tables, such as the SMBIOS table.

%description -n libsmbiosxml-libs
Libsmbios is a library and utilites that can be used by client programs 
to get information from standard BIOS tables, such as the SMBIOS table.

%description devel
Libsmbios is a library and utilites that can be used by client programs 
to get information from standard BIOS tables, such as the SMBIOS table.

This package contains the headers and .a files necessary to compile new 
client programs against libsmbios

%description bin
Libsmbios is a library and utilites that can be used by client programs 
to get information from standard BIOS tables, such as the SMBIOS table.

This package contains some sample binaries that use libsmbios.

%description unsupported-bin
Libsmbios is a library and utilites that can be used by client programs 
to get information from standard BIOS tables, such as the SMBIOS table.

This package contains some sample binaries that use libsmbios.

%description -n libsmbiosxml-bin
Libsmbios is a library and utilites that can be used by client programs 
to get information from standard BIOS tables, such as the SMBIOS table.

This package contains some sample binaries that use libsmbios.

%description static
Libsmbios is a library and utilites that can be used by client programs 
to get information from standard BIOS tables, such as the SMBIOS table.

This package contains some sample binaries that use libsmbios.

%prep
%setup 

%build
make default
%if %{build_static}
    make static
%endif
%if %{build_xml}
    make xml
%endif
%if %{build_docs}
    make doxygen
%endif

%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
install -d -m 755 $RPM_BUILD_ROOT/%{_bindir}  $RPM_BUILD_ROOT/%{_libdir} $RPM_BUILD_ROOT/usr/include/ $RPM_BUILD_ROOT/%{_sysconfdir} $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/

install -D -m 555 supported-bins/output/* $RPM_BUILD_ROOT/%{_bindir}
install -D -m 555 bins/output/* $RPM_BUILD_ROOT/%{_bindir}

cp    lib/libsmbios*  $RPM_BUILD_ROOT/%{_libdir}/
cp -a include/smbios  $RPM_BUILD_ROOT/usr/include/

install -D -m 555 build/bios_update_tools/bios_update.conf   $RPM_BUILD_ROOT/%{_sysconfdir}/bios_update/bios_update.conf
install -D -m 555 build/bios_update_tools/bios_update_check $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/bios_update_check
install -D -m 555 build/bios_update_tools/apply_installed_updates  $RPM_BUILD_ROOT%{_bindir}/apply_installed_updates
install -D -m 555 build/bios_update_tools/inventory_system  $RPM_BUILD_ROOT%{_bindir}/inventory_system
install -D -m 555 build/bios_update_tools/inventory_to_packages  $RPM_BUILD_ROOT%{_bindir}/inventory_to_packages
install -D -m 555 build/bios_update_tools/rbu_check  $RPM_BUILD_ROOT%{_bindir}/rbu_check
install -D -m 555 build/bios_update_tools/update_bios  $RPM_BUILD_ROOT%{_bindir}/update_bios

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf ${RPM_BUILD_ROOT}

%post libs
ldconfig

%post -n libsmbiosxml-libs
ldconfig

%if %{build_butrpm}
%files -n bios_update_tools
%defattr(-,root,root)
%{_sysconfdir}/bios_update/bios_update.conf
%{_sysconfdir}/rc.d/init.d/bios_update_check
%{_bindir}/apply_installed_updates
%{_bindir}/inventory_system
%{_bindir}/inventory_to_packages
%{_bindir}/rbu_check
%{_bindir}/update_bios
%endif

%files libs
%defattr(-,root,root)
%{_libdir}/libsmbios.so.*.*

%if %{build_xml}
%files -n libsmbiosxml-libs
%defattr(-,root,root)
%{_libdir}/libsmbiosxml.so.*.*
%endif

%files devel
%defattr(-,root,root)

%if %{build_docs}
    %doc doc/full/html
%endif

%{_libdir}/libsmbios.so
/usr/include/smbios

%if %{build_xml}
%{_libdir}/libsmbiosxml.so
%endif


%files bin 
%defattr(555,root,root)
%{_bindir}/assetTag
%{_bindir}/dellBiosUpdate
%{_bindir}/getSystemId
%{_bindir}/propertyTag
%{_bindir}/serviceTag
%{_bindir}/tokenCtl
%{_bindir}/verifySmiPassword
%{_bindir}/wakeupCtl

%files unsupported-bin 
%defattr(555,root,root)
%{_bindir}/activateCmosToken
%{_bindir}/ascii2enUS_scancode
%{_bindir}/createUnitTestFiles
%{_bindir}/disable_console_redir
%{_bindir}/dumpCmos
%{_bindir}/getPasswordFormat
%{_bindir}/isCmosTokenActive
%{_bindir}/probes
%{_bindir}/smitest
%{_bindir}/stateByteCtl
%{_bindir}/upBootCtl

%if %{build_xml}
%files -n libsmbiosxml-bin 
%defattr(555,root,root)
%{_bindir}/dumpSmbios
%endif

%if %{build_static}
%files static 
%defattr(555,root,root)
%{_bindir}/*S
%endif