@ -3,34 +3,23 @@
%define lang_dom libsmbios-2.4
Name: libsmbios
Version: 2.4.3
Release: 4%{?dist}
Summary: Libsmbios C/C++ shared libraries
Version: 2.4.1
Release: 2%{?dist}
License: GPLv2+ or OSL 2.1
Summary: Libsmbios C/C++ shared libraries
Group: System Environment/Libraries
URL: https://github.com/dell/libsmbios
Source0: https://github.com/dell/libsmbios/archive/v%{version}/libsmbios-%{version}.tar.gz
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: cppunit-devel
BuildRequires: doxygen
BuildRequires: gcc-c++
BuildRequires: gettext
BuildRequires: gettext-devel
BuildRequires: help2man
BuildRequires: libtool
BuildRequires: libxml2-devel
BuildRequires: make
BuildRequires: pkgconfig
BuildRequires: python3-devel
BuildRequires: strace
BuildRequires: valgrind
BuildRequires: strace libxml2-devel gcc-c++ gettext git doxygen
BuildRequires: valgrind cppunit-devel hardlink pkgconfig python3-devel
BuildRequires: autoconf gettext-devel automake libtool help2man
# libsmbios only ever makes sense on intel compatible arches
# no DMI tables on ppc, s390, etc.
ExclusiveArch: x86_64 %{ix86}
Source0: https://github.com/dell/libsmbios/archive/v%{version}/libsmbios-%{version}.tar.gz
Patch0001: 0001-libsmbios-fix-more-places-with-loop-iterators-with-b.patch
%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.
@ -39,6 +28,7 @@ This package provides the C-based libsmbios library, with a C interface.
%package -n python3-smbios
Summary: Python interface to Libsmbios C library
Group: System Environment/Libraries
Requires: libsmbios = %{version}-%{release}
Requires: python3
Obsoletes: python-smbios < 2.4.1
@ -48,6 +38,7 @@ 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
Requires: smbios-utils-python
@ -57,6 +48,7 @@ as the python executables.
%package -n smbios-utils-bin
Summary: Binary utilities that use libsmbios
Group: Applications/System
Requires: libsmbios = %{version}-%{release}
%description -n smbios-utils-bin
@ -65,6 +57,7 @@ asset tag.
%package -n smbios-utils-python
Summary: Python executables that use libsmbios
Group: Applications/System
Requires: python3-smbios = %{version}-%{release}
%description -n smbios-utils-python
@ -76,6 +69,7 @@ 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: libsmbios = %{version}-%{release}
%description -n libsmbios-devel
@ -86,11 +80,19 @@ This package contains the headers and .a files necessary to compile new client
programs against libsmbios.
%prep
%autosetup -p1
%setup -q -n libsmbios-%{version}
find . -type d -exec chmod -f 755 {} \;
find doc src -type f -exec chmod -f 644 {} \;
chmod 755 src/cppunit/*.sh
git init
git config user.email "%{name}-owner@fedoraproject.org"
git config user.name "Fedora Ninjas"
git config gc.auto 0
git add .
git commit -a -q -m "%{version} baseline."
git am %{patches} </dev/null
git config --unset user.email
git config --unset user.name
%build
# this line lets us build an RPM directly from a git tarball
@ -105,10 +107,30 @@ chmod +x ./configure
%configure
mkdir -p out/libsmbios_c
mkdir -p out/libsmbios_c++
make CFLAGS+="%{optflags} -Werror" %{?_smp_mflags} 2>&1 | tee build-%{_arch}.log
echo \%doc _build/build-%{_arch}.log > buildlogs.txt
TOPDIR=$(pwd)/../
pushd ../src/bin
for x in smbios-battery-ctl smbios-keyboard-ctl smbios-lcd-brightness \
smbios-passwd smbios-sys-info smbios-thermal-ctl smbios-token-ctl \
smbios-wakeup-ctl smbios-wireless-ctl ;
do
chmod +x ${x}
LD_LIBRARY_PATH=$TOPDIR/_build/out/.libs/ help2man -o ${x}.8 -s 8 -n ${x} -N -l ./${x}
done
popd
pushd out
for x in smbios-get-ut-data smbios-state-byte-ctl smbios-sys-info-lite \
smbios-upflag-ctl ;
do
LD_LIBRARY_PATH=$TOPDIR/_build/out/.libs/ help2man -o ${x}.8 -s 8 -n ${x} -N -l ./${x}
done
popd
%check
runtest() {
mkdir _$1$2
@ -121,43 +143,75 @@ runtest() {
echo \%doc _$1$2/$1$2-%{_arch}.log >> _build/buildlogs.txt
}
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
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
fi
if [ -e /usr/bin/valgrind -a -d /usr/include/cppunit ]; then
runtest valgrind > /dev/null || echo FAILED valgrind check
fi
if [ -d /usr/include/cppunit ]; then
runtest check > /dev/null || echo FAILED check
fi
if [ ! -d /usr/include/cppunit ]; then
echo "Unit tests skipped due to missing cppunit."
fi
%install
rm -rf %{buildroot}
mkdir %{buildroot}
cd _build
TOPDIR=..
%make_install
make install DESTDIR=%{buildroot} INSTALL="%{__install} -p"
mkdir -p %{buildroot}/%{_includedir}
mkdir -p %{buildroot}/%{_bindir}
mkdir -p %{buildroot}/%{_mandir}/man8/
cp -v $TOPDIR/src/bin/*.8 %{buildroot}/%{_mandir}/man8/
cp -v $TOPDIR/_build/out/*.8 %{buildroot}/%{_mandir}/man8/
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 -exec touch -r $TOPDIR/configure.ac {} \;
find %{buildroot}/%{_includedir} out/libsmbios_c++ out/libsmbios_c -exec touch -r $TOPDIR/configure.ac {} \;
mv out/libsmbios_c++ out/libsmbios_c++-%{_arch}
mv out/libsmbios_c out/libsmbios_c-%{_arch}
# https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_3
%py_byte_compile %{python3} %{buildroot}%{python3_sitearch}/
rename %{pot_file}.mo %{lang_dom}.mo $(find %{buildroot}/%{_datadir} -name %{pot_file}.mo)
%find_lang %{lang_dom}
%ldconfig_scriptlets
# hardlink files to save some space.
/usr/sbin/hardlink -c -v $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files -f _build/%{lang_dom}.lang
# Only need to include license once here
%license COPYING-GPL COPYING-OSL
%defattr(-,root,root,-)
%{_libdir}/libsmbios_c.so.*
%files -n libsmbios-devel -f _build/buildlogs.txt
%license src/bin/getopts_LICENSE.txt src/include/smbios_c/config/boost_LICENSE_1_0_txt
%doc README.md _build/out/libsmbios_c-%{_arch}
%defattr(-,root,root,-)
%doc COPYING-GPL COPYING-OSL README.md src/bin/getopts_LICENSE.txt src/include/smbios_c/config/boost_LICENSE_1_0_txt
%{_includedir}/smbios
%{_includedir}/smbios_c
%{_libdir}/libsmbios_c.so
%{_libdir}/pkgconfig/*.pc
%doc _build/out/libsmbios_c-%{_arch}
%files -n smbios-utils
# opensuse 11.1 enforces non-empty file list :(
%defattr(-,root,root,-)
%doc COPYING-GPL COPYING-OSL README.md
# no other files.
%files -n smbios-utils-bin
%license src/bin/getopts_LICENSE.txt src/include/smbios_c/config/boost_LICENSE_1_0_txt
%defattr(-,root,root,-)
%doc COPYING-GPL COPYING-OSL README.md
%doc src/bin/getopts_LICENSE.txt src/include/smbios_c/config/boost_LICENSE_1_0_txt
%{_sbindir}/smbios-state-byte-ctl
%{_mandir}/man?/smbios-state-byte-ctl.*
%{_sbindir}/smbios-get-ut-data
@ -168,10 +222,14 @@ rename %{pot_file}.mo %{lang_dom}.mo $(find %{buildroot}/%{_datadir} -name %{pot
%{_mandir}/man?/smbios-sys-info-lite.*
%files -n python3-smbios
%defattr(-,root,root,-)
%doc COPYING-GPL COPYING-OSL README.md
%{python3_sitearch}/*
%files -n smbios-utils-python
%license src/bin/getopts_LICENSE.txt src/include/smbios_c/config/boost_LICENSE_1_0_txt
%defattr(-,root,root,-)
%doc COPYING-GPL COPYING-OSL README.md
%doc src/bin/getopts_LICENSE.txt src/include/smbios_c/config/boost_LICENSE_1_0_txt
%dir %{_sysconfdir}/libsmbios
%config(noreplace) %{_sysconfdir}/libsmbios/*
@ -199,53 +257,6 @@ rename %{pot_file}.mo %{lang_dom}.mo $(find %{buildroot}/%{_datadir} -name %{pot
%{_datadir}/smbios-utils
%changelog
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.4.3-4
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.4.3-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Sun Jan 17 2021 Peter Robinson <pbrobinson@fedoraproject.org> - 2.4.3-1
- Update to 2.4.3
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.2-10
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.2-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.4.2-8
- Rebuilt for Python 3.9
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.2-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.4.2-6
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.4.2-5
- Rebuilt for Python 3.8
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jul 10 2018 Pete Walter <pwalter@fedoraproject.org> - 2.4.2-1
- Update to 2.4.2
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.4.1-3
- Rebuilt for Python 3.7
* Wed Apr 18 2018 Karsten Hopp <karsten@redhat.com> - 2.4.1-2
- rebuild with latest rpm build flags (rhbz#1540264)