File kitscenarist.spec of Package kitscenarist

#
# spec file for package kitscenarist
#
# Copyright (c) 2021 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 https://bugs.opensuse.org/
#


%define  _name  scenarist
%define _ver_core a777107fb3058887630ad13a3e85a3118e42a51e
Name:           kitscenarist
Version:        0.7.2.rc15
Release:        0
Summary:        Screenwriting software
Summary(ru):    Программа для написания сценариев
License:        GPL-3.0-or-later
Group:          Productivity/Publishing/Other
URL:            https://github.com/dimkanovikov/KITScenarist
Source0:        https://github.com/dimkanovikov/KITScenarist/archive/%{version}.tar.gz#/KITScenarist-%{version}.tar.gz
# Upstream doesn't provide releases for the core part
# KITScenaristCore is licensed under GPL-3.0
Source1:        KITScenaristCore-%{_ver_core}.zip
Source2:        %{name}.mime.xml
Patch0:         desktop_file.patch
# PATCH-FIX-UPSTREAM -- Use system libraries
Patch1:         0001-Use-system-libraries.patch
# PATCH-FIX-UPSTREAM -- Use the system gumbo parser library if available
# Only available on Tumbleweed for the moment
%if 0%{?sle_version} >= 150400 || 0%{?suse_version} >= 1550
Patch2:         0002-Use-the-system-gumbo-parser-library.patch
%endif
BuildRequires:  gcc-c++
BuildRequires:  libQt5Gui-private-headers-devel
BuildRequires:  libQt5Widgets-private-headers-devel
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
%if 0%{?sle_version} >= 150400 || 0%{?suse_version} >= 1550
BuildRequires:  pkgconfig(gumbo)
%endif
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5Core) >= 5.7.0
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Multimedia)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5PrintSupport)
BuildRequires:  pkgconfig(Qt5Sql)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5WebEngine)
BuildRequires:  pkgconfig(Qt5WebEngineWidgets)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5Xml)
BuildRequires:  pkgconfig(hunspell)
# Commented out in the code
# BuildRequires:  pkgconfig(mythes)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  unzip
Provides:       scenarist

%description
KIT Scenarist combines convenient script editor and organizer of the
screenplay project. Script editor implements numerous opportunities to
facilitate the work of the screenwriter, including: the ability to
autosubstitution locations, names of characters; check the spelling on the
fly; support the grouping of scenes and groups self; painless exporting to
PDF and DOCX in all world languages; customizable timing counting and more.
Options for the characters and locations allow to collect all the material
on the project in one file, and provide a simple way to work with it.
Website: http://kitscenarist.ru

%description -l ru
КИТ Сценарист сочетает в себе удобный текстовый редактор сценария и
органайзер проекта. Текстовый редактор реализует многочисленные
возможности, способствующие работе сценариста, среди которых: возможность
автоподстановки локаций, имён персонажей; проверка правописания на ходу;
поддержка группирования сцен, групп сцен; безболезненный экспорт в форматы
PDF и RTF; настраиваемый подсчёт хронометража и многое другое. Функции для
работы с персонажами и локациями позволяют собрать весь материал по проекту
в одном месте, и предоставляют простой способ для работы с ним.

%prep
%autosetup -p1 -a1 -n KITScenarist-%{version}
chmod 644 README.md LICENSE
mv KITScenaristCore-%{_ver_core}/* src/bin/scenarist-core/

# Make sure we use the system libraries
rm -fr src/libs/{hunspell,mythes}
# Only available on Tumbleweed
%if 0%{?sle_version} >= 150400 || 0%{?suse_version} >= 1550
rm -fr src/libs/qgumboparser/gumbo-parser
%endif

%build
pushd ./src
%qmake5
%make_build
popd

%install
install -Dm 0755 build/Release/bin/%{_name}-desktop/Scenarist %{buildroot}%{_bindir}/%{_name}
install -Dm 0644 build/Rpm/translations/%{_name}-en.desktop %{buildroot}%{_datadir}/applications/%{_name}.desktop
install -Dm 0644 ui/logo.png %{buildroot}%{_datadir}/pixmaps/%{_name}.png
install -Dm 0644 %{SOURCE2} %{buildroot}%{_datadir}/mime/packages/%{name}.xml

%suse_update_desktop_file -r %{_name} Office WordProcessor ProjectManagement

%files
%license LICENSE
%doc README.md
%{_bindir}/%{_name}
%{_datadir}/applications/%{_name}.desktop
%{_datadir}/pixmaps/%{_name}.??g
%dir %{_datadir}/mime
%dir %{_datadir}/mime/packages
%{_datadir}/mime/packages/%{name}.xml

%changelog
openSUSE Build Service is sponsored by