[packages/ann] - new, patches and pkgconfig file based on Fedora package

qboosh qboosh at pld-linux.org
Sun Nov 10 17:46:16 CET 2013


commit cbbb429f98e0d876b9e1a9d6822ee4525a2f238b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Nov 10 17:46:35 2013 +0100

    - new, patches and pkgconfig file based on Fedora package

 ann-gcc43.patch |  26 +++++++++++
 ann-make.patch  |  43 ++++++++++++++++++
 ann.spec        | 133 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 202 insertions(+)
---
diff --git a/ann.spec b/ann.spec
new file mode 100644
index 0000000..0b1421d
--- /dev/null
+++ b/ann.spec
@@ -0,0 +1,133 @@
+#
+# Conditional build:
+%bcond_without	static_libs	# static library build
+#
+Summary:	Library for searching Approximate Nearest Neighbors
+Summary(pl.UTF-8):	Biblioteka do przybliżonego wyszukiwania najbliższych sąsiadów
+Name:		ann
+Version:	1.1.2
+Release:	1
+License:	LGPL v2.1+
+Group:		Libraries
+#Source0Download: http://www.cs.umd.edu/~mount/ANN/
+Source0:	http://www.cs.umd.edu/~mount/ANN/Files/%{version}/%{name}_%{version}.tar.gz
+# Source0-md5:	7ffaacc7ea79ca39d4958a6378071365
+Patch0:		%{name}-make.patch
+Patch1:		%{name}-gcc43.patch
+URL:		http://www.cs.umd.edu/~mount/ANN/
+BuildRequires:	libstdc++-devel
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+ANN is a library written in the C++ programming language to support
+both exact and approximate nearest neighbor searching in spaces of
+various dimensions.
+
+%description -l pl.UTF-8
+ANN to napisana w języku C++ biblioteka do zarówno dokładnego, jak i
+przybliżonego wyszukiwania najbliższych sąsiadów w przestrzeniach o
+różnej liczbie wymiarów.
+
+%package devel
+Summary:	Header files for ANN library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki ANN
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+Requires:	libstdc++-devel
+
+%description devel
+Header files for ANN library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki ANN.
+
+%package static
+Summary:	Static ANN library
+Summary(pl.UTF-8):	Statyczna biblioteka ANN
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+
+%description static
+Static ANN library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka ANN.
+
+%prep
+%setup -q -n %{name}_%{version}
+%patch0 -p1
+%patch1 -p1
+
+%build
+%if %{with static_libs}
+# static
+%{__make} -C src targets \
+	ANNLIB="libANN.a" \
+	"C++ = %{__cxx}" \
+	CFLAGS="%{rpmcxxflags}" \
+	MAKELIB="ar ruv" \
+	RANLIB=true
+%{__rm} src/*.o
+%endif
+
+# shared
+for d in src ann2fig ; do
+%{__make} -C $d targets \
+	ANNLIB="libANN.so.1.0" \
+	ANNDEVLIB="libANN.so" \
+	"C++ = %{__cxx}" \
+	CFLAGS="%{rpmcxxflags} -fPIC" \
+	MAKELIB="%{__cxx} %{rpmldflags} -shared -Wl,-soname,libANN.so.1 -o" \
+	RANLIB=true
+done
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_includedir}/ANN,%{_pkgconfigdir}}
+
+install bin/ann2fig $RPM_BUILD_ROOT%{_bindir}
+%{?with_static_libs:install lib/libANN.a $RPM_BUILD_ROOT%{_libdir}}
+install lib/libANN.so.1.0 $RPM_BUILD_ROOT%{_libdir}
+ln -sf libANN.so.1.0 $RPM_BUILD_ROOT%{_libdir}/libANN.so.1
+ln -sf libANN.so.1.0 $RPM_BUILD_ROOT%{_libdir}/libANN.so
+
+# create pkg-config file
+cat >$RPM_BUILD_ROOT%{_pkgconfigdir}/ann.pc <<'EOF'
+prefix=%{_prefix}
+exec_prefix=%{_exec_prefix}
+libdir=%{_libdir}
+includedir=%{_includedir}
+
+Name: ann
+Description: Library for searching Approximate Nearest Neighbors
+Version: %{version}
+Requires:
+Libs: -L${libdir} -lANN
+Cflags: -I${includedir}
+EOF
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc Copyright.txt ReadMe.txt
+%attr(755,root,root) %{_bindir}/ann2fig
+%attr(755,root,root) %{_libdir}/libANN.so.*.*
+%attr(755,root,root) %ghost %{_libdir}/libANN.so.1
+
+%files devel
+%defattr(644,root,root,755)
+%doc doc/ANNmanual.pdf
+%attr(755,root,root) %{_libdir}/libANN.so
+%{_includedir}/ANN
+%{_pkgconfigdir}/ann.pc
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libANN.a
+%endif
diff --git a/ann-gcc43.patch b/ann-gcc43.patch
new file mode 100644
index 0000000..677d7ea
--- /dev/null
+++ b/ann-gcc43.patch
@@ -0,0 +1,26 @@
+diff -Naur ann_1.1.2.orig/src/kd_dump.cpp ann_1.1.2/src/kd_dump.cpp
+--- ann_1.1.2.orig/src/kd_dump.cpp	2010-01-28 05:40:01.000000000 +0100
++++ ann_1.1.2/src/kd_dump.cpp	2013-03-22 15:59:40.675142146 +0100
+@@ -31,6 +31,9 @@
+ // desired.)
+ //----------------------------------------------------------------------
+ 
++#include <cstring>						// C standard string
++#include <cstdlib>						// C standard lib
++
+ #include "kd_tree.h"					// kd-tree declarations
+ #include "bd_tree.h"					// bd-tree declarations
+ 
+diff -Naur ann_1.1.2.orig/test/ann_test.cpp ann_1.1.2/test/ann_test.cpp
+--- ann_1.1.2.orig/test/ann_test.cpp	2010-01-28 05:40:01.000000000 +0100
++++ ann_1.1.2/test/ann_test.cpp	2013-03-22 15:59:40.676142171 +0100
+@@ -37,6 +37,9 @@
+ //		Allow round-off error in validation test
+ //----------------------------------------------------------------------
+ 
++#include <cstring>						// C standard string
++#include <cstdlib>						// C standard lib
++
+ #include <ctime>						// clock
+ #include <cmath>						// math routines
+ #include <cstring>						// C string ops
diff --git a/ann-make.patch b/ann-make.patch
new file mode 100644
index 0000000..75bf800
--- /dev/null
+++ b/ann-make.patch
@@ -0,0 +1,43 @@
+diff -Naur ann_1.1.2.orig/Make-config ann_1.1.2/Make-config
+--- ann_1.1.2.orig/Make-config	2010-01-28 05:40:01.000000000 +0100
++++ ann_1.1.2/Make-config	2013-03-22 15:56:58.290617102 +0100
+@@ -67,6 +67,14 @@
+ #				files in the MS_WIN32 directory).
+ #-----------------------------------------------------------------------------
+ 
++#					Linux shared library using g++
++linux:
++	$(MAKE) targets \
++	"ANNLIB = libANN.so.1.0" \
++	"ANNDEVLIB = libANN.so" \
++	"C++ = g++" \
++	"MAKELIB = $(C++) -shared -Wl,-soname -Wl,libANN.so.1 -o" \
++	"RANLIB = true"
+ #					Linux using g++
+ linux-g++:
+ 	$(MAKE) targets \
+diff -Naur ann_1.1.2.orig/Makefile ann_1.1.2/Makefile
+--- ann_1.1.2.orig/Makefile	2010-01-28 05:40:01.000000000 +0100
++++ ann_1.1.2/Makefile	2013-03-22 15:56:58.290617102 +0100
+@@ -56,7 +56,7 @@
+ #-----------------------------------------------------------------------------
+ # main make entry point
+ #-----------------------------------------------------------------------------
+-alpha-g++ macosx-g++ linux-g++ sgi sunos4 sunos4-g++ sunos5 sunos5-g++ sunos5-g++-sl authors-debug authors-perf:
++alpha-g++ macosx-g++ linux linux-g++ sgi sunos4 sunos4-g++ sunos5 sunos5-g++ sunos5-g++-sl authors-debug authors-perf:
+ 	cd src ; $(MAKE) $@
+ 	cd test ; $(MAKE) $@
+ 	cd sample ; $(MAKE) $@
+diff -Naur ann_1.1.2.orig/src/Makefile ann_1.1.2/src/Makefile
+--- ann_1.1.2.orig/src/Makefile	2010-01-28 05:40:01.000000000 +0100
++++ ann_1.1.2/src/Makefile	2013-03-22 15:56:58.290617102 +0100
+@@ -56,7 +56,8 @@
+ $(LIBDIR)/$(ANNLIB): $(OBJECTS)
+ 	$(MAKELIB) $(ANNLIB) $(OBJECTS)
+ 	$(RANLIB) $(ANNLIB)
+-	mv $(ANNLIB) $(LIBDIR)
++	[ -z "$(ANNDEVLIB)" ] || ln -s $(ANNLIB) $(ANNDEVLIB)
++	mv $(ANNLIB) $(ANNDEVLIB) $(LIBDIR)
+ 
+ #-----------------------------------------------------------------------------
+ # Make object files
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ann.git/commitdiff/cbbb429f98e0d876b9e1a9d6822ee4525a2f238b



More information about the pld-cvs-commit mailing list