File slhelpers.spec of Package slhelpers

#
# spec file for package slhelpers
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define sover 2
%define use_gcc13 0%{?suse_version} > 0 && 0%{?suse_version} < 1600

Name:           slhelpers
Version:        0
Release:        0
License:        GPL-2.0-only
Group:          Productivity/Other
Summary:        Slaby helper libraries
URL:            https://github.com/jirislaby/slhelpers
Source:         %{name}-%{version}.tar.xz
%if %{use_gcc13}
BuildRequires:  gcc13-c++
%else
BuildRequires:  gcc-c++
%endif
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  meson
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(libgit2)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  xz
Obsoletes:      slsqlite++ < %{version}
Provides:       slsqlite++ = %{version}

%description
Helper libraries (c++ wrappers) for various libraries like curl and git.

%package -n libslcurl++%{sover}
Summary:        Library of libslcurl++
Group:          System/Libraries

%description -n libslcurl++%{sover}
libslcurl++ library built from slhelpers.

%package -n libslcves++%{sover}
Summary:        Library of libslcves++
Group:          System/Libraries

%description -n libslcves++%{sover}
libslcves++ library built from slhelpers.

%package -n libslgit++%{sover}
Summary:        Library of libslgit++
Group:          System/Libraries

%description -n libslgit++%{sover}
libslgit++ library built from slhelpers.

%package -n libslhelpers++%{sover}
Summary:        Library of libslhelpers++
Group:          System/Libraries

%description -n libslhelpers++%{sover}
libslhelpers++ library built from slhelpers.

%package -n libslkerncvs++%{sover}
Summary:        Library of libslkerncvs++
Group:          System/Libraries

%description -n libslkerncvs++%{sover}
libslkerncvs++ library built from slhelpers.

%package -n libslsqlite++%{sover}
Summary:        Library of libslsqlite++
Group:          System/Libraries

%description -n libslsqlite++%{sover}
libslsqlite++ library built from slhelpers.

%package devel
Summary:        Devel files for slhelpers
Group:          Development/Languages/C and C++
Requires:       %{name} = %{version}
Requires:       libslcurl++%{sover} = %{version}
Requires:       libslcves++%{sover} = %{version}
Requires:       libslgit++%{sover} = %{version}
Requires:       libslhelpers++%{sover} = %{version}
Requires:       libslkerncvs++%{sover} = %{version}
Requires:       libslsqlite++%{sover} = %{version}
Requires:       pkgconfig(libgit2)

%description devel
Devel files needed for slhelpers.

%package docs
Summary:        Documentation for slhelpers
Group:          Documentation
Requires:       %{name} = %{version}

%description docs
Documentation for slhelpers.

%prep
%autosetup

%build
%if %{use_gcc13}
export CXX=g++-13
%endif
%meson
%meson_build
%meson_build api-docs

%install
%meson_install
%fdupes %{buildroot}%{_datadir}/doc/%{name}

%check
%meson_test

%post -n libslcurl++%{sover} -p /sbin/ldconfig
%postun -n libslcurl++%{sover} -p /sbin/ldconfig
%post -n libslcves++%{sover} -p /sbin/ldconfig
%postun -n libslcves++%{sover} -p /sbin/ldconfig
%post -n libslgit++%{sover} -p /sbin/ldconfig
%postun -n libslgit++%{sover} -p /sbin/ldconfig
%post -n libslhelpers++%{sover} -p /sbin/ldconfig
%postun -n libslhelpers++%{sover} -p /sbin/ldconfig
%post -n libslkerncvs++%{sover} -p /sbin/ldconfig
%postun -n libslkerncvs++%{sover} -p /sbin/ldconfig
%post -n libslsqlite++%{sover} -p /sbin/ldconfig
%postun -n libslsqlite++%{sover} -p /sbin/ldconfig

%files
%doc README.rst
%license LICENSE

%files -n libslcurl++%{sover}
%license LICENSE
%{_libdir}/libslcurl++.so.*

%files -n libslcves++%{sover}
%license LICENSE
%{_libdir}/libslcves++.so.*

%files -n libslgit++%{sover}
%license LICENSE
%{_libdir}/libslgit++.so.*

%files -n libslhelpers++%{sover}
%license LICENSE
%{_libdir}/libslhelpers++.so.*

%files -n libslkerncvs++%{sover}
%license LICENSE
%{_libdir}/libslkerncvs++.so.*

%files -n libslsqlite++%{sover}
%license LICENSE
%{_libdir}/libslsqlite++.so.*

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

%files docs
%dir %{_datadir}/doc/%{name}/
%{_datadir}/doc/%{name}/html

%changelog
openSUSE Build Service is sponsored by