File gaupol.spec of Package gaupol

#
# spec file for package gaupol
#
# Copyright (c) 2017 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:           gaupol
Version:        1.3.1
Release:        0
Summary:        GTK Subtitle editor
License:        GPL-3.0+
Group:          Productivity/Multimedia/Video/Editors and Convertors
Url:            http://otsaloma.io/gaupol/
Source0:        https://github.com/otsaloma/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE gaupol-0.17.1-desktop.patch prusnak@suse.cz -- add desktop category
Patch0:         %{name}-0.17.1-desktop.patch
BuildRequires:  fdupes
BuildRequires:  hicolor-icon-theme
BuildRequires:  python3-devel
BuildRequires:  python3-gobject >= 3.12
BuildRequires:  python3-pyenchant
BuildRequires:  update-desktop-files
Requires:       python3
Requires:       python3-aeidon
Requires:       python3-gobject >= 3.12
Requires:       python3-pyenchant
Requires:       typelib-1_0-Gst-1_0
Requires:       typelib-1_0-GstPbutils-1_0
Requires:       typelib-1_0-GtkSpell-3_0
Recommends:     iso-codes
Recommends:     python-chardet
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
Requires:       python(abi) = %{py3_ver}

%description
Gaupol is an editor for text-based subtitle files. It supports multiple subtitle
file formats and provides means of correcting texts and timing subtitles to match
video. The user interface is designed with attention to batch processing of
multiple documents and convenience of translating.

Gaupol should run on all Unix-like (GNU/Linux, *BSD, etc.) operating systems and
on Windows. Technically it should be able to run on Mac as well, but that has
not been tested nor made convenient. Gaupol's user interface is based on the GTK+
toolkit and has been designed to best fit the GNOME desktop environment.

%package -n python3-aeidon
Summary:        Package for reading, writing and manipulating text-based subtitle files
Group:          Development/Libraries/Python
Provides:       python-aeidon = %version
Obsoletes:      python-aeidon < %version

%description -n python3-aeidon
This is a Python package for reading, writing and manipulating
text-based subtitle files. It is separate from the gaupol package,
which provides a subtitle editor application with a GTK+ user
interface.

%prep
%setup -q
%patch0

%build
export CFLAGS="%{optflags}"
python3 setup.py build

%install
python3 setup.py clean install --prefix=%{_prefix} --root=%{buildroot}
rm -f %{buildroot}%{_datadir}/gaupol/extensions/side-pane/__pycache__/*.pyc
rm -f %{buildroot}%{_datadir}/gaupol/extensions/custom-framerates/__pycache__/*.pyc
rm -f %{buildroot}%{_datadir}/gaupol/extensions/bookmarks/__pycache__/*.pyc

#remove zero length files
find %{buildroot} -type f -size 0 -delete

%suse_update_desktop_file -i %{name}
%find_lang %{name}
%fdupes %{buildroot}

%files -f %{name}.lang
%defattr(-,root,root)
%doc AUTHORS.md COPYING README.md NEWS.md
%{_bindir}/gaupol
%{python3_sitelib}/gaupol*
%{_datadir}/%{name}
%dir %{_datadir}/metainfo/
%{_datadir}/metainfo/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/*/*/apps/%{name}.*
%{_mandir}/man1/gaupol.1*

%files -n python3-aeidon
%defattr(-, root, root, -)
%doc AUTHORS.md COPYING README.aeidon.md NEWS.md TODO.md
%{python3_sitelib}/aeidon

%changelog
openSUSE Build Service is sponsored by