diff --git a/libsmbios-2.4.3.tar.gz b/libsmbios-2.4.3.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..13b0f1aeaa401649eda522533a29365aae366b92 Binary files /dev/null and b/libsmbios-2.4.3.tar.gz differ diff --git a/libsmbios.spec b/libsmbios.spec new file mode 100644 index 0000000000000000000000000000000000000000..0ab96d1f6b2016f21049a125ead6f143ef9ee0e1 --- /dev/null +++ b/libsmbios.spec @@ -0,0 +1,203 @@ +%define anolis_release 1 + +# these are all substituted by autoconf +%define pot_file libsmbios +%define lang_dom libsmbios-2.4 + +Name: libsmbios +Version: 2.4.3 +Release: %{anolis_release}%{?dist} +Summary: Libsmbios C/C++ shared libraries + +License: GPLv2+ or OSL 2.1 +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 + +# libsmbios only ever makes sense on intel compatible arches +ExclusiveArch: x86_64 + +%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. + +This package provides the C-based libsmbios library, with a C interface. + +%package -n python3-smbios +Summary: Python interface to Libsmbios C library +Requires: libsmbios = %{version}-%{release} +Requires: python3 +Obsoletes: python-smbios < 2.4.1 + +%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 +Requires: smbios-utils-bin +Requires: smbios-utils-python + +%description -n smbios-utils +This is a meta-package that pulls in the binary libsmbios executables as well +as the python executables. + +%package -n smbios-utils-bin +Summary: Binary utilities that use libsmbios +Requires: libsmbios = %{version}-%{release} + +%description -n smbios-utils-bin +Get BIOS information, such as System product name, product id, service tag and +asset tag. + +%package -n smbios-utils-python +Summary: Python executables that use libsmbios +Requires: python3-smbios = %{version}-%{release} + +%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. + +%package -n libsmbios-devel +Summary: Development headers and archives +Requires: libsmbios = %{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. + +%prep +%autosetup -p1 + +find . -type d -exec chmod -f 755 {} \; +find doc src -type f -exec chmod -f 644 {} \; +chmod 755 src/cppunit/*.sh + +%build +# this line lets us build an RPM directly from a git tarball +# and retains any customized version information we might have +[ -e ./configure ] || PACKAGE_VERSION=%{version} ./autogen.sh --no-configure + +mkdir _build +cd _build +echo '../configure "$@"' > configure +chmod +x ./configure + +%configure + +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 + +%check +runtest() { + mkdir _$1$2 + pushd _$1$2 + ../configure + 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 + popd + 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 + +%install +cd _build +TOPDIR=.. +%make_install +rm -f %{buildroot}/%{_libdir}/lib*.{la,a} +find %{buildroot}/%{_includedir} out/libsmbios_c -exec touch -r $TOPDIR/configure.ac {} \; + +mv out/libsmbios_c out/libsmbios_c-%{_arch} + +%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 + +%files -f _build/%{lang_dom}.lang +# Only need to include license once here +%license COPYING-GPL COPYING-OSL +%{_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} +%{_includedir}/smbios_c +%{_libdir}/libsmbios_c.so +%{_libdir}/pkgconfig/*.pc + +%files -n smbios-utils + +%files -n smbios-utils-bin +%license 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 +%{python3_sitearch}/* + +%files -n smbios-utils-python +%license 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.* + +# data files +%{_datadir}/smbios-utils + +%changelog +* Wed Mar 09 2022 Hongwei Qin - 2.4.3-1 +- Update to 2.4.3 +- Init for Anolis OS 23