Skip to content

apkg commands

To get a summary of available apkg commands, simply run it without parameters:

$> apkg

Usage: apkg [OPTIONS] COMMAND [ARGS]...

  apkg the upstream packaging automation tool

Options:
  -L, --log-level [debug|verbose|info|brief|quiet]
                                  set log level  [default: info]
  -h, --help                      show this help message
  --version                       show apkg version

Commands:
  build         build packages
  build-dep     install or list build dependencies
  compat        check apkg compat level
  get-archive   download upstream archive for current project
  install       install packages using native package manager
  make-archive  create dev archive from current project state
  srcpkg        create source package (files to build packages from)
  status        show status of current project
  system-setup  setup system for packaging

Use --help/-h after a command to get help for that particular command instead:

$> apkg command --help

status

$> apkg status --help

Usage: apkg status [OPTIONS]

  show status of current project

Options:
  -d, --distro TEXT  override target distro  [default: current]
  -h, --help         show this help

Example:

$> apkg status

project name:            apkg
project base path:       /home/u/src/apkg
project VCS:             git
project config:          distro/config/apkg.toml (exists)
package templates path:  distro/pkg (exists)
package templates:
    arch: arch pkgstyle default: arch
    deb: deb pkgstyle default: ubuntu | debian | linuxmint | raspbian
    nix: nix pkgstyle default: nix | nixos
    rpm: rpm pkgstyle default: fedora | centos | rocky | rhel | opensuse | oracle | pidora | scientific

current distro: arch / Arch Linux
    package style: arch
    package template: distro/pkg/arch

system-setup

$> apkg system-setup --help

Usage: apkg system-setup [OPTIONS]

  setup system for packaging

Options:
  -I, --isolated     also install packages for isolated build
  -d, --distro TEXT  override target distro  [default: current]
  --ask / --no-ask   enable/disable interactive mode  [default: no-ask]
  --help             Show this message and exit.

make-archive

$> apkg make-archive --help

Usage: apkg make-archive [OPTIONS]

  create dev archive from current project state

Options:
  -O, --result-dir TEXT  put results into specified dir
  --cache / --no-cache   enable/distable cache  [default: cache]
  -h, --help             show this help

make-archive requires project.make_archive_script config option to be set.

This command will only succeed when the script finishes successfully (with exit code 0) and the resulting archive it created and printed to stdout followed by one line for each additional file (like signature).

Resulting archive is copied to pkg/archives/dev/ or to --result-dir.

get-archive

$> apkg get-archive --help

Usage: apkg get-archive [OPTIONS]

  download upstream archive for current project

Options:
  -v, --version TEXT     version of archive to download
  -O, --result-dir TEXT  put results into specified dir
  --cache / --no-cache   enable/distable cache  [default: cache]
  -h, --help             show this help

get-archive requires upstream.archive_url config option to be set with additional options available in upstream config section.

This command will only succeed when it managed to download specified archive.

Archive is downloaded into pkg/archives/upstream/ or to --result-dir.

If automatic latest upstream version detection doesn't work, you can always supply version manually with -v/--version option, i.e. apkg get-archive -v 1.2.3

srcpkg

$> apkg srcpkg --help

Usage: apkg srcpkg [OPTIONS] [INPUT_FILES]...

  create source package (files to build packages from)

Options:
  -a, --archive          source package from speficied archive file(s)
  -u, --upstream         upstream source package from archive templates
  -v, --version TEXT     upstream archive version to use, implies --upstream,
                         exclusive with --archive
  -r, --release TEXT     set packagge release  [default: 1]
  -d, --distro TEXT      set target distro  [default: current]
  -O, --result-dir TEXT  put results into specified dir  [default:
                         pkg/srcpkg/DISTRO/NVR]
  --render-template      only render source package template
  --cache / --no-cache   enable/disable cache  [default: cache]
  -F, --file-list TEXT   specify text file listing one input file per line,
                         use '-' to read from stdin
  -h, --help             show this help message

build

$> apkg build --help

Usage: apkg build [OPTIONS] [INPUT_FILES]...

  build packages

Options:
  -s, --srcpkg           use source package
  -a, --archive          use template (/build srcpkg) from archive
  -u, --upstream         use upstream template / archive / srcpkg
  -v, --version TEXT     upstream archive version to use, implies --upstream,
                         exclusive with --srcpkg and --archive
  -r, --release TEXT     set packagge release  [default: 1]
  -d, --distro TEXT      override target distro  [default: current]
  -b, --build-dep        install build dependencies on host (apkg build-dep)
  -O, --result-dir TEXT  put results into specified dir  [default:
                         pkg/srcpkg/DISTRO/NVR]
  --cache / --no-cache   enable/disable cache  [default: cache]
  -F, --file-list TEXT   specify text file listing one input file per line,
                         use '-' to read from stdin
  -I, --isolated         use isolated builder (pbuilder, mock, ...)
  -i, --install-dep      [DEPRECATED] compat alias for --build-dep
  -h, --help             show this help message

build-dep

$> apkg build-dep --help

Usage: apkg build-dep [OPTIONS] [INPUT_FILES]...

  install or list build dependencies

Options:
  -l, --list            list build deps only, don't install
  -u, --upstream        use upstream template / archive / srcpkg
  -s, --srcpkg          use source package
  -a, --archive         use template (/build srcpkg) from archive
  -d, --distro TEXT     override target distro  [default: current]
  -F, --file-list TEXT  specify text file listing one input file per line, use
                        '-' to read from stdin
  --ask / --no-ask      enable/disable interactive mode  [default: no-ask]
  -y, --yes             compat alias for --no-ask
  -h, --help            show this help message

install

$> apkg install --help

Usage: apkg install [OPTIONS] [INPUT_FILES]...

  install packages using native package manager

  Default: build packages and install them

  `apkg build` options are available

  you can supply a list of --custom-pkgs or --distro-pkgs to install specified
  custom/distro packages directly without any build

Options:
  -C, --custom-pkgs     install custom packages (no build)
  -D, --distro-pkgs     install packages from distro repos (no build)
  -s, --srcpkg          build and install packages from srcpkg
  -a, --archive         build and install packages from archive
  -u, --upstream        build and install upstream packages
  -v, --version TEXT    upstream archive version to use, implies --upstream
  -r, --release TEXT    set release for built packages  [default: 1]
  -b, --build-dep       install build deps on host (apkg build-dep)
  -d, --distro TEXT     override target distro  [default: current]
  --cache / --no-cache  enable/disable cache  [default: cache]
  --ask / --no-ask      enable/disable interactive mode  [default: no-ask]
  -F, --file-list TEXT  specify text file listing one input file per line, use
                        '-' to read from stdin
  -y, --yes             [DEPRECATED] compat alias for --no-ask
  -h, --help            show this help message