File moodbar.spec of Package moodbar

#
# spec file for package moodbar (Version 0.1.2)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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/
#



Name:           moodbar
Group:          System/Libraries
Version:        0.1.2
Release:        1
License:        GNU Public License
Summary:        Analysis program for creating a colorful visual representation of an audio file
Url:            http://amarok.kde.org/wiki/Moodbar
Source:         %{name}-%{version}.tar.gz
Patch:          gthread_init.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       gstreamer010-plugins-good
BuildRequires:  gstreamer010-devel
BuildRequires:  docbook-xsl-stylesheets
BuildRequires:  fftw3-devel

%package devel
License:        GNU Public License
Summary:        Devel files for moodbar
Requires:       %{name} = %{version}
Group:          Development/Languages/C and C++

%description
The Moodbar is an algorithm for creating a colorful visual
representation of the contents of an audio file, giving an idea of its
"mood" (this is a rather fanciful term for the simple analysis it
actually does).  The Moodbar was invented by Gavin Wood and Simon
O'Keefe for inclusion in the Amarok music player.

This package contains a GStreamer plugin with elements that are used
in the moodbar analysis, and an application that actually does the
analysis.

The package also contains a shell-script (create-moodbar.sh), which will
generate the mood files for all music-files (mp3|ogg|flac|wma) in the directory
(including sub-directories) where it is being executed

%description devel
The Moodbar is an algorithm for creating a colorful visual
representation of the contents of an audio file, giving an idea of its
"mood" (this is a rather fanciful term for the simple analysis it
actually does).  The Moodbar was invented by Gavin Wood and Simon
O'Keefe for inclusion in the Amarok music player.

This package contains a link library for GStreamer plugin with elements
that are used in the moodbar analysis, and an application that actually
does the analysis.

%prep
%setup
%patch -p1

%build
%configure
make

%install
make DESTDIR=%{buildroot} install
%define gnomelibdir %(pkg-config --variable=pluginsdir gstreamer-0.10)
%{__cat} > $RPM_BUILD_ROOT/usr/bin/create-moodbar.sh <<EOF 
#!/bin/bash
control_c()        # run if user hits control-c
{
 echo $1 > lastreadsong
 echo "Exiting..."
 exit
}
if [ -e lastreadsong ]; then
  read filetodelete < lastreadsong
  rm "\$filetodelete" lastreadsong
fi
find . -type f -regextype posix-awk -iregex '.*\.(mp3|ogg|flac|wma)' | while read i
do
  trap 'control_c "\$OUTF"' SIGINT
  TEMP="\${i%.*}.mood"
  OUTF=\`echo "\$TEMP" | sed 's#\(.*\)/\([^,]*\)#\1/.\2#'\`
  if [ ! -e "\$OUTF" ]; then
    moodbar -o "\$OUTF" "\$i"
  fi
done
EOF

%files
%defattr(-,root,root)
%doc NEWS TODO AUTHORS COPYING README
%{_prefix}/bin/moodbar
%exclude %{gnomelibdir}/libmoodbar.la
%{gnomelibdir}/libmoodbar.so
%defattr(755,root,root)
%{_prefix}/bin/create-moodbar.sh

%files devel
%defattr(-,root,root)
%{gnomelibdir}/libmoodbar.a

%clean
rm -rf %{buildroot}

%changelog
openSUSE Build Service is sponsored by