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
This commit is contained in:
Josef Möllers 2018-04-04 13:52:45 +00:00 committed by Git OBS Bridge
parent 605bd51462
commit 5e821c3c67
2 changed files with 72 additions and 46 deletions

View File

@ -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 Thu Mar 22 19:45:36 UTC 2018 - antoine.belvire@opensuse.org
- Update to 2.4.1: - Update to 2.4.1:
* Minor fixes submitted for help2man improvements and a signed * Minor fixes submitted for help2man improvements and a signed
comparison. comparison.
* Fix a crash when used by fwupd [boo#1086732]
- Changes in 2.4.0: - Changes in 2.4.0:
* Convert all python2 -> python3. * Convert all python2 -> python3.
* Drop libsmbios C++ library. * Drop libsmbios C++ library.

View File

@ -28,7 +28,7 @@
%define release_name libsmbios %define release_name libsmbios
%define other_name libsmbios2 %define other_name libsmbios2
%if 0%{?suse_version} %if 0%{?suse_version}
%define release_name libsmbios2 %define release_name libsmbios_c2
%define other_name libsmbios %define other_name libsmbios
%endif %endif
@ -59,12 +59,12 @@
# if unit tests are disabled, get rid of a few BuildRequires # if unit tests are disabled, get rid of a few BuildRequires
%{!?run_unit_tests: %global valgrind_BR %{nil}} %{!?run_unit_tests: %global valgrind_BR %{nil}}
Name: %{release_name} Name: libsmbios
Version: %{release_version} Version: %{release_version}
Release: 0%{?dist} Release: 0%{?dist}
Summary: Libsmbios C shared libraries Summary: SMBIOS table library and utilities
License: GPL-2.0-or-later OR OSL-2.1 License: GPL-2.0-or-later OR OSL-2.1
Group: System/Libraries Group: Hardware/Other
Source: libsmbios-%{version}.tar.xz Source: libsmbios-%{version}.tar.xz
Source1: libsmbios.rpmlintrc Source1: libsmbios.rpmlintrc
Url: http://github.com/dell/libsmbios Url: http://github.com/dell/libsmbios
@ -86,10 +86,33 @@ Provides: %{other_name} = 0:%{version}-%{release}
ExclusiveArch: x86_64 ia64 %{ix86} ExclusiveArch: x86_64 ia64 %{ix86}
%description %description
Libsmbios is a library and utilities that can be used by client programs to get libsmbios provides a library to interface with the SMBIOS tables. It
information from standard BIOS tables, such as the SMBIOS table. 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 %package -n python-smbios
Summary: Python interface to Libsmbios C library Summary: Python interface to Libsmbios C library
@ -163,9 +186,9 @@ programs against libsmbios.
: '########################################' : '########################################'
: '########################################' : '########################################'
%setup -q -n libsmbios-%{version} %setup -q -n libsmbios-%{version}
find . -type d -exec chmod -f 755 {} \; find . -type d -exec chmod -f a+rx "{}" "+"
find doc src -type f -exec chmod -f 644 {} \; find doc src -type f -exec chmod -f a-x "{}" "+"
find ./src/pyunit/ -name "*.sh" -o -name "*.py" -type f -exec chmod 755 '{}' \; find src/pyunit/ -name "*.sh" -o -name "*.py" -type f -exec chmod a+x "{}" "+"
%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
@ -174,16 +197,14 @@ find ./src/pyunit/ -name "*.sh" -o -name "*.py" -type f -exec chmod 755 '{}' \;
mkdir _build mkdir _build
cd _build cd _build
echo '../configure "$@"' > configure %define _configure ../configure
chmod +x ./configure
%configure \ %configure \
%{?!as_needed:--disable-as-needed} %{?!build_python:--disable-python} %{?!as_needed:--disable-as-needed} %{?!build_python:--disable-python}
mkdir -p out/libsmbios_c mkdir -p out/libsmbios_c
make CFLAGS="-Werror %{optflags}" %{?_smp_mflags} 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 echo '%%doc _build/build-%{_arch}.log' > buildlogs.txt
%check %check
runtest() { runtest() {
@ -195,7 +216,7 @@ runtest() {
touch -r ../configure.ac $1$2-%{_arch}.log touch -r ../configure.ac $1$2-%{_arch}.log
make -e $1 2>&1 | tee $1$2.log make -e $1 2>&1 | tee $1$2.log
popd popd
echo \%doc _$1$2/$1$2-%{_arch}.log >> _build/buildlogs.txt echo "%%doc _$1$2/$1$2-%{_arch}.log" >> _build/buildlogs.txt
%endif %endif
} }
@ -204,25 +225,22 @@ runtest valgrind > /dev/null || echo FAILED valgrind check
runtest check > /dev/null || echo FAILED check runtest check > /dev/null || echo FAILED check
%install %install
rm -rf %{buildroot}
mkdir %{buildroot}
cd _build cd _build
TOPDIR=.. TOPDIR=..
make install DESTDIR=%{buildroot} INSTALL="%{__install} -p" %make_install INSTALL="install -p"
mkdir -p %{buildroot}/%{_includedir} mkdir -p %{buildroot}/%{_includedir}
mkdir -p %{buildroot}/%{_bindir} mkdir -p %{buildroot}/%{_bindir}
cp -a $TOPDIR/src/include/* %{buildroot}/%{_includedir}/ cp -a $TOPDIR/src/include/* %{buildroot}/%{_includedir}/
cp -a out/public-include/* %{buildroot}/%{_includedir}/ cp -a out/public-include/* %{buildroot}/%{_includedir}/
rm -f %{buildroot}/%{_libdir}/libsmbios*.*a 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} mv out/libsmbios_c out/libsmbios_c-%{_arch}
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}
find %{buildroot} -name '*-1.pyc' -exec rm {} \; find %{buildroot} -name '*-1.pyc' -delete
touch files-smbios-utils-python touch files-smbios-utils-python
touch files-python-smbios touch files-python-smbios
@ -236,52 +254,52 @@ ln -s smbios-wireless-ctl %{buildroot}/%{_sbindir}/dellWirelessCtl
ln -s smbios-lcd-brightness %{buildroot}/%{_sbindir}/dellLcdBrightness ln -s smbios-lcd-brightness %{buildroot}/%{_sbindir}/dellLcdBrightness
cat > files-python-smbios <<-EOF cat > files-python-smbios <<-EOF
%doc COPYING-GPL COPYING-OSL %%doc COPYING-GPL COPYING-OSL
%{python3_sitearch}/* %%{python3_sitearch}/*
EOF EOF
cat > files-smbios-utils-python <<-EOF cat > files-smbios-utils-python <<-EOF
%doc COPYING-GPL COPYING-OSL %%doc COPYING-GPL COPYING-OSL
%doc src/bin/getopts_LICENSE.txt %%doc src/bin/getopts_LICENSE.txt
%dir %{_sysconfdir}/libsmbios %%dir %%{_sysconfdir}/libsmbios
%config(noreplace) %{_sysconfdir}/libsmbios/* %%config(noreplace) %%{_sysconfdir}/libsmbios/*
# python utilities # python utilities
%{_sbindir}/smbios-sys-info %%{_sbindir}/smbios-sys-info
%{_sbindir}/smbios-token-ctl %%{_sbindir}/smbios-token-ctl
%{_sbindir}/smbios-passwd %%{_sbindir}/smbios-passwd
%{_sbindir}/smbios-wakeup-ctl %%{_sbindir}/smbios-wakeup-ctl
%{_sbindir}/smbios-wireless-ctl %%{_sbindir}/smbios-wireless-ctl
%{_sbindir}/smbios-lcd-brightness %%{_sbindir}/smbios-lcd-brightness
%{_sbindir}/smbios-keyboard-ctl %%{_sbindir}/smbios-keyboard-ctl
%{_sbindir}/smbios-thermal-ctl %%{_sbindir}/smbios-thermal-ctl
%{_sbindir}/smbios-battery-ctl %%{_sbindir}/smbios-battery-ctl
# man pages # man pages
%{_mandir}/man1/smbios* %%{_mandir}/man1/smbios*
# used by HAL in old location, so keep it around until HAL is updated. # used by HAL in old location, so keep it around until HAL is updated.
%{_sbindir}/dellLcdBrightness %%{_sbindir}/dellLcdBrightness
%{_sbindir}/getSystemId %%{_sbindir}/getSystemId
%{_sbindir}/dellWirelessCtl %%{_sbindir}/dellWirelessCtl
%{_bindir}/dellWirelessCtl %%{_bindir}/dellWirelessCtl
# data files # data files
%{_datadir}/smbios-utils %%{_datadir}/smbios-utils
EOF EOF
%endif %endif
%clean
rm -rf %{buildroot}
%post -n %{release_name} -p /sbin/ldconfig %post -n %{release_name} -p /sbin/ldconfig
%postun -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,-) %defattr(-,root,root,-)
%{_libdir}/libsmbios_c.so.* %{_libdir}/libsmbios_c.so.*
%files lang -f _build/%{lang_dom}.lang
%defattr(-,root,root,-)
%files -n libsmbios-devel -f _build/buildlogs.txt %files -n libsmbios-devel -f _build/buildlogs.txt
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc COPYING-GPL COPYING-OSL src/bin/getopts_LICENSE.txt %doc COPYING-GPL COPYING-OSL src/bin/getopts_LICENSE.txt