File retext.spec of Package retext

# spec file for package retext
# Copyright (c) 2014 SUSE LINUX Products 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

Name:           retext
Version:        5.0.0
Release:        0
Summary:        Simple editor for Markdown and reStructuredText
License:        GPL-3.0+
Group:          Productivity/Editors/Other
Source1:        %{name}.desktop
BuildRequires:  fdupes
BuildRequires:  python3
BuildRequires:  python3-devel
BuildRequires:  rsvg-view
BuildRequires:  update-desktop-files
Requires:       python3-Markdown
Requires:       python3-Markups
Requires:       python3-docutils
Requires:       python3-pyenchant
Requires:       python3-qt5
Provides:       ReText = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

ReText is simple text editor that supports Markdown and reStructuredText
markup languages. It is written in Python using PyQt libraries.

%{?gpg_verify: %gpg_verify %{S:2}}
%setup -q -n ReText-%{version}

python3 build

python3 install --root=%{buildroot} --prefix=%{_prefix}

%{__mkdir} -pv %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
%{__mkdir} -pv %{buildroot}%{_datadir}/%{name}/
%{__mkdir} -pv %{buildroot}%{_datadir}/applications/

%{__cp} -r templates %{buildroot}%{_datadir}/%{name}/
%{__cp} -r icons/*.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
ICONSIZE="16 22 32 48 64 128 256"
pushd %{buildroot}%{_datadir}/icons/hicolor/
for i in $ICONSIZE; do
  mkdir -pv ${i}x${i}/apps/
  rsvg-convert -h $i -w $i scalable/apps/%{name}.svg -o ${i}x${i}/apps/%{name}.png
%{__cp} -r %{S:1} %{buildroot}%{_datadir}/applications/

%suse_update_desktop_file %{name}

%fdupes %{buildroot}%{_prefix}


openSUSE Build Service is sponsored by