File chromaprint.spec of Package chromaprint

# vim: set sw=4 ts=4 et nu:
#
# spec file for package chromaprint
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012 Pascal Bleser <pascal.bleser@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


# Please submit bugfixes or comments via http://bugs.opensuse.org/

Name:           chromaprint
Version:        0.7
Release:        0
%define soname      0
Summary:        Audio Fingerprinting Library
License:        GPL-2.0+
Group:          System/Libraries
Source:         https://github.com/downloads/lalinsky/chromaprint/chromaprint-%{version}.tar.gz
Url:            http://acoustid.org/chromaprint
%if 0%{?_with_ffmpeg}
%else
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  fftw3-devel
BuildRequires:  libtag-devel
%if 0%{?_with_ffmpeg}
BuildRequires:  boost-devel
BuildRequires:  ffmpeg-devel
%endif
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  make
BuildRequires:  pkgconfig

%description
Chromaprint is the core component of the Acoustid project. It's a client-side
library that implements a custom algorithm for extracting fingerprints from any
audio source.

%package -n libchromaprint%{soname}
Summary:        Audio Fingerprinting Library
License:        LGPL-2.1+
Group:          System/Libraries
%if 0%{?_with_ffmpeg}
Provides:       libchromaprint-with-ffmpeg = %{version}
%endif

%description -n libchromaprint%{soname}
Chromaprint is the core component of the Acoustid project. It's a client-side
library that implements a custom algorithm for extracting fingerprints from any
audio source.

%package -n libchromaprint-devel
Summary:        Audio Fingerprinting Library
License:        LGPL-2.1+
Group:          Development/Libraries/C and C++
Requires:       fftw3-devel
Requires:       libchromaprint%{soname} = %{version}
Requires:       libtag-devel
%if 0%{?_with_ffmpeg}
Requires:       ffmpeg-devel
Provides:       libchromaprint-devel-with-ffmpeg = %{version}
%endif

%description -n libchromaprint-devel
Chromaprint is the core component of the Acoustid project. It's a client-side
library that implements a custom algorithm for extracting fingerprints from any
audio source.

%if 0%{?_with_ffmpeg}
%package fpcalc
Summary:        Chromaprint Audio Fingerprinting Command Line Tool
License:        GPL-2.0+
Group:          Productivity/Multimedia/Sound/Utilities
Requires:       libchromaprint%{soname} = %{version}
Provides:       fpcalc = %{version}

%description fpcalc
Chromaprint is the core component of the Acoustid project. It's a client-side
library that implements a custom algorithm for extracting fingerprints from any
audio source.
This package contains fpcalc, a command-line tool to perform Chromaprint
fingerprinting.
%endif

%prep
%setup -q

%build
%__install -d build
pushd build
cmake \
    -DCMAKE_VERBOSE_MAKEFILE=TRUE \
    -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
    -DCMAKE_SKIP_RPATH=TRUE \
    -DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE \
%if 0%{?suse_version}
%ifarch x86_64 ppc64
    -DLIB_SUFFIX="64" \
%endif
%endif
%if 0%{?_with_ffmpeg}
    -DWITH_AVFFT=ON \
    -DBUILD_EXAMPLES=ON \
%endif
    ..
%__make %{?_smp_mflags}
popd

%install
pushd build
%makeinstall
popd

%post   -n libchromaprint%{soname} -p /sbin/ldconfig

%postun -n libchromaprint%{soname} -p /sbin/ldconfig

%clean
%{?buildroot:%__rm -rf "%{buildroot}"}

%files -n libchromaprint%{soname}
%defattr(-,root,root)
%doc CHANGES.txt COPYING.txt NEWS.txt README.txt
%{_libdir}/libchromaprint.so.%{soname}
%{_libdir}/libchromaprint.so.%{soname}.*

%files -n libchromaprint-devel
%defattr(-,root,root)
%{_includedir}/chromaprint.h
%{_libdir}/libchromaprint.so
%{_libdir}/pkgconfig/libchromaprint.pc

%if 0%{?_with_ffmpeg}
%files fpcalc
%defattr(-,root,root)
%{_bindir}/fpcalc
%endif

%changelog
openSUSE Build Service is sponsored by