File gismo.spec of Package gismo

#
# spec file for package gismo
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 _version %{_soversion}.01.0
%define _libname libgismo
%define _packagename libgismo%{_soversion}
#define _commit 57b761800c9fc8d6ca8e1da8ac7777347bbdfa92

#do not check for invalid RPATHs
%global __brp_check_rpaths %{nil}

Name:           gismo
Summary:        Geometry plus Simulation modules
Version:        %{_version}
Release:        %{_soversion}
License:        MPL-2.0
Group:          Productivity/Scientific/Math
Packager:       Angelos Mantzaflaris <angelos.mantzaflaris@inria.fr>
Url:            http://gismo.github.io
Source:         %{name}-%{_version}.tar.gz
#Source:        https://github.com/gismo/gismo/archive/v.%{_version}.tar.gz
#Source:         https://github.com/gismo/gismo/archive/%{_commit}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{_version}
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 %{_packagename}
Summary:        Geometry plus Simulation modules
License:        MPL-2.0
Group:          System/Libraries

%description -n %{_packagename}
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
Provides:       %{_libname}-devel = %{_version}
Requires:       %{_packagename} >= %{_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
%setup -q -n %{name}-%{_version}
#setup -q -n gismo-%{_commit}

%build
export LDFLAGS="-Wl,-z,relro,-z,now"
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
%if 0%{?suse_version} > 1500 
export CXXFLAGS="%{optflags} -flto -ffat-lto-objects"
%endif
export MAKEFLAGS="%{?_smp_mflags}"
%cmake -DGISMO_INSOURCE_BUILD=ON -DCMAKE_BUILD_TYPE=Release -DGISMO_BUILD_EXAMPLES=ON -DTARGET_ARCHITECTURE=native
make

%install
%make_install

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

%files -n %{_packagename}
%defattr(-,root,root)
%{_libdir}/%{_libname}.so.%{_soversion}
%{_libdir}/%{_libname}.so.%{_version}

%files devel
%defattr(-,root,root,-)
%{_includedir}/*
%{_libdir}/%{_libname}.so
%{_libdir}/%{_libname}.a
%{_libdir}/gismo/*
%dir %{_libdir}/cmake
%dir %{_libdir}/cmake/gismo
%{_libdir}/pkgconfig/gismo.pc

%files examples
%defattr(-,root,root,-)
%{_bindir}/*
%{_datadir}/gismodata

%changelog
openSUSE Build Service is sponsored by