From d413f363f4c12393ba8cecab6ea1f109e891f827 Mon Sep 17 00:00:00 2001 From: DengXiewei Date: Sat, 15 Apr 2023 12:03:11 +0800 Subject: [PATCH 1/2] optimise spec Signed-off-by: DengXiewei --- libsmbios.spec | 67 +++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/libsmbios.spec b/libsmbios.spec index dd46646..7ed3d02 100644 --- a/libsmbios.spec +++ b/libsmbios.spec @@ -1,4 +1,4 @@ -%define anolis_release 2 +%define anolis_release 3 # these are all substituted by autoconf %define pot_file libsmbios @@ -11,23 +11,12 @@ 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 +Source0: %{url}/archive/v%{version}/libsmbios-%{version}.tar.gz + +BuildRequires: make, gcc-c++, autoconf, automake, pkgconfig +BuildRequires: doxygen, help2man, libtool, strace, valgrind +BuildRequires: gettext, gettext-devel +BuildRequires: cppunit-devel, libxml2-devel, python3-devel # libsmbios only ever makes sense on intel compatible arches ExclusiveArch: x86_64 @@ -45,6 +34,9 @@ Requires: python3 Obsoletes: python-smbios < 2.4.1 %description -n python3-smbios +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 a Python interface to libsmbios %package -n smbios-utils @@ -53,6 +45,9 @@ Requires: smbios-utils-bin Requires: smbios-utils-python %description -n smbios-utils +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 is a meta-package that pulls in the binary libsmbios executables as well as the python executables. @@ -61,6 +56,9 @@ Summary: Binary utilities that use libsmbios Requires: libsmbios = %{version}-%{release} %description -n smbios-utils-bin +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. + Get BIOS information, such as System product name, product id, service tag and asset tag. @@ -69,6 +67,9 @@ Summary: Python executables that use libsmbios Requires: python3-smbios = %{version}-%{release} %description -n smbios-utils-python +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. + 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. @@ -88,35 +89,32 @@ programs against libsmbios. %prep %autosetup -p1 -find . -type d -exec chmod -f 755 {} \; -find doc src -type f -exec chmod -f 644 {} \; +find . -type d -print -exec chmod -f 755 {} \; +find doc src -type f -print -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 +echo '../configure "$@"' > _build/configure +chmod +x _build/configure +%build +PACKAGE_VERSION=%{version} ./autogen.sh --no-configure +cd _build %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 +echo \%doc _build/build-%{_arch}.log | tee 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 + ../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 } @@ -215,6 +213,9 @@ rename %{pot_file}.mo %{lang_dom}.mo $(find %{buildroot}/%{_datadir} -name %{pot %{_datadir}/smbios-utils %changelog +* Sat Apr 15 2023 DengXiewei - 2.4.3-3 +- optimise spec + * Thu Oct 20 2022 mgb01105731 - 2.4.3-2 - optimise spec file -- Gitee From 6b0bf267653079e904c80e954889d07263adcee5 Mon Sep 17 00:00:00 2001 From: DengXiewei Date: Mon, 17 Apr 2023 14:03:12 +0800 Subject: [PATCH 2/2] remove list files which not exists Signed-off-by: DengXiewei --- libsmbios.spec | 9 --------- 1 file changed, 9 deletions(-) diff --git a/libsmbios.spec b/libsmbios.spec index 7ed3d02..5940d7d 100644 --- a/libsmbios.spec +++ b/libsmbios.spec @@ -199,15 +199,6 @@ rename %{pot_file}.mo %{lang_dom}.mo $(find %{buildroot}/%{_datadir} -name %{pot %{_mandir}/man?/smbios-keyboard-ctl.* %{_sbindir}/smbios-thermal-ctl %{_mandir}/man?/smbios-thermal-ctl.* -%{abidir}/smbios-battery-ctl-option.list -%{abidir}/smbios-sys-info-option.list -%{abidir}/smbios-token-ctl-option.list -%{abidir}/smbios-passwd-option.list -%{abidir}/smbios-wakeup-ctl-option.list -%{abidir}/smbios-wireless-ctl-option.list -%{abidir}/smbios-lcd-brightness-option.list -%{abidir}/smbios-keyboard-ctl-option.list -%{abidir}/smbios-thermal-ctl-option.list # data files %{_datadir}/smbios-utils -- Gitee