There is my spec file:
Name: BonsoleRTA-client-lib
Version: 0.0.4
Release: 0.0.4
Summary: This package providces a wrapper for BonsoleRTA backends
License: GPL-3.0-or-later
BuildRequires: cmake dbus-1-devel gcc-c++ webkit2gtk3-devel gtk3-devel dbus-1-devel gcc-c++ libxslt-devel
Requires: dbus-1
URL: https://sourceforge.net/projects/Bonsole
Source0: https://sourceforge.net/projects/bonsole/files/Sources/BonsoleRTA-GUI-client-%{version}.tar.gz
Provides: libBonsoleClient.so
%define short_name libBonsoleClient
%define library_name %{short_name}.so.%{version}
%description
BonsoleRTA-client-lib is library needed for BonsoleRTA applications to work properly
%prep
%setup -q
%build
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make BonsoleClient
make BonsoleHelper
%install
mkdir -p %{buildroot}/%{_libdir}
mkdir -p %{buildroot}/usr/share/Bonsole/xsl-views
cd build
cmake --install . --verbose --component ClientLib --prefix %{buildroot}/%{_prefix}
install -dm 0655 data/xslt %{buildroot}/usr/share/Bonsole/xsl-views
rm %{buildroot}/%{_prefix}/%{_lib}/libBonsoleHelper.so*
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%files
%{_libdir}/%{short_name}.so*
/usr/share/Bonsole
%changelog
* Thu Apr 22 2021 Sławomir Lach <slawek@lach.art.pl>
Problem is:
11s] RPMLINT report:
11s] ===============
12s] BonsoleRTA-client-lib.x86_64: W: shared-lib-calls-exit /usr/lib64/libBonsoleClient.so.0.0.4 exit@GLIBC_2.2.5
12s] This library package calls exit() or _exit(), probably in a non-fork()
12s] context. Doing so from a library is strongly discouraged - when a library
12s] function calls exit(), it prevents the calling program from handling the
12s] error, reporting it to the user, closing files properly, and cleaning up any
12s] state that the program has. It is preferred for the library to return an
12s] actual error code and let the calling program decide how to handle the
12s] situation.
12s]
12s] BonsoleRTA-client-lib.x86_64: E: devel-file-in-non-devel-package (Badness: 50) /usr/lib64/libBonsoleClient.so
12s] A file that is needed only e.g. when developing or building software is
12s] included in a non-devel package. These files should go in devel packages.
12s]
12s] BonsoleRTA-client-lib.x86_64: E: shlib-policy-name-error (Badness: 10000) libBonsoleClient0
12s] Your package contains a single shared library but is not named after its
12s] SONAME.
12s]
12s] (none): E: badness 10050 exceeds threshold 1000, aborting.
12s] 2 packages and 0 specfiles checked; 2 errors, 1 warnings.
12s]
12s]
12s] localhost.localdomain failed "build BonsoleRTA-client-lib.spec" at Fri Apr 30 16:15:10 UTC 2021.
12s]
The buildroot was: /var/tmp/build-root/openSUSE_Tumbleweed-x86_64
Problem appear, when I was trying to use cmake install instead of manually copy package name.
This is my CMakeList.txt file
cmake_minimum_required(VERSION 2.8.9)
project(Bonsole)
get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
if ("${LIB64}" STREQUAL "TRUE")
set(LIBSUFFIX 64)
else()
set(LIBSUFFIX "")
endif()
add_definitions( -DINSTALL_PATH="${INSTALL_PATH}" )
add_definitions( -DDATA_PATH="${CMAKE_INSTALL_FULL_DATADIR}/Bonsole/" )
add_definitions( -DLIB_PATH="${LIBDIR}/bonsole/" )
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0 webkit2gtk-4.0 )
pkg_check_modules(DBUS REQUIRED IMPORTED_TARGET dbus-1 )
pkg_check_modules(libxslt REQUIRED IMPORTED_TARGET libxslt)
file(GLOB BONSOLE_SRC Bonsole/*.c)
file(GLOB client_library lib/client_lib/*.c lib/client_lib/error_handling/*.c )
add_library( normal SHARED lib/bonsole-backends/normal.c )
target_link_libraries( normal PkgConfig::DBUS )
add_library( console SHARED lib/bonsole-backends/console.c )
add_library( BonsoleHelper SHARED helper/polling.c helper/polling.h )
target_link_libraries( BonsoleHelper PkgConfig::DBUS )
add_library( BonsoleClient SHARED ${client_library} )
target_link_libraries( BonsoleClient PkgConfig::libxslt )
add_executable( Bonsole ${BONSOLE_SRC} )
target_link_libraries( Bonsole PUBLIC PkgConfig::GTK PkgConfig::DBUS BonsoleHelper )
set_target_properties( BonsoleClient PROPERTIES SOVERSION 0 VERSION 0.0.4)
set_target_properties( Bonsole PROPERTIES VERSION 0.0.4)
set_target_properties( normal PROPERTIES SOVERSION 0 VERSION 0.0.4)
set_target_properties( BonsoleHelper PROPERTIES SOVERSION 0 VERSION 0.0.4)
set_target_properties( console PROPERTIES SOVERSION 0 VERSION 0.0.4)
INSTALL( TARGETS Bonsole RUNTIME DESTINATION bin COMPONENT WebBasedClient)
INSTALL( TARGETS BonsoleClient BonsoleHelper LIBRARY DESTINATION lib${LIBSUFFIX} COMPONENT ClientLib)
INSTALL( TARGETS normal console
LIBRARY DESTINATION lib${LIBSUFFIX}/bonsole/bonsole-backends COMPONENT WebBasedBackend)
INSTALL(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/data/dtd/" DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/Bonsole/dtd/ COMPONENT Schema )
INSTALL(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/data/etc/" DESTINATION ${INSTALL_PATH}/etc COMPONENT Configuration )
INSTALL(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/data/xslt/" DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/Bonsole/xsl-views COMPONENT Data)