File playitslowly.spec of Package playitslowly

%{!?python_sitelib:  %global python_sitelib  %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
#
# spec file for package playitslowly
#
# Copyright (c) 2008-10 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/
#

# norootforbuild

Name:           playitslowly
Version:        1.3.0
Release:        1
Summary:        An audio player with adjustable speed and pitch
Group:          Productivity/Multimedia/Sound/Players
License:        GPLv2
URL:            http://29a.ch/playitslowly/
Source0:        http://29a.ch/playitslowly/playitslowly-%{version}.tar.gz
Source1000:     playitslowly-rpmlintrc
Patch0:         playitslowly-1.1.0-desktop.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  update-desktop-files
# for mangling record-rpm output:
BuildRequires:  perl
# for ownership:
BuildRequires:  hicolor-icon-theme
BuildRequires:  python
%{py_requires}
Requires:       python-gstreamer-0_10
Requires:       gstreamer-0_10-plugins-bad
%if 0%{?suse_version} >= 1120
BuildArch:      noarch
%endif

%description
Play it slowly is a software to play back audio files at a different speed or
pitch. It does also allow you to loop over a certain part of a file. It's
intended to help you learn or transcribe songs.

It can also play videos thanks to gstreamer.

Features:
* play every file gstreamer does (mp3, ogg vorbis, midi, even flv!)
* can use alsa and jack
* change speed and pitch Loop over certain parts
* export to wav

%prep
%setup -q
%patch0

%build

export CFLAGS="%{optflags}"
%__python setup.py build

%install
%__python setup.py install \
    --root="%{buildroot}" \
    --prefix="%{_prefix}" \
    --record-rpm=INSTALLED_FILES

# remove all files and directories under %{_datadir} from INSTALLED_FILES
%__perl -i -n -e 'print unless m|^(%dir\s+)?%{_datadir}|' INSTALLED_FILES

%suse_update_desktop_file -r %{name} AudioVideo Player

# fix paths of icons, they're installed as
# %{_datadir}/icons/hicolor/SIZExSIZE/playitslow.*
# instead of
# %{_datadir}/icons/hicolor/SIZExSIZE/apps/playitslow.*
pushd "%{buildroot}%{_datadir}/icons/hicolor"
for f in */*.png */*.svg; do
    [ -e "$f" ] || continue
    size=$(dirname "$f")
    filename=$(basename "$f")
    %__install -d "./$size/apps"
    %__mv "$f" "./$size/apps/"
done
popd

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

%files -f INSTALLED_FILES
%defattr(-,root,root,0755)
%doc README COPYING
%{python_sitelib}/playitslowly-py%{py_ver}.install-info
%{_datadir}/applications/playitslowly.desktop
%{_datadir}/icons/*/*/apps/playitslowly.*
%{_datadir}/pixmaps/playitslowly.png

openSUSE Build Service is sponsored by