From 917ebde91bd3c18ff2ba30b112d029bb2d8fb33a Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 14 Feb 2018 15:08:13 -0500 Subject: [PATCH] Update for libsmbios 2.4.1 Signed-off-by: Peter Jones --- .gitignore | 10 +- libsmbios.spec | 348 +++++++++++++++---------------------------------- sources | 2 +- 3 files changed, 110 insertions(+), 250 deletions(-) diff --git a/.gitignore b/.gitignore index 2620a76..4c48885 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ -libsmbios-2.2.26.tar.bz2 -/libsmbios-2.2.28.tar.bz2 -/libsmbios-2.3.0.tar.bz2 -/libsmbios-2.3.3.tar.gz +.build*.log +libsmbios-*.tar.* +libsmbios-*/ +*.rpm +.*.sw? +*~ diff --git a/libsmbios.spec b/libsmbios.spec index 00a54ed..b4e186a 100644 --- a/libsmbios.spec +++ b/libsmbios.spec @@ -1,125 +1,24 @@ -# pkg/libsmbios.spec. Generated from libsmbios.spec.in by configure. -# required by suse build system -# norootforbuild - # these are all substituted by autoconf -%define major 2 -%define minor 3 -%define micro 3 -%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 -%define release_name libsmbios -%define other_name libsmbios2 -%if 0%{?suse_version} -%define release_name libsmbios2 -%define other_name libsmbios -%endif - -%{!?build_python: %global build_python 1} -%{?_with_python: %global build_python 1} -%{?_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} -%{?_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} - -# some distros already have fdupes macro. If not, we just set it to something innocuous -%{?!fdupes: %global fdupes /usr/sbin/hardlink -c -v} - -%global cppunit_BR cppunit-devel -%global pkgconfig_BR pkgconfig -%global ctypes_BR python-ctypes -%global fdupes_BR hardlink -%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 - %global 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 :( - %global ctypes_BR %{nil} -%endif -%if 0%{?suse_version} > 1020 - %global fdupes_BR fdupes -%else - %global fdupes_BR %{nil} - %global fdupes echo fdupes disabled -%endif -%endif - -# rhel (should work on OBS and EPEL) -%if 0%{?rhel} -%if 0%{?rhel} < 5 - %global fdupes echo fdupes disabled - %global fdupes_BR %{nil} -%endif -%if 0%{?rhel} < 4 - # dont yet have rhel3 valgrind - %global valgrind_BR %{nil} - # no python-ctypes for python <= 2.2 - %undefine build_python - # rhel3 doesnt have -as-needed - %undefine as_needed -%endif -%endif - -%global python_devel_BR %{nil} -%if 0%{?build_python} - %global python_devel_BR python-devel - # 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))")} - -%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%{?dist} +Name: libsmbios +Version: 2.4.1 +Release: 1%{?dist} License: GPLv2+ or OSL 2.1 Summary: Libsmbios C/C++ shared libraries Group: System Environment/Libraries -Source: https://github.com/dell/libsmbios/archive/v%{version}/libsmbios-%{version}.tar.gz -URL: http://linux.dell.com/libsmbios/main +URL: https://github.com/dell/libsmbios Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: autoconf -BuildRequires: automake -BuildRequires: gettext-devel -BuildRequires: libtool -BuildRequires: strace libxml2-devel gcc-c++ gettext doxygen %{valgrind_BR} %{cppunit_BR} %{fdupes_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} +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 ia64 %{ix86} +ExclusiveArch: x86_64 %{ix86} + +Source0: https://github.com/dell/libsmbios/archive/v%{version}/libsmbios-%{version}.tar.gz %description Libsmbios is a library and utilities that can be used by client programs to get @@ -127,31 +26,21 @@ information from standard BIOS tables, such as the SMBIOS table. This package provides the C-based libsmbios library, with a C interface. -This package also has a C++-based library, with a C++ interface. It is not -actively maintained, but provided for backwards compatibility. New programs -should use the libsmbios C interface. - - -%package -n python-smbios +%package -n python3-smbios Summary: Python interface to Libsmbios C library Group: System Environment/Libraries -Requires: %{release_name} = 0:%{version}-%{release} -Requires: python +Requires: libsmbios = %{version}-%{release} +Requires: python3 +Obsoletes: python-smbios < 2.4.1 -%description -n python-smbios +%description -n python3-smbios 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 -%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 @@ -160,7 +49,7 @@ as the python executables. %package -n smbios-utils-bin Summary: Binary utilities that use libsmbios Group: Applications/System -Requires: %{release_name} = 0:%{version}-%{release} +Requires: libsmbios = %{version}-%{release} %description -n smbios-utils-bin Get BIOS information, such as System product name, product id, service tag and @@ -169,7 +58,7 @@ asset tag. %package -n smbios-utils-python Summary: Python executables that use libsmbios Group: Applications/System -Requires: python-smbios = %{version}-%{release} +Requires: python3-smbios = %{version}-%{release} %description -n smbios-utils-python Get BIOS information, such as System product name, product id, service tag and @@ -181,9 +70,7 @@ 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 -Requires: %{release_name} = 0:%{version}-%{release} -Provides: libsmbios2-devel = %{version}-%{release} -Obsoletes: libsmbios2-devel < %{version}-%{release} +Requires: libsmbios = %{version}-%{release} %description -n libsmbios-devel Libsmbios is a library and utilities that can be used by client programs to get @@ -192,60 +79,61 @@ 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. -%package -n yum-dellsysid -Summary: YUM plugin to retrieve the Dell System ID -Group: Development/Tools -# yum plugin and supporting functions first appeared in 2.2.0 -Requires: smbios-utils-python >= 2.2.0 - -%description -n yum-dellsysid -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 a YUM plugin which allows the use of certain -substitutions in yum repository configuration files on Dell systems. - - %prep -: '########################################' -: '########################################' -: '#' -: '# build_python: %{?build_python}' -: '# run_unit_tests: %{?run_unit_tests}' -: '# rhel: %{?rhel}' -: '# 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 {} \; -find ./src/cppunit/ -name "*.sh" -type f -exec chmod 755 '{}' \; +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} configure chmod +x ./configure -%configure \ - %{?!as_needed:--disable-as-needed} %{?!build_python:--disable-python} \ - --enable-libsmbios_cxx +%configure mkdir -p out/libsmbios_c mkdir -p out/libsmbios_c++ -make CFLAGS="-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 +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 -%if 0%{?run_unit_tests} pushd _$1$2 ../configure make -e $1 CFLAGS="$CFLAGS -DDEBUG_OUTPUT_ALL" 2>&1 | tee $1$2.log @@ -253,7 +141,6 @@ runtest() { make -e $1 2>&1 | tee $1$2.log popd echo \%doc _$1$2/$1$2-%{_arch}.log >> _build/buildlogs.txt -%endif } if [ -d /usr/include/cppunit ]; then @@ -282,6 +169,9 @@ TOPDIR=.. 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} @@ -293,118 +183,86 @@ 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} -touch files-yum-dellsysid -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 - %doc COPYING-GPL COPYING-OSL - %{python_sitelib}/* -EOF - -cat > files-smbios-utils-python <<-EOF - %doc COPYING-GPL COPYING-OSL - %doc src/bin/getopts_LICENSE.txt src/include/smbios/config/boost_LICENSE_1_0_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 - - # used by HAL in old location, so keep it around until HAL is updated. - %{_sbindir}/dellLEDCtl - %{_sbindir}/dellLcdBrightness - %{_sbindir}/dellMediaDirectCtl - %{_sbindir}/getSystemId - %{_sbindir}/dellWirelessCtl - %{_bindir}/dellWirelessCtl - - # data files - %{_datadir}/smbios-utils -EOF - -cat > files-yum-dellsysid <<-EOF - %doc COPYING-GPL COPYING-OSL - # YUM Plugin - %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/* - %{_exec_prefix}/lib/yum-plugins/* - # SUSE build has anal directory ownership check. RPM which owns all dirs *must* - # be installed at buildtime. - %if 0%{?suse_version} >= 1100 - %dir %{_sysconfdir}/yum - %dir %{_sysconfdir}/yum/pluginconf.d/ - %dir %{_exec_prefix}/lib/yum-plugins/ - %endif -EOF -%endif - # hardlink files to save some space. -%fdupes $RPM_BUILD_ROOT +/usr/sbin/hardlink -c -v $RPM_BUILD_ROOT -%post -n %{release_name} -p /sbin/ldconfig -%postun -n %{release_name} -p /sbin/ldconfig +%clean +rm -rf %{buildroot} + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig %files -f _build/%{lang_dom}.lang %defattr(-,root,root,-) %{_libdir}/libsmbios_c.so.* -%{_libdir}/libsmbios.so.* %files -n libsmbios-devel -f _build/buildlogs.txt %defattr(-,root,root,-) -%doc COPYING-GPL COPYING-OSL src/bin/getopts_LICENSE.txt src/include/smbios/config/boost_LICENSE_1_0_txt +%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.so %{_libdir}/libsmbios_c.so %{_libdir}/pkgconfig/*.pc -%doc _build/out/libsmbios_c++-%{_arch} %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 +%doc COPYING-GPL COPYING-OSL README.md # no other files. %files -n smbios-utils-bin %defattr(-,root,root,-) -%doc COPYING-GPL COPYING-OSL -%doc src/bin/getopts_LICENSE.txt src/include/smbios/config/boost_LICENSE_1_0_txt - -# new C utilities +%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 +%{_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 +%defattr(-,root,root,-) +%doc COPYING-GPL COPYING-OSL README.md +%{python3_sitearch}/* + +%files -n smbios-utils-python +%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/* + +# 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.* -%files -n python-smbios -f _build/files-python-smbios -%defattr(-,root,root,-) - -%files -n smbios-utils-python -f _build/files-smbios-utils-python -%defattr(-,root,root,-) - -%files -n yum-dellsysid -f _build/files-yum-dellsysid -%defattr(-,root,root,-) +# data files +%{_datadir}/smbios-utils %changelog +* Wed Feb 14 2018 Peter Jones - 2.4.1-1 +- Update for libsmbios 2.4.1 + * Wed Feb 07 2018 Fedora Release Engineering - 2.3.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild diff --git a/sources b/sources index 9c0cf4d..e9317cf 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libsmbios-2.3.3.tar.gz) = d4ee556fc0b734827e1a0def9c9914e79130ce9f164f62a5aa752276772f9ed27874fd8a285b65e016f16f001cdfa23c7c9d228533bb8a03134db90b9cc4f96d +SHA512 (libsmbios-2.4.1.tar.gz) = dd71e45f8047480a669b70efebb9bdbbea4870f96437fc45eb4088fd66331d117b29a65c45cee2e5c4628d0536072a5939eb83f1905857a85bd0567b3d1c22fb