This document describes how to build and install RPM packages for the Python GUI Menu application.
The application can be packaged as an RPM for easy installation and distribution on Red Hat-based Linux systems (RHEL, CentOS, Fedora, etc.). The RPM package includes:
- Pre-built executable installed in
/opt/PythonMenu/ - Desktop integration with menu entry and icon
- System wrapper script at
/usr/bin/python-gui-menu - All required configuration files and documentation
The automated RPM build is triggered by:
-
Git Tags: Push a version tag (e.g.,
v1.0.0)git tag v1.0.0 git push origin v1.0.0
-
Manual Workflow: Run from GitHub Actions tab
- Go to your repository's "Actions" tab
- Select "Build RPM Package" workflow
- Click "Run workflow"
- Optionally specify a release tag
The GitHub Action:
- Uses CentOS Stream 9 container for authentic RPM environment
- Installs all required dependencies (Qt5, Python, build tools)
- Builds the application using cross-platform enhanced mode
- Creates proper RPM package with all files
- Tests the installation process
- Uploads the RPM as an artifact
- Creates a GitHub release (for tagged builds)
After a successful build:
- RPM package is available as GitHub artifact
- For tagged builds: RPM is attached to the GitHub release
- Package name format:
python-gui-menu-<version>-1.<arch>.rpm
On CentOS/RHEL/Fedora systems, install required packages:
# For CentOS Stream 9 / RHEL 9+ / Fedora
sudo dnf install rpm-build rpmdevtools python3 python3-pip python3-devel \
qt5-qtbase-devel desktop-file-utils
# For CentOS/RHEL 8
sudo dnf install rpm-build rpmdevtools python3 python3-pip python3-devel \
qt5-qtbase-devel desktop-file-utils
# For older systems with yum
sudo yum install rpm-build rpmdevtools python3 python3-pip python3-devel \
qt5-qtbase-devel desktop-file-utilsUse the included build script:
# Auto-detect version from git tags
./build-rpm.sh
# Or specify a version
./build-rpm.sh 1.0.0The script will:
- Verify all required files are present
- Build the application using the existing build system
- Prepare files for RPM packaging
- Create the RPM spec file
- Build the final RPM package
After successful build:
- RPM package:
python-gui-menu-<version>-1.<arch>.rpm - Source tarball:
~/rpmbuild/SOURCES/python-gui-menu-<version>.tar.gz - Spec file:
~/rpmbuild/SPECS/python-gui-menu.spec
# Install the RPM package
sudo dnf install ./python-gui-menu-*.rpm
# Or using rpm directly
sudo rpm -ivh python-gui-menu-*.rpmAfter installation, verify the package:
# Check installed files
rpm -ql python-gui-menu
# Check package information
rpm -qi python-gui-menu
# Test the application
python-gui-menu --helpThe RPM installs the following files:
menu- Main executableconfig.yml- Default configurationconfig_sample.yml- Sample configurationlogo.png,smallicon.png- Application imagesrun_linux.sh- Enhanced Linux launcher scriptDocs/- Help documentationREADME.txt- Package documentation
/usr/bin/python-gui-menu- System wrapper script/usr/share/applications/python-gui-menu.desktop- Desktop entry/usr/share/pixmaps/python-gui-menu.png- Application icon
# Run with default configuration
python-gui-menu
# Run with custom configuration
python-gui-menu /path/to/custom_config.yml
# Run from installation directory
cd /opt/PythonMenu
./menu- Application appears in system menu under "Utilities" or "System"
- Can be launched from desktop environment's application launcher
- Search for "Python GUI Menu"
The application looks for configuration files in this order:
- Command line argument:
python-gui-menu custom_config.yml - Default configuration:
/opt/PythonMenu/config.yml
To customize:
- Copy
/opt/PythonMenu/config_sample.ymlto a new file - Edit the configuration as needed
- Run with:
python-gui-menu /path/to/your_config.yml
# Remove the package
sudo dnf remove python-gui-menu
# Or using rpm
sudo rpm -e python-gui-menuThis removes all installed files and cleans up desktop integration.
python3,python3-pip,python3-develqt5-qtbase-develrpm-build,rpmdevtoolsdesktop-file-utilsgcc,gcc-c++,make(for PyInstaller)
qt5-qtbase-gui- Qt5 GUI librariesqt5-qtwayland- Wayland supportlibxcb- X11 connection libraryfontconfig- Font configuration
All runtime dependencies are automatically installed with the RPM.
-
"rpmbuild not found"
sudo dnf install rpm-build rpmdevtools
-
"No match for argument: python3-venv"
- In CentOS Stream 9,
venvis included in the basepython3package - Use
python3-develinstead for development headers
sudo dnf install python3-devel
- In CentOS Stream 9,
-
"PyQt5 installation failed"
sudo dnf install qt5-qtbase-devel python3-devel gcc gcc-c++
-
"Desktop file validation failed"
sudo dnf install desktop-file-utils
-
"Empty %files file debugsourcefiles.list"
- This occurs when RPM tries to create debug packages for a pre-built executable
- The fix is already included in the spec files (debug packages disabled)
- If you see this in custom builds, add to your spec file:
%global _enable_debug_package 0 %global debug_package %{nil}
-
"Cannot find Qt platform plugin"
sudo dnf install qt5-qtbase-gui qt5-qtwayland
-
Application won't start
- Run with debug:
cd /opt/PythonMenu && ./run_linux.sh --debug - Check dependencies:
ldd /opt/PythonMenu/menu
- Run with debug:
-
Missing desktop entry
- Reinstall package:
sudo dnf reinstall python-gui-menu - Update desktop database:
sudo update-desktop-database
- Reinstall package:
To create a customized RPM:
- Modify the spec file template in
build-rpm.sh - Add additional files or dependencies
- Rebuild:
./build-rpm.sh
The GitHub Action can be integrated into larger CI/CD workflows:
- name: Build RPM
uses: ./.github/workflows/build-rpm.yml
- name: Deploy to Repository
run: |
# Upload to your RPM repository
scp *.rpm user@repo-server:/path/to/repo/
# Update repository metadata
ssh user@repo-server "cd /path/to/repo && createrepo ."For issues with:
- Application functionality: Check main project README
- RPM packaging: Review this document and GitHub Action logs
- Installation issues: Check system logs and dependency requirements
The automated GitHub Action provides the most reliable build environment and should be preferred for production use.