File HeldenViewer.spec of Package HeldenViewer

#
# spec file for package HeldenViewer
#
# 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/
#


%define current 5

Name:           HeldenViewer
Version:        1.0.%{current}
Release:        0
License:        GPL-3.0+
Summary:        YouTube Videos Downloader
Url:            http://www.heldenviewer.de/cms/index.php/en/
Group:          Productivity/Networking/Web/Utilities
Source0:        http://www.heldenviewer.com/http/downloads/%{name}_src_1_0_%{current}.tar.gz
# PATCH-FIX-UPSTREAM HeldenViewer-missing_include.patch <edogawa@aon.at> -- fix build for openSUSE 13.1
Patch0:         HeldenViewer-missing_include.patch
BuildRequires:  ImageMagick
BuildRequires:  cmake
BuildRequires:  hicolor-icon-theme
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5Xml)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Provides:       heldenviewer = %{version}

%description
HeldenViewer makes it possible to search for, download and view YouTube
videos in a very easy to use fashion. An important feature is the
concept of adding authors as favorites, in order to be notified at the
next start of HeldenViewer if the author has uploaded a new video.

%prep
%setup -qn %{name}_src_1_0_%{current}
%patch -P0 -p1

%build
cd build
export CXXFLAGS="%{optflags}"
cmake ..
make %{?_smp_mflags} VERBOSE=1

%install
install -Dm 0755 build/%{name} %{buildroot}%{_bindir}/%{name}
install -Dm 0644 build/icon.png \
    %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
for size in 48x48 32x32 22x22 16x16 ; do
    install -dm 0755 \
        %{buildroot}%{_datadir}/icons/hicolor/${size}/apps/
    convert -strip -resize ${size} build/icon.png \
        %{buildroot}%{_datadir}/icons/hicolor/${size}/apps/%{name}.png
done
%suse_update_desktop_file -c %{name} HeldenViewer "YouTube Videos Downloader" %{name} %{name} Network FileTransfer

%post
%icon_theme_cache_post

%postun
%icon_theme_cache_postun

%files
%defattr(-,root,root,-)
%doc COPYING
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/*/%{name}.png

%changelog
openSUSE Build Service is sponsored by