File blockify.spec of Package blockify

#
# spec file for package blockify
#
# Copyright (c) 2017 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:           blockify
Version:        3.6.3
Release:        1
License:        MIT
Summary:        Ad blocker for Spotify written in Python
Url:            https://github.com/mikar/%{name}
Source:         https://github.com/mikar/%{name}/archive/v%{version}.tar.gz
%if 0%{?rhel} >= 7
BuildRequires:  python34-setuptools
%endif
%if 0%{?rhel} == 6
BuildRequires:  python33-setuptools
%endif
%if 0%{?suse_version} || 0%{?fedora_version} || 0%{?mageia} || 0%{?mandriva_release}
BuildRequires:  python3-setuptools
%endif

%if 0%{?fedora}
BuildRequires:  pygtk2
%endif
%if 0%{?mageia} || 0%{?mandriva_release}
BuildRequires:  pygtk2.0
%endif
%if 0%{?suse_version}
BuildRequires:  python-gtk
%endif

Requires:       python3-docopt
Requires:       wmctrl

%if 0%{?fedora} || 0%{?rhel}
Requires:       dbus
%else
Requires:       dbus-1
%endif

Requires:       pulseaudio
Requires:       alsa-lib-devel
Requires:       gstreamer-devel

BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Blockify is an ad-blocker for Spotify that is written in Python.

%prep
%setup -q

%build
python3 setup.py build

%install
python3 setup.py install --root=%{buildroot}
mkdir -p %{buildroot}%{_datadir}/{applications,pixmaps}
cp blockify/data/icon-red-512.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
cp blockify/data/blockify.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
sed -i -e 's/AudioVideo/AudioVideo;Music;/g' \
       -e 's/icon-red-512.png/blockify/g' %{buildroot}%{_datadir}/applications/%{name}.desktop

%post

%postun

%files
%defattr(-,root,root)
%doc README.md LICENSE.txt
%{_bindir}/blockify
%{_bindir}/blockify-dbus
%{_bindir}/blockify-ui
/usr/lib/python3.*/site-packages/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
openSUSE Build Service is sponsored by