]>
Commit | Line | Data |
---|---|---|
84734a52 JB |
1 | # TODO: CUDA support, MPI (on bconds) |
2 | # | |
3 | # Conditional build: | |
8a4c0f2d | 4 | %bcond_without openmp # OpenMP support |
84734a52 | 5 | # |
68353b89 JB |
6 | Summary: FLANN - Fast Library for Approximate Nearest Neighbours |
7 | Summary(pl.UTF-8): FLANN - szybka biblioteka do przybliżonego wyszukiwania najbliższych sąsiadów | |
8 | Name: flann | |
6238bbc2 | 9 | Version: 1.9.1 |
fb680b22 | 10 | Release: 2 |
68353b89 JB |
11 | License: BSD |
12 | Group: Libraries | |
6238bbc2 JR |
13 | Source0: https://github.com/mariusmuja/flann/archive/%{version}/%{name}-%{version}.tar.gz |
14 | # Source0-md5: 73adef1c7bf8e8b978987e7860926ea6 | |
68353b89 JB |
15 | Patch0: %{name}-python.patch |
16 | URL: http://www.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN | |
17 | BuildRequires: cmake >= 2.6 | |
8a4c0f2d | 18 | %{?with_openmp:BuildRequires: gcc-c++ >= 6:4.2} |
b40b9a8d | 19 | BuildRequires: gtest-devel |
68353b89 | 20 | BuildRequires: hdf5-devel |
7ef77888 | 21 | BuildRequires: latex2html |
8a4c0f2d | 22 | %{?with_openmp:BuildRequires: libgomp-devel} |
68353b89 | 23 | BuildRequires: libstdc++-devel |
14a4ea94 | 24 | BuildRequires: octave-devel |
68353b89 JB |
25 | BuildRequires: python >= 1:2.5 |
26 | BuildRequires: python-devel >= 1:2.5 | |
27 | BuildRequires: rpmbuild(macros) >= 1.605 | |
6238bbc2 | 28 | BuildRequires: texlive-format-pdflatex |
7ef77888 | 29 | BuildRequires: texlive-latex |
6238bbc2 | 30 | BuildRequires: texlive-latex-bibtex |
7ef77888 | 31 | BuildRequires: texlive-makeindex |
68353b89 JB |
32 | BuildRequires: unzip |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
fb680b22 JR |
35 | %define octave_m_dir %(octave-config --m-site-dir) |
36 | %define octave_oct_dir %(octave-config --oct-site-dir) | |
37 | ||
68353b89 JB |
38 | %description |
39 | FLANN is a library for performing fast approximate nearest neighbour | |
40 | searches in high dimensional spaces. It contains a collection of | |
41 | algorithms we found to work best for nearest neighbour search and a | |
42 | system for automatically choosing the best algorithm and optimum | |
43 | parameters depending on the dataset. | |
44 | ||
45 | FLANN is written in C++ and contains bindings for the following | |
46 | languages: C, MATLAB and Python. | |
47 | ||
48 | %description -l pl.UTF-8 | |
49 | FLANN (Fast Library for Approximage Nearest Neighbours) to biblioteka | |
50 | do wykonywania szybkich przybliżonych wyszukiwań najbliższych sąsiadów | |
51 | w przestrzeniach o wielu wymiarach. Zawiera zbiór algorytmów, które | |
52 | sprawdzają się najlepiej w tym zastosowaniu oraz system automatycznego | |
53 | wyboru najlepszego algorytmu oraz optymalnych parametrów w zależności | |
54 | od zbioru danych. | |
55 | ||
56 | Biblioteka FLANN została napisana w C++ i zawiera dowiązania dla | |
57 | następujących języków: C, MATLAB i Python. | |
58 | ||
59 | %package devel | |
60 | Summary: Header files for FLANN libraries | |
61 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek FLANN | |
62 | Group: Development/Libraries | |
63 | Requires: %{name} = %{version}-%{release} | |
64 | Requires: hdf5-devel | |
b40b9a8d | 65 | Requires: gtest-devel |
68353b89 | 66 | Requires: libstdc++-devel |
68353b89 JB |
67 | |
68 | %description devel | |
69 | Header files for FLANN libraries. | |
70 | ||
71 | %description devel -l pl.UTF-8 | |
72 | Pliki nagłówkowe bibliotek FLANN. | |
73 | ||
74 | %package static | |
75 | Summary: Static FLANN libraries | |
76 | Summary(pl.UTF-8): Statyczne biblioteki FLANN | |
77 | Group: Development/Libraries | |
78 | Requires: %{name}-devel = %{version}-%{release} | |
79 | ||
80 | %description static | |
81 | Static FLANN libraries. | |
82 | ||
83 | %description static -l pl.UTF-8 | |
84 | Statyczne biblioteki FLANN. | |
85 | ||
fb680b22 JR |
86 | %package -n octave-flann |
87 | Summary: Octave binding for FLANN library | |
88 | Summary(pl.UTF-8): Dowiązania języka Octave do biblioteki FLANN | |
89 | Group: Development/Languages | |
90 | Requires: %{name} = %{version}-%{release} | |
91 | ||
92 | %description -n octave-flann | |
93 | Octave binding for FLANN library. | |
94 | ||
95 | %description -n octave-flann -l pl.UTF-8 | |
96 | Dowiązania języka Octave do biblioteki FLANN. | |
97 | ||
68353b89 JB |
98 | %package -n python-flann |
99 | Summary: Python binding for FLANN library | |
100 | Summary(pl.UTF-8): Dowiązania Pythona do biblioteki FLANN | |
101 | Group: Libraries/Python | |
102 | Requires: %{name} = %{version}-%{release} | |
103 | ||
104 | %description -n python-flann | |
105 | Python binding for FLANN library. | |
106 | ||
107 | %description -n python-flann -l pl.UTF-8 | |
108 | Dowiązania Pythona do biblioteki FLANN. | |
109 | ||
110 | %prep | |
6238bbc2 | 111 | %setup -q |
68353b89 JB |
112 | %patch0 -p1 |
113 | ||
114 | %build | |
115 | install -d build | |
116 | cd build | |
117 | %cmake .. \ | |
84734a52 | 118 | -DBUILD_CUDA_LIB=OFF \ |
8a4c0f2d | 119 | %{!?with_openmp:-DUSE_OPENMP=OFF} |
68353b89 JB |
120 | |
121 | %{__make} | |
6238bbc2 | 122 | %{__make} -C doc pdf |
68353b89 JB |
123 | |
124 | %install | |
125 | rm -rf $RPM_BUILD_ROOT | |
126 | ||
127 | %{__make} -C build install \ | |
128 | DESTDIR=$RPM_BUILD_ROOT | |
129 | ||
130 | %{__rm} $RPM_BUILD_ROOT%{_bindir}/flann_example_* | |
131 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
132 | cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
133 | ||
134 | # packaged as %doc | |
135 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/flann | |
136 | ||
fb680b22 JR |
137 | install -d $RPM_BUILD_ROOT{%{octave_m_dir},%{octave_oct_dir}} |
138 | %{__rm} $RPM_BUILD_ROOT%{_datadir}/flann/octave/test*.m | |
139 | %{__mv} $RPM_BUILD_ROOT%{_datadir}/flann/octave/*.m $RPM_BUILD_ROOT%{octave_m_dir} | |
140 | %{__mv} $RPM_BUILD_ROOT%{_datadir}/flann/octave/*.mex $RPM_BUILD_ROOT%{octave_oct_dir} | |
141 | ||
6238bbc2 | 142 | %{__mv} $RPM_BUILD_ROOT%{py_sitedir}/pyflann/lib/libflann.so $RPM_BUILD_ROOT%{py_sitedir}/pyflann |
68353b89 JB |
143 | |
144 | %py_postclean | |
145 | ||
146 | %clean | |
147 | rm -rf $RPM_BUILD_ROOT | |
148 | ||
149 | %post -p /sbin/ldconfig | |
150 | %postun -p /sbin/ldconfig | |
151 | ||
152 | %files | |
153 | %defattr(644,root,root,755) | |
154 | %doc COPYING README.md | |
155 | %attr(755,root,root) %{_libdir}/libflann.so.*.*.* | |
6238bbc2 | 156 | %attr(755,root,root) %ghost %{_libdir}/libflann.so.1.9 |
68353b89 | 157 | %attr(755,root,root) %{_libdir}/libflann_cpp.so.*.*.* |
6238bbc2 | 158 | %attr(755,root,root) %ghost %{_libdir}/libflann_cpp.so.1.9 |
68353b89 JB |
159 | |
160 | %files devel | |
161 | %defattr(644,root,root,755) | |
6238bbc2 | 162 | %doc build/doc/manual.pdf |
68353b89 JB |
163 | %attr(755,root,root) %{_libdir}/libflann.so |
164 | %attr(755,root,root) %{_libdir}/libflann_cpp.so | |
165 | %{_includedir}/flann | |
166 | %{_pkgconfigdir}/flann.pc | |
167 | %{_examplesdir}/%{name}-%{version} | |
168 | ||
169 | %files static | |
170 | %defattr(644,root,root,755) | |
171 | %{_libdir}/libflann_s.a | |
172 | %{_libdir}/libflann_cpp_s.a | |
68353b89 | 173 | |
fb680b22 JR |
174 | %files -n octave-flann |
175 | %defattr(644,root,root,755) | |
176 | %{octave_m_dir}/flann*.m | |
177 | %attr(755,root,root) %{octave_oct_dir}/nearest_neighbors.mex | |
178 | ||
68353b89 JB |
179 | %files -n python-flann |
180 | %defattr(644,root,root,755) | |
181 | %dir %{py_sitedir}/pyflann | |
ba494716 | 182 | %{py_sitedir}/pyflann/*.py[co] |
68353b89 | 183 | %attr(755,root,root) %{py_sitedir}/pyflann/libflann.so |
ba494716 | 184 | %{py_sitedir}/flann-%{version}-py*.egg-info |