From 605bd51462436ca6e09b8c7c5ec1036f6c9d7da99c8fa4ffb4a1810b0c9fc4fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20M=C3=B6llers?= Date: Mon, 26 Mar 2018 09:07:27 +0000 Subject: [PATCH 1/2] Accepting request 590769 from home:1Antoine1:branches:Base:System - Update to 2.4.1: * Minor fixes submitted for help2man improvements and a signed comparison. - Changes in 2.4.0: * Convert all python2 -> python3. * Drop libsmbios C++ library. * Introduce support for WMI SMM API provided by Linux kernel 4.15+. * Add proper support for SMBIOS 3.0 tables. * Fix many many crashers. * Clean up long standing coverity errors. OBS-URL: https://build.opensuse.org/request/show/590769 OBS-URL: https://build.opensuse.org/package/show/Base:System/libsmbios?expand=0&rev=36 --- libsmbios-2.3.3.tar.bz2 | 3 -- libsmbios-2.4.1.tar.xz | 3 ++ libsmbios.changes | 15 ++++++ libsmbios.spec | 108 +++++++++++----------------------------- 4 files changed, 48 insertions(+), 81 deletions(-) delete mode 100644 libsmbios-2.3.3.tar.bz2 create mode 100644 libsmbios-2.4.1.tar.xz diff --git a/libsmbios-2.3.3.tar.bz2 b/libsmbios-2.3.3.tar.bz2 deleted file mode 100644 index 2540a07..0000000 --- a/libsmbios-2.3.3.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ff0fbcc5fd581772aaabcde1a998b774da70fd87e2934a19fd7d61e60ab5245d -size 872617 diff --git a/libsmbios-2.4.1.tar.xz b/libsmbios-2.4.1.tar.xz new file mode 100644 index 0000000..a647b36 --- /dev/null +++ b/libsmbios-2.4.1.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bca36af54a169eafeda19463e100378b26b1845d90dfd2fcb41cbd05a632f015 +size 435512 diff --git a/libsmbios.changes b/libsmbios.changes index e4c61c2..a33326d 100644 --- a/libsmbios.changes +++ b/libsmbios.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Thu Mar 22 19:45:36 UTC 2018 - antoine.belvire@opensuse.org + +- Update to 2.4.1: + * Minor fixes submitted for help2man improvements and a signed + comparison. +- Changes in 2.4.0: + * Convert all python2 -> python3. + * Drop libsmbios C++ library. + * Introduce support for WMI SMM API provided by Linux kernel + 4.15+. + * Add proper support for SMBIOS 3.0 tables. + * Fix many many crashers. + * Clean up long standing coverity errors. + ------------------------------------------------------------------- Fri Feb 23 15:36:12 UTC 2018 - josef.moellers@suse.com diff --git a/libsmbios.spec b/libsmbios.spec index db5fe6f..64ea6f6 100644 --- a/libsmbios.spec +++ b/libsmbios.spec @@ -1,7 +1,7 @@ # # spec file for package libsmbios # -# Copyright (c) 2018 SUSE LINUX Products GmbH, Nuernberg, Germany. +# 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 @@ -18,12 +18,12 @@ # these are all substituted by autoconf %define major 2 -%define minor 3 -%define micro 3 +%define minor 4 +%define micro 1 %define extra %{nil} %define pot_file libsmbios -%define lang_dom libsmbios-2.3-x86_64 -%define release_version 2.3.3 +%define lang_dom libsmbios-2.4-x86_64 +%define release_version 2.4.1 %define release_name libsmbios %define other_name libsmbios2 @@ -35,87 +35,50 @@ %{!?build_python: %global build_python 1} %{?_with_python: %global build_python 1} %{?_without_python: %undefine build_python} -%{?!python_module:%define python_module() python-%{**} python3-%{**}} -# %%define debug_package %%{nil} # run_unit_tests not defined by default as cppunit # not available in OS on several major OS %{?_without_unit_tests: %undefine run_unit_tests} -%{?_with_unit_tests: %define run_unit_tests 1} +%{?_with_unit_tests: %global run_unit_tests 1} %{!?as_needed: %global as_needed 1} %{?_without_as_needed: %undefine as_needed} %{?_with_as_needed: %global as_needed 1} -%define cppunit_BR cppunit-devel -%define pkgconfig_BR pkgconfig -%define ctypes_BR python-ctypes -%define valgrind_BR valgrind +%global pkgconfig_BR pkgconfig +%global valgrind_BR valgrind # 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 -# suse/sles -%if 0%{?suse_version} -%if 0%{?suse_version} < 1000 - %define valgrind_BR %{nil} - # sles 9 doesnt have as_needed - %undefine as_needed -%endif -%if 0%{?suse_version} >= 1020 - # suse never added python-ctypes provides to python 2.5 :( - %define ctypes_BR %{nil} -%endif -%endif - -# rhel (should work on OBS and EPEL) -%if 0%{?rhel} -%if 0%{?rhel} < 4 - # dont yet have rhel3 valgrind - %define valgrind_BR %{nil} - # no python-ctypes for python <= 2.2 - %undefine build_python - # rhel3 doesnt have -as-needed - %undefine as_needed -%endif -%endif - -%define python_devel_BR %{nil} +%global python_devel_BR %{nil} %if 0%{?build_python} - %define python_devel_BR %{pythons} - # per fedora and suse python packaging guidelines - # suse: will define py_sitedir for us - # fedora: use the !? code below to define when it isnt already - - # pure python stuff goes here - %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} - - # arch-dep python stuff goes here - %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} - + %global python_devel_BR python3-devel %endif # if unit tests are disabled, get rid of a few BuildRequires -%{!?run_unit_tests: %global cppunit_BR %{nil}} %{!?run_unit_tests: %global valgrind_BR %{nil}} Name: %{release_name} Version: %{release_version} -Release: 3.1%{?dist} +Release: 0%{?dist} Summary: Libsmbios C shared libraries -License: GPL-2.0+ or OSL-2.1 +License: GPL-2.0-or-later OR OSL-2.1 Group: System/Libraries -Source: libsmbios-%{version}.tar.bz2 +Source: libsmbios-%{version}.tar.xz Source1: libsmbios.rpmlintrc Url: http://github.com/dell/libsmbios BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: gettext-devel +BuildRequires: libtool BuildRequires: python-rpm-macros -BuildRequires: strace libxml2-devel gcc-c++ gettext doxygen %{valgrind_BR} %{cppunit_BR} %{pkgconfig_BR} %{pythons} +BuildRequires: strace libxml2-devel gcc-c++ gettext doxygen help2man %{valgrind_BR} %{pkgconfig_BR} %{python_devel_BR} # uncomment for official fedora Obsoletes: libsmbios-libs < 2.0.0 Provides: libsmbios-libs = 0:%{version}-%{release} Obsoletes: %{other_name} < 0:%{version}-%{release} - Provides: %{other_name} = 0:%{version}-%{release} # libsmbios only ever makes sense on intel compatible arches @@ -123,7 +86,7 @@ Provides: %{other_name} = 0:%{version}-%{release} ExclusiveArch: x86_64 ia64 %{ix86} %description -This package 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. This package provides the C-based libsmbios library, with a C interface. @@ -132,7 +95,7 @@ This package provides the C-based libsmbios library, with a C interface. Summary: Python interface to Libsmbios C library Group: System/Libraries Requires: %{release_name} = %{version}-%{release} -Requires: python %{ctypes_BR} +Requires: python3 %description -n python-smbios This package provides a Python interface to libsmbios @@ -202,7 +165,7 @@ programs against libsmbios. %setup -q -n libsmbios-%{version} find . -type d -exec chmod -f 755 {} \; find doc src -type f -exec chmod -f 644 {} \; -find ./src/cppunit/ -name "*.sh" -type f -exec chmod 755 '{}' \; +find ./src/pyunit/ -name "*.sh" -o -name "*.py" -type f -exec chmod 755 '{}' \; %build # this line lets us build an RPM directly from a git tarball @@ -218,7 +181,7 @@ chmod +x ./configure %{?!as_needed:--disable-as-needed} %{?!build_python:--disable-python} mkdir -p out/libsmbios_c -make CFLAGS="-Werror" %{?_smp_mflags} OPT="$RPM_OPT_FLAGS" 2>&1 | tee build-%{_arch}.log +make CFLAGS="-Werror %{optflags}" %{?_smp_mflags} 2>&1 | tee build-%{_arch}.log echo \%doc _build/build-%{_arch}.log > buildlogs.txt @@ -236,22 +199,9 @@ runtest() { %endif } -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 +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 %install rm -rf %{buildroot} @@ -264,7 +214,7 @@ mkdir -p %{buildroot}/%{_includedir} mkdir -p %{buildroot}/%{_bindir} 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}/libsmbios*.*a find %{buildroot}/%{_includedir} out/libsmbios_c -exec touch -r $TOPDIR/configure.ac {} \; mv out/libsmbios_c out/libsmbios_c-%{_arch} @@ -285,10 +235,9 @@ ln -s smbios-sys-info %{buildroot}/%{_sbindir}/getSystemId ln -s smbios-wireless-ctl %{buildroot}/%{_sbindir}/dellWirelessCtl ln -s smbios-lcd-brightness %{buildroot}/%{_sbindir}/dellLcdBrightness -%python_expand sitelib=%{$python_sitelib} cat > files-python-smbios <<-EOF %doc COPYING-GPL COPYING-OSL - $sitelib/* + %{python3_sitearch}/* EOF cat > files-smbios-utils-python <<-EOF @@ -308,6 +257,9 @@ cat > files-smbios-utils-python <<-EOF %{_sbindir}/smbios-thermal-ctl %{_sbindir}/smbios-battery-ctl + # man pages + %{_mandir}/man1/smbios* + # used by HAL in old location, so keep it around until HAL is updated. %{_sbindir}/dellLcdBrightness %{_sbindir}/getSystemId From 5e821c3c675bc507f120fba227aa81a93c2df7d2c4266df2198b73d0daf90d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20M=C3=B6llers?= Date: Wed, 4 Apr 2018 13:52:45 +0000 Subject: [PATCH 2/2] Accepting request 593551 from home:jengelh:branches:Base:System - Update shared library packaging to meet guideline. - Use find's -exec + strategy. - Escape all % signs to %% where needed. OBS-URL: https://build.opensuse.org/request/show/593551 OBS-URL: https://build.opensuse.org/package/show/Base:System/libsmbios?expand=0&rev=37 --- libsmbios.changes | 8 ++++ libsmbios.spec | 110 +++++++++++++++++++++++++++------------------- 2 files changed, 72 insertions(+), 46 deletions(-) diff --git a/libsmbios.changes b/libsmbios.changes index a33326d..4cb5c2f 100644 --- a/libsmbios.changes +++ b/libsmbios.changes @@ -1,9 +1,17 @@ +------------------------------------------------------------------- +Mon Mar 26 11:18:52 UTC 2018 - jengelh@inai.de + +- Update shared library packaging to meet guideline. +- Use find's -exec + strategy. +- Escape all % signs to %% where needed. + ------------------------------------------------------------------- Thu Mar 22 19:45:36 UTC 2018 - antoine.belvire@opensuse.org - Update to 2.4.1: * Minor fixes submitted for help2man improvements and a signed comparison. + * Fix a crash when used by fwupd [boo#1086732] - Changes in 2.4.0: * Convert all python2 -> python3. * Drop libsmbios C++ library. diff --git a/libsmbios.spec b/libsmbios.spec index 64ea6f6..c883a97 100644 --- a/libsmbios.spec +++ b/libsmbios.spec @@ -28,7 +28,7 @@ %define release_name libsmbios %define other_name libsmbios2 %if 0%{?suse_version} -%define release_name libsmbios2 +%define release_name libsmbios_c2 %define other_name libsmbios %endif @@ -59,12 +59,12 @@ # if unit tests are disabled, get rid of a few BuildRequires %{!?run_unit_tests: %global valgrind_BR %{nil}} -Name: %{release_name} +Name: libsmbios Version: %{release_version} Release: 0%{?dist} -Summary: Libsmbios C shared libraries +Summary: SMBIOS table library and utilities License: GPL-2.0-or-later OR OSL-2.1 -Group: System/Libraries +Group: Hardware/Other Source: libsmbios-%{version}.tar.xz Source1: libsmbios.rpmlintrc Url: http://github.com/dell/libsmbios @@ -86,10 +86,33 @@ Provides: %{other_name} = 0:%{version}-%{release} ExclusiveArch: x86_64 ia64 %{ix86} %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. +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-based libsmbios library, with a C interface. +%package lang +Summary: Translations for package libsmbios +Group: System/Localization + +%description lang +Provides translations for the "libsmbios" package. + +%package -n %{release_name} +Summary: SMBIOS table interface library +# Leap 42.X +Group: System/Libraries +Provides: libsmbios = %{version} +Obsoletes: libsmbios < %{version} +# Short-time Factory package containing libsmbios_c2 +Provides: libsmbios2 = %{version} +Obsoletes: libsmbios2 < %{version} + +%description -n %{release_name} +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 python-smbios Summary: Python interface to Libsmbios C library @@ -163,9 +186,9 @@ programs against libsmbios. : '########################################' : '########################################' %setup -q -n libsmbios-%{version} -find . -type d -exec chmod -f 755 {} \; -find doc src -type f -exec chmod -f 644 {} \; -find ./src/pyunit/ -name "*.sh" -o -name "*.py" -type f -exec chmod 755 '{}' \; +find . -type d -exec chmod -f a+rx "{}" "+" +find doc src -type f -exec chmod -f a-x "{}" "+" +find src/pyunit/ -name "*.sh" -o -name "*.py" -type f -exec chmod a+x "{}" "+" %build # this line lets us build an RPM directly from a git tarball @@ -174,16 +197,14 @@ find ./src/pyunit/ -name "*.sh" -o -name "*.py" -type f -exec chmod 755 '{}' \; mkdir _build cd _build -echo '../configure "$@"' > configure -chmod +x ./configure - +%define _configure ../configure %configure \ %{?!as_needed:--disable-as-needed} %{?!build_python:--disable-python} mkdir -p out/libsmbios_c make CFLAGS="-Werror %{optflags}" %{?_smp_mflags} 2>&1 | tee build-%{_arch}.log -echo \%doc _build/build-%{_arch}.log > buildlogs.txt +echo '%%doc _build/build-%{_arch}.log' > buildlogs.txt %check runtest() { @@ -195,7 +216,7 @@ runtest() { touch -r ../configure.ac $1$2-%{_arch}.log make -e $1 2>&1 | tee $1$2.log popd - echo \%doc _$1$2/$1$2-%{_arch}.log >> _build/buildlogs.txt + echo "%%doc _$1$2/$1$2-%{_arch}.log" >> _build/buildlogs.txt %endif } @@ -204,25 +225,22 @@ runtest valgrind > /dev/null || echo FAILED valgrind check runtest check > /dev/null || echo FAILED check %install -rm -rf %{buildroot} -mkdir %{buildroot} - cd _build TOPDIR=.. -make install DESTDIR=%{buildroot} INSTALL="%{__install} -p" +%make_install 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}/ rm -f %{buildroot}/%{_libdir}/libsmbios*.*a -find %{buildroot}/%{_includedir} out/libsmbios_c -exec touch -r $TOPDIR/configure.ac {} \; +find %{buildroot}/%{_includedir} out/libsmbios_c -exec touch -r $TOPDIR/configure.ac "{}" "+" 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} -find %{buildroot} -name '*-1.pyc' -exec rm {} \; +find %{buildroot} -name '*-1.pyc' -delete touch files-smbios-utils-python touch files-python-smbios @@ -236,52 +254,52 @@ ln -s smbios-wireless-ctl %{buildroot}/%{_sbindir}/dellWirelessCtl ln -s smbios-lcd-brightness %{buildroot}/%{_sbindir}/dellLcdBrightness cat > files-python-smbios <<-EOF - %doc COPYING-GPL COPYING-OSL - %{python3_sitearch}/* + %%doc COPYING-GPL COPYING-OSL + %%{python3_sitearch}/* EOF cat > files-smbios-utils-python <<-EOF - %doc COPYING-GPL COPYING-OSL - %doc src/bin/getopts_LICENSE.txt - %dir %{_sysconfdir}/libsmbios - %config(noreplace) %{_sysconfdir}/libsmbios/* + %%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 + %%{_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 # man pages - %{_mandir}/man1/smbios* + %%{_mandir}/man1/smbios* # used by HAL in old location, so keep it around until HAL is updated. - %{_sbindir}/dellLcdBrightness - %{_sbindir}/getSystemId - %{_sbindir}/dellWirelessCtl - %{_bindir}/dellWirelessCtl + %%{_sbindir}/dellLcdBrightness + %%{_sbindir}/getSystemId + %%{_sbindir}/dellWirelessCtl + %%{_bindir}/dellWirelessCtl # data files - %{_datadir}/smbios-utils + %%{_datadir}/smbios-utils EOF %endif -%clean -rm -rf %{buildroot} - %post -n %{release_name} -p /sbin/ldconfig %postun -n %{release_name} -p /sbin/ldconfig -%files -f _build/%{lang_dom}.lang +%files -n %{release_name} %defattr(-,root,root,-) %{_libdir}/libsmbios_c.so.* +%files lang -f _build/%{lang_dom}.lang +%defattr(-,root,root,-) + %files -n libsmbios-devel -f _build/buildlogs.txt %defattr(-,root,root,-) %doc COPYING-GPL COPYING-OSL src/bin/getopts_LICENSE.txt