File qutebrowser.spec of Package qutebrowser

#
# spec file for package qutebrowser
#
# Copyright (c) 2016 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:           qutebrowser
Version:        0.7.0
Release:        0
Summary:        Keyboard-driven vim-like browser on Qt5
License:        GPL-3.0+
Group:          Productivity/Networking/Web/Browsers
Url:            https://qutebrowser.org/
Source:         https://github.com/The-Compiler/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz
Source1:        https://github.com/The-Compiler/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz.asc
Source2:        %{name}.keyring
BuildRequires:  asciidoc
BuildRequires:  fdupes
BuildRequires:  hicolor-icon-theme
BuildRequires:  libxslt-tools
BuildRequires:  python3-Jinja2
BuildRequires:  python3-MarkupSafe
BuildRequires:  python3-PyYAML
BuildRequires:  python3-Pygments
BuildRequires:  python3-devel >= 3.4
#uildRequires:  python3-pyPEG2
BuildRequires:  python3-qt5 >= 5.2
BuildRequires:  update-desktop-files
Requires:       python3-Jinja2
Requires:       python3-MarkupSafe
Requires:       python3-PyYAML
Requires:       python3-Pygments
Requires:       python3-pyPEG2
Requires:       python3-qt5 >= 5.2
Recommends:     python3-colorlog
Recommends:     python3-cssutils
BuildArch:      noarch

%description
qutebrowser is a keyboard-focused browser with a minimal GUI.
It's based on Python, PyQt5 and QtWebKit and is free software.

%prep
%setup -q

%build
a2x --format manpage doc/%{name}.1.asciidoc
asciidoc doc/%{name}.1.asciidoc

python3 setup.py build

%install
python3 setup.py install \
  --root=%{buildroot} --prefix=%{_prefix}

install -Dm 0644 %{name}.desktop \
  %{buildroot}%{_datadir}/applications/%{name}.desktop

for size in 16 24 32 48 64 128 256; do
    install -Dm 0644 "icons/%{name}-${size}x${size}.png" \
      "%{buildroot}%{_datadir}/icons/hicolor/${size}x${size}/apps/%{name}.png"
done
install -Dm 0644 icons/%{name}.svg \
  %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg

install -Dm 0644 doc/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1

%fdupes %{buildroot}%{python3_sitelib}/

%post
%desktop_database_post
%icon_theme_cache_post

%postun
%desktop_database_postun
%icon_theme_cache_postun

%files
%defattr(-,root,root)
%doc CHANGELOG.asciidoc COPYING README.asciidoc
%{_bindir}/%{name}
%{python3_sitelib}/%{name}/
%{python3_sitelib}/%{name}-*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%{_mandir}/man?/%{name}.?%{ext_man}

%changelog
openSUSE Build Service is sponsored by