# RPM spec for quai. packaging/make-srpm.sh builds the source RPM (and its # two archives) from a checkout; CI builds it for every supported Fedora # release and COPR publishes it. %global appid io.github.it_yohan.Quai # Licenses of the crates linked into each binary, quai's own Apache-2.0 # included. Generated by packaging/licenses.py (`--write` after a dependency # change; CI runs `--check`). %global license_core Apache-2.0 AND BSD-3-Clause AND ISC AND MIT AND Unicode-3.0 AND Zlib AND bzip2-1.0.6 AND (0BSD OR Apache-2.0 OR MIT) AND (Apache-2.0 OR BSD-2-Clause OR MIT) AND (Apache-2.0 OR BSD-3-Clause OR MIT) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR ISC OR MIT) AND (Apache-2.0 OR MIT OR Zlib) AND (Apache-2.0 OR MIT) AND (MIT OR Unlicense) %global license_gtk Apache-2.0 AND MIT AND (Apache-2.0 OR MIT) AND (MIT OR Unlicense) %global license_kde Apache-2.0 AND MIT AND Zlib AND (Apache-2.0 OR MIT) AND (MIT OR Unlicense) Name: quai Version: 0.1.0 Release: 1%{?dist} Summary: Keep RPMs published as GitHub, GitLab or Forgejo releases updated with dnf # The command and the service; LICENSE.dependencies lists each crate. License: %{license_core} URL: https://github.com/IT-Yohan/quai Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz # The crates from Cargo.lock, for every architecture Fedora builds Rust on: # cargo vendor-filterer --versioned-dirs --platform=-unknown-linux-gnu... vendor # packaging/make-srpm.sh makes it; each release attaches it. Source1: %{url}/releases/download/v%{version}/%{name}-%{version}-vendor.tar.xz ExclusiveArch: %{rust_arches} BuildRequires: cargo-rpm-macros >= 25 BuildRequires: gcc-c++ # cxx-qt links quai-kde with lld or mold: GNU ld.bfd resolves Qt's static # registration objects in the wrong order. BuildRequires: lld BuildRequires: pkgconfig(gtk4) >= 4.14 BuildRequires: pkgconfig(libadwaita-1) >= 1.5 # quai-kde (cxx-qt finds Qt through qmake6) BuildRequires: qt6-qtbase-devel >= 6.6 BuildRequires: qt6-qtdeclarative-devel >= 6.6 BuildRequires: systemd-rpm-macros BuildRequires: desktop-file-utils # Catalogues, and the translated desktop, AppStream and polkit files (msgfmt # --desktop/--xml; the AppStream rules come with appstream). BuildRequires: gettext >= 0.20 BuildRequires: appstream # Used by the test-suite to cross-check the RPM header reader. BuildRequires: rpm-build BuildRequires: createrepo_c Requires: (dnf5 or dnf or rpm-ostree) Requires: systemd # The quai user and group come from %%{_sysusersdir}/quai.conf (rpm >= 4.19 creates them). # On a desktop, bring the window too; quai-gui picks the frontend that fits it. Recommends: (%{name}-gui if (gnome-shell or plasma-workspace)) %description quai turns projects that attach .rpm files to their GitHub, GitLab or Forgejo releases into small signed dnf repositories served on 127.0.0.1 by a socket-activated service. dnf, GNOME Software, Discover and rpm-ostree then install, update and roll back those packages like any other Fedora package. This package contains the quai command and the quaid service, their translations, man pages and shell completions. %package gui Summary: Graphical interface for quai, native on GNOME and KDE Plasma # The AppStream file is CC0-1.0. License: Apache-2.0 AND CC0-1.0 BuildArch: noarch Requires: %{name} = %{version}-%{release} Requires: hicolor-icon-theme Requires: (%{name}-gtk or %{name}-kde) # Install the frontend that matches the desktop (both with two desktops; GTK # on any other one). Checked by tests/packaging/weak-deps.sh. Recommends: (%{name}-kde if plasma-workspace else %{name}-gtk) Recommends: (%{name}-gtk if gnome-shell) %description gui The "Quai" application: one launcher, menu entry and AppStream component. It runs `quai gui`, which opens the Kirigami frontend on KDE Plasma and the GTK/libadwaita frontend elsewhere, falling back to whichever is installed. %package gtk Summary: GTK 4 / libadwaita frontend for quai License: %{license_gtk} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}-gui = %{version}-%{release} Requires: polkit %description gtk A GTK 4 / libadwaita window to add, inspect and remove quai sources, native on GNOME. Changes go through polkit; updates themselves are applied by dnf or GNOME Software. %package kde Summary: Kirigami frontend for quai License: %{license_kde} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}-gui = %{version}-%{release} Requires: polkit Requires: kf6-kirigami%{?_isa} Requires: kf6-qqc2-desktop-style%{?_isa} # Qt's own texts (and right-to-left layout) in the user's language. Recommends: qt6-qttranslations %description kde A Kirigami window to add, inspect and remove quai sources, native on KDE Plasma. Changes go through polkit; updates themselves are applied by dnf or Discover. %prep %autosetup -n %{name}-%{version} -p1 -a1 %cargo_prep -v vendor %build export QMAKE=%{?_qt6_qmake}%{!?_qt6_qmake:qmake6} %cargo_build # Catalogues, translated data files, man pages and completions (target/generated). %make_build translations docs TARGET_DIR=target/rpm %{cargo_license_summary} # Per binary package, the crates linked in: cargo-vendor.txt (from which rpm # generates the bundled(crate(...)) Provides) and their licenses. for spec in core:quai-cli,quaid gtk:quai-gtk kde:quai-kde; do dir=deps/$(echo "$spec" | cut -d: -f1) pkgs=$(echo "$spec" | cut -d: -f2 | sed 's/^/-p /; s/,/ -p /g') mkdir -p "$dir" %{__cargo} tree $pkgs --offline --edges normal,build --no-dedupe --prefix none --format '{p}' \ | sed -e '/ (\//d' -e 's/ (proc-macro)//' -e 's/ (\*)//' | sort -u > "$dir/cargo-vendor.txt" %{__cargo} tree $pkgs --offline --edges no-build,no-dev,no-proc-macro --no-dedupe --prefix none \ --format '{l}: {p}' | sed -e '/([*/]/d' -e 's: / :/:g' -e 's:/: OR :g' | sort -u > "$dir/LICENSE.dependencies" test -s "$dir/cargo-vendor.txt" done %install %make_install TARGET_DIR=target/rpm PREFIX=%{_prefix} LIBEXECDIR=%{_libexecdir} \ UNITDIR=%{_unitdir} SYSUSERSDIR=%{_sysusersdir} SYSCONFDIR=%{_sysconfdir} install -dm0750 %{buildroot}%{_sysconfdir}/quai/private %find_lang %{name} %check export QMAKE=%{?_qt6_qmake}%{!?_qt6_qmake:qmake6} %cargo_test desktop-file-validate %{buildroot}%{_datadir}/applications/%{appid}.desktop appstreamcli validate --no-net --explain %{buildroot}%{_metainfodir}/%{appid}.metainfo.xml %post %systemd_post quaid.socket %preun %systemd_preun quaid.socket quaid.service %postun %systemd_postun_with_restart quaid.service if [ $1 -eq 0 ]; then # Package removed: drop the .repo files quai generated so dnf does not # keep pointing at a service that no longer exists. for f in %{_sysconfdir}/yum.repos.d/quai-*.repo; do [ -f "$f" ] && head -n1 "$f" | grep -q '^# Managed by quai' && rm -f "$f" done fi : %files -f %{name}.lang %license LICENSE deps/core/LICENSE.dependencies deps/core/cargo-vendor.txt %doc README.md %{_bindir}/quai %{_libexecdir}/quaid %{_mandir}/man1/quai.1* %{_mandir}/man1/quai-*.1* %{bash_completions_dir}/quai %{zsh_completions_dir}/_quai %{fish_completions_dir}/quai.fish %{_unitdir}/quaid.socket %{_unitdir}/quaid.service %{_sysusersdir}/quai.conf %{_datadir}/polkit-1/actions/io.github.it-yohan.quai.policy %dir %{_sysconfdir}/quai %dir %{_sysconfdir}/quai/sources.d %attr(0750,root,quai) %dir %{_sysconfdir}/quai/private %config(noreplace) %{_sysconfdir}/quai/quai.toml %files gui %license LICENSE %{_datadir}/applications/%{appid}.desktop %{_metainfodir}/%{appid}.metainfo.xml %{_datadir}/icons/hicolor/scalable/apps/%{appid}.svg %{_datadir}/icons/hicolor/symbolic/apps/%{appid}-symbolic.svg %files gtk %license LICENSE deps/gtk/LICENSE.dependencies deps/gtk/cargo-vendor.txt %{_bindir}/quai-gtk %files kde %license LICENSE deps/kde/LICENSE.dependencies deps/kde/cargo-vendor.txt %{_bindir}/quai-kde %changelog * Fri Nov 20 2026 The quai contributors - 0.1.0-1 - First release: command, service, GTK and Kirigami interfaces; English and French