Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > bb87dcec826b3385fabb35839d633729 > files > 3

flann-1.6.7-4.fc13.src.rpm

%if 0%{?rhel} < 6 && ! 0%{?fedora}
%{!?python_sitearch: %global python_sitearch %(/usr/bin/python26 -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif

Name:           flann
Version:        1.6.7
Release:        4%{?dist}
Summary:        Fast Library for Approximate Nearest Neighbors

Group:          Development/Libraries
License:        BSD
URL:            http://www.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN
Source0:        http://www.cs.ubc.ca/~mariusm/uploads/FLANN/%{name}-%{version}-src.zip
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

# This patch removes an exit() in a shared library.  This issue
# is fixed upstream
Patch0:         flann-1.6.7.noexit.patch

BuildRequires:  cmake
BuildRequires:  zlib-devel

%if 0%{?fedora}
BuildRequires:  hdf5-devel  
BuildRequires:  gtest-devel
%endif

%if 0%{?rhel} >= 6 || 0%{?fedora}
BuildRequires:  python-devel
%else
BuildRequires:  python26
BuildRequires:  python26-devel
%endif


%description
FLANN is a library for performing fast approximate nearest neighbor searches 
in high dimensional spaces. It contains a collection of algorithms found 
to work best for nearest neighbor search and a system for automatically 
choosing the best algorithm and optimum parameters depending on the data sets.

%package devel
Summary: Development headers and libraries for flann
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
Development headers and libraries for flann.

%package static
Summary: Static libraries for flann
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}

%description static
Static libraries for flann.

%package python
Summary: Python bindings for flann
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: numpy

%description python
Python bindings for flann

%prep
%setup -q -n %{name}-%{version}-src
%patch0 -p0 -b .noexit

%build
mkdir %{_target_platform}
pushd %{_target_platform}
%cmake -DBUILD_MATLAB_BINDINGS=OFF  -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_PYTHON_BINDINGS=true  ..
popd
make %{?_smp_mflags} -C %{_target_platform}


%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} -C %{_target_platform}

# install the python bindings
pushd src/python
%if 0%{?rhel} >= 6 || 0%{?fedora}
python setup.py install --root=%{buildroot} --install-purelib=%{python_sitearch}
%else
python26 setup.py install --root=%{buildroot} --install-purelib=%{python_sitearch}
%endif
popd
# get rid of duplicate shared libraries
rm -rf %{buildroot}%{python_sitearch}/pyflann/lib
# Remove example binaries
rm -rf %{buildroot}%{_bindir}*
# Remove installed documentation, we'll install it later with the doc macro
rm -rf %{buildroot}%{_datadir}/doc/flann

%clean
rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc doc/manual.pdf
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root,-)
%{_libdir}/*.so
%{_libdir}/pkgconfig/*
%{_includedir}/flann

%files static
%defattr(-,root,root,-)
%{_libdir}/*.a

%files python
%defattr(-,root,root,-)
%{python_sitearch}/pyflann
%{python_sitearch}/flann-%{version}*.egg-info

%changelog
* Thu Feb 03 2011 Rich Mattes <richmattes@gmail.com> - 1.6.7-4
- Disabled hdf and ctest requirements for el6
- Explicit python26 dependency for el5

* Wed Feb 02 2011 Rich Mattes <richmattes@gmail.com> - 1.6.7-3
- Added clean section, rm buildroot at beginning of install
- Switched to using buildroot macro throughout specfile

* Mon Jan 31 2011 Rich Mattes <richmattes@gmail.com> - 1.6.7-2
- Fix exit() in shared lib error

* Wed Dec 22 2010 - Rich Mattes <richmattes@gmail.com> - 1.6.7-1
- Initial build