Blob Blame History Raw
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

Name:           earcandy
Version:        0.5.1
Release:        6%{?dist}
Summary:        Sound level manager

Group:          Applications/Multimedia
# pulseaudio/lib.py is BSD-licensed, the rest is GPLv2+
License:        BSD and GPLv2+
URL:            https://launchpad.net/earcandy
Source0:        http://launchpad.net/%{name}/0.5/0.5.release/+download/%{name}-%{version}.tar.gz
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

BuildRequires:  python-devel
BuildRequires:  desktop-file-utils
Requires:       pygobject2
Requires:       pygtk2
Requires:       dbus-python
Requires:       notify-python
Requires:       gnome-python2-libwnck
Requires:       pulseaudio-libs
BuildArch:      noarch


%description
A sound level manager that nicely fades applications in and out based on
their profile and window focus. It is useful if you need to fade out music
or video players during VoIP calls, switch to music player with focus when
more using than one, push sound to USB headsets on plugin, etc. Settings
can be configured via nice and simple UI.


%prep
%setup -q


%build
# Fix the shebangs
find . -name '*.py' -o -type f -name 'ear_candy' |
while read F
do
        S='/^#!/d'
        echo $F |grep -q '\.py$' || S='s,^#!/usr/bin/env python,#!/usr/bin/python,'
        sed "$S" $F >$F.new
        touch -r $F $F.new
        mv $F.new $F
done
%{__python} setup.py build


%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT
desktop-file-validate $RPM_BUILD_ROOT/%{_datadir}/applications/earcandy.desktop


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%{_bindir}/ear_candy
%{_datadir}/applications/earcandy.desktop
%{_datadir}/earcandy
%{_datadir}/earcandy/earcandy.desktop
%{_datadir}/pixmaps/earsLabel.png
%{python_sitelib}/ear_candy
%{python_sitelib}/*.egg-info
%doc README COPYING


%changelog
* Sun Mar 28 2010 Lubomir Rintel <lkundrak@v3.sk> - 0.5.1-6
- Don't exclude the desktop file in share, it's used for autostart

* Tue Dec 29 2009 Lubomir Rintel <lkundrak@v3.sk> - 0.5.1-5
- Don't depend on specific version of libpulse

* Thu Dec 24 2009 Lubomir Rintel <lkundrak@v3.sk> - 0.5.1-4
- Don't require on 32bit libpulse

* Sun Oct 18 2009 Lubomir Rintel <lkundrak@v3.sk> - 0.5.1-3
- Drop unnecessary python dependency
- Ignore duplicate desktop file

* Mon Oct 05 2009 Lubomir Rintel <lkundrak@v3.sk> - 0.5.1-2
- Correct the license (Martin Gieseking, #527059#c2)
- Fix up the shebangs (Martin Gieseking, #527059#c2)
- Depend on specific version of PulseAudio ABI

* Sat Oct 03 2009 Lubomir Rintel <lkundrak@v3.sk> - 0.5.1-1
- Initial packaging