Blob Blame Raw
# pkg/libsmbios.spec.  Generated from by configure.
# required by suse build system
# norootforbuild

# these are all substituted by autoconf
%define major 2
%define minor 3
%define micro 3
%define extra %{nil}
%define pot_file  libsmbios
%define lang_dom  libsmbios-2.3-x86_64
%define release_version 2.3.3

%define release_name libsmbios
%define other_name   libsmbios2
%if 0%{?suse_version}
%define release_name libsmbios2
%define other_name   libsmbios

%{!?build_python:   %global build_python 1}
%{?_with_python:    %global build_python 1}
%{?_without_python: %undefine build_python}

# run_unit_tests not defined by default as cppunit
# not available in OS on several major OS
%{?_without_unit_tests: %undefine run_unit_tests}
%{?_with_unit_tests:    %global run_unit_tests 1}

%{!?as_needed:         %global as_needed 1}
%{?_without_as_needed: %undefine as_needed}
%{?_with_as_needed:    %global as_needed 1}

# some distros already have fdupes macro. If not, we just set it to something innocuous
%{?!fdupes: %global fdupes /usr/sbin/hardlink -c -v}

%global cppunit_BR cppunit-devel
%global pkgconfig_BR pkgconfig
%global ctypes_BR python-ctypes
%global fdupes_BR hardlink
%global valgrind_BR valgrind
# Some variable definitions so that we can be compatible between SUSE Build service and Fedora build system
# SUSE: fedora_version  suse_version rhel_version centos_version sles_version
# Fedora: fedora dist fc8 fc9

# suse/sles
%if 0%{?suse_version}
%if 0%{?suse_version} < 1000
    %global valgrind_BR %{nil}
    # sles 9 doesnt have as_needed
    %undefine as_needed
%if 0%{?suse_version} >= 1020
    # suse never added python-ctypes provides to python 2.5 :(
    %global ctypes_BR %{nil}
%if 0%{?suse_version} > 1020
    %global fdupes_BR fdupes
    %global fdupes_BR %{nil}
    %global fdupes echo fdupes disabled

# rhel (should work on OBS and EPEL)
%if 0%{?rhel}
%if 0%{?rhel} < 5
    %global fdupes echo fdupes disabled
    %global fdupes_BR %{nil}
%if 0%{?rhel} < 4
    # dont yet have rhel3 valgrind
    %global valgrind_BR %{nil}
    # no python-ctypes for python <= 2.2
    %undefine build_python
    # rhel3 doesnt have -as-needed
    %undefine as_needed

%global python_devel_BR %{nil}
%if 0%{?build_python}
    %global python_devel_BR python-devel
    # per fedora and suse python packaging guidelines
    # suse: will define py_sitedir for us
    # fedora: use the !? code below to define when it isnt already

    # pure python stuff goes here
    %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}

    # arch-dep python stuff goes here
    %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}


# if unit tests are disabled, get rid of a few BuildRequires
%{!?run_unit_tests: %global cppunit_BR %{nil}}
%{!?run_unit_tests: %global valgrind_BR %{nil}}

Name: %{release_name}
Version: %{release_version}
Release: 7%{?dist}
License: GPLv2+ or OSL 2.1
Summary: Libsmbios C/C++ shared libraries
Group: System Environment/Libraries
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-devel
BuildRequires: libtool
BuildRequires: strace libxml2-devel gcc-c++ gettext doxygen %{valgrind_BR} %{cppunit_BR} %{fdupes_BR} %{pkgconfig_BR} %{python_devel_BR}
# uncomment for official fedora
Obsoletes: libsmbios-libs < 2.0.0
Provides: libsmbios-libs = 0:%{version}-%{release}
Obsoletes: %{other_name} <= 0:%{version}-%{release}
Provides: %{other_name} = 0:%{version}-%{release}

# libsmbios only ever makes sense on intel compatible arches
# no DMI tables on ppc, s390, etc.
ExclusiveArch: x86_64 ia64 %{ix86}

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

This package provides the C-based libsmbios library, with a C interface.

This package also has a C++-based library, with a C++ interface. It is not
actively maintained, but provided for backwards compatibility. New programs
should use the libsmbios C interface.

%package -n python-smbios
Summary: Python interface to Libsmbios C library
Group: System Environment/Libraries
Requires: %{release_name} = 0:%{version}-%{release}
Requires: python

%description -n python-smbios
This package provides a Python interface to libsmbios

%package -n smbios-utils
Summary: Meta-package that pulls in all smbios binaries and python scripts
Group: Applications/System
Requires: smbios-utils-bin
%if 0%{?build_python}
Requires: smbios-utils-python
Obsoletes: libsmbios-bin < 0:2.0.0
Provides: libsmbios-bin = %{version}-%{release}
Obsoletes: libsmbios-unsupported-bin < 0:2.0.0
Provides: libsmbios-unsupported-bin = %{version}-%{release}

%description -n smbios-utils
This is a meta-package that pulls in the binary libsmbios executables as well
as the python executables.

%package -n smbios-utils-bin
Summary: Binary utilities that use libsmbios
Group: Applications/System
Requires: %{release_name} = 0:%{version}-%{release}

%description -n smbios-utils-bin
Get BIOS information, such as System product name, product id, service tag and
asset tag.

%package -n smbios-utils-python
Summary: Python executables that use libsmbios
Group: Applications/System
Requires: python-smbios = %{version}-%{release}

%description -n smbios-utils-python
Get BIOS information, such as System product name, product id, service tag and
asset tag. Set service and asset tags on Dell machines. Manipulate wireless
cards/bluetooth on Dell laptops. Set BIOS password on select Dell systems.
Update BIOS on select Dell systems. Set LCD brightness on select Dell laptops.

# name the devel package libsmbios-devel regardless of package name, per suse/fedora convention
%package -n libsmbios-devel
Summary: Development headers and archives
Group: Development/Libraries
Requires: %{release_name} = 0:%{version}-%{release}
Provides: libsmbios2-devel = %{version}-%{release}
Obsoletes: libsmbios2-devel < %{version}-%{release}

%description -n libsmbios-devel
Libsmbios is a library and utilities 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.

%package -n yum-dellsysid
Summary: YUM plugin to retrieve the Dell System ID
Group: Development/Tools
# yum plugin and supporting functions first appeared in 2.2.0
Requires: smbios-utils-python >= 2.2.0

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

This package contains a YUM plugin which allows the use of certain
substitutions in yum repository configuration files on Dell systems.

: '########################################'
: '########################################'
: '#'
: '# build_python: %{?build_python}'
: '# run_unit_tests: %{?run_unit_tests}'
: '# rhel: %{?rhel}'
: '# suse_version: %{?suse_version}'
: '#'
: '########################################'
: '########################################'
%setup -q -n libsmbios-%{version}
find . -type d -exec chmod -f 755 {} \;
find doc src -type f -exec chmod -f 644 {} \;
find ./src/cppunit/ -name "*.sh" -type f -exec chmod 755  '{}' \;

# this line lets us build an RPM directly from a git tarball
# and retains any customized version information we might have
[ -e ./configure ] || ./ --no-configure

mkdir _build
cd _build
echo '../configure "$@"' > configure
chmod +x ./configure

%configure \
    %{?!as_needed:--disable-as-needed} %{?!build_python:--disable-python} \

mkdir -p out/libsmbios_c
mkdir -p out/libsmbios_c++
make CFLAGS="-Werror" %{?_smp_mflags} 2>&1 | tee build-%{_arch}.log

echo \%doc _build/build-%{_arch}.log > buildlogs.txt

runtest() {
    mkdir _$1$2
%if 0%{?run_unit_tests}
    pushd _$1$2
    make -e $1 CFLAGS="$CFLAGS -DDEBUG_OUTPUT_ALL" 2>&1 | tee $1$2.log
    touch -r ../ $1$2-%{_arch}.log
    make -e $1 2>&1 | tee $1$2.log
    echo \%doc _$1$2/$1$2-%{_arch}.log >> _build/buildlogs.txt

if [ -d /usr/include/cppunit ]; then
   # run this first since it is slightly faster than valgrind
    VALGRIND="strace -f" runtest check strace > /dev/null || echo FAILED strace check

if [ -e /usr/bin/valgrind -a -d /usr/include/cppunit ]; then
    runtest valgrind > /dev/null || echo FAILED valgrind check

if [ -d /usr/include/cppunit ]; then
    runtest check > /dev/null || echo FAILED check

if [ ! -d /usr/include/cppunit ]; then
    echo "Unit tests skipped due to missing cppunit."

rm -rf %{buildroot}
mkdir %{buildroot}

cd _build
make install DESTDIR=%{buildroot} INSTALL="%{__install} -p"
mkdir -p %{buildroot}/%{_includedir}
mkdir -p %{buildroot}/%{_bindir}
cp -a $TOPDIR/src/include/*  %{buildroot}/%{_includedir}/
cp -a out/public-include/*  %{buildroot}/%{_includedir}/
rm -f %{buildroot}/%{_libdir}/lib*.{la,a}
find %{buildroot}/%{_includedir} out/libsmbios_c++ out/libsmbios_c -exec touch -r $TOPDIR/ {} \;

mv out/libsmbios_c++  out/libsmbios_c++-%{_arch}
mv out/libsmbios_c    out/libsmbios_c-%{_arch}

rename %{pot_file}.mo %{lang_dom}.mo $(find %{buildroot}/%{_datadir} -name %{pot_file}.mo)
%find_lang %{lang_dom}

touch files-yum-dellsysid
touch files-smbios-utils-python
touch files-python-smbios

%if 0%{?build_python}

# backwards compatible:
ln -s %{_sbindir}/dellWirelessCtl %{buildroot}/%{_bindir}/dellWirelessCtl
ln -s smbios-sys-info %{buildroot}/%{_sbindir}/getSystemId
ln -s smbios-wireless-ctl %{buildroot}/%{_sbindir}/dellWirelessCtl
ln -s smbios-lcd-brightness %{buildroot}/%{_sbindir}/dellLcdBrightness

cat > files-python-smbios <<-EOF

cat > files-smbios-utils-python <<-EOF
	%doc src/bin/getopts_LICENSE.txt src/include/smbios/config/boost_LICENSE_1_0_txt
	%dir %{_sysconfdir}/libsmbios
	%config(noreplace) %{_sysconfdir}/libsmbios/*
	# python utilities
	# used by HAL in old location, so keep it around until HAL is updated.
	# data files

cat > files-yum-dellsysid <<-EOF
	# YUM Plugin
	%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/*
	# SUSE build has anal directory ownership check. RPM which owns all dirs *must*
	# be installed at buildtime.
	%if 0%{?suse_version} >= 1100
	%dir %{_sysconfdir}/yum
	%dir %{_sysconfdir}/yum/pluginconf.d/
	%dir %{_exec_prefix}/lib/yum-plugins/

# hardlink files to save some space.

rm -rf %{buildroot}

%post   -n %{release_name}   -p /sbin/ldconfig
%postun -n %{release_name}   -p /sbin/ldconfig

%files -f _build/%{lang_dom}.lang

%files -n libsmbios-devel -f _build/buildlogs.txt
%doc COPYING-GPL COPYING-OSL src/bin/getopts_LICENSE.txt src/include/smbios/config/boost_LICENSE_1_0_txt
%doc _build/out/libsmbios_c++-%{_arch}
%doc _build/out/libsmbios_c-%{_arch}

%files -n smbios-utils
# opensuse 11.1 enforces non-empty file list :(
# no other files.

%files -n smbios-utils-bin
%doc src/bin/getopts_LICENSE.txt src/include/smbios/config/boost_LICENSE_1_0_txt

# new C utilities

%files -n python-smbios -f _build/files-python-smbios

%files -n smbios-utils-python -f _build/files-smbios-utils-python

%files -n yum-dellsysid -f _build/files-yum-dellsysid

* Wed May 16 2018 Kevin Fenzi <> - 2.3.3-7
- Bump release to be higher than RHEL 7.5 package until it can be fixed. 
- As soon as new RHEL package is released, this package will be retired from epel.

* Mon Dec 11 2017 Pete Walter <> - 2.3.3-2
- Remove obsolete python-ctypes requires (#1399686)

* Tue Nov 14 2017 Pete Walter <> - 2.3.3-1
- Update to 2.3.3

* Thu Aug 03 2017 Fedora Release Engineering <> - 2.3.0-6
- Rebuilt for

* Wed Jul 26 2017 Fedora Release Engineering <> - 2.3.0-5
- Rebuilt for

* Fri Feb 10 2017 Fedora Release Engineering <> - 2.3.0-4
- Rebuilt for

* Tue Jul 19 2016 Fedora Release Engineering <> - 2.3.0-3

* Wed Mar 09 2016 Peter Jones <> - 2.3.0-2
- Once again, don't complain about compilers newer than tested with in the
  public headers.
- Fix up bad %%global vs %%define directives
- Fix up bad old changelog dates
- Note there's a missing changelog here from the 2.3.0 rebase

* Thu Feb 25 2016 Peter Jones <> - 2.2.28-16
- Don't complain about compilers newer than tested with in the public

* Thu Feb 04 2016 Fedora Release Engineering <> - 2.2.28-15
- Rebuilt for

* Tue Sep 1 2015 Srinivas G Gowda <> - 2.2.28-14
- Fixes Bug 852719: Dell Open Manage falis to start when libsmbios in EPEL branch is used.
- Patch re-enables display of "OEM String" in smbios-sys-info-lite.

* Wed Jun 17 2015 Fedora Release Engineering <> - 2.2.28-13
- Rebuilt for

* Sat May 02 2015 Kalev Lember <> - 2.2.28-12
- Rebuilt for GCC 5 C++11 ABI change

* Sun Aug 17 2014 Fedora Release Engineering <> - 2.2.28-11
- Rebuilt for

* Sat Jun 07 2014 Fedora Release Engineering <> - 2.2.28-10
- Rebuilt for

* Sat Aug 03 2013 Fedora Release Engineering <> - 2.2.28-9
- Rebuilt for

* Thu Feb 14 2013 Fedora Release Engineering <> - 2.2.28-8
- Rebuilt for

* Thu Jul 19 2012 Fedora Release Engineering <> - 2.2.28-7
- Rebuilt for

* Tue Feb 28 2012 Fedora Release Engineering <> - 2.2.28-6
- Rebuilt for c++ ABI breakage

* Fri Jan 13 2012 Fedora Release Engineering <> - 2.2.28-5
- Rebuilt for

* Thu Jun 30 2011 Praveen K Paladugu <> 2.2.28-4
- Adding the right tar ball, coz files were missing from the previous version. 

* Thu Jun 30 2011 Praveen K Paladugu <> - 2.2.28-3
- Fixing the build failure of version 2.2.26-4.
- The updated sources adds support for the compiler version available in F15 and other fixes.

* Tue Feb 08 2011 Fedora Release Engineering <> - 2.2.26-4
- Rebuilt for

* Mon Sep 27 2010 Matt Domsch <> - 2.2.26-3
- build for Fedora 15

* Wed Jul 21 2010 David Malcolm <> - 2.2.19-2
- Rebuilt for

* Tue Jul 06 2010 Michael Brown <michael-e_brown at> - 2.2.26-1
- implement CSV export of token settings from smbios-token-ctl

* Tue Jul 06 2010 Michael Brown <michael-e_brown at> - 2.2.25-1
- Fix breakage resulting from improperly fixing up constructors for MemoryAccess/CmosAccess. Fixes CLI utilities.

* Fri Jun 11 2010 Michael Brown <michael-e_brown at> - 2.2.23-1
- Fixup ABI break where a couple functions that should have been exported were not marked.

* Thu Jun 10 2010 Michael Brown <michael-e_brown at> - 2.2.22-1
- Fixup bug in reading asset and service tag where it A) read checksum from wrong location and B) used wrong comparison check to validate it
- enable service tag SET for machines that still set service tag in CMOS
- ABI/API - change to -fvisibility=hidden for*, mark public api's. This removes all non-public symbols that were not formerly part of the ABI from the dynamic link table.

* Mon May 18 2009 Matt Domsch <> - 2.2.16-3
- split yum plugin into yum-dellsysid package

* Tue Mar 24 2009 Michael E Brown <michael_e_brown at> - 2.2.16-1
- add gcc 4.4 support

* Tue Mar 24 2009 Michael E Brown <michael_e_brown at> - 2.2.15-1
- update to lastest upstream.
- fixes bug in bios update on systems with versions like x.y.z.

* Wed Feb 25 2009 Fedora Release Engineering <> - 2.2.13-2
- Rebuilt for

* Tue Feb 3 2009 Michael E Brown <michael_e_brown at> - 2.2.12-1
- Add feature to turn on debugging printf()'s without recompiling by setting
  certain environment variables:
    LIBSMBIOS_C_DEBUG_OUTPUT_ALL    -- all debugging output
        or, per module:

* Mon Feb 2 2009 Michael E Brown <michael_e_brown at> - 2.2.12-1
- Add pkgconfig files to -devel
- fixup yum plugin to not parse certain data that causes a crash on some machines (Optiplex 755, others may be affected)

* Thu Jan 15 2009 Michael E Brown <michael_e_brown at> - 2.2.8-1
- revert change in upstream renaming rpm to libsmbios2

* Thu Jan 15 2009 Michael E Brown <michael_e_brown at> - 2.2.7-1
- change source to bz2 format
- Update to latest upstream release. Many changes in the new release:
  - python interface
  - libsmbios_c interface almost fully implemented
  - libsmbios c++ interface deprecated

* Tue Oct 28 2008 Michael E Brown <michael_e_brown at> - 2.2.0-1
- Spec updates

* Mon Apr 21 2008 Michael E Brown <michael_e_brown at> - 2.0.1-2.1
- obsolete libsmbios-libs as well

* Mon Mar 3 2008 Michael E Brown <michael_e_brown at> - 2.0.1-2
- properly obsolete older versions

* Wed Feb 13 2008 Michael E Brown <michael_e_brown at> - 2.0.1
- Fixup GCC 4.3 compile issues.

* Wed Jan 9 2008 Michael E Brown <michael_e_brown at> - 2.0.0
- ABI incompatible, minor API changes
- sync up libsmbios soname with version #
- move binaries to /usr/sbin as they are only runnable by root
- drop libsmbiosxml lib as it was mostly unused.
- drop autotools generated files out of git and add
- drop tokenCtl binary-- pysmbios has a *much* improved version

* Wed Aug 22 2007 Michael E Brown <michael_e_brown at> - 0.13.9
- Fix a couple of failure-to-check-return on fopen. most were unit-test code
  only, but two or three were in regular code.
- Add hinting to the memory class, so that it can intelligently close /dev/mem
  file handle when it is not needed (which is most of the time). it only
  leaves it open when it is scanning, so speed is not impacted.

* Mon Aug 6 2007 Michael E Brown <michael_e_brown at> - 0.13.8
- new upstream

* Tue Apr 3 2007 Michael E Brown <michael_e_brown at> - 0.13.6
- critical bugfix for dellBiosUpdate utility for packet mode
- autoconf/automake support for automatically building docs
- more readable 'make' lines by splitting out env vars
- remove run_cppunit option... always run unit tests.
- update autoconf/automake utilities to latest version
- fix LDFLAGS to not overwrite user entered LDFLAGS
- add automatic doxygen build of docs
- fix urls of public repos
- remove yum repo page in favor of official page from docs
- split dmi table entry point from smbios table entry point
- support legacy _DMI_ tables
- fix support for EFI-based imacs without proper _SM_ anchor

* Tue Mar 20 2007 Michael E Brown <michael_e_brown at> - 0.13.5
- rpmlint cleanups
- Add dellLEDCtl binary
- update AUTHORS file to add credit for dellLEDCtl
- update doc/DellToken.txt to add a few more useful tokens.
- updated build system to create documentation
- skip cppunit dep on .elX builds (not in EPEL yet)

* Mon Mar 12 2007 Michael E Brown <michael_e_brown at> - 0.13.4-1
- Added dellWirelessCtl binary
- Added 'static' makefile target to build static binaries and clean them as well
- fix for signed/unsigned bug in probes binary. CPU temp misreported
- simplify interface for DELL_CALLING_INTERFACE_SMI, autodetect Port/Magic
- document all of the tokens for controlling wireless on dell notebooks
- enums for SMI args/res to make code match docs better (cbRES1 = res[0], which
  was confusing.
- helper functions isTokenActive() and activateToken() to simplify token API.
- Added missing windows .cpp files to the dist tarball for those who compile
  windows from dist tarball vs source control
- Add support for EFI based machines without backwards compatible smbios table
  entry point in 0xF0000 block.
- Added wirelessSwitchControl() and wirelessRadioControl() API for newer
- fixed bug in TokenDA activate() code where it wasnt properly using SMI
  (never worked, but apparently wasnt used until now.)

* Tue Oct 3 2006 Michael E Brown <> - 0.13.0-1
- autotools conversion
- add Changelog

* Tue Sep 26 2006 Michael E Brown <michael_e_brown at> - 0.12.4-1
- Changes per Fedora Packaging Guidelines to prepare to submit to Extras.
- Add in a changelog entry per Fedora Packaging Guidelines...