.rpm Package
Build an RPM package for Fedora and RHEL-based distributions.
An .rpm package is the native package format for Red Hat-based Linux distributions including Fedora, RHEL, CentOS Stream, Rocky Linux, AlmaLinux, and openSUSE. Users install it with dnf or rpm, and the system handles dependencies, menu integration, and clean uninstallation.
Building
Section titled “Building”lightshell build --target rpmOutput:
✓ Built my-app in 1.4s → 5.2MB✓ Created myapp binary✓ Packaged RPM → dist/myapp-1.0.0-1.x86_64.rpmThe .rpm file appears in the dist/ directory.
Installing
Section titled “Installing”Users can install the package using dnf or rpm:
# Using dnf (recommended — resolves dependencies automatically)sudo dnf install ./myapp-1.0.0-1.x86_64.rpm
# Using rpm (manual dependency resolution)sudo rpm -i myapp-1.0.0-1.x86_64.rpmAfter installation:
- The binary is placed at
/usr/bin/myapp - A
.desktopentry is created at/usr/share/applications/myapp.desktop - The app icon is installed to
/usr/share/icons/hicolor/256x256/apps/myapp.png - The app appears in the GNOME or KDE application launcher
Uninstalling
Section titled “Uninstalling”sudo dnf remove myappThis removes the binary, desktop entry, and icon. User data in ~/.local/share/{appId} is preserved.
Package Contents
Section titled “Package Contents”LightShell generates an RPM containing:
/usr/bin/myapp # Application binary/usr/share/applications/myapp.desktop # Desktop entry/usr/share/icons/hicolor/256x256/apps/myapp.png # App iconSpec File
Section titled “Spec File”LightShell generates an RPM spec file from your lightshell.json configuration. The spec file defines the package metadata, dependencies, and file list:
Name: myappVersion: 1.0.0Release: 1Summary: A short description of your appLicense: MITURL: https://example.comRequires: webkit2gtk4.1 >= 2.38, gtk3
%descriptionA short description of your app
%files/usr/bin/myapp/usr/share/applications/myapp.desktop/usr/share/icons/hicolor/256x256/apps/myapp.pngLightShell uses rpmbuild if available on the build system, or falls back to fpm (Effing Package Management) as an alternative RPM builder.
Dependencies
Section titled “Dependencies”LightShell RPM packages declare two runtime dependencies:
- webkit2gtk4.1 (>= 2.38) — the WebKitGTK webview
- gtk3 — the GTK 3 toolkit
On Fedora and RHEL desktop installations, these are typically pre-installed. If missing, dnf install resolves them automatically.
Configuration
Section titled “Configuration”The RPM metadata is derived from your lightshell.json:
{ "name": "my-app", "version": "1.0.0", "description": "A short description of your app", "author": "Your Name", "homepage": "https://example.com", "build": { "icon": "assets/icon.png", "appId": "com.example.myapp" }}| Field | RPM Spec Field |
|---|---|
name | Name (lowercased, hyphens removed) |
version | Version |
description | Summary and %description |
author | Used in the changelog |
homepage | URL |
build.icon | Installed to hicolor icons |
build.appId | Used in .desktop entry |
Inspecting the Package
Section titled “Inspecting the Package”Verify the RPM contents before distributing:
# View package metadatarpm -qpi dist/myapp-1.0.0-1.x86_64.rpm
# List all files in the packagerpm -qpl dist/myapp-1.0.0-1.x86_64.rpm
# Show dependenciesrpm -qpR dist/myapp-1.0.0-1.x86_64.rpmExample rpm -qpi output:
Name : myappVersion : 1.0.0Release : 1Architecture: x86_64Size : 5242880Summary : A short description of your appURL : https://example.comDescription : A short description of your appBuild Requirements
Section titled “Build Requirements”To build RPM packages, your build system needs one of:
- rpmbuild — the standard RPM build tool, part of the
rpm-buildpackage - fpm — a multi-format package builder that can produce RPMs
On Fedora/RHEL:
sudo dnf install rpm-buildOn Ubuntu (for cross-building):
sudo apt-get install rpmArchitecture
Section titled “Architecture”LightShell builds for the architecture of the current machine:
- x86_64 — standard AMD/Intel 64-bit systems
- aarch64 — ARM 64-bit systems
The architecture is detected automatically and used in the package filename and spec file.
CI Integration
Section titled “CI Integration”Build RPM packages in GitHub Actions:
jobs: build-rpm: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install build dependencies run: | sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev rpm - name: Build .rpm run: lightshell build --target rpm - name: Upload artifact uses: actions/upload-artifact@v4 with: name: linux-rpm path: dist/*.rpmFor native Fedora builds:
jobs: build-rpm: runs-on: ubuntu-latest container: fedora:latest steps: - uses: actions/checkout@v4 - name: Install build dependencies run: dnf install -y gtk3-devel webkit2gtk4.1-devel rpm-build - name: Build .rpm run: lightshell build --target rpmHosting in a DNF Repository
Section titled “Hosting in a DNF Repository”For ongoing distribution, host your RPMs in a YUM/DNF repository so users can install and receive updates through the package manager. You can use Fedora COPR (Community Projects) for free hosting of RPM packages, or set up a self-hosted repository with createrepo.