Hello.

Please remove
Provides: bamtools-devel = %{version}
and add read https://en.opensuse.org/openSUSE:Packaging_scriptlet_snippets#Shared_libraries


пн, 17 мая 2021, 23:16 карыстальнік Vojtěch Zeisek <vojtech.zeisek@opensuse.org> напісаў:
Hi,
this is probably very basic problem, but I'm sorry, I'm bit lost...

I have spec file like

Name:           bamtools
Version:        2.5.1
Release:        0
Summary:        C++ API & command-line toolkit for working with BAM data
License:        MIT
Group:          Productivity/Scientific/Other
URL:            https://github.com/pezmaster31/bamtools/wiki
Source:         https://github.com/pezmaster31/bamtools/archive/refs/tags/v%{version}.tar.gz#/bamtools-%{version}.tar.gz
BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  zlib-devel

%description
BamTools is a project that provides both a C++ API and a command-line toolkit for reading, writing, and manipulating BAM (genome alignment) files.

%package devel
Summary:        Developmental files for bamtools
Requires:       bamtools = %{version}
Provides:       bamtools-devel = %{version}
Obsoletes:      bamtools-devel < %{version}

%description devel
Developmental files for BamTools, s a project that provides both a C++ API and a command-line toolkit for reading, writing, and manipulating BAM (genome alignment) files.

%prep
%setup -q

%build
%cmake -DBUILD_SHARED_LIBS=ON

%install
%cmake_install DESTDIR=%{buildroot}

%check
%ctest

%post -n bamtools-devel -p /sbin/ldconfig
%postun -n bamtools-devel -p /sbin/ldconfig

%files devel
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc

%files
%license LICENSE
%{_bindir}/*
%{_libdir}/*so.*

%changelog

and it does produce bamtools RPM looking fine (providing working bamtools binary), but I also get several warnings from 'osc build --local-package'

[   77s] RPMLINT report:
[   77s] ===============
[   78s] bamtools.x86_64: W: library-without-ldconfig-postin /usr/lib64/libbamtools.so.2.5.1
[   78s] This package contains a library and provides no %post scriptlet containing a
[   78s] call to ldconfig.
[   78s]
[   78s] bamtools.x86_64: W: library-without-ldconfig-postun /usr/lib64/libbamtools.so.2.5.1
[   78s] This package contains a library and provides no %postun scriptlet containing a
[   78s] call to ldconfig.
[   78s]
[   78s] bamtools.x86_64: W: shared-lib-calls-exit /usr/lib64/libbamtools.so.2.5.1 exit@GLIBC_2.2.5
[   78s] This library package calls exit() or _exit(), probably in a non-fork()
[   78s] context. Doing so from a library is strongly discouraged - when a library
[   78s] function calls exit(), it prevents the calling program from handling the
[   78s] error, reporting it to the user, closing files properly, and cleaning up any
[   78s] state that the program has. It is preferred for the library to return an
[   78s] actual error code and let the calling program decide how to handle the
[   78s] situation.
[   78s]
[   78s] bamtools-devel.x86_64: W: useless-provides bamtools-devel
[   78s] This package provides 2 times the same capacity. It should only provide it
[   78s] once.
[   78s]
[   78s] 3 packages and 0 specfiles checked; 0 errors, 4 warnings.

Could anyone, please, point me to the way to fix the above warnings to make rpmlint happy? I'm probably missing how to split the source package into appropriate binary packages. I hope the spec source shows I tried to find the way myself, but failed. :-)

--
Vojtěch Zeisek
https://trapa.cz/

Komunita openSUSE GNU/Linuxu
Community of the openSUSE GNU/Linux
https://www.opensuse.org/