File gismo.spec of Package gismo

#
# spec file for package gismo
#
# Copyright (c) 2023 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 http://bugs.opensuse.org/
#

%define _soversion 25
%define libname libgismo%{_soversion}

Name:           gismo
Version:        25.01.0
Release:        0
Summary:        Geometry plus Simulation modules

Group:          Productivity/Scientific/Math
License:        MPL-2.0
Url:            http://gismo.github.io
Source:         https://github.com/gismo/gismo/archive/refs/tags/v%{version}.tar.gz#/gismo-%{version}.tar.gz
BuildRequires:  cmake
BuildRequires:  gcc-c++

%description
G+Smo (Geometry + Simulation Modules) is an open-source C++ library
that brings together mathematical tools for geometric design and
numerical simulation.


%package -n %{libname}
Summary:        Geometry plus Simulation modules
License:        MPL-2.0
Group:          System/Libraries

%description -n %{libname}
This package provides G+Smo dynamic library that can be linked against
applications.

%package devel
Summary:        Development files and tools for G+Smo applications
License:        MPL-2.0
Group:          Development/Libraries
Requires:       %{libname} = %{version}

%description devel
This package provides the headers files and tools you may need to
develop applications using G+Smo.

%package examples
Summary:        Example files for G+Smo library usage (compiled)
License:        MPL-2.0
Group:          Development/Libraries

%description examples
This package provides the (compiled) examples of the
G+Smo library.

%prep
%setup -q

%build
%cmake \
  -DCMAKE_BUILD_TYPE=Release \
  -DGISMO_BUILD_LIB:BOOL=ON \
  -DGISMO_BUILD_EXAMPLES:BOOL=ON \
  -DLIB_INSTALL_DIR=%{_lib} \
  -DINCLUDE_INSTALL_DIR=include \
  -DCMAKE_INSTALL_DIR=%{_lib}/cmake/gismo \
%ifarch x86_64
  -DTARGET_ARCHITECTURE=core \
%else
  -DTARGET_ARCHITECTURE=none \
%endif
  %{nil}

%cmake_build

%install
%cmake_install
rm %{buildroot}%{_libdir}/lib*.a

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

%files -n %{libname}
%{_libdir}/libgismo.so.%{_soversion}*

%files devel
%{_includedir}/*
%{_libdir}/libgismo.so
%dir %{_libdir}/cmake/gismo
%{_libdir}/cmake/gismo/*
%{_libdir}/pkgconfig/gismo.pc

%files examples
%{_bindir}/*
%{_datadir}/gismodata

%changelog
openSUSE Build Service is sponsored by