2007-01-16 00:23:15 +01:00
|
|
|
#
|
2011-03-21 10:18:21 +01:00
|
|
|
# spec file for package libsmbios
|
2007-01-16 00:23:15 +01:00
|
|
|
#
|
2018-03-26 11:07:27 +02:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
2007-01-16 00:23:15 +01:00
|
|
|
#
|
2008-08-13 18:17:23 +02:00
|
|
|
# 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.
|
|
|
|
|
2007-01-16 00:23:15 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2011-03-21 10:18:33 +01:00
|
|
|
|
2017-10-07 12:08:23 +02:00
|
|
|
# these are all substituted by autoconf
|
|
|
|
%define major 2
|
2018-03-26 11:07:27 +02:00
|
|
|
%define minor 4
|
|
|
|
%define micro 1
|
2017-10-07 12:08:23 +02:00
|
|
|
%define extra %{nil}
|
|
|
|
%define pot_file libsmbios
|
2018-03-26 11:07:27 +02:00
|
|
|
%define lang_dom libsmbios-2.4-x86_64
|
|
|
|
%define release_version 2.4.1
|
2017-10-07 12:08:23 +02:00
|
|
|
|
|
|
|
%define release_name libsmbios
|
|
|
|
%define other_name libsmbios2
|
2018-02-27 10:50:39 +01:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
%define release_name libsmbios2
|
|
|
|
%define other_name libsmbios
|
|
|
|
%endif
|
2017-10-07 12:08:23 +02:00
|
|
|
|
2018-02-27 10:50:39 +01:00
|
|
|
%{!?build_python: %global build_python 1}
|
|
|
|
%{?_with_python: %global build_python 1}
|
2017-10-07 12:08:23 +02:00
|
|
|
%{?_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}
|
2018-03-26 11:07:27 +02:00
|
|
|
%{?_with_unit_tests: %global run_unit_tests 1}
|
2017-10-07 12:08:23 +02:00
|
|
|
|
2018-02-27 10:50:39 +01:00
|
|
|
%{!?as_needed: %global as_needed 1}
|
2017-10-07 12:08:23 +02:00
|
|
|
%{?_without_as_needed: %undefine as_needed}
|
2018-02-27 10:50:39 +01:00
|
|
|
%{?_with_as_needed: %global as_needed 1}
|
2017-10-07 12:08:23 +02:00
|
|
|
|
2018-03-26 11:07:27 +02:00
|
|
|
%global pkgconfig_BR pkgconfig
|
|
|
|
%global valgrind_BR valgrind
|
2018-02-27 10:50:39 +01:00
|
|
|
# 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
|
|
|
|
|
2018-03-26 11:07:27 +02:00
|
|
|
%global python_devel_BR %{nil}
|
2017-10-07 12:08:23 +02:00
|
|
|
%if 0%{?build_python}
|
2018-03-26 11:07:27 +02:00
|
|
|
%global python_devel_BR python3-devel
|
2017-10-07 12:08:23 +02:00
|
|
|
%endif
|
2011-03-21 10:18:21 +01:00
|
|
|
|
2017-10-07 12:08:23 +02:00
|
|
|
# if unit tests are disabled, get rid of a few BuildRequires
|
2018-02-27 10:50:39 +01:00
|
|
|
%{!?run_unit_tests: %global valgrind_BR %{nil}}
|
2017-10-07 12:08:23 +02:00
|
|
|
|
|
|
|
Name: %{release_name}
|
2018-02-27 10:50:39 +01:00
|
|
|
Version: %{release_version}
|
2018-03-26 11:07:27 +02:00
|
|
|
Release: 0%{?dist}
|
2018-02-27 10:50:39 +01:00
|
|
|
Summary: Libsmbios C shared libraries
|
2018-03-26 11:07:27 +02:00
|
|
|
License: GPL-2.0-or-later OR OSL-2.1
|
2018-02-27 10:50:39 +01:00
|
|
|
Group: System/Libraries
|
2018-03-26 11:07:27 +02:00
|
|
|
Source: libsmbios-%{version}.tar.xz
|
2018-02-27 10:50:39 +01:00
|
|
|
Source1: libsmbios.rpmlintrc
|
|
|
|
Url: http://github.com/dell/libsmbios
|
2017-10-07 12:08:23 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2018-03-26 11:07:27 +02:00
|
|
|
BuildRequires: autoconf
|
|
|
|
BuildRequires: automake
|
|
|
|
BuildRequires: gettext-devel
|
|
|
|
BuildRequires: libtool
|
2018-02-27 10:50:39 +01:00
|
|
|
BuildRequires: python-rpm-macros
|
2018-03-26 11:07:27 +02:00
|
|
|
BuildRequires: strace libxml2-devel gcc-c++ gettext doxygen help2man %{valgrind_BR} %{pkgconfig_BR} %{python_devel_BR}
|
2017-10-07 12:08:23 +02:00
|
|
|
# uncomment for official fedora
|
|
|
|
Obsoletes: libsmbios-libs < 2.0.0
|
|
|
|
Provides: libsmbios-libs = 0:%{version}-%{release}
|
2018-02-27 10:50:39 +01:00
|
|
|
Obsoletes: %{other_name} < 0:%{version}-%{release}
|
2017-10-07 12:08:23 +02:00
|
|
|
Provides: %{other_name} = 0:%{version}-%{release}
|
2007-01-16 00:23:15 +01:00
|
|
|
|
2017-10-07 12:08:23 +02:00
|
|
|
# libsmbios only ever makes sense on intel compatible arches
|
|
|
|
# no DMI tables on ppc, s390, etc.
|
|
|
|
ExclusiveArch: x86_64 ia64 %{ix86}
|
2007-01-16 00:23:15 +01:00
|
|
|
|
2017-10-07 12:08:23 +02:00
|
|
|
%description
|
2018-03-26 11:07:27 +02:00
|
|
|
Libsmbios is a library and utilities that can be used by client programs to get
|
2011-03-21 10:18:21 +01:00
|
|
|
information from standard BIOS tables, such as the SMBIOS table.
|
2007-01-16 00:23:15 +01:00
|
|
|
|
2017-10-07 12:08:23 +02:00
|
|
|
This package provides the C-based libsmbios library, with a C interface.
|
2007-10-16 18:21:08 +02:00
|
|
|
|
2011-03-21 10:18:21 +01:00
|
|
|
%package -n python-smbios
|
|
|
|
Summary: Python interface to Libsmbios C library
|
2018-02-27 10:50:39 +01:00
|
|
|
Group: System/Libraries
|
2017-10-07 12:08:23 +02:00
|
|
|
Requires: %{release_name} = %{version}-%{release}
|
2018-03-26 11:07:27 +02:00
|
|
|
Requires: python3
|
2007-01-16 00:23:15 +01:00
|
|
|
|
2011-03-21 10:18:21 +01:00
|
|
|
%description -n python-smbios
|
2017-10-07 12:08:23 +02:00
|
|
|
This package provides a Python interface to libsmbios
|
|
|
|
|
|
|
|
%package -n smbios-utils
|
|
|
|
Summary: Meta-package that pulls in all smbios binaries and python scripts
|
2018-02-27 10:50:39 +01:00
|
|
|
Group: System/Management
|
2017-10-07 12:08:23 +02:00
|
|
|
Requires: smbios-utils-bin
|
|
|
|
%if 0%{?build_python}
|
|
|
|
Requires: smbios-utils-python
|
|
|
|
%endif
|
|
|
|
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.
|
2007-01-16 00:23:15 +01:00
|
|
|
|
2011-03-21 10:18:21 +01:00
|
|
|
%package -n smbios-utils-bin
|
|
|
|
Summary: Binary utilities that use libsmbios
|
2018-02-27 10:50:39 +01:00
|
|
|
Group: System/Management
|
2017-10-07 12:08:23 +02:00
|
|
|
Requires: %{release_name} = %{version}-%{release}
|
2007-01-16 00:23:15 +01:00
|
|
|
|
2011-03-21 10:18:21 +01:00
|
|
|
%description -n smbios-utils-bin
|
|
|
|
Get BIOS information, such as System product name, product id, service tag and
|
|
|
|
asset tag.
|
2007-01-16 00:23:15 +01:00
|
|
|
|
2011-03-21 10:18:21 +01:00
|
|
|
%package -n smbios-utils-python
|
|
|
|
Summary: Python executables that use libsmbios
|
2018-02-27 10:50:39 +01:00
|
|
|
Group: System/Management
|
2017-10-07 12:08:23 +02:00
|
|
|
Requires: python-smbios = %{version}-%{release}
|
2007-01-16 00:23:15 +01:00
|
|
|
|
2011-03-21 10:18:21 +01:00
|
|
|
%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.
|
2007-01-16 00:23:15 +01:00
|
|
|
|
2017-10-07 12:08:23 +02:00
|
|
|
# name the devel package libsmbios-devel regardless of package name, per suse/fedora convention
|
|
|
|
%package -n libsmbios-devel
|
|
|
|
Summary: Development headers and archives
|
2018-02-27 10:50:39 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2017-10-07 12:08:23 +02:00
|
|
|
Requires: %{release_name} = %{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.
|
|
|
|
|
2011-03-21 10:18:21 +01:00
|
|
|
%prep
|
2017-10-07 12:08:23 +02:00
|
|
|
: '########################################'
|
|
|
|
: '########################################'
|
|
|
|
: '#'
|
|
|
|
: '# build_python: %{?build_python}'
|
|
|
|
: '# run_unit_tests: %{?run_unit_tests}'
|
2018-02-27 10:50:39 +01:00
|
|
|
: '# rhel: %{?rhel}'
|
2017-10-07 12:08:23 +02:00
|
|
|
: '# 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 {} \;
|
2018-03-26 11:07:27 +02:00
|
|
|
find ./src/pyunit/ -name "*.sh" -o -name "*.py" -type f -exec chmod 755 '{}' \;
|
2007-01-16 00:23:15 +01:00
|
|
|
|
2011-03-21 10:18:21 +01:00
|
|
|
%build
|
2017-10-07 12:08:23 +02:00
|
|
|
# this line lets us build an RPM directly from a git tarball
|
|
|
|
# and retains any customized version information we might have
|
|
|
|
[ -e ./configure ] || ./autogen.sh --no-configure
|
|
|
|
|
|
|
|
mkdir _build
|
|
|
|
cd _build
|
|
|
|
echo '../configure "$@"' > configure
|
|
|
|
chmod +x ./configure
|
|
|
|
|
|
|
|
%configure \
|
2018-02-27 10:50:39 +01:00
|
|
|
%{?!as_needed:--disable-as-needed} %{?!build_python:--disable-python}
|
2017-10-07 12:08:23 +02:00
|
|
|
|
|
|
|
mkdir -p out/libsmbios_c
|
2018-03-26 11:07:27 +02:00
|
|
|
make CFLAGS="-Werror %{optflags}" %{?_smp_mflags} 2>&1 | tee build-%{_arch}.log
|
2018-02-27 10:50:39 +01:00
|
|
|
|
|
|
|
echo \%doc _build/build-%{_arch}.log > buildlogs.txt
|
2017-10-07 12:08:23 +02:00
|
|
|
|
|
|
|
%check
|
|
|
|
runtest() {
|
|
|
|
mkdir _$1$2
|
|
|
|
%if 0%{?run_unit_tests}
|
|
|
|
pushd _$1$2
|
|
|
|
../configure
|
2018-02-27 10:50:39 +01:00
|
|
|
make -e $1 CFLAGS="$CFLAGS -DDEBUG_OUTPUT_ALL" 2>&1 | tee $1$2.log
|
|
|
|
touch -r ../configure.ac $1$2-%{_arch}.log
|
|
|
|
make -e $1 2>&1 | tee $1$2.log
|
2017-10-07 12:08:23 +02:00
|
|
|
popd
|
2018-02-27 10:50:39 +01:00
|
|
|
echo \%doc _$1$2/$1$2-%{_arch}.log >> _build/buildlogs.txt
|
2017-10-07 12:08:23 +02:00
|
|
|
%endif
|
|
|
|
}
|
2007-01-16 00:23:15 +01:00
|
|
|
|
2018-03-26 11:07:27 +02:00
|
|
|
VALGRIND="strace -f" runtest check strace > /dev/null || echo FAILED strace check
|
|
|
|
runtest valgrind > /dev/null || echo FAILED valgrind check
|
|
|
|
runtest check > /dev/null || echo FAILED check
|
2011-05-14 02:49:02 +02:00
|
|
|
|
2017-10-07 12:08:23 +02:00
|
|
|
%install
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
mkdir %{buildroot}
|
|
|
|
|
|
|
|
cd _build
|
|
|
|
TOPDIR=..
|
|
|
|
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}/
|
2018-03-26 11:07:27 +02:00
|
|
|
rm -f %{buildroot}/%{_libdir}/libsmbios*.*a
|
2018-02-27 10:50:39 +01:00
|
|
|
find %{buildroot}/%{_includedir} out/libsmbios_c -exec touch -r $TOPDIR/configure.ac {} \;
|
2017-10-07 12:08:23 +02:00
|
|
|
|
|
|
|
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}
|
|
|
|
|
2018-02-27 10:50:39 +01:00
|
|
|
find %{buildroot} -name '*-1.pyc' -exec rm {} \;
|
|
|
|
|
2017-10-07 12:08:23 +02:00
|
|
|
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
|
2018-02-27 10:50:39 +01:00
|
|
|
%doc COPYING-GPL COPYING-OSL
|
2018-03-26 11:07:27 +02:00
|
|
|
%{python3_sitearch}/*
|
2017-10-07 12:08:23 +02:00
|
|
|
EOF
|
|
|
|
|
|
|
|
cat > files-smbios-utils-python <<-EOF
|
2018-02-27 10:50:39 +01:00
|
|
|
%doc COPYING-GPL COPYING-OSL
|
|
|
|
%doc src/bin/getopts_LICENSE.txt
|
|
|
|
%dir %{_sysconfdir}/libsmbios
|
|
|
|
%config(noreplace) %{_sysconfdir}/libsmbios/*
|
|
|
|
|
|
|
|
# python utilities
|
|
|
|
%{_sbindir}/smbios-sys-info
|
|
|
|
%{_sbindir}/smbios-token-ctl
|
|
|
|
%{_sbindir}/smbios-passwd
|
|
|
|
%{_sbindir}/smbios-wakeup-ctl
|
|
|
|
%{_sbindir}/smbios-wireless-ctl
|
|
|
|
%{_sbindir}/smbios-lcd-brightness
|
|
|
|
%{_sbindir}/smbios-keyboard-ctl
|
|
|
|
%{_sbindir}/smbios-thermal-ctl
|
|
|
|
%{_sbindir}/smbios-battery-ctl
|
|
|
|
|
2018-03-26 11:07:27 +02:00
|
|
|
# man pages
|
|
|
|
%{_mandir}/man1/smbios*
|
|
|
|
|
2018-02-27 10:50:39 +01:00
|
|
|
# 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
|
2017-10-07 12:08:23 +02:00
|
|
|
EOF
|
|
|
|
|
2007-01-16 00:23:15 +01:00
|
|
|
%endif
|
2011-05-14 02:49:02 +02:00
|
|
|
|
2011-03-21 10:18:21 +01:00
|
|
|
%clean
|
|
|
|
rm -rf %{buildroot}
|
2007-01-16 00:23:15 +01:00
|
|
|
|
2017-10-07 12:08:23 +02:00
|
|
|
%post -n %{release_name} -p /sbin/ldconfig
|
|
|
|
%postun -n %{release_name} -p /sbin/ldconfig
|
2007-01-16 00:23:15 +01:00
|
|
|
|
2017-10-07 12:08:23 +02:00
|
|
|
%files -f _build/%{lang_dom}.lang
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%{_libdir}/libsmbios_c.so.*
|
2008-03-05 22:38:04 +01:00
|
|
|
|
2018-02-27 10:50:39 +01:00
|
|
|
%files -n libsmbios-devel -f _build/buildlogs.txt
|
2011-03-21 10:18:21 +01:00
|
|
|
%defattr(-,root,root,-)
|
2018-02-27 10:50:39 +01:00
|
|
|
%doc COPYING-GPL COPYING-OSL src/bin/getopts_LICENSE.txt
|
2017-10-07 12:08:23 +02:00
|
|
|
%{_includedir}/smbios
|
|
|
|
%{_includedir}/smbios_c
|
2011-03-21 10:18:21 +01:00
|
|
|
%{_libdir}/libsmbios_c.so
|
2017-10-07 12:08:23 +02:00
|
|
|
%{_libdir}/pkgconfig/*.pc
|
|
|
|
%doc _build/out/libsmbios_c-%{_arch}
|
2007-01-16 00:23:15 +01:00
|
|
|
|
2017-10-07 12:08:23 +02:00
|
|
|
%files -n smbios-utils
|
|
|
|
# opensuse 11.1 enforces non-empty file list :(
|
2011-03-21 10:18:21 +01:00
|
|
|
%defattr(-,root,root,-)
|
2017-10-07 12:08:23 +02:00
|
|
|
%doc COPYING-GPL COPYING-OSL
|
|
|
|
# no other files.
|
2007-01-16 00:23:15 +01:00
|
|
|
|
2011-03-21 10:18:21 +01:00
|
|
|
%files -n smbios-utils-bin
|
|
|
|
%defattr(-,root,root,-)
|
2017-10-07 12:08:23 +02:00
|
|
|
%doc COPYING-GPL COPYING-OSL
|
2018-02-27 10:50:39 +01:00
|
|
|
%doc src/bin/getopts_LICENSE.txt
|
2017-10-07 12:08:23 +02:00
|
|
|
|
2011-03-21 10:18:21 +01:00
|
|
|
# new C utilities
|
|
|
|
%{_sbindir}/smbios-state-byte-ctl
|
2017-10-07 12:08:23 +02:00
|
|
|
%{_sbindir}/smbios-get-ut-data
|
2011-03-21 10:18:21 +01:00
|
|
|
%{_sbindir}/smbios-upflag-ctl
|
2017-10-07 12:08:23 +02:00
|
|
|
%{_sbindir}/smbios-sys-info-lite
|
2011-03-21 10:18:21 +01:00
|
|
|
|
2017-10-07 12:08:23 +02:00
|
|
|
%files -n python-smbios -f _build/files-python-smbios
|
2011-03-21 10:18:21 +01:00
|
|
|
%defattr(-,root,root,-)
|
2017-10-07 12:08:23 +02:00
|
|
|
|
|
|
|
%files -n smbios-utils-python -f _build/files-smbios-utils-python
|
2011-03-21 10:18:21 +01:00
|
|
|
%defattr(-,root,root,-)
|
|
|
|
|
2007-03-05 00:24:53 +01:00
|
|
|
%changelog
|