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