@ -3,34 +3,23 @@
%define lang_dom libsmbios-2.4
%define lang_dom libsmbios-2.4
Name: libsmbios
Name: libsmbios
Version: 2.4.3
Version: 2.4.1
Release: 4%{?dist}
Release: 2%{?dist}
Summary: Libsmbios C/C++ shared libraries
License: GPLv2+ or OSL 2.1
License: GPLv2+ or OSL 2.1
Summary: Libsmbios C/C++ shared libraries
Group: System Environment/Libraries
URL: https://github.com/dell/libsmbios
URL: https://github.com/dell/libsmbios
Source0: https://github.com/dell/libsmbios/archive/v%{version}/libsmbios-%{version}.tar.gz
BuildRequires: strace libxml2-devel gcc-c++ gettext git doxygen
BuildRequires: valgrind cppunit-devel hardlink pkgconfig python3-devel
BuildRequires: autoconf
BuildRequires: autoconf gettext-devel automake libtool help2man
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
# libsmbios only ever makes sense on intel compatible arches
# libsmbios only ever makes sense on intel compatible arches
# no DMI tables on ppc, s390, etc.
# no DMI tables on ppc, s390, etc.
ExclusiveArch: x86_64 %{ix86}
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
%description
Libsmbios is a library and utilities that can be used by client programs to get
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.
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
%package -n python3-smbios
Summary: Python interface to Libsmbios C library
Summary: Python interface to Libsmbios C library
Group: System Environment/Libraries
Requires: libsmbios = %{version}-%{release}
Requires: libsmbios = %{version}-%{release}
Requires: python3
Requires: python3
Obsoletes: python-smbios < 2.4.1
Obsoletes: python-smbios < 2.4.1
@ -48,6 +38,7 @@ This package provides a Python interface to libsmbios
%package -n smbios-utils
%package -n smbios-utils
Summary: Meta-package that pulls in all smbios binaries and python scripts
Summary: Meta-package that pulls in all smbios binaries and python scripts
Group: Applications/System
Requires: smbios-utils-bin
Requires: smbios-utils-bin
Requires: smbios-utils-python
Requires: smbios-utils-python
@ -57,6 +48,7 @@ as the python executables.
%package -n smbios-utils-bin
%package -n smbios-utils-bin
Summary: Binary utilities that use libsmbios
Summary: Binary utilities that use libsmbios
Group: Applications/System
Requires: libsmbios = %{version}-%{release}
Requires: libsmbios = %{version}-%{release}
%description -n smbios-utils-bin
%description -n smbios-utils-bin
@ -65,6 +57,7 @@ asset tag.
%package -n smbios-utils-python
%package -n smbios-utils-python
Summary: Python executables that use libsmbios
Summary: Python executables that use libsmbios
Group: Applications/System
Requires: python3-smbios = %{version}-%{release}
Requires: python3-smbios = %{version}-%{release}
%description -n smbios-utils-python
%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
# name the devel package libsmbios-devel regardless of package name, per suse/fedora convention
%package -n libsmbios-devel
%package -n libsmbios-devel
Summary: Development headers and archives
Summary: Development headers and archives
Group: Development/Libraries
Requires: libsmbios = %{version}-%{release}
Requires: libsmbios = %{version}-%{release}
%description -n libsmbios-devel
%description -n libsmbios-devel
@ -86,11 +80,19 @@ This package contains the headers and .a files necessary to compile new client
programs against libsmbios.
programs against libsmbios.
%prep
%prep
%autosetup -p1
%setup -q -n libsmbios-%{version}
find . -type d -exec chmod -f 755 {} \;
find . -type d -exec chmod -f 755 {} \;
find doc src -type f -exec chmod -f 644 {} \;
find doc src -type f -exec chmod -f 644 {} \;
chmod 755 src/cppunit/*.sh
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
%build
# this line lets us build an RPM directly from a git tarball
# this line lets us build an RPM directly from a git tarball
@ -105,10 +107,30 @@ chmod +x ./configure
%configure
%configure
mkdir -p out/libsmbios_c
mkdir -p out/libsmbios_c
mkdir -p out/libsmbios_c++
make CFLAGS+="%{optflags} -Werror" %{?_smp_mflags} 2>&1 | tee build-%{_arch}.log
make CFLAGS+="%{optflags} -Werror" %{?_smp_mflags} 2>&1 | tee build-%{_arch}.log
echo \%doc _build/build-%{_arch}.log > buildlogs.txt
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
%check
runtest() {
runtest() {
mkdir _$1$2
mkdir _$1$2
@ -121,43 +143,75 @@ runtest() {
echo \%doc _$1$2/$1$2-%{_arch}.log >> _build/buildlogs.txt
echo \%doc _$1$2/$1$2-%{_arch}.log >> _build/buildlogs.txt
}
}
VALGRIND="strace -f" runtest check strace > /dev/null || echo FAILED strace check
if [ -d /usr/include/cppunit ]; then
runtest valgrind > /dev/null || echo FAILED valgrind check
# run this first since it is slightly faster than valgrind
runtest check > /dev/null || echo FAILED check
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
%install
rm -rf %{buildroot}
mkdir %{buildroot}
cd _build
cd _build
TOPDIR=..
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}
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}
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)
rename %{pot_file}.mo %{lang_dom}.mo $(find %{buildroot}/%{_datadir} -name %{pot_file}.mo)
%find_lang %{lang_dom}
%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
%files -f _build/%{lang_dom}.lang
# Only need to include license once here
%defattr(-,root,root,-)
%license COPYING-GPL COPYING-OSL
%{_libdir}/libsmbios_c.so.*
%{_libdir}/libsmbios_c.so.*
%files -n libsmbios-devel -f _build/buildlogs.txt
%files -n libsmbios-devel -f _build/buildlogs.txt
%license src/bin/getopts_LICENSE.txt src/include/smbios_c/config/boost_LICENSE_1_0_txt
%defattr(-,root,root,-)
%doc README.md _build/out/libsmbios_c-%{_arch}
%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
%{_includedir}/smbios_c
%{_libdir}/libsmbios_c.so
%{_libdir}/libsmbios_c.so
%{_libdir}/pkgconfig/*.pc
%{_libdir}/pkgconfig/*.pc
%doc _build/out/libsmbios_c-%{_arch}
%files -n smbios-utils
%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
%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
%{_sbindir}/smbios-state-byte-ctl
%{_mandir}/man?/smbios-state-byte-ctl.*
%{_mandir}/man?/smbios-state-byte-ctl.*
%{_sbindir}/smbios-get-ut-data
%{_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.*
%{_mandir}/man?/smbios-sys-info-lite.*
%files -n python3-smbios
%files -n python3-smbios
%defattr(-,root,root,-)
%doc COPYING-GPL COPYING-OSL README.md
%{python3_sitearch}/*
%{python3_sitearch}/*
%files -n smbios-utils-python
%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
%dir %{_sysconfdir}/libsmbios
%config(noreplace) %{_sysconfdir}/libsmbios/*
%config(noreplace) %{_sysconfdir}/libsmbios/*
@ -199,52 +257,8 @@ rename %{pot_file}.mo %{lang_dom}.mo $(find %{buildroot}/%{_datadir} -name %{pot
%{_datadir}/smbios-utils
%{_datadir}/smbios-utils
%changelog
%changelog
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.4.3-4
* Wed Jul 26 2023 MSVSphere Packaging Team <packager@msvsphere.ru> - 2.4.1-2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
- Rebuilt for MSVSphere 8.8
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
* Wed Apr 18 2018 Karsten Hopp <karsten@redhat.com> - 2.4.1-2
- rebuild with latest rpm build flags (rhbz#1540264)
- rebuild with latest rpm build flags (rhbz#1540264)