[flann/el6/master] - Disabled hdf and ctest requirements for el6 - Explicit python26 dependency for el5

rmattes rmattes at fedoraproject.org
Fri Feb 4 04:33:44 UTC 2011


commit 103f76ed43164c2f24ab148117aa37f1f6a24168
Author: Rich Mattes <richmattes at gmail.com>
Date:   Thu Feb 3 23:31:12 2011 -0500

    - Disabled hdf and ctest requirements for el6
    - Explicit python26 dependency for el5

 .gitignore               |    1 +
 flann-1.6.7.noexit.patch |   12 ++++
 flann.spec               |  138 ++++++++++++++++++++++++++++++++++++++++++++++
 sources                  |    1 +
 4 files changed, 152 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..69f34dc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/flann-1.6.7-src.zip
diff --git a/flann-1.6.7.noexit.patch b/flann-1.6.7.noexit.patch
new file mode 100644
index 0000000..16d70f4
--- /dev/null
+++ b/flann-1.6.7.noexit.patch
@@ -0,0 +1,12 @@
+diff -up ./src/cpp/flann/util/allocator.h.noexit ./src/cpp/flann/util/allocator.h
+--- ./src/cpp/flann/util/allocator.h.noexit	2011-01-31 18:33:14.772634001 -0500
++++ ./src/cpp/flann/util/allocator.h	2011-01-31 18:33:37.578634001 -0500
+@@ -145,7 +145,7 @@ public:
+ 			void* m = ::malloc(blocksize);
+ 			if (!m) {
+                 fprintf(stderr,"Failed to allocate memory.\n");
+-                exit(1);
++                return NULL;
+ 			}
+ 
+ 			/* Fill first word of new block with pointer to previous block. */
diff --git a/flann.spec b/flann.spec
new file mode 100644
index 0000000..13755e7
--- /dev/null
+++ b/flann.spec
@@ -0,0 +1,138 @@
+%if 0%{?rhel} < 6 && ! 0%{?fedora}
+%{!?python_sitearch: %global python_sitearch %(/usr/bin/python26 -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
+%endif
+
+Name:           flann
+Version:        1.6.7
+Release:        4%{?dist}
+Summary:        Fast Library for Approximate Nearest Neighbors
+
+Group:          Development/Libraries
+License:        BSD
+URL:            http://www.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN
+Source0:        http://www.cs.ubc.ca/~mariusm/uploads/FLANN/%{name}-%{version}-src.zip
+BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+# This patch removes an exit() in a shared library.  This issue
+# is fixed upstream
+Patch0:         flann-1.6.7.noexit.patch
+
+BuildRequires:  cmake
+BuildRequires:  zlib-devel
+
+%if 0%{?fedora}
+BuildRequires:  hdf5-devel  
+BuildRequires:  gtest-devel
+%endif
+
+%if 0%{?rhel} >= 6 || 0%{?fedora}
+BuildRequires:  python-devel
+%else
+BuildRequires:  python26
+BuildRequires:  python26-devel
+%endif
+
+
+%description
+FLANN is a library for performing fast approximate nearest neighbor searches 
+in high dimensional spaces. It contains a collection of algorithms found 
+to work best for nearest neighbor search and a system for automatically 
+choosing the best algorithm and optimum parameters depending on the data sets.
+
+%package devel
+Summary: Development headers and libraries for flann
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Development headers and libraries for flann.
+
+%package static
+Summary: Static libraries for flann
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}-%{release}
+
+%description static
+Static libraries for flann.
+
+%package python
+Summary: Python bindings for flann
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: numpy
+
+%description python
+Python bindings for flann
+
+%prep
+%setup -q -n %{name}-%{version}-src
+%patch0 -p0 -b .noexit
+
+%build
+mkdir %{_target_platform}
+pushd %{_target_platform}
+%cmake -DBUILD_MATLAB_BINDINGS=OFF  -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_PYTHON_BINDINGS=true  ..
+popd
+make %{?_smp_mflags} -C %{_target_platform}
+
+
+%install
+rm -rf %{buildroot}
+make install DESTDIR=%{buildroot} -C %{_target_platform}
+
+# install the python bindings
+pushd src/python
+%if 0%{?rhel} >= 6 || 0%{?fedora}
+python setup.py install --root=%{buildroot} --install-purelib=%{python_sitearch}
+%else
+python26 setup.py install --root=%{buildroot} --install-purelib=%{python_sitearch}
+%endif
+popd
+# get rid of duplicate shared libraries
+rm -rf %{buildroot}%{python_sitearch}/pyflann/lib
+# Remove example binaries
+rm -rf %{buildroot}%{_bindir}*
+# Remove installed documentation, we'll install it later with the doc macro
+rm -rf %{buildroot}%{_datadir}/doc/flann
+
+%clean
+rm -rf %{buildroot}
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root,-)
+%doc doc/manual.pdf
+%{_libdir}/*.so.*
+
+%files devel
+%defattr(-,root,root,-)
+%{_libdir}/*.so
+%{_libdir}/pkgconfig/*
+%{_includedir}/flann
+
+%files static
+%defattr(-,root,root,-)
+%{_libdir}/*.a
+
+%files python
+%defattr(-,root,root,-)
+%{python_sitearch}/pyflann
+%{python_sitearch}/flann-%{version}*.egg-info
+
+%changelog
+* Thu Feb 03 2011 Rich Mattes <richmattes at gmail.com> - 1.6.7-4
+- Disabled hdf and ctest requirements for el6
+- Explicit python26 dependency for el5
+
+* Wed Feb 02 2011 Rich Mattes <richmattes at gmail.com> - 1.6.7-3
+- Added clean section, rm buildroot at beginning of install
+- Switched to using buildroot macro throughout specfile
+
+* Mon Jan 31 2011 Rich Mattes <richmattes at gmail.com> - 1.6.7-2
+- Fix exit() in shared lib error
+
+* Wed Dec 22 2010 - Rich Mattes <richmattes at gmail.com> - 1.6.7-1
+- Initial build
diff --git a/sources b/sources
index e69de29..9f42233 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+326a199e4222cc4d0c78a9e29077d27f  flann-1.6.7-src.zip


More information about the scm-commits mailing list