#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

#
# Copyright 2025 Marcel Telka
#

%patch% 01-no-shebang.patch

%hook-begin%
# This project is not on PyPI so we need to provide all info here.
# See also https://github.com/gnome-terminator/terminator/issues/715
VERSION='2.1.3'
HOMEPAGE='https://gnome-terminator.org/'
DOWNLOAD_URL='https://github.com/gnome-terminator/terminator/releases/download/v$(HUMAN_VERSION)/terminator-$(HUMAN_VERSION).tar.gz'
SUMMARY='Multiple GNOME terminals in one window'
LICENSE_FILE='COPYING'

%include-2%
COMPONENT_FMRI =	terminal/terminator

# This is a standalone application.  Since no other Python project depends on
# it we just provide single unversioned package.
SINGLE_PYTHON_VERSION = yes
%include-3%
# Make sure compiled binaries are installed at proper location
PYTHON_DATA = $(USRDIR)
%hook-manifest%
# Do not generate dependencies on dbus otherwise we would end with duplicate dependency on dbus-python.
printf '<transform file path=usr/bin/terminator$ -> add pkg.depend.bypass-generate .*/dbus.*>\n' >> "$MANIFEST"
# Do not generate dependencies on gi otherwise we would end with duplicate dependency on pygobject.
printf '<transform file path=usr/bin/terminator$ -> add pkg.depend.bypass-generate .*/gi.*>\n' >> "$MANIFEST"
# Do not generate dependencies on psutil otherwise we would end with duplicate dependency on psutil.
printf '<transform file path=usr/bin/terminator$ -> add pkg.depend.bypass-generate .*/psutil.*>\n' >> "$MANIFEST"