From aa4aa98db453a32df8c050a3959e82b5b8a8950a Mon Sep 17 00:00:00 2001 From: Gilver Date: Mon, 5 May 2025 10:25:44 -0500 Subject: [PATCH] feat(rio): Doc package, use desktop-file-utils, cleanup (#4675) * feat(rio): Doc package * feat(rio): bcond, changelog, and better doc folder * cleanup: Doc release in suggestion * cleanup: Remove unnecessary explicit dep * chore: The desktop file also has TryExec * chore: Validate the desktop file * Agh --- anda/devs/rio/rio.spec | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/anda/devs/rio/rio.spec b/anda/devs/rio/rio.spec index fa9dd1c6f6..fa86e92993 100644 --- a/anda/devs/rio/rio.spec +++ b/anda/devs/rio/rio.spec @@ -1,6 +1,7 @@ %global crate rioterm %global _description %{expand: A hardware-accelerated terminal emulator focusing to run in desktops and browsers.} +%bcond docs 1 Name: rio Version: 0.2.13 @@ -12,6 +13,7 @@ URL: http://rioterm.com Source0: https://github.com/raphamorim/%{name}/archive/refs/tags/v%{version}.tar.gz BuildRequires: anda-srpm-macros BuildRequires: cargo-rpm-macros +BuildRequires: desktop-file-utils BuildRequires: freetype-devel BuildRequires: cmake BuildRequires: gcc-c++ @@ -22,8 +24,10 @@ BuildRequires: sed Requires: freetype Requires: fontconfig Requires: hicolor-icon-theme -Requires: libgcc Obsoletes: %{crate} < %{version}-%{release} +%if %{with docs} +Suggests: %{name}-doc = %{version}-%{release} +%endif Packager: Gilver E. %description %_description @@ -35,10 +39,18 @@ Requires: %{name} = %{version}-%{release} %description devel This package contains the development libraries for Rio. +%if %{with docs} +%package doc +Summary: Documentation for Rio + +%description doc +This package contains all official documentation files for the Rio terminal. +%endif + %prep %autosetup -n %{name}-%{version} -sed -i 's/Exec=.*/Exec=%{crate}/g' misc/%{name}.desktop %cargo_prep_online +sed -i 's/Exec=.*/Exec=%{crate}/g' misc/%{name}.desktop %build %cargo_build -a @@ -46,10 +58,13 @@ sed -i 's/Exec=.*/Exec=%{crate}/g' misc/%{name}.desktop %install install -Dm755 target/rpm/%{name} %{buildroot}%{_bindir}/%{crate} install -Dm755 target/rpm/*.so -t %{buildroot}%{_libdir} -install -Dm644 misc/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop install -Dm644 docs/static/assets/%{name}-logo.svg %{buildroot}%{_iconsdir}/hicolor/scalable/apps/%{name}.svg +desktop-file-install misc/%{name}.desktop %{cargo_license_online -a} > LICENSE.dependencies +%check +desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop + %files %doc README.md %license LICENSE @@ -63,6 +78,13 @@ install -Dm644 docs/static/assets/%{name}-logo.svg %{buildroot}%{_iconsdir}/hico %{_libdir}/librio_proc_macros.so %{_libdir}/libsugarloaf.so +%if %{with docs} +%files doc +%doc docs/docs/* +%endif + %changelog +* Mon May 5 2025 Gilver E. - 0.2.13-1 +- Added doc package * Sat Mar 8 2025 Gilver E. - Initial package