milkice / rpms / libccd

Forked from rpms/libccd 2 years ago
Clone
Blob Blame History Raw
%ifarch %{ix86} x86_64 ppc ppc64 s390x %{arm}
%global with_valgrind 1
%endif

Name:           libccd
Version:        2.0
Release:        3%{?dist}
Summary:        Library for collision detection between convex shapes

License:        BSD
URL:            http://libccd.danfis.cz
Source0:        http://libccd.danfis.cz/files/%{name}-%{version}.tar.gz
# This patch integrates all of the test programs that are present in
# the testsuites folder into CMake, via CTest.  Not yet submitted
# upstream
Patch0:         %{name}-2.0-ctest.patch
# This patch changes the ccd.pc file to point to the correct include
# directory.  Not yet submitted upstream
Patch1:         %{name}-1.3-fixpkgconfig.patch

%if 0%{?rhel}
BuildRequires:  cmake28
%else
BuildRequires:  cmake
%endif
# These are required for executing the test suite
BuildRequires:  python
%if 0%{?with_valgrind}
BuildRequires:  valgrind
%endif

%description
libccd 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 7.


%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%prep
%setup -q
%patch0 -p0 -b .ctest
%patch1 -p0

%build
mkdir build
pushd build
%if 0%{?rhel}
%cmake28 \
%else
%cmake \
%endif
  -DBUILD_TESTS=ON \
  -DCMAKE_BUILD_TYPE=None \
  ..
popd
make -C build %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make -C build install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a

%check
%if 0%{?with_valgrind}
make -C build test ||exit 0
%endif

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%doc BSD-LICENSE README
%{_libdir}/*.so.*

%files devel
%doc 
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc

%changelog
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Jun 01 2014 Rich Mattes <rmattes@fedoraproject.org> - 2.0-1
- Update to release 2.0

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Wed Jan 09 2013 Dan HorĂ¡k <dan[at]danny.cz> - 1.4-2
- build on platforms without valgrind

* Mon Oct 22 2012 Rich Mattes <richmattes@gmail.com> - 1.4-1
- Update to release 1.4

* Tue May 29 2012 Rich Mattes <richmattes@gmail.com> - 1.3-3
- Fixed pkgconfig file to point to correct include dir

* Sat May 26 2012 Rich Mattes <richmattes@gmail.com> - 1.3-2
- Convert test suite to CTest

* Fri May 25 2012 Rich Mattes <richmattes@gmail.com> - 1.3-1
- Update to release 1.3
- Remove upstreamed soname patch

* Sun May 06 2012 Rich Mattes <richmattes@gmail.com> - 1.2-3
- Removed -static subpackage.

* Mon Apr 30 2012 Rich Mattes <richmattes@gmail.com> - 1.2-2
- Update soname patch to match upstream implementation 

* Fri Apr 27 2012 Rich Mattes <richmattes@gmail.com> - 1.2-1
- Initial package