File matplot++.spec of Package matplot++

#
# spec file for package matplot++
#
# Copyright (c) 2024 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/
#


%if 0%{suse_version} < 1650
%define gcc_ver 9
%endif
%define shlib libmatplot1
Name:           matplot++
Version:        1.2.2
Release:        0
Summary:        A C++ Graphics Library for Data Visualization
License:        MIT
URL:            https://alandefreitas.github.io/matplotplusplus/
Source:         https://github.com/alandefreitas/matplotplusplus/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  blas-devel
BuildRequires:  cmake >= 3.14
BuildRequires:  gcc%{?gcc_ver}-c++
BuildRequires:  gnuplot
BuildRequires:  lapack-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(fftw3)
BuildRequires:  pkgconfig(libjpeg)
BuildRequires:  pkgconfig(libpng16)
BuildRequires:  pkgconfig(libtiff-4)
BuildRequires:  pkgconfig(opencv4)
BuildRequires:  pkgconfig(zlib)
Requires:       gnuplot

%description
Matplot++ is a graphics library for data visualization.

%package -n %{shlib}
Summary:        A C++ Graphics Library for Data Visualization

%description -n %{shlib}
Matplot++ is a graphics library for data visualization that provides
interactive plotting, means for exporting plots in formats for
scientific publications, a syntax consistent with similar libraries,
dozens of plot categories with specialized algorithms, multiple coding styles,
and supports generic backends.

This package provides the shared library for %{name}.

%package devel
Summary:        Headers and sources for developing with %{name}
Requires:       %{shlib} = %{version}

%description devel
Matplot++ is a graphics library for data visualization.

This package provides the headers and sources needed for developing software
against %{name}.

%prep
%autosetup -p1 -n matplotplusplus-%{version}

%build
%cmake \
  -DCMAKE_CXX_COMPILER=g++%{?gcc_ver:-%{gcc_ver}} \
  -DBUILD_TESTING=ON
%cmake_build

%install
%cmake_install

%check
%ctest

%post -n %{shlib} -p /sbin/ldconfig
%postun -n %{shlib} -p /sbin/ldconfig

%files -n %{shlib}
%license LICENSE
%{_libdir}/*.so.*

%files devel
%license LICENSE
%doc README.md
%{_includedir}/matplot/
%{_libdir}/*.so
%{_libdir}/cmake/Matplot++/

%changelog
openSUSE Build Service is sponsored by