PAXBuild is a package builder for the PAX package manager. It creates .pax
packages from .paxmeta
recipes.
cargo build --release
sudo cp target/release/paxbuild /usr/local/bin/
# Build from URL
paxbuild build https://example.com/package.paxmeta
# Build for specific architecture
paxbuild build package.paxmeta --arch x86_64
# Build for multiple architectures
paxbuild build package.paxmeta --arch x86_64 --arch aarch64
# Build with custom output path (for single architecture)
paxbuild build package.paxmeta --arch x86_64 --output /tmp/my-package-x86_64.pax
# Build with custom output directory (for multiple architectures)
paxbuild build package.paxmeta --arch x86_64 --arch aarch64 --output /tmp/packages/
# Verbose output
paxbuild build package.paxmeta --verbose
# Verify package integrity
paxbuild verify package.pax
# Verify with signature
paxbuild verify package.pax --key public.key
# Sign package
paxbuild sign package.pax --key private.key
# Sign with custom output
paxbuild sign package.pax --key private.key --output package.pax.sig
# Show package info
paxbuild info package.pax
# Extract to current directory
paxbuild extract package.pax
# Extract to specific directory
paxbuild extract package.pax --output /tmp/extracted
PAXBuild provides comprehensive key management functionality for cryptographic operations:
# Generate a new Ed25519 key pair
paxbuild keys generate --private private.key --public public.key
# Generate with force overwrite
paxbuild keys generate --private private.key --public public.key --force
# Show private key information
paxbuild keys info --key private.key --type private
# Show public key information
paxbuild keys info --key public.key --type public
# List keys in current directory
paxbuild keys list
# List keys in specific directory
paxbuild keys list --directory ./keys/
# Export public key from private key
paxbuild keys export --private private.key --public exported-public.key
# Import a key from another location
paxbuild keys import --source backup.key --dest imported.key --type private
# Backup all keys from directory
paxbuild keys backup --source ./keys/ --dest ./backup/
- Private keys: Used for signing packages (32 bytes Ed25519)
- Public keys: Used for signature verification (32 bytes Ed25519)
All keys are stored as hexadecimal strings in .key
files.
PAXBuild uses YAML recipe files to define how to build packages:
name: package-name
version: 1.0.0
description: Package description
source: https://example.com/package-1.0.0.tar.gz
hash: sha256:abc123... # Optional, auto-generated if missing
# Build configuration
build: |
./configure --prefix=/usr
make -j$(nproc)
make install DESTDIR=$PAX_BUILD_ROOT
# Dependencies
dependencies:
- libc>=2.31
- libssl>=1.1
runtime_dependencies:
- libc.so.6
- libssl.so.1.1
# Package metadata
provides:
- package-name
- package-bin
conflicts:
- old-package
# Scripts
install: |
ldconfig
update-desktop-database
uninstall: |
ldconfig
The build script has access to these environment variables:
PAX_BUILD_ROOT
: Installation destinationPAX_PACKAGE_NAME
: Package namePAX_PACKAGE_VERSION
: Package versionPAX_ARCH
: Target architecturePAX_SOURCE_DIR
: Source directoryPAX_BUILD_DIR
: Build directory
PAXBuild supports building packages for multiple architectures in a single command:
# Build for specific architectures
paxbuild build package.paxmeta --arch x86_64 --arch aarch64
# Build for all architectures defined in recipe
paxbuild build package.paxmeta
# Supported architectures: x86_64, aarch64, armv7, i686, riscv64
Multi-architecture packages use the format: name-version-architecture.pax
hello-world-1.0.0-x86_64.pax
(x86_64 architecture)hello-world-1.0.0-aarch64.pax
(ARM64 architecture)
When building multiple architectures:
- Without
--output
: Packages are created in temp directory with proper names - With
--output
for single architecture: Package copied to specified path - With
--output
for multiple architectures: Output treated as directory, each architecture gets its own file
PAX packages are zstd-compressed tarballs containing:
metadata.yaml
: Package metadata (YAML) with installation information- Package files in standard Linux directory structure (usr/bin/, usr/lib/, etc.)
- Optional signature file
The .pax
format is a compiled package ready for direct installation by PAX, not a local build recipe.
name: htop
version: 3.2.1
description: Interactive process viewer
source: https://github.com/htop-dev/htop/releases/download/3.2.1/htop-3.2.1.tar.xz
name: myapp
version: 1.0.0
description: My custom application
source: https://github.com/user/myapp/archive/v1.0.0.tar.gz
build: |
cargo build --release
mkdir -p $PAX_BUILD_ROOT/usr/bin
cp target/release/myapp $PAX_BUILD_ROOT/usr/bin/
name: myapp
version: 1.0.0
description: My application
source: https://example.com/myapp-1.0.0.tar.gz
dependencies:
- libc>=2.31
- libssl>=1.1
runtime_dependencies:
- libc.so.6
- libssl.so.1.1
provides:
- myapp
- myapp-bin
PAXBuild integrates with the PAX package manager's compile
command:
# PAX will automatically use paxbuild
sudo pax compile https://github.com/user/project
sudo pax compile ./package.paxmeta
- Packages are signed with Ed25519 signatures
- Source checksums are verified
- Build scripts run in isolated environment
- Temporary files are cleaned up automatically
- Rust 1.70+
- tar
- zstd
- unzip (for zip archives)
feel free to contribute!