[packages/pHash] Initial release
megabajt
megabajt at pld-linux.org
Mon Nov 9 21:08:54 CET 2015
commit 54e724362c5b83a4fe572d9253022ac26e2e06dd
Author: Marcin Banasiak <marcin.banasiak at gmail.com>
Date: Mon Nov 9 21:05:49 2015 +0100
Initial release
Added -link.patch to fix linking with pthread library
Added -optflags.patch that removes unused configure option which breaks our optflags
pHash-link.patch | 10 +++++
pHash-optflags.patch | 21 ++++++++++
pHash.spec | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 139 insertions(+)
---
diff --git a/pHash.spec b/pHash.spec
new file mode 100644
index 0000000..f929dd5
--- /dev/null
+++ b/pHash.spec
@@ -0,0 +1,108 @@
+#
+# Conditional build:
+%bcond_without static_libs # don't build static libraries
+#
+Summary: Perceptual hashing library
+Name: pHash
+Version: 0.9.6
+Release: 1
+License: GPL v3
+Group: Libraries
+Source0: http://www.phash.org/releases/%{name}-%{version}.tar.gz
+# Source0-md5: 0572f3cfe2219a5537b78d3c5b78f84c
+Patch0: %{name}-optflags.patch
+Patch1: %{name}-link.patch
+URL: http://www.phash.org/
+BuildRequires: CImg >= 1.6.7
+BuildRequires: autoconf >= 2.61
+BuildRequires: automake
+BuildRequires: ffmpeg-devel
+BuildRequires: fftw3-devel
+BuildRequires: libjpeg-devel
+BuildRequires: libmpg123-devel
+BuildRequires: libpng-devel
+BuildRequires: libsamplerate-devel
+BuildRequires: libsndfile-devel
+BuildRequires: libstdc++-devel
+BuildRequires: libtool
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+pHash is an open source software library that implements several
+perceptual hashing algorithms, and provides a C-like API to use those
+functions in your own programs. pHash itself is written in C++.
+
+%package devel
+Summary: Header files for pHash library
+Summary(pl.UTF-8): Pliki nagłówkowe biblioteki pHash
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Header files for pHash library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki pHash.
+
+%package static
+Summary: Static pHash library
+Summary(pl.UTF-8): Statyczna biblioteka pHash
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}-%{release}
+
+%description static
+Static pHash library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka pHash.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+
+%build
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+ CPPFLAGS="-I/usr/include/CImg" \
+ %{!?with_static_libs:--disable-static}
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+cp examples/*.cpp $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS ChangeLog
+%attr(755,root,root) %{_libdir}/libpHash.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libpHash.so.0
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libpHash.so
+%{_libdir}/libpHash.la
+%{_includedir}/*.h
+%{_pkgconfigdir}/pHash.pc
+%{_examplesdir}/%{name}-%{version}
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libpHash.a
+%endif
diff --git a/pHash-link.patch b/pHash-link.patch
new file mode 100644
index 0000000..3134b22
--- /dev/null
+++ b/pHash-link.patch
@@ -0,0 +1,10 @@
+--- pHash-0.9.6/src/Makefile.am.link 2015-11-09 19:45:06.853969444 +0100
++++ pHash-0.9.6/src/Makefile.am 2015-11-09 19:45:28.471019230 +0100
+@@ -1,6 +1,7 @@
+ lib_LTLIBRARIES = libpHash.la
+ libpHash_la_SOURCES = pHash.cpp
+ libpHash_la_LDFLAGS = -no-undefined
++libpHash_la_LIBADD = -lpthread
+ include_HEADERS = pHash.h
+
+ if HAVE_AUDIO_HASH
diff --git a/pHash-optflags.patch b/pHash-optflags.patch
new file mode 100644
index 0000000..098447e
--- /dev/null
+++ b/pHash-optflags.patch
@@ -0,0 +1,21 @@
+--- pHash-0.9.6/configure.ac.optflags 2015-11-08 20:09:24.661483056 +0100
++++ pHash-0.9.6/configure.ac 2015-11-08 20:09:58.115445684 +0100
+@@ -37,18 +37,6 @@ AS_IF([test "x$enable_pthread" != "xno"]
+
+ AM_CONDITIONAL([HAVE_PTHREAD], [test "x$enable_pthread" != "xno"])
+
+-AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],
+-[compile with debugging support @<:@default=no@:>@])])
+-
+-AS_IF([test "x$enable_debug" = "xyes"],
+- [CXXFLAGS="`echo $CXXFLAGS' ' | sed 's/-O[0-9]//g'`"
+- CXXFLAGS="$CXXFLAGS -O0 -g"
+- LDFLAGS="`echo $LDFLAGS | sed 's/-g//g' | sed 's/-O[0-9]//g'`"],
+- [CXXFLAGS="`echo $CXXFLAGS' -ffast-math' | sed 's/-g//g' | sed 's/-O[0-9]//g'`"
+- CXXFLAGS="$CXXFLAGS -O3"
+- CPPFLAGS="`echo $CPPFLAGS | sed 's/-g//g' | sed 's/-O[0-9]//g'`"
+- LDFLAGS="`echo $LDFLAGS | sed 's/-g//g' | sed 's/-O[0-9]//g'`"])
+-
+ AC_ARG_ENABLE(openmp, [AS_HELP_STRING([--enable-openmp],
+ [enable OpenMP support in pHash to use multiple cores/CPUs @<:@default=no@:>@])])
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/pHash.git/commitdiff/54e724362c5b83a4fe572d9253022ac26e2e06dd
More information about the pld-cvs-commit
mailing list