Blob Blame History Raw
%bcond_without tests

Name:           gaupol
Version:        1.11
Release:        %autorelease
Summary:        Editor for text-based subtitle files

# Everything is GPL-3.0-or-later, except:
#   - data/ is CC0-1.0, which is allowed for
#     content only
License:        GPL-3.0-or-later AND CC0-1.0

# The package cannot be noarch because it has weak dependencies and BR’s
# conditioned on architecture. There is still no compiled code, so there will
# be no debug packages.
%global debug_package %{nil}

BuildRequires:  python3-devel
# Note that this package does not (yet) require python3dist(setuptools)!
# Note also that we cannot use dynamic BuildRequires or automatic Requires
# generation, as does not have the relevant metadata. We must do it
# the old-fashioned way, by perusing READMEs, plus grepping source and
# inspecting imports.

BuildRequires:  desktop-file-utils
BuildRequires:  gettext

# For AppData file validation
# Still required by guidelines for now
# (
BuildRequires:  libappstream-glib
# Matches what gnome-software and others use:
BuildRequires:  appstream

%if %{with tests}
BuildRequires:  python3dist(pygobject) >= 3.12
BuildRequires:  gtk3 >= 3.12
# The gstreamer weak dependencies are not actually used in the tests, but we
# BuildRequire them anyway to make sure they are satisfiable.
BuildRequires:  gstreamer1 >= 1.6
BuildRequires:  gstreamer1-plugins-base >= 1.6
BuildRequires:  gstreamer1-plugins-good >= 1.6
BuildRequires:  gstreamer1-plugins-good-gtk >= 1.6
BuildRequires:  gstreamer1-vaapi >= 1.6
%ifarch x86_64
# svt-av1 is ExclusiveArch: x86_64
BuildRequires:  gstreamer1-svt-av1
# svt-vp9 is ExclusiveArch: x86_64
BuildRequires:  gstreamer1-svt-vp9
BuildRequires:  iso-codes
BuildRequires:  gspell >= 1.0.0
BuildRequires:  python3dist(chardet) >= 2.2.1

BuildRequires:  python3dist(pytest)
# Support graphical tests in non-graphical environment
BuildRequires:  xorg-x11-server-Xvfb

# For /usr/share/icons/hicolor/{scalable,symbolic}/apps
Requires:  hicolor-icon-theme

Requires:       python3dist(pygobject) >= 3.12
Requires:       gtk3 >= 3.12
Requires:       iso-codes
Recommends:     gstreamer1
Requires:       (gstreamer1 >= 1.6 if gstreamer1)
Recommends:     gstreamer1-plugins-base
Requires:       (gstreamer1-plugins-base >= 1.6 if gstreamer1-plugins-base)
Recommends:     gstreamer1-plugins-good
Requires:       (gstreamer1-plugins-good >= 1.6 if gstreamer1-plugins-good)
Recommends:     gstreamer1-plugins-good-gtk
Requires:       (gstreamer1-plugins-good-gtk >= 1.6 if gstreamer1-plugins-good-gtk)
Recommends:     gstreamer1-vaapi
Requires:       (gstreamer1-vaapi >= 1.6 if gstreamer1-vaapi)
%ifarch x86_64
Recommends:     gstreamer1-svt-av1
Recommends:     gstreamer1-svt-vp9
Recommends:     gspell
Requires:       (gspell >= 1.0.0 if gspell)
Recommends:     python3dist(chardet)
Requires:       (python3dist(chardet) >= 2.2.1 if python3dist(chardet))

Requires:       python3-aeidon = %{version}-%{release}

Summary(cs):    Editor pro textově založené titulky
Summary(es):    Editor de archivos de subtítulos basados en texto
Summary(fi):    Muokkain tekstimuotoisille tekstityksille
Summary(fr):    Éditeur de sous-titres au format texte
Summary(ie):    Un redactor por textual subtitules
Summary(is):    Ritill fyrir skjátexta á textaformi
Summary(nl):    Bewerker voor op tekst gebaseerde ondertitels
Summary(pl):    Edytor napisów tekstowych
Summary(pt_BR): Editor para legendas em texto
Summary(pt):    Editor para legendas em texto
Summary(ru):    Редактор текстовых субтитров
Summary(tr):    Metin tabanlı altyazılar için düzenleyici

%global app_id io.otsaloma.gaupol

Gaupol is an editor for text-based subtitle files. It supports multiple
subtitle file formats and provides means of creating subtitles, editing texts
and timing subtitles to match video.

%description -l cs
Gaupol je editor pro textově založené soubory titulků. Podporuje více formátů
souborů titulků a poskytuje prostředky k vytváření titulků, upravování textů a
časování titulků, aby odpovídaly obrazovému záznamu.

%description -l es
Gaupol es un editor de archivos de subtítulos basados en texto. Con soporte
para diversos formatos de archivos, proporciona los medios para crear
subtítulos, manipular líneas y sincronizar subtítulos a un vídeo.

%description -l fi
Gaupol on muokkain tekstimuotoisille tekstitystiedostoille. Se tukee useita eri
tekstitystiedostomuotoja ja tarjoaa toimintoja tekstitysten luomiseen, tekstien
muokkaamiseen ja tekstitysten ajoittamiseen videoon sovittaen.

%description -l fr
Gaupol est un éditeur de sous-titres au format texte. Il supporte de nombreux
formats de sous-titres et permet de créer, des sous-titres, d’éditer du texte,
et de synchroniser les sous-titres à une vidéo.

%description -l ie
Gaupol es un redactor por files de textual subtitules. It supporta multiplic
formates de file e permisse vos crear, redacter e colocar subtitules secun un

%description -l is
Gaupol er ritill til meðhöndlunar á skjátextaskrám á textaformi. Hann styður
margar gerðir skjátextaskráa og býður upp á að útbúa nýja skjátexta, breytingar
texta og tímasetningu þeirra svo að þeir samsvari myndskeiðum.

%description -l nl
Gaupol is een bewerker voor op tekst gebaseerde ondertitels. Gaupol ondersteunt
meerdere soorten ondertitelformaten, en kan ook worden gebruikt om nieuwe
ondertitels te maken, teksten aan te passen en ondertitels te timen met

%description -l pl
Gaupol to edytor tekstowych plików napisów. Obsługuje wiele formatów plików
napisów i zapewnia środki do tworzenia napisów, edycji tekstów i synchronizacji
napisów w celu dopasowania do wideo.

%description -l pt_BR
Gaupol é um editor de arquivos de legendas em texto. Ele possui suporte a
vários formatos de arquivo de legenda e fornece meios de criar legendas, editar
textos e legendas de tempo para corresponder ao vídeo.

%description -l pt
O Gaupol é um editor de ficheiros de legendas em texto. Possui suporte a vários
formatos de ficheiro de legenda e fornece meios de criar legendas, editar
textos e legendas de tempo para corresponder ao vídeo.

%description -l ru
Gaupol - редактор для текстовых субтитров. Он поддерживает множество форматов
файлов субтитров и предоставляет средства для их создания, редактирования и
синхронизации с видео.

%description -l tr
Gaupol, metin tabanlı altyazı dosyaları için bir düzenleyicidir. Birçok altyazı
dosya biçimini destekler ve video eşleştirmek için altyazı oluşturma, metinleri
düzenleme ve altyazıları zamanlama araçları sağlar.

%package -n python3-aeidon
Summary: Read, write, and manipulate text-based subtitle files

BuildArch:      noarch

Provides:       aeidon = %{version}-%{release}
Obsoletes:      aeidon <= 1.4-11
Conflicts:      aeidon <= 1.4-11

Requires:       iso-codes
Recommends:     python3dist(chardet)
Requires:       (python3dist(chardet) >= 2.2.1 if python3dist(chardet))

%description -n python3-aeidon
aeidon is a Python package that provides classes and functions for dealing with
text-based subtitle files of many different formats. Functions exist for
reading and writing subtitle files as well as manipulating subtitle data, i.e.
positions (times or frames) and texts.

The aeidon package is part of the Gaupol subtitle editor, where the other
package, gaupol, provides the GTK user interface.

Separating a user interface independent general-purpose subtitle editing
package from Gaupol has been an afterthought and thus not well designed to be a
reusable component, but on the other hand is proven, working and maintained

API documentation:

%autosetup -p1
# Remove bundled iso-codes:
find data/iso-codes -type f -name '*.json' |
  while read -r fn
    ln -svf "%{_datadir}/iso-codes/json/$(basename "${fn}")" "${fn}"
# We want to install the Markdown docs in a subdirectory of the package
# documentation directory; copy them to a directory of the desired name.
cp -vrp doc using-gaupol


# From
#   When packaging both aeidon and gaupol in a Linux distro, it's best to use
#   the switches in the main `` for a consistent whole.
#       sudo python3 --without-gaupol install --prefix=/usr/local
#       sudo python3 --without-aeidon install --prefix=/usr/local
%global py_setup_args --without-iso-codes --without-gaupol
%global py_setup_args --without-iso-codes --without-aeidon

%find_lang gaupol
desktop-file-install \
    --dir='%{buildroot}%{_datadir}/applications' \
    --delete-original \
    --add-category='AudioVideoEditing' \

if [ "$(find data/iso-codes -type f ! -name 'README*' | wc -l)" != 0 ]
  echo 'Failed to fully remove bundled iso-codes' 1>&2
# Validate the installed AppData file. Fedora guidelines require validate-relax
# to pass (but not validate-strict), and do require validation at build time.
# Still required by guidelines for now
# (
appstream-util validate-relax --nonet \
# Matches what gnome-software and others use:
appstreamcli validate --nonet \

%if %{with tests}
%global __pytest %{_bindir}/xvfb-run -a %{_bindir}/pytest
# The skipped test passes in a real Fedora desktop session, but fails under
# xvfb; we do not understand why, although it smells like a trivial font
# issue.
%pytest -k 'not (TestModule and test_char_to_px__font)'

%files -f gaupol.lang
%license COPYING
%doc using-gaupol




%files -n python3-aeidon
%license COPYING