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