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