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