File gmixer.spec of Package gmixer

#
# spec file for package gmixer
#
# Copyright (c) 2015 SUSE LINUX 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:           gmixer
Version:        1.3
Release:        0
Summary:        Simple and Lightweight Audio Mixer
License:        GPL-3.0+
Group:          Productivity/Multimedia/Sound/Mixers
Url:            https://launchpad.net/gmixer
Source0:        http://launchpad.net/gmixer/1.x/%{version}/+download/%{name}-%{version}.tar.bz2
Source1:        %name.desktop
Source2:        %name-trayicon.desktop
Patch0:         %name-version_fix.patch
Patch1:         gmixer-1.3-setup-py.patch
Patch2:         gmixer-fix-unreferened-sep.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  desktop-file-utils
BuildRequires:  fdupes
BuildRequires:  gtk2-devel
BuildRequires:  pkgconfig
BuildRequires:  python-devel
BuildRequires:  python-gtk-devel
Requires:       python-gstreamer-0_10
Requires:       python-gtk
Requires:       python-xlib
%{py_requires}

%description
A simple gtk/gstreamer audio mixer, aimed to work with light desktop managers.

Features:
 - support all mixer plugins of gstreamer (alsa/oss/pulseaudio/...)
 - tray icon support
 - support special keys of multimedia keyboard. 

%prep
%setup -q
%patch0 -p1 -b .version_fix
%patch1 -p1 -b .gmixer-1.3-setup-py
%patch2 -p1

%build
python setup.py build

%install
python setup.py install \
  --prefix=%{_prefix} \
  --root=$RPM_BUILD_ROOT \
  --skip-build
# icon
install -dm 755 $RPM_BUILD_ROOT%{_datadir}/pixmaps
install -m 644 data/mixer.png \
  $RPM_BUILD_ROOT%{_datadir}/pixmaps/gmixer.png
# link the icon back to ../gmixer/mixer.png to ensure fdupes won't do it wrong
ln -sf %{_datadir}/pixmaps/gmixer.png %{buildroot}%{_datadir}/gmixer/mixer.png
# menu-entry
desktop-file-install \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
  %SOURCE1
# autostart launcher
desktop-file-install \
  --dir $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart \
  %SOURCE2
%find_lang %{name}
%fdupes -s %buildroot

%clean
rm -rf $RPM_BUILD_ROOT

%post
%desktop_database_post

%postun
%desktop_database_postun

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc gpl.txt 
%{_bindir}/gmixer
%{_sysconfdir}/xdg/autostart/gmixer-trayicon.desktop
%{python_sitearch}/gtktrayicon.py*
%{python_sitearch}/volkeys.so
%{python_sitearch}/gmixer-1.0-py%{py_ver}.egg-info
%{_datadir}/gmixer/
%{_datadir}/applications/gmixer.desktop
%{_datadir}/pixmaps/gmixer.png

%changelog