This directory contains the configuration and tooling for building .deb (Debian/Ubuntu) and .rpm (Fedora/RHEL) packages for the structkit CLI.
debian/— Debian/Ubuntu package configurationrpm/— Fedora/RHEL package configurationstructkit-shim.sh— Wrapper script installed at/usr/bin/structkit
The packages install structkit in a vendored Python virtual environment to handle dependencies that may not be available in distribution repositories:
- Vendored environment:
/usr/lib/structkit/venv/— Complete Python environment with all dependencies - CLI wrapper:
/usr/bin/structkit— Shim script that invokes the vendored structkit - Documentation:
/usr/share/doc/structkit/— README and LICENSE files
This approach ensures:
- No conflicts with system Python packages
- Consistent dependency versions across distributions
- Simple installation without requiring pip or virtual environment management
Install required tools:
Debian/Ubuntu:
sudo apt-get update
sudo apt-get install -y python3 python3-pip python3-virtualenvFedora/RHEL:
sudo dnf install -y python3 python3-pip python3-virtualenvInstall nfpm (cross-platform package builder):
# Option 1: Using apt (Debian/Ubuntu)
echo "deb [trusted=yes] https://repo.goreleaser.com/apt/ /" | sudo tee /etc/apt/sources.list.d/goreleaser.list
sudo apt-get update
sudo apt-get install -y nfpm
# Option 2: Using yum/dnf (Fedora/RHEL)
echo '[goreleaser]
name=GoReleaser
baseurl=https://repo.goreleaser.com/yum/
enabled=1
gpgcheck=0' | sudo tee /etc/yum.repos.d/goreleaser.repo
sudo dnf install -y nfpm
# Option 3: Direct download
# See: https://nfpm.goreleaser.com/install/-
Install Python build dependencies:
python3 -m pip install --upgrade pip build virtualenv
-
Build the Python wheel:
python3 -m build --wheel
-
Create vendored virtual environment:
mkdir -p dist python3 -m virtualenv dist/venv dist/venv/bin/pip install --upgrade pip dist/venv/bin/pip install dist/*.whl -
Build Debian package (amd64):
VERSION=$(python3 -c "import tomllib; f = open('pyproject.toml', 'rb'); data = tomllib.load(f); f.close(); print(data['project']['version'])") ARCH=amd64 nfpm package --packager deb --config packaging/debian/nfpm.yaml --target dist/ -
Build RPM package (amd64):
VERSION=$(python3 -c "import tomllib; f = open('pyproject.toml', 'rb'); data = tomllib.load(f); f.close(); print(data['project']['version'])") ARCH=amd64 nfpm package --packager rpm --config packaging/rpm/nfpm.yaml --target dist/
The built packages will be in the dist/ directory:
structkit_${VERSION}_amd64.debstructkit-${VERSION}-1.x86_64.rpm
Packages are attached to each GitHub Release starting with 3.3.1. Download the .deb / .rpm (and SHA256SUMS) from the release, or build them locally with the steps above.
# Download the .deb from the GitHub release, then:
sudo apt install ./structkit_VERSION_amd64.deb
# If there are dependency issues, resolve them with:
sudo apt-get install -f# Download the .rpm from the GitHub release, then:
sudo dnf install ./structkit-VERSION-1.x86_64.rpm
# Or using rpm directly:
sudo rpm -ivh structkit-VERSION-1.x86_64.rpmAfter installation, verify that structkit is working:
structkit info
structkit --helpThe .github/workflows/build-linux-packages.yaml workflow automatically builds packages when:
- On release — Triggered when a new GitHub release is published
- Manual dispatch — Can be triggered from the Actions tab with a required
taginput (for examplev3.3.1) to rebuild that tag and attach packages to that release
The workflow:
- Checks out the release tag (or the
workflow_dispatchtag) - Builds packages for both
amd64andarm64architectures - Creates both
.deband.rpmpackages (4 total artifacts) - Uploads packages as GitHub Actions artifacts (90-day retention)
- Attaches the packages and a
SHA256SUMSfile to the corresponding GitHub Release
- Go to Actions → build-linux-packages
- Click Run workflow
- Enter the release tag to backfill (for example
v3.3.1) - Click Run workflow
After the workflow completes, download packages from the GitHub release for that tag:
structkit_VERSION_amd64.deb/structkit_VERSION_arm64.debstructkit-VERSION-1.x86_64.rpm/structkit-VERSION-1.aarch64.rpmSHA256SUMS
The same files are also available as Actions artifacts:
structkit-VERSION-amd64-debstructkit-VERSION-arm64-debstructkit-VERSION-amd64-rpmstructkit-VERSION-arm64-rpm
Each package includes:
/usr/bin/structkit— CLI entry point (wrapper script)/usr/lib/structkit/venv/— Vendored Python environment with:- Python interpreter
- structkit and all dependencies
- Site packages (PyYAML, requests, openai, jinja2, etc.)
/usr/share/doc/structkit/README.md— Project README/usr/share/doc/structkit/LICENSE— Apache-2.0 License
Package metadata is defined in:
packaging/debian/nfpm.yaml— Debian package configurationpackaging/rpm/nfpm.yaml— RPM package configuration
Common fields to update:
maintainer— Package maintainer contactdescription— Package descriptiondepends— Runtime dependenciesrecommends— Recommended packages
The package version is automatically extracted from pyproject.toml during builds. Ensure the version in pyproject.toml is updated before building or releasing.
If you encounter dependency issues:
Debian/Ubuntu:
sudo apt-get update
sudo apt-get install -fFedora/RHEL:
sudo dnf install ca-certificatesVerify the installation:
which structkit # Should show /usr/bin/structkit
ls -la /usr/lib/structkit/venv/ # Should show Python environment
/usr/lib/structkit/venv/bin/structkit --help # Direct invocationIf the shim script fails, you can directly invoke:
/usr/lib/structkit/venv/bin/structkit [command]This is Phase 1 of Linux distribution packaging. Not included in this PR:
- Submission to Debian mentors or Fedora review
- PPA/COPR repository setup
- Official distribution repository inclusion
- Package signing/verification
- Marketplace/catalog integration
These may be addressed in future phases based on community adoption and requirements.