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