Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > 43b9315d8c9d78d5bb57ecf597104865 > files > 4

NearTree-2.4-1.fc13.src.rpm

Name:           NearTree
Version:        2.4
Release:        1%{?dist}
Summary:        An API for finding nearest neighbors

Group:          System Environment/Libraries
License:        LGPLv2+
URL:            http://neartree.sourceforge.net/
Source0:        http://downloads.sourceforge.net/project/neartree/neartree/NearTree-%{version}/NearTree-%{version}.tar.gz
# library should not have version number in their name.
# Sent to upstream but upstream cannot accept.
Patch0:         NearTree-2.3.1-fedora.patch
# to fix libdir for lib64 architecture
Patch1:         NearTree-2.3.2-lib64.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  libtool CVector-devel

%description
This is a release of an API for finding nearest neighbors among
points in spaces of arbitrary dimensions. This release provides a
C++ template, TNear.h, and a C library, CNearTree.c, with
example/test programs.

%package devel
Summary:        Development tools for compiling programs using NearTree
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}

%description devel
The NearTree-devel package includes the header and library files for
developing applications that use NearTree.

%prep
%setup -q
%patch0 -p1 -b .fedora
%if %{_lib} == lib64
%patch1 -p1 -b .lib64
%endif

# convert end of line code from CRFL to LF
mv README_NearTree.txt README_NearTree.txt.orig
tr -d \\r < README_NearTree.txt.orig > README_NearTree.txt

%build
make all CFLAGS="%{optflags} -ansi -pedantic -DCNEARTREE_SAFE_TRIANG=1" %{?_smp_mflags}

%install
rm -rf %{buildroot}

make install CFLAGS="%{optflags} -ansi -pedantic -DCNEARTREE_SAFE_TRIANG=1" INSTALL_PREFIX="%{buildroot}%{_prefix}"

# remove .la and .a files
find %{buildroot} -name '*.la' -exec rm -f {} ';'
find %{buildroot} -name '*.a' -exec rm -f {} ';'

%check
if [ "`gcc -dumpversion | cut -d \. -f 1-2`" = "4.4" ] ; then
  # gcc-4.4.x may have a bug in -fcaller-saves
  make tests CFLAGS="%{optflags} -fno-caller-saves -ansi -pedantic -DCNEARTREE_SAFE_TRIANG=1"
else
  make tests CFLAGS="%{optflags} -ansi -pedantic -DCNEARTREE_SAFE_TRIANG=1"
fi

%clean
rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc README_NearTree.html README_NearTree.txt lgpl.txt
%{_libdir}/libCNearTree.so.*

%files devel
%defattr(-,root,root,-)
%{_includedir}/CNearTree.h
%{_includedir}/TNear.h
%{_includedir}/rhrand.h
%{_includedir}/triple.h
%{_libdir}/libCNearTree.so

%changelog
* Wed Dec 22 2010 Takanori MATSUURA <t.matsuu@gmail.com> - 2.4-1
- update to 2.4

* Tue Dec 14 2010 Takanori MATSUURA <t.matsuu@gmail.com> - 2.3.2-2
- add "-fno-caller-saves" option for gcc-4.4.x

* Thu Nov 11 2010 Takanori MATSUURA <t.matsuu@gmail.com> - 2.3.2-1
-  update to 2.3.2

* Fri Oct 22 2010 Takanori MATSUURA <t.matsuu@gmail.com> - 2.3.1-1
- initial import (#545047)

* Mon Oct 18 2010 Takanori MATSUURA <t.matsuu@gmail.com> - 2.3.1-0.1
- use "make all" instead of "make"
- add %%check

* Tue Oct 12 2010 Takanori MATSUURA <t.matsuu@gmail.com> - 2.3.1-0
- update to 2.3.1

* Wed Dec  9 2009 Takanori MATSUURA <t.matsuu@gmail.com> - 2.1.4-3
- remove static library

* Tue Dec  8 2009 Takanori MATSUURA <t.matsuu@gmail.com> - 2.1.4-2
- fit to Fedora Packaging Guidelines

* Fri Dec  3 2009 Takanori MATSUURA <t.matsuu@gmail.com> - 2.1.4-1
- update to 2.1.4

* Wed Jul 29 2009 Takanori MATSUURA <t.matsuu@gmail.com> - 2.1.3-1
- initial build