]> git.pld-linux.org Git - packages/ann.git/blob - ann.spec
- x32 rebuild
[packages/ann.git] / ann.spec
1 #
2 # Conditional build:
3 %bcond_without  static_libs     # static library build
4 #
5 Summary:        Library for searching Approximate Nearest Neighbors
6 Summary(pl.UTF-8):      Biblioteka do przybliżonego wyszukiwania najbliższych sąsiadów
7 Name:           ann
8 Version:        1.1.2
9 Release:        2
10 License:        LGPL v2.1+
11 Group:          Libraries
12 #Source0Download: http://www.cs.umd.edu/~mount/ANN/
13 Source0:        http://www.cs.umd.edu/~mount/ANN/Files/%{version}/%{name}_%{version}.tar.gz
14 # Source0-md5:  7ffaacc7ea79ca39d4958a6378071365
15 Patch0:         %{name}-make.patch
16 Patch1:         %{name}-gcc43.patch
17 URL:            http://www.cs.umd.edu/~mount/ANN/
18 BuildRequires:  libstdc++-devel
19 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20
21 %description
22 ANN is a library written in the C++ programming language to support
23 both exact and approximate nearest neighbor searching in spaces of
24 various dimensions.
25
26 %description -l pl.UTF-8
27 ANN to napisana w języku C++ biblioteka do zarówno dokładnego, jak i
28 przybliżonego wyszukiwania najbliższych sąsiadów w przestrzeniach o
29 różnej liczbie wymiarów.
30
31 %package devel
32 Summary:        Header files for ANN library
33 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki ANN
34 Group:          Development/Libraries
35 Requires:       %{name} = %{version}-%{release}
36 Requires:       libstdc++-devel
37
38 %description devel
39 Header files for ANN library.
40
41 %description devel -l pl.UTF-8
42 Pliki nagłówkowe biblioteki ANN.
43
44 %package static
45 Summary:        Static ANN library
46 Summary(pl.UTF-8):      Statyczna biblioteka ANN
47 Group:          Development/Libraries
48 Requires:       %{name}-devel = %{version}-%{release}
49
50 %description static
51 Static ANN library.
52
53 %description static -l pl.UTF-8
54 Statyczna biblioteka ANN.
55
56 %prep
57 %setup -q -n %{name}_%{version}
58 %patch0 -p1
59 %patch1 -p1
60
61 %build
62 %if %{with static_libs}
63 # static
64 %{__make} -C src targets \
65         ANNLIB="libANN.a" \
66         "C++ = %{__cxx}" \
67         CFLAGS="%{rpmcxxflags}" \
68         MAKELIB="ar ruv" \
69         RANLIB=true
70 %{__rm} src/*.o
71 %endif
72
73 # shared
74 for d in src ann2fig ; do
75 %{__make} -C $d targets \
76         ANNLIB="libANN.so.1.0" \
77         ANNDEVLIB="libANN.so" \
78         "C++ = %{__cxx}" \
79         CFLAGS="%{rpmcxxflags} -fPIC" \
80         MAKELIB="%{__cxx} %{rpmldflags} -shared -Wl,-soname,libANN.so.1 -o" \
81         RANLIB=true
82 done
83
84 %install
85 rm -rf $RPM_BUILD_ROOT
86 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_includedir}/ANN,%{_pkgconfigdir}}
87
88 install bin/ann2fig $RPM_BUILD_ROOT%{_bindir}
89 %{?with_static_libs:install lib/libANN.a $RPM_BUILD_ROOT%{_libdir}}
90 install lib/libANN.so.1.0 $RPM_BUILD_ROOT%{_libdir}
91 ln -sf libANN.so.1.0 $RPM_BUILD_ROOT%{_libdir}/libANN.so.1
92 ln -sf libANN.so.1.0 $RPM_BUILD_ROOT%{_libdir}/libANN.so
93 cp -p include/ANN/*.h $RPM_BUILD_ROOT%{_includedir}/ANN
94
95 # create pkg-config file
96 cat >$RPM_BUILD_ROOT%{_pkgconfigdir}/ann.pc <<'EOF'
97 prefix=%{_prefix}
98 exec_prefix=%{_exec_prefix}
99 libdir=%{_libdir}
100 includedir=%{_includedir}
101
102 Name: ann
103 Description: Library for searching Approximate Nearest Neighbors
104 Version: %{version}
105 Requires:
106 Libs: -L${libdir} -lANN
107 Cflags: -I${includedir}
108 EOF
109
110 %clean
111 rm -rf $RPM_BUILD_ROOT
112
113 %post   -p /sbin/ldconfig
114 %postun -p /sbin/ldconfig
115
116 %files
117 %defattr(644,root,root,755)
118 %doc Copyright.txt ReadMe.txt
119 %attr(755,root,root) %{_bindir}/ann2fig
120 %attr(755,root,root) %{_libdir}/libANN.so.*.*
121 %attr(755,root,root) %ghost %{_libdir}/libANN.so.1
122
123 %files devel
124 %defattr(644,root,root,755)
125 %doc doc/ANNmanual.pdf
126 %attr(755,root,root) %{_libdir}/libANN.so
127 %{_includedir}/ANN
128 %{_pkgconfigdir}/ann.pc
129
130 %if %{with static_libs}
131 %files static
132 %defattr(644,root,root,755)
133 %{_libdir}/libANN.a
134 %endif
This page took 0.08355 seconds and 4 git commands to generate.