%global commit ddaf69917c4ab94cd74ce4005be7314d73fb9828 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global commitdate 20251028 %global forgeurl https://github.com/leo-editor/leo-editor %forgemeta Name: python-leo Version: 6.8.7^%{commitdate}git%{shortcommit} Release: %autorelease Summary: A PIM, IDE and Outliner License: MIT URL: https://leo-editor.github.io/leo-editor/ Source0: %{forgesource} Source1: leo.metainfo.xml Source2: leo.desktop # Use python-tkinter is a system package, not on PyPI Patch: tkinter.patch BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-tkinter BuildRequires: xorg-x11-server-Xvfb BuildRequires: desktop-file-utils BuildRequires: libappstream-glib %global _description %{expand: Leo is a scriptable outliner that accelerates the work flow of programmers, authors and web designers. Outline nodes may appear in more than one place, allowing multidimensional views of data, including computer programs, within a single outline.} %description %_description %package -n python3-leo Summary: %{summary} Requires: hicolor-icon-theme Provides: leo-editor %description -n python3-leo %_description %prep %autosetup -p1 -n leo-editor-%{commit} # Type checking not needed sed -i "/types-paramiko/d" pyproject.toml sed -i "/types-paramiko/d" requirements.txt sed -i "/types-Markdown/d" pyproject.toml sed -i "/types-Markdown/d" requirements.txt %py3_shebang_fix leo/external/saveleo %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l leo cp -p leo/Icons/LeoLogo.svg leo.svg mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps install -pm644 leo.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps mkdir -p %{buildroot}%{_metainfodir}/ install -pm644 %{SOURCE1} %{buildroot}%{_metainfodir}/ desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE2} %check %pyproject_check_import -t # Skip failing tests %pytest -k "not test_gui and not test_g_OptionsUtils" appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/leo.metainfo.xml %files -n python3-leo -f %{pyproject_files} %doc README.md %{_bindir}/leo %{_bindir}/leo-c %{_bindir}/leo-console %{_datadir}/icons/hicolor/scalable/apps/leo.svg %{_datadir}/applications/leo.desktop %{_metainfodir}/leo.metainfo.xml %changelog %autochangelog