flatpak2spec is a fast, robust Rust CLI tool designed to inspect Flatpak application repositories (or remote URLs) and automatically generate idiomatic Fedora RPM .spec files. By parsing Flatpak manifests (JSON/YAML), AppStream metadata, and build configurations, it bridges the gap between containerized app specs and native RPM packagingβoptimizing the output out-of-the-box for Fedora Copr, GitHub Actions, and online CI pipelines.
Important
Build System Support: flatpak2spec currently supports Flatpak manifests that utilize the Meson build system (buildstream / meson build options). Support for Cargo, CMake, and Autotools build systems is planned for future releases.
- π Remote & Local Workspace Inspection: Supports direct workspace parsing from local filesystem directories or remote repositories on GitHub, GitLab, and Codeberg.
- π¦ Manifest & Metadata Parsing: Inspects Flatpak JSON/YAML manifests, AppStream metadata (
.metainfo.xml), and Meson project configurations (meson.build). - π Changelog & Release Notes Extraction: Automatically parses project changelogs and release notes to populate the RPM
%changelogsection cleanly. - π·οΈ Smart Version & Forge Detection: Queries remote forge tags to determine the latest semantic release version, handles URL prefixes (
v1.0vs1.0), and formats accurate%forgesetuporSource0download links. - π Automatic Submodule Handling: Detects
.gitmoduleswithin target repositories and emits Git fetching logic in%prepto streamline online CI archive builds. - π οΈ Idiomatic Spec Output: Leverages modern Fedora packaging macros (
%meson,%meson_build,%find_lang) and%checkvalidation steps (desktop-file-validate,appstream-util). - β‘ Copr & CI-Ready: Built specifically for automated online build environments such as Fedora Copr (with internet enabled), GitHub Actions, and
mockchroots. - π― Noarch Detection: Automatically detects asset-only or script projects to emit
BuildArch: noarchwhen appropriate.
Note
Build Environment Compatibility:
Spec files generated by flatpak2spec are designed for online, automated build environments (such as Fedora Copr with network access enabled, GitHub Actions, or local mock chroots with network enabled).
Because these specs fetch missing Git submodules during %prep over the network, they are not directly intended for official Fedora Koji submission, which strictly requires offline/network-isolated builds and pre-bundled source archives.
The easiest way to install and stay updated on Fedora or Enterprise Linux systems is via Copr:
-
Enable the Copr repository
sudo dnf copr enable infiniti151/flatpak2spec -
Install flatpak2spec
sudo dnf install flatpak2spec
If you prefer not to install via package manager or are running a non-RPM Linux distribution, grab the latest pre-compiled release binary tarball and its corresponding .sig signature for your architecture (x86_64 or aarch64):
-
Download tarball and .sig
# Fetch the latest release tag dynamically TAG=$(curl -sI https://github.com/Infiniti151/flatpak2spec/releases/latest | grep -i "^location:" | awk -F'/' '{print $NF}' | tr -d '\r') # Download the tarball and signature for your machine architecture curl -LO "https://github.com/Infiniti151/flatpak2spec/releases/download/${TAG}/flatpak2spec-${TAG#v}-$(uname -m).tar.gz" curl -LO "https://github.com/Infiniti151/flatpak2spec/releases/download/${TAG}/flatpak2spec-${TAG#v}-$(uname -m).tar.gz.sig"
-
Verification
-
Verify SSH signature
# Create an ephemeral allowed signers file for verification echo "43163551+Infiniti151@users.noreply.github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILTdQcJHfsMenp/k1A6ANxCqDJKvj3wp1d+7wSQCYwSU" > /tmp/allowed_signers # Verify the signature against the release archive ssh-keygen -Y verify -f /tmp/allowed_signers -I 43163551+Infiniti151@users.noreply.github.com -n file -s flatpak2spec-*.tar.gz.sig < flatpak2spec-*.tar.gz
A successful output will read:
Good "file" signature for 43163551+Infiniti151@users.noreply.github.com with ED25519 key SHA256:5zeSTkU1qsZrkkCW4w2TKlD61J9eTihMPVx6lhgL92M`
-
Verify build attestation (needs GitHub CLI installed)
gh attestation verify --owner Infiniti151 flatpak2spec-*.tar.gzA successful output will read:
The following policy criteria will be enforced: - Predicate type must match:................ https://slsa.dev/provenance/v1 - Source Repository Owner URI must match:... https://github.com/Infiniti151 - Subject Alternative Name must match regex: (?i)^https://github\.com/Infiniti151/ - OIDC Issuer must match:................... https://token.actions.githubusercontent.com β Verification succeeded! The following 1 attestation matched the policy criteria - Attestation #1 - Build repo:..... Infiniti151/flatpak2spec - Build workflow:. .github/workflows/release.yml@refs/heads/main - Signer repo:.... Infiniti151/flatpak2spec - Signer workflow: .github/workflows/release.yml@refs/heads/main
-
-
Extract the release tarball
tar -xzf flatpak2spec-*.tar.gz -
Make executable and move to
/usr/local/binchmod +x flatpak2spec sudo mv flatpak2spec /usr/local/bin/ rm flatpak2spec*
Ensure you have Rust and Cargo installed, then build directly from source:
git clone https://github.com/Infiniti151/flatpak2spec.git
cd flatpak2spec
cargo build --releaseThe compiled binary will be available at target/release/flatpak2spec or $CARGO_TARGET_DIR/release/flatpak2spec (if you've set $CARGO_TARGET_DIR).
flatpak2spec [OPTIONS] --repo <PATH_OR_URL>
Options:
-r, --repo <PATH_OR_URL> Path or URL to the Flatpak application repository
-b, --bug-url <URL> Bug tracker URL for the BugURL spec field (optional)
-p, --packager <PACKAGER> Packager name for the %changelog section (optional)
-e, --email <EMAIL> Packager email for the %changelog section (optional)
-o, --output <FILE> Optional output file path (defaults to stdout if omitted)
-v, --verbose... Enable verbose logging output
-h, --help Print help
-V, --version Print version
Command:
flatpak2spec -b https://github.com/Infiniti151/flatpak-apps -p Infiniti151 -e 43163551+Infiniti151@users.noreply.github.com -r https://gitlab.com/mission-center-devs/mission-centerOutput:
%global app_id io.missioncenter.MissionCenter
%global forgeurl https://gitlab.com/mission-center-devs/mission-center
%global tag v%{version}
Name: missioncenter
Version: 1.2.0
Release: 1%{?dist}
Summary: Monitor system resource usage
License: GPL-3.0-or-later
BugURL: https://github.com/Infiniti151/flatpak-apps
%forgemeta
URL: %{forgeurl}
Source0: %{forgesource}
BuildRequires: meson >= 0.63.0
BuildRequires: ninja-build
BuildRequires: blueprint-compiler
BuildRequires: cargo
BuildRequires: cargo-rpm-macros
BuildRequires: cmake
BuildRequires: desktop-file-utils
BuildRequires: forge-srpm-macros
BuildRequires: gcc
BuildRequires: gettext
BuildRequires: glib2-devel
BuildRequires: glibc-langpack-en
BuildRequires: gtk-update-icon-cache
BuildRequires: libappstream-glib
BuildRequires: patch
BuildRequires: pkgconfig(gbm)
BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(libudev)
BuildRequires: python3-devel
BuildRequires: rustc
Requires: gtk4
Requires: hicolor-icon-theme
Requires: libadwaita
%description
Monitor your CPU, Memory, Disk, Network and GPU usage, accompanied by a per app and process breakdown of these statistics
Features:
- Monitor overall or per-thread CPU usage
- See system process, thread, and handle count, uptime, clock speed (base and current), cache sizes
- Monitor RAM and Swap usage
- See a breakdown how the memory is being used by the system
- Monitor Disk utilization and transfer rates
- Monitor network utilization and transfer speeds
- See network interface information such as network card name, connection type (Wi-Fi or Ethernet), wireless speeds and frequency, hardware address, IP address
- Monitor overall GPU usage, video encoder and decoder usage, memory usage and power consumption, powered by the popular NVTOP project
- Monitor system fans
- See a breakdown of resource usage by app and process
- Supports a minified summary view for simple monitoring
- Use hardware accelerated rendering for all the graphs in an effort to reduce CPU and overall resource usage
- Uses GTK4 and Libadwaita
- Written in Rust
Limitations (there is ongoing work to overcome all of these):
- Intel GPU monitoring is only supported for Broadwell and later GPUs; and does not support VRAM, power, or temperature monitoring
- When using Linux Mint/Cinnamon, launched applications may not show up in the "Applications" section (Upstream issue: https://github.com/linuxmint/cinnamon/issues/12015)
Comments, suggestions, bug reports and contributions welcome
%prep
%forgesetup
# Re-initialize git context for forge tarballs to resolve submodules
if [ ! -d ".git" ]; then
git init -q
git remote add origin %{forgeurl}
git fetch -q --depth 1 origin %{tag}
git checkout -q -f FETCH_HEAD
fi
git submodule update --init --recursive
%build
%meson
%meson_build
%install
%meson_install
%find_lang %{name}
%check
%meson_test
desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml
glib-compile-schemas --dry-run --strict %{buildroot}%{_datadir}/glib-2.0/schemas/
%files -f %{name}.lang
%license COPYING
%doc README.md
%{_bindir}/%{name}
%{_bindir}/%{name}-magpie
%{_datadir}/%{name}
%{_datadir}/applications/%{app_id}.desktop
%{_datadir}/icons/hicolor/*/apps/%{app_id}*
%{_datadir}/glib-2.0/schemas/*.gschema.xml
%{_metainfodir}/%{app_id}.metainfo.xml
%changelog
* Sat Aug 01 2026 Infiniti151 <43163551+Infiniti151@users.noreply.github.com> - 1.2.0-1
- Noteworthy changes:
- Add a new Battery page to the Performance tab, with charge graphs and detailed battery information (@jlo62)
- Show per-partition usage details on the disk page, including used and free space (@jojo2357)
- Overhaul the graphing backend: smoother animations and rendering, a new loading shimmer while data loads, and less stuttering on application startup (@jojo2357, @kicsyromy)
- Improve application detection, fixing wrong names and icons, phantom entries for PWAs, and constantly cycling processes (@kicsyromy)
- Improvements to the Snap package, which was upgraded to the core24 snap (@kicsyromy)
- Improvements to the AppImage package which now uses quick-sharun, is smaller and no longer depends on FUSE (@kicsyromy)
- Minor features:
- Add a second CPU graph that can show temperature, power draw or CPU frequency (@jlo62)
- Add memory compression (zRAM/zswap) statistics to the Memory page (@timatgca)
- ... see upstream for full release notes
flatpak2spec/
βββ Cargo.toml # Project metadata, binary definition, and crate dependencies
βββ cliff.toml # git-cliff changelog generator config
βββ .github/
β βββ workflows/
β βββ release.yml # CI/CD workflow for automated building, attestation, and releases
βββ src/
βββ main.rs # Entry point: orchestrates CLI args, workspace cloning, and pipeline execution
βββ spec.rs # Assembles all generated section strings into a final RPM .spec file
βββ repository.rs # Workspace preparation and remote Git repository cloning logic
βββ manifest.rs # Flatpak manifest parser and validation engine
βββ meson.rs # Meson build file inspection and metadata extraction
βββ utils.rs # Common filesystem, regex search, and string helper utilities
βββ sections/ # Spec file section generators
βββ mod.rs # Module aggregator exporting all spec section submodules
βββ header.rs # Generates RPM spec preamble metadata (Name, Version, License, URL, Source0)
βββ deps.rs # Translates Flatpak modules/dependencies into BuildRequires and Requires directives
βββ description.rs # Generates the %description section
βββ build.rs # Generates %prep, %build, %install, and %check sections
βββ scriptlets.rs # Generates post/un scriptlets (icon cache updates, glib schemas)
βββ files.rs # Scans project artifacts to generate %files listings and %find_lang macros
βββ changelog.rs # Generates the %changelog section
Contributions, bug reports, and pull requests are welcome! Feel free to check out the issues page.
This project is licensed under GPL-3.0-or-later.