File ceres-solver.spec of Package ceres-solver
#
# spec file for package ceres-solver
#
# Copyright (c) 2018 Malcolm J Lewis <malcolmlewis@opensuse.org>
#
# 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 soname 2
Name: ceres-solver
Version: 1.14.0+20180710.923fddc
Release: 0
License: BSD-3-Clause and MIT
Summary: A fast non-linear least squares minimizer
URL: http://ceres-solver.org/
Group: Development/Libraries/C and C++
Source0: %{name}-%{version}.tar.xz
#Source0 via sh get_from_git.sh ceres-solver ceres-solver 1.14.0 master
Source99: get_from_git.sh
#PATCH-FIX-OPENSUSE ceres-solver-eigen3-includes.patch malcolmlewis@opensuse.org -- Add eigen3 to include path on numerious files since the cmake test fails.
Patch0: ceres-solver-eigen3-includes.patch
Patch1: ceres-solver-eigen-cmake.patch
#Patch0: test.patch
BuildRequires: atlascpp-devel
BuildRequires: cmake
BuildRequires: eigen3-devel
BuildRequires: gcc-c++
BuildRequires: gflags-devel-static
BuildRequires: glog-devel
BuildRequires: suitesparse-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
C++ library for modeling and solving large, complicated optimization problems.
It can be used to solve Non-linear Least Squares problems with bounds
constraints and general unconstrained optimization problems. It is a mature,
feature rich.
%package -n libceres%{soname}
Summary: A fast non-linear least squares minimizer
Group: Development/Libraries/C and C++
%description -n libceres%{soname}
C++ library for modeling and solving large, complicated optimization problems.
It can be used to solve Non-linear Least Squares problems with bounds
constraints and general unconstrained optimization problems. It is a mature,
feature rich.
%package -n libceres%{soname}-devel
Summary: A fast non-linear least squares minimizer
Group: Development/Libraries/C and C++
Requires: libceres%{soname} == %{version}
%description -n libceres%{soname}-devel
C++ library for modeling and solving large, complicated optimization problems.
It can be used to solve Non-linear Least Squares problems with bounds
constraints and general unconstrained optimization problems. It is a mature,
feature rich.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%build
%cmake -DBUILD_TESTING=OFF \
-DBUILD_EXAMPLES=OFF \
-DCMAKE_SHARED_LINKER_FLAGS="-pthread -lpthread" \
-DGFLAGS_INCLUDE_DIR="/usr/include/gflags" \
..
make %{?_smp_mflags}
%install
%cmake_install
%postun -n libceres%{soname}
/sbin/ldconfig
%post -n libceres%{soname}
/sbin/ldconfig
%files -n libceres%{soname}
%defattr(-,root,root,-)
%license LICENSE
%{_libdir}/libceres.so.2
%{_libdir}/libceres.so.2.0.0
%files -n libceres%{soname}-devel
%defattr(-,root,root,-)
%{_includedir}/ceres
%{_libdir}/cmake/Ceres
%{_libdir}/libceres.so
%changelog