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