File ccd.spec of Package ccd

#
# spec file for package ccd
#
# 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 sover   2
%define srcname libccd
Name:           ccd
Version:        2.1
Release:        0
Summary:        Library for a collision detection between two convex shapes
License:        BSD-3-Clause
Group:          Productivity/Scientific/Other
Url:            https://github.com/danfis/libccd
Source0:        %{name}-v%{version}.tar.gz
BuildRequires:  pkg-config
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Implements variation on Gilbert-Johnson-Keerthi (GJK) algorithm + Expand 
Polytope Algorithm (EPA). It also implements Minkowski Portal Refinement 
(MPR, a.k.a. XenoCollide) algorithm as published in Game Programming Gems.

%package -n     lib%{name}%{sover}
Summary:        Library for a collision detection between two convex shapes
Group:          System/Libraries

%description -n lib%{name}%{sover}
Implements variation on Gilbert-Johnson-Keerthi (GJK) algorithm + Expand 
Polytope Algorithm (EPA). It also implements Minkowski Portal Refinement 
(MPR, a.k.a. XenoCollide) algorithm as published in Game Programming Gems.

This package contains the shared library.

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries/C and C++
Requires:       lib%{name}%{sover} = %{version}

%description    devel
ibrary for a collision detection between two convex shapes.

This package contains the header files and libraries needed to develop
application that use %{name}.

%prep
%setup -q -n %{srcname}-%{version}

# Change path to includedir
sed -i '/^includedir/s|[^=]\+$|%{_includedir}/%{name}|' ccd.pc.in

%build
%cmake \
    -DCCD_DOUBLE=ON

%make_jobs

%install
%cmake_install

find %{buildroot} -type f -name \*.a -delete -print

%post -n lib%{name}%{sover} -p /sbin/ldconfig
%postun -n lib%{name}%{sover} -p /sbin/ldconfig

%files -n lib%{name}%{sover}
%defattr(-,root,root)
%{_libdir}/lib%{name}.so.*

%files devel
%defattr(-,root,root)
%{_includedir}/%{name}
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/ccd.pc
%{_libdir}/%{name}
%{_datadir}/doc/%{name}

%changelog
openSUSE Build Service is sponsored by