]> git.pld-linux.org Git - packages/flann.git/blob - flann.spec
upstream fix to cmake files so lz4 is linked in as well; rel 2
[packages/flann.git] / flann.spec
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:        2
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 URL:            https://github.com/flann-lib/flann
20 BuildRequires:  cmake >= 2.6
21 %{?with_openmp:BuildRequires:   gcc-c++ >= 6:4.2}
22 BuildRequires:  gtest-devel
23 BuildRequires:  hdf5-devel
24 BuildRequires:  latex2html
25 %{?with_openmp:BuildRequires:   libgomp-devel}
26 BuildRequires:  libstdc++-devel
27 BuildRequires:  octave-devel
28 BuildRequires:  python >= 1:2.5
29 BuildRequires:  python-devel >= 1:2.5
30 BuildRequires:  rpmbuild(macros) >= 1.605
31 BuildRequires:  texlive-format-pdflatex
32 BuildRequires:  texlive-latex
33 BuildRequires:  texlive-latex-bibtex
34 BuildRequires:  texlive-makeindex
35 BuildRequires:  texlive-xetex
36 BuildRequires:  unzip
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 %define         octave_m_dir    %(octave-config --m-site-dir)
40 %define         octave_oct_dir  %(octave-config --oct-site-dir)
41
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
69 Requires:       gtest-devel
70 Requires:       libstdc++-devel
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
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
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
115 %setup -q
116 %patch0 -p1
117 %patch1 -p1
118 %patch2 -p1
119
120 %build
121 install -d build
122 cd build
123 %cmake .. \
124         -DBUILD_CUDA_LIB=OFF \
125         %{!?with_openmp:-DUSE_OPENMP=OFF}
126
127 %{__make}
128 %{__make} -C doc pdf
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
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
148 %{__mv} $RPM_BUILD_ROOT%{py_sitedir}/pyflann/lib/libflann.so $RPM_BUILD_ROOT%{py_sitedir}/pyflann
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.*.*.*
162 %attr(755,root,root) %ghost %{_libdir}/libflann.so.1.9
163 %attr(755,root,root) %{_libdir}/libflann_cpp.so.*.*.*
164 %attr(755,root,root) %ghost %{_libdir}/libflann_cpp.so.1.9
165
166 %files devel
167 %defattr(644,root,root,755)
168 %doc build/doc/manual.pdf
169 %attr(755,root,root) %{_libdir}/libflann.so
170 %attr(755,root,root) %{_libdir}/libflann_cpp.so
171 %{_includedir}/flann
172 %{_pkgconfigdir}/flann.pc
173 %{_libdir}/cmake/flann
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
180
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
186 %files -n python-flann
187 %defattr(644,root,root,755)
188 %dir %{py_sitedir}/pyflann
189 %{py_sitedir}/pyflann/*.py[co]
190 %attr(755,root,root) %{py_sitedir}/pyflann/libflann.so
191 %{py_sitedir}/flann-%{version}-py*.egg-info
This page took 0.082628 seconds and 3 git commands to generate.