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