124 lines
3.0 KiB
RPMSpec
124 lines
3.0 KiB
RPMSpec
%global srcname flann
|
|
%global soversion 1.9
|
|
|
|
Name: flann
|
|
Version: 1.9.2
|
|
Release: 1%{?dist}
|
|
Summary: Fast Library for Approximate Nearest Neighbors
|
|
|
|
License: BSD
|
|
URL: http://www.cs.ubc.ca/research/flann
|
|
Source0: %{version}.tar.gz
|
|
|
|
Patch0: flann-1.9.1-fixpyflann.patch
|
|
Patch1: %{name}-libdir.patch
|
|
Patch2: flann-fix-lz4.patch
|
|
|
|
Requires: lz4
|
|
|
|
BuildRequires: gcc-c++
|
|
BuildRequires: cmake
|
|
BuildRequires: zlib-devel
|
|
|
|
BuildRequires: hdf5-devel
|
|
BuildRequires: gtest-devel
|
|
|
|
BuildRequires: latex2html
|
|
BuildRequires: texlive-bibtex
|
|
BuildRequires: texlive-latex
|
|
BuildRequires: texlive-tetex
|
|
BuildRequires: gtest-devel
|
|
BuildRequires: gmock-devel
|
|
BuildRequires: lz4-devel
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
%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
|
|
Requires: lz4-devel
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
# flann/flann_mpi.hpp requires boost/mpi.hpp, which is a convenience header
|
|
# inside of the boost-devel package
|
|
Requires: boost-devel
|
|
|
|
%description devel
|
|
Development headers and libraries for flann.
|
|
|
|
%package static
|
|
Summary: Static libraries for flann
|
|
Requires: lz4-devel
|
|
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
|
|
|
|
%description static
|
|
Static libraries for flann.
|
|
|
|
%package -n python3-flann
|
|
Summary: Python bindings for flann
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
Requires: python3-numpy
|
|
%{?python_provide:%python_provide python3-%{srcname}}
|
|
|
|
%description -n python3-flann
|
|
Python 3 bindings for flann
|
|
|
|
%prep
|
|
%setup -q
|
|
%patch0 -p1
|
|
%patch1 -p1
|
|
%patch2 -p1
|
|
|
|
%build
|
|
mkdir build && cd build
|
|
%cmake -DBUILD_MATLAB_BINDINGS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON_BINDINGS=ON ..
|
|
%make_build
|
|
%make_build doc
|
|
|
|
%install
|
|
%make_install -C build
|
|
rm -rf %{buildroot}%{_datadir}/%{name}/python
|
|
|
|
# install the python bindings
|
|
cp -r src/python/pyflann build/src/python
|
|
cp -r build/src/python src/python3
|
|
|
|
cp build/src/python/setup.py src/python3
|
|
|
|
pushd src/python3
|
|
%{__python3} setup.py install --prefix=/usr --root=%{buildroot} --install-lib=%{python3_sitearch}
|
|
popd
|
|
|
|
# get rid of duplicate shared libraries
|
|
rm -rf %{buildroot}%{python3_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
|
|
|
|
%files
|
|
%doc doc/manual.pdf
|
|
%{_libdir}/*.so.%{version}
|
|
%{_libdir}/*.so.%{soversion}
|
|
|
|
%files devel
|
|
%{_libdir}/*.so
|
|
%{_libdir}/pkgconfig/*
|
|
%{_includedir}/flann
|
|
%{_libdir}/cmake/flann
|
|
|
|
%files static
|
|
%{_libdir}/*.a
|
|
|
|
%files -n python3-%{srcname}
|
|
%{python3_sitearch}/pyflann
|
|
%{python3_sitearch}/flann-%{version}*.egg-info
|
|
|
|
%changelog
|
|
* Mon May 1 2023 will_niutao <niutao2@huawei.com> - 1.9.2-1
|
|
- Init for openEuler
|