File gearlever.spec of Package gearlever

#
# spec file for package gearlever
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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 appid it.mijorus.gearlever
Name:           gearlever
Version:        0
Release:        0
Summary:        Manage AppImages
License:        GPL-3.0-or-later
URL:            https://gearlever.mijorus.it/
Source:         %{name}-%{version}.tar.zst
Group:          System/X11/Utilities
BuildArch:      noarch

BuildRequires:  fdupes
BuildRequires:  gobject-introspection
BuildRequires:  gtk4-tools
BuildRequires:  meson
BuildRequires:  desktop-file-utils
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(python3)
BuildRequires:  desktop-file-utils
BuildRequires:  appstream-glib
BuildRequires:  update-desktop-files
Requires:       7zip
Requires:       dwarfs
Requires:       flatpak-spawn
Requires:       python3-dbus-python
Requires:       python3-gobject
Requires:       python3-pyxdg
Requires:       python3-requests
Requires:       squashfs
Requires:       typelib(Adw) = 1
Requires:       typelib(GLib)
Requires:       typelib(Gio)
Requires:       typelib(Gtk) = 4.0
#Requires:       python3dist(desktop-entry-lib)
#Requires:       python3dist(ftputil)
Requires:       python313-desktop-entry-lib
Requires:       python313-ftputil
%description
An utility to manage AppImages with ease! Gear lever will organize and manage
AppImage files for you, generate desktop entries and app metadata, update apps
in-place or keep multiple versions side-by-side.

%lang_package

%prep
%setup -q

%build
%meson
%meson_build

%install
%meson_install
%find_lang %{name}

# Cleanup: Remove binary demo files included in source
rm -f %{buildroot}%{_datadir}/gearlever/gearlever/assets/demo.AppImage

# Cleanup: Remove meson build files incorrectly installed to icon folders
find %{buildroot} -iname 'meson.build' -delete

# Compile python bytecode
%if 0%{?suse_version}
%py3_compile %{buildroot}%{_datadir}/gearlever
%endif

%fdupes %{buildroot}/%{_prefix}

%check
%meson_test

%files
%license COPYING
%doc README.md
%{_bindir}/%{name}
%{_datadir}/gearlever/
%exclude %{_datadir}/gearlever/gearlever/__pycache__
%{_datadir}/appdata/%{appid}.appdata.xml
%{_datadir}/applications/%{appid}.desktop
%{_datadir}/glib-2.0/schemas/%{appid}.gschema.xml
%{_datadir}/icons/hicolor/scalable/actions
%{_datadir}/icons/hicolor/*/apps/%{appid}*.svg

%files lang -f %{name}.lang

%changelog
* Wed Nov 26 2025 itachi_re <xanbenson99@gmail.com>
- Initial package release
openSUSE Build Service is sponsored by