File audience.spec of Package audience

#
# spec file for package audience
#
# 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:           audience
Version:        0.2.2
Release:        0
Summary:        A minimalistic media player
License:        GPL-3.0
Group:          Productivity/Multimedia/Video/Players
Url:            https://launchpad.net/audience
Source:         https://launchpad.net/audience/0.4-loki/%{version}/+download/%{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM dbus.patch -- https://github.com/elementary/videos/issues/25
Patch0:         audience-0.2.2-dbus.patch
BuildRequires:  cmake
BuildRequires:  desktop-file-utils
BuildRequires:  elementary-icon-theme
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  intltool
BuildRequires:  pkgconfig
BuildRequires:  vala >= 0.28.0
BuildRequires:  pkgconfig(clutter-gst-3.0)
BuildRequires:  pkgconfig(clutter-gtk-1.0)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(granite)
BuildRequires:  pkgconfig(gstreamer-1.0)
BuildRequires:  pkgconfig(gstreamer-pbutils-1.0)
BuildRequires:  pkgconfig(gstreamer-tag-1.0)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(libnotify)
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%glib2_gsettings_schema_requires

%description
A modern video player that combines DVD playback, streaming media and file playback 
in a single unified user interface.

%lang_package

%prep
%setup -q
%if 0%{?suse_version} > 1320
%patch0 -p1
%endif

%build
%cmake \
    -DGSETTINGS_COMPILE=OFF
make %{?_smp_mflags}

%install
%cmake_install

pushd %{buildroot}
for _icon in $(find -name \*.desktop* | xargs sed -n '/Icon/s/^.*\=//p'); do
    _icon=${_icon##*/}
    if ! find -name "$_icon" | grep -q .; then
        _icon=$(find %{_datadir}/icons -name "${_icon%.*}.svg" | head -n1)
        install -Dm0644 \
            "$_icon" ".%{_datadir}/icons/hicolor/scalable/apps/${_icon##*/}"
    else
        echo "Found: $_icon"
        exit 1
    fi
done
popd

%fdupes %{buildroot}%{_datadir}/locale
%find_lang %{name}

%post
%icon_theme_cache_post
%desktop_database_post
%glib2_gsettings_schema_post

%postun
%icon_theme_cache_postun
%desktop_database_postun
%glib2_gsettings_schema_postun

%files
%defattr(-,root,root)
%doc AUTHORS COPYING README
%{_bindir}/%{name}
%{_datadir}/applications/*.%{name}.desktop
%{_datadir}/icons/hicolor/scalable/*/multimedia-video-player.??g
%{_datadir}/glib-2.0/schemas/*.%{name}.gschema.xml
%{_datadir}/appdata/*.%{name}.appdata.xml
%dir %{_datadir}/appdata

%files lang -f %{name}.lang
%defattr(-,root,root)

%changelog
openSUSE Build Service is sponsored by