Shared packaging tooling for Mechanix apps. Currently builds RPM and DEB (via nfpm).
Each app repo (mechanix-clock, mechanix-files, ...) stays fully
independent - this tool is installed separately and invoked from an
app repo's root.
package.py CLI entrypoint: resolves version/arch, stages the
build bundle, dispatches each requested format to
its packager
resolve_version.py Standalone package release resolver (rpm/deb version)
common.py helpers: repo root, upstream version
(pubspec.yaml or Cargo.toml), finding/staging the
flutter-elinux bundle
packagers/
__init__.py The packager contract + registry
nfpm.py rpm, deb, apk, archlinux - all via nfpm
Download and extract a tagged release:
curl -fsSL -o mechanix-packager.tar.gz \
https://github.com/mecha-org/mechanix-packager/archive/refs/tags/v0.0.1.tar.gz
mkdir -p mechanix-packager && tar -xzf mechanix-packager.tar.gz -C mechanix-packager --strip-components=1Run it from the app repo's root, it resolves everything (pubspec.yaml or Cargo.toml, packaging/nfpm/nfpm.yaml, the build output) relative to app's current working directory.
# version from pubspec.yaml/Cargo.toml, release defaults to "1"
python3 /path/to/mechanix-packager/package.py
# CI / fetch the next release number:
python3 /path/to/mechanix-packager/resolve_version.py --format rpm
python3 /path/to/mechanix-packager/package.py --formats rpm --release "$RELEASE"pubspec.yaml(flutter-elinux apps) orCargo.toml(Rust apps) at the repo root, with aversion:/version = "..."field.packaging/nfpm/nfpm.yaml- the nfpm config. Itsname:field is what the nfpm packager andresolve_version.pyuse as the package name.packaging/nfpm/scripts/- launcher/postinstall/postremove scripts referenced fromnfpm.yaml, if any.- flutter-elinux apps: a
build/elinux/*/release/bundledirectory to package, before runningpackage.py- it gets staged to a fixed./stage/bundlepath since nfpm.yaml can't reference a variable one. - Cargo apps: build output lands at a fixed
target/.../release/<bin>path already, sonfpm.yamlreferences it directly.nfpm.yaml's actual content (binary name, maintainer, description, dependencies, whether a desktop entry/icon exist yet) - is actual per-app data and will be maintained in each app repo.