]>
Commit | Line | Data |
---|---|---|
1 | # TODO: CUDA support, MPI (on bconds) | |
2 | # | |
3 | # Conditional build: | |
4 | %bcond_without openmp # OpenMP support | |
5 | # | |
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 | |
9 | Version: 1.9.2 | |
10 | Release: 4 | |
11 | License: BSD | |
12 | Group: Libraries | |
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 | |
16 | Patch0: %{name}-python.patch | |
17 | Patch1: %{name}-libdir.patch | |
18 | Patch2: cmake.patch | |
19 | Patch3: pc-lz4-flags.patch | |
20 | URL: https://github.com/flann-lib/flann | |
21 | BuildRequires: cmake >= 2.6 | |
22 | %{?with_openmp:BuildRequires: gcc-c++ >= 6:4.2} | |
23 | BuildRequires: gtest-devel | |
24 | BuildRequires: hdf5-devel | |
25 | BuildRequires: latex2html | |
26 | %{?with_openmp:BuildRequires: libgomp-devel} | |
27 | BuildRequires: libstdc++-devel | |
28 | BuildRequires: lz4-devel | |
29 | BuildRequires: octave-devel | |
30 | BuildRequires: python >= 1:2.5 | |
31 | BuildRequires: python-devel >= 1:2.5 | |
32 | BuildRequires: rpmbuild(macros) >= 1.605 | |
33 | BuildRequires: texlive-format-pdflatex | |
34 | BuildRequires: texlive-latex | |
35 | BuildRequires: texlive-latex-bibtex | |
36 | BuildRequires: texlive-makeindex | |
37 | BuildRequires: texlive-xetex | |
38 | BuildRequires: unzip | |
39 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
40 | ||
41 | %define octave_m_dir %(octave-config --m-site-dir) | |
42 | %define octave_oct_dir %(octave-config --oct-site-dir) | |
43 | ||
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 | |
71 | Requires: gtest-devel | |
72 | Requires: libstdc++-devel | |
73 | Requires: lz4-devel | |
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 | ||
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 | ||
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 | |
118 | %setup -q | |
119 | %patch0 -p1 | |
120 | %patch1 -p1 | |
121 | %patch2 -p1 | |
122 | %patch3 -p1 | |
123 | ||
124 | %build | |
125 | install -d build | |
126 | cd build | |
127 | %cmake .. \ | |
128 | -DBUILD_CUDA_LIB=OFF \ | |
129 | %{!?with_openmp:-DUSE_OPENMP=OFF} | |
130 | ||
131 | %{__make} | |
132 | %{__make} -C doc pdf | |
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 | ||
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 | ||
152 | %{__mv} $RPM_BUILD_ROOT%{py_sitedir}/pyflann/lib/libflann.so $RPM_BUILD_ROOT%{py_sitedir}/pyflann | |
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.*.*.* | |
166 | %attr(755,root,root) %ghost %{_libdir}/libflann.so.1.9 | |
167 | %attr(755,root,root) %{_libdir}/libflann_cpp.so.*.*.* | |
168 | %attr(755,root,root) %ghost %{_libdir}/libflann_cpp.so.1.9 | |
169 | ||
170 | %files devel | |
171 | %defattr(644,root,root,755) | |
172 | %doc build/doc/manual.pdf | |
173 | %attr(755,root,root) %{_libdir}/libflann.so | |
174 | %attr(755,root,root) %{_libdir}/libflann_cpp.so | |
175 | %{_includedir}/flann | |
176 | %{_pkgconfigdir}/flann.pc | |
177 | %{_libdir}/cmake/flann | |
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 | |
184 | ||
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 | ||
190 | %files -n python-flann | |
191 | %defattr(644,root,root,755) | |
192 | %dir %{py_sitedir}/pyflann | |
193 | %{py_sitedir}/pyflann/*.py[co] | |
194 | %attr(755,root,root) %{py_sitedir}/pyflann/libflann.so | |
195 | %{py_sitedir}/flann-%{version}-py*.egg-info |