File subtitlecomposer.spec of Package subtitlecomposer

# spec file for package subtitlecomposer
# Copyright (c) 2020 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:           subtitlecomposer
Version:        0.7.0
Release:        0
Summary:        A text-based subtitle editor
License:        GPL-2.0-or-later
Group:          Productivity/Multimedia/Video/Editors and Convertors
# No longer part of mpv >= 0.33
# PATCH-FIX-UPSTREAM use a local qthelper.hpp copy
Patch0:         0001-Use-a-local-qthelper.cpp-copy.patch
BuildRequires:  cmake >= 3.10
BuildRequires:  extra-cmake-modules
BuildRequires:  kauth-devel
BuildRequires:  kcodecs-devel
BuildRequires:  kconfig-devel
BuildRequires:  kconfigwidgets-devel
BuildRequires:  kcoreaddons-devel
BuildRequires:  ki18n-devel
BuildRequires:  kio-devel
BuildRequires:  kross-devel
BuildRequires:  ktextwidgets-devel
BuildRequires:  kwidgetsaddons-devel
BuildRequires:  kxmlgui-devel
BuildRequires:  pkgconfig
BuildRequires:  sonnet-devel
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(Qt5Core) >= 5.6
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Test)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(gstreamer-1.0)
BuildRequires:  pkgconfig(gstreamer-plugins-base-1.0)
BuildRequires:  pkgconfig(icu-i18n)
BuildRequires:  pkgconfig(icu-uc)
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(libxine)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(mpv)
BuildRequires:  pkgconfig(phonon4qt5)
Recommends:     %{name}-lang = %{version}
%if 0%{?suse_version} < 1500
Requires(post): shared-mime-info
Requires(postun): shared-mime-info

A text-based subtitles editor that supports basic operations. It supports
SubRip (SRT), MicroDVD, SSA/ASS, MPlayer, TMPlayer and YouTube captions, and
has speech Recognition using PocketSphinx.


%setup -q -n SubtitleComposer-%{version}
%patch0 -p1

cp %{SOURCE1} src/videoplayerplugins/mpv/

# Fix permissions
chmod 644 ChangeLog

# We build kross-interpreters without python support anyway, so we can
# remove the python examples to remove an useless dependency on python2
rm src/scripting/examples/*.py

# Fix shebang
sed -i '1s|%{_bindir}/env ruby|%{_bindir}/ruby|' \

# Fix shebang in newly created files
sed -i 's,#!/usr/bin/env ruby,#!%{_bindir}/ruby,' \

%cmake_kf5 -d build

%kf5_makeinstall -C build

# Fix persissions
chmod 755 %{buildroot}%{_kf5_appsdir}/%{name}/scripts/*.rb
# Fix rpmlint error (devel-file-in-non-devel-package) and install header files as doc (since they are installed just for help)
mkdir files_for_doc
cp -a %{buildroot}%{_kf5_appsdir}/%{name}/scripts/api/ files_for_doc/
rm -rf %{buildroot}%{_kf5_appsdir}/%{name}/scripts/api/
# Point to the correct path of the header files directory (doc)
perl -pi -e "s|'api'|'%{_docdir}/subtitlecomposer/api'|" %{buildroot}%{_kf5_appsdir}/%{name}/scripts/README

%suse_update_desktop_file -r %{name} Qt KDE AudioVideo AudioVideoEditing

%find_lang %{name}


%if 0%{?suse_version} < 1500


%doc ChangeLog files_for_doc/api
%license LICENSE
%config(noreplace) %{_kf5_configdir}/%{name}rc
%dir %{_kf5_iconsdir}/hicolor/256x256
%dir %{_kf5_iconsdir}/hicolor/256x256/apps

%files lang -f %{name}.lang

openSUSE Build Service is sponsored by