File retext.spec of Package retext

# spec file for package retext
# Copyright (c) 2022 SUSE LLC
# 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:        7.2.3
Release:        0
Summary:        Simple editor for Markdown and reStructuredText
License:        GPL-3.0-or-later
Group:          Productivity/Text/Editors
BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  hicolor-icon-theme
BuildRequires:  python-rpm-macros
BuildRequires:  python3
BuildRequires:  python3-Markdown
BuildRequires:  python3-Markups >= 2.0
BuildRequires:  python3-devel
BuildRequires:  python3-docutils
BuildRequires:  python3-qt5 >= 5.11
BuildRequires:  python3-setuptools
%if 0%{suse_version} >= 1550 || 0%{?sle_version} >= 150200
BuildRequires:  rsvg-convert
BuildRequires:  rsvg-view
BuildRequires:  update-desktop-files
Requires:       python3-Markdown
Requires:       python3-Markups >= 2.0
Requires:       python3-docutils
Requires:       python3-pyenchant
Requires:       python3-qt5
Recommends:     python3-Pygments
Recommends:     python3-qtwebengine-qt5
Provides:       ReText = %{version}
BuildArch:      noarch

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

dos2unix LICENSE_GPL
# remove shebang
sed -i '/^#!/d' ReText/ ReText/



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

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

%suse_update_desktop_file %{buildroot}%{_datadir}/applications/me.mitya57.ReText.desktop

%fdupes %{buildroot}%{_prefix}

%license LICENSE_GPL
%dir %{_datadir}/metainfo

openSUSE Build Service is sponsored by