libsmbios/libsmbios.spec
Marcus Meissner ac352d034b Accepting request 477516 from home:fschnizlein:branches:Base:System
- Update to 2.3.2
  * Drop rbu support
  * Add smbios-battery script
- Fetch source from GitHub
- Remove obsolete patches:
D libsmbios-2.2.28-fix-bashisms.patch since pkgheader.sh was
  removed

OBS-URL: https://build.opensuse.org/request/show/477516
OBS-URL: https://build.opensuse.org/package/show/Base:System/libsmbios?expand=0&rev=24
2017-03-09 13:33:17 +00:00

244 lines
8.2 KiB
RPMSpec

#
# spec file for package libsmbios
#
# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
Name: libsmbios
Version: 2.3.2
Release: 0
Summary: Libraries to get information from standard BIOS tables
License: GPL-2.0+ or OSL-2.1
Group: System/Management
Url: https://github.com/dell/libsmbios
Source0: https://github.com/dell/libsmbios/archive/v%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: autoconf
BuildRequires: autogen
BuildRequires: automake
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: libcppunit-devel
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: python-base
BuildRequires: pkgconfig(libxml-2.0)
# Modules: dcdbas.ko
Supplements: modalias(dmi:*:[bs]vnD[Ee][Ll][Ll]*:*)
# Generated with: extract-modaliases dcdbas
# libsmbios only ever makes sense on intel compatible arches, no DMI tables on ppc, s390, etc.
ExclusiveArch: ia64 %{ix86} x86_64
%description
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.
%package devel
Summary: Development files for libsmios
Group: Development/Libraries/C and C++
Requires: libsmbios2 = %{version}
Requires: libstdc++-devel
%description 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 necessary files to compile new client programs
against libsmbios.
%package -n libsmbios2
Summary: Libraries to get information from standard BIOS tables
Group: System/Management
Supplements: modalias(dmi:*:[bs]vnD[Ee][Ll][Ll]*:*)
%description -n libsmbios2
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.
%package -n python-smbios
Summary: Python interface to Libsmbios C library
Group: Development/Libraries/Python
Requires: libsmbios2 = %{version}
Supplements: modalias(dmi:*:[bs]vnD[Ee][Ll][Ll]*:*)
%if %{?suse_version: 0%{?suse_version} > 1110} %{!?suse_version:1}
BuildArch: noarch
%endif
%description -n python-smbios
This package provides a Python interface to libsmbios.
%package -n smbios-utils-bin
Summary: Binary utilities that use libsmbios
Group: System/Management
Supplements: modalias(dmi:*:[bs]vnD[Ee][Ll][Ll]*:*)
# libsmbios-unsupported-bin was last used in openSUSE 11.4 (libsmbios-unsupported-bin-2.0.2)
Obsoletes: libsmbios-unsupported-bin <= 2.0.2
Provides: libsmbios-unsupported-bin = %{version}
%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: System/Management
Requires: python-smbios = %{version}
Supplements: modalias(dmi:*:[bs]vnD[Ee][Ll][Ll]*:*)
# libsmbios-bin was last used in openSUSE 11.4 (libsmbios-bin-2.0.2)
Obsoletes: libsmbios-bin <= 2.0.2
Provides: libsmbios-bin = %{version}
%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.
%package -n yum-dellsysid
Summary: YUM plugin to retrieve the Dell System ID
Group: System/Packages
Requires: smbios-utils-python = %{version}
Requires: yum
%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.
%prep
%setup -q
%build
./autogen.sh
%configure --disable-rpath
make %{?_smp_mflags}
%install
%make_install
# Install headers
install -dp -m 0755 %{buildroot}%{_includedir}
cp -a src/include/* %{buildroot}/%{_includedir}/
cp -a out/public-include/* %{buildroot}/%{_includedir}/
find %{buildroot}/%{_includedir} out/libsmbios_c++ out/libsmbios_c -exec touch -r configure.ac {} \;
# Remove *.la files (package provides pkg-config files), remove static libraries
rm -f %{buildroot}/%{_libdir}/lib*.{la,a}
# Prepare doc files for devel package
mv out/libsmbios_c out/libsmbios_c-%{_arch}
mv out/libsmbios_c++ out/libsmbios_c++-%{_arch}
# Manually install the doc files for the devel package in order to fix duplicates with "fdupes -s"
install -dp -m 0755 %{buildroot}%{_defaultdocdir}/%{name}-devel
cp -a COPYING COPYING-GPL COPYING-OSL NEWS README TODO %{buildroot}%{_defaultdocdir}/%{name}-devel/
cp -a src/bin/getopts_LICENSE.txt src/include/smbios/config/boost_LICENSE_1_0_txt %{buildroot}%{_defaultdocdir}/%{name}-devel/
cp -a out/libsmbios_c-%{_arch} %{buildroot}%{_defaultdocdir}/%{name}-devel/
cp -a out/libsmbios_c++-%{_arch} %{buildroot}%{_defaultdocdir}/%{name}-devel/
#
rename libsmbios.mo libsmbios-2.2-x86_64.mo $(find %{buildroot}/%{_datadir} -name libsmbios.mo)
# Remove unneeded locales
%if 0%{?suse_version} && 0%{?suse_version} < 1140
rm -rf %{buildroot}%{_datadir}/locale/en/
rm -rf %{buildroot}%{_datadir}/locale/en@boldquot/
rm -rf %{buildroot}%{_datadir}/locale/en@quot/
%endif
%find_lang %{name}-2.2-x86_64
%fdupes -s %{buildroot}
%clean
rm -rf %{buildroot}
%post -n libsmbios2 -p /sbin/ldconfig
%postun -n libsmbios2 -p /sbin/ldconfig
%files devel
%defattr(-,root,root,-)
%doc %{_defaultdocdir}/%{name}-devel/
%{_includedir}/smbios/
%{_includedir}/smbios_c/
%{_libdir}/libsmbios.so
%{_libdir}/libsmbios_c.so
%{_libdir}/pkgconfig/libsmbios_c*.pc
%files -n libsmbios2 -f %{name}-2.2-x86_64.lang
%defattr(-,root,root,-)
%{_libdir}/libsmbios.so.2*
%{_libdir}/libsmbios_c.so.2*
%files -n python-smbios
%defattr(-,root,root,-)
%doc COPYING-GPL COPYING-OSL NEWS README TODO
%{python_sitelib}/libsmbios_c/
%files -n smbios-utils-bin
%defattr(-,root,root,-)
%doc COPYING-GPL COPYING-OSL NEWS README TODO
%defattr(555,root,root,-)
# legacy C++
%{_sbindir}/dellLEDCtl
%ifnarch ia64
%{_sbindir}/dellMediaDirectCtl
%endif
# new C utilities
%{_sbindir}/smbios-get-ut-data
%{_sbindir}/smbios-state-byte-ctl
%{_sbindir}/smbios-sys-info-lite
%{_sbindir}/smbios-upflag-ctl
%{_sbindir}/smbios-keyboard-ctl
%{_sbindir}/smbios-thermal-ctl
%files -n smbios-utils-python
%defattr(-,root,root,-)
%doc COPYING-GPL COPYING-OSL NEWS README TODO
%dir %{_sysconfdir}/libsmbios
%config(noreplace) %{_sysconfdir}/libsmbios/*
%defattr(555,root,root,-)
# python utilities
%{_sbindir}/smbios-lcd-brightness
%{_sbindir}/smbios-passwd
%{_sbindir}/smbios-battery-ctl
%{_sbindir}/smbios-sys-info
%{_sbindir}/smbios-token-ctl
%{_sbindir}/smbios-wakeup-ctl
%{_sbindir}/smbios-wireless-ctl
%defattr(-,root,root,-)
%{_datadir}/smbios-utils/
%files -n yum-dellsysid
%defattr(-,root,root,-)
%doc COPYING-GPL COPYING-OSL NEWS README TODO
%dir %{_sysconfdir}/yum
%dir %{_sysconfdir}/yum/pluginconf.d
%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/dellsysid.conf
%dir %{_exec_prefix}/lib/yum-plugins
%{_exec_prefix}/lib/yum-plugins/dellsysid.*
%changelog