libsmbios/libsmbios.spec
Josef Möllers 510d67e0c3 Accepting request 593790 from home:scarabeus_iv:branches:Base:System
- Adhere to the packaging guidelines
  * As we build only against tumbleweed do not fuzz around with
    supporting Fedora and Centos
  * Use explicit filelists as it is way more readable
  * Do not play around with %release as it behaves differently
    compared to RH
- Use package names as mandated by python packaging guidelines
- Use full url to fetch tarball from github...
- Do not mess with permission in %prep phase, the perms on
  directories and files look correct both in tarball and github
- Make build run parallel make and just configure/make without any
  hassle
- Do not mess with locale generating, it is properly created by make
  already
- Do not install buildlog on user systems, we have OBS for that
- Install manpage with each binary, do not just put all mans in
  python3 subpackage
- Actually run tests rather than playing around with valgrind
- Make sure to do -fPIE build

OBS-URL: https://build.opensuse.org/request/show/593790
OBS-URL: https://build.opensuse.org/package/show/Base:System/libsmbios?expand=0&rev=39
2018-04-09 15:14:43 +00:00

222 lines
6.8 KiB
RPMSpec

#
# spec file for package libsmbios
#
# Copyright (c) 2018 SUSE LINUX 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/
#
%define libname libsmbios_c2
Name: libsmbios
Version: 2.4.1
Release: 0
Summary: SMBIOS table library and utilities
License: GPL-2.0-or-later OR OSL-2.1
Group: Hardware/Other
URL: https://github.com/dell/libsmbios
Source: https://github.com/dell/libsmbios/archive/v2.4.1.tar.gz#/%{name}-%{version}.tar.gz
Source1: libsmbios-rpmlintrc
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: chrpath
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: gettext
BuildRequires: help2man
BuildRequires: libcppunit-devel
BuildRequires: libtool
BuildRequires: libxml2-devel
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: python3-devel
# libsmbios only ever makes sense on intel compatible arches
# no DMI tables on ppc, s390, etc.
ExclusiveArch: x86_64 ia64 %{ix86}
%description
libsmbios provides a library to interface with the SMBIOS tables. It
also provides extensions for proprietary methods of interfacing with
Dell specific SMBIOS tables.
%lang_package
%package -n %{libname}
Summary: SMBIOS table interface library
Group: System/Libraries
%description -n %{libname}
libsmbios provides a library to interface with the SMBIOS tables. It
also provides extensions for proprietary methods of interfacing with
Dell specific SMBIOS tables.
This package provides the C API library.
%package -n python3-smbios
Summary: Python interface to Libsmbios C library
Group: System/Libraries
Requires: %{libname} = %{version}
# We provide only python3 bindings thus obsolete the old ones
Obsoletes: python-smbios
%description -n python3-smbios
This package provides a Python interface to libsmbios
%package -n smbios-utils
Summary: Utilities that use libsmbios
Group: System/Management
Recommends: %{name}-lang
Recommends: python3-smbios-utils = %{version}
# Give away the bin subpkg and just pull them all here instead of playing with
# metapackages
Provides: smbios-utils-bin
Provides: libsmbios-bin = %{version}
Obsoletes: libsmbios-bin < %{version}
Provides: libsmbios-unsupported-bin = %{version}
Obsoletes: libsmbios-unsupported-bin < %{version}
%description -n smbios-utils
Get BIOS information, such as System product name, product id, service tag and
asset tag.
%package -n python3-smbios-utils
Summary: Python executables that use libsmbios
Group: System/Management
Requires: python3-smbios = %{version}
# Former name replacement
Provides: smbios-utils-python = %{version}
%description -n python3-smbios-utils
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 libsmbios-devel
Summary: Development headers and archives
Group: Development/Libraries/C and C++
Requires: %{libname} = %{version}
Provides: libsmbios2-devel = %{version}
Obsoletes: libsmbios2-devel < %{version}
%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.
%prep
%setup -q
%build
autoreconf -fvi
export CFLAGS="%{optflags} -fPIE"
export LDFLAGS="-pie"
%configure \
--disable-static \
--enable-nls \
--enable-python \
--enable-as-needed \
--enable-doxygen
make %{?_smp_mflags}
%install
%make_install
find %{buildroot} -type f -name "*.la" -delete -print
# remove rpath from binaries
chrpath --replace '$ORIGIN' %{buildroot}%{_sbindir}/smbios-sys-info-lite
# python3 duplicates
%fdupes %{buildroot}%{python3_sitearch}
# include files
mkdir -p %{buildroot}/%{_includedir}
cp -a src/include/* %{buildroot}/%{_includedir}/
cp -a out/public-include/* %{buildroot}%{_includedir}/
%find_lang %{name}
# backwards compatible
mkdir -p %{buildroot}%{_bindir}
ln -s %{_sbindir}/smbios-wireless-ctl %{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
%check
make %{?_smp_mflags} check
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files -n %{libname}
%license COPYING-GPL COPYING-OSL
%license src/bin/getopts_LICENSE.txt
%{_libdir}/libsmbios_c.so.*
%files lang -f %{name}.lang
%files -n libsmbios-devel
%{_includedir}/smbios
%{_includedir}/smbios_c
%{_libdir}/libsmbios_c.so
%{_libdir}/pkgconfig/*.pc
%files -n smbios-utils
# C utilities
%{_sbindir}/smbios-state-byte-ctl
%{_mandir}/man?/smbios-state-byte-ctl.*
%{_sbindir}/smbios-get-ut-data
%{_mandir}/man?/smbios-get-ut-data.*
%{_sbindir}/smbios-upflag-ctl
%{_mandir}/man?/smbios-upflag-ctl.*
%{_sbindir}/smbios-sys-info-lite
%{_mandir}/man?/smbios-sys-info-lite.*
%files -n python3-smbios
%{python3_sitearch}/*
%files -n python3-smbios-utils
%dir %{_sysconfdir}/libsmbios
%config(noreplace) %{_sysconfdir}/libsmbios/*
# python utilities
%{_sbindir}/smbios-battery-ctl
%{_mandir}/man?/smbios-battery-ctl.*
%{_sbindir}/smbios-sys-info
%{_mandir}/man?/smbios-sys-info.*
%{_sbindir}/smbios-token-ctl
%{_mandir}/man?/smbios-token-ctl.*
%{_sbindir}/smbios-passwd
%{_mandir}/man?/smbios-passwd.*
%{_sbindir}/smbios-wakeup-ctl
%{_mandir}/man?/smbios-wakeup-ctl.*
%{_sbindir}/smbios-wireless-ctl
%{_mandir}/man?/smbios-wireless-ctl.*
%{_sbindir}/smbios-lcd-brightness
%{_mandir}/man?/smbios-lcd-brightness.*
%{_sbindir}/smbios-keyboard-ctl
%{_mandir}/man?/smbios-keyboard-ctl.*
%{_sbindir}/smbios-thermal-ctl
%{_mandir}/man?/smbios-thermal-ctl.*
# used by HAL in old location, so keep it around until HAL is updated.
%{_sbindir}/dellLcdBrightness
%{_sbindir}/getSystemId
%{_sbindir}/dellWirelessCtl
%{_bindir}/dellWirelessCtl
# data files
%{_datadir}/smbios-utils
%changelog