Skip to content

Debian package (.deb) after build

On Linux, the project configures CPack with the DEB generator so you can produce a Debian package from the same install() rules used for a normal install.

Prerequisites

  • Debian or Ubuntu build host (or compatible) with build dependencies from ci/dependencies/apt-packages-base.txt at the repository root.
  • CMake 3.25+ and Ninja. Packaging is a separate step after the release workflow (see CMakePresets.json at the repository root). CPack is not part of the debug / release workflows.

Install prefix

The hidden zpc configure preset (inherited by debug / release) sets CMAKE_INSTALL_PREFIX from the parent environment ($penv{CMAKE_INSTALL_PREFIX} in CMakePresets.json). If unset, configure falls back to /usr/local. Override with the environment variable or -DCMAKE_INSTALL_PREFIX=....

For FHS (Filesystem Hierarchy Standard) paths and the /var/lib/zpc install rule in applications/zpc/CMakeLists.txt, set CMAKE_INSTALL_PREFIX=/usr when packaging (see applications/zpc/CMakeLists.txt).

Build and generate the .deb

Typical sequence (matches CI):

CMAKE_INSTALL_PREFIX=/usr cmake --workflow --preset release
cpack --preset release

Configure and build use the release workflow on any host. Run cpack --preset release only on Linux (CPack is not enabled on macOS). CI runs this extra step after the release workflow.

Equivalent without the workflow preset:

cmake --preset release -DCMAKE_INSTALL_PREFIX=/usr
cmake --build --preset release
cpack --preset release

CPack writes the .deb under build/release/.

Runtime Depends: are set in cmake/include/cpack.cmake (CPACK_DEBIAN_PACKAGE_DEPENDS). Override at configure time with -DCPACK_DEBIAN_PACKAGE_DEPENDS='...' if needed.

The default runtime dependencies are libc6 (>= 2.31) and libssl3 (>= 3.0.0). SQLite, fmt, yaml-cpp, and nlohmann/json are built into ZPC (or are header-only), so the package no longer requires their separate Debian runtime packages. Sanitizer packages add the matching runtime library: libasan8 and libubsan1 for AddressSanitizer/UndefinedBehaviorSanitizer builds, or libtsan2 for ThreadSanitizer builds.

All Debian build presets use the filename zpc-<architecture>.deb, including sanitizer builds. CI artifact names identify the sanitizer preset separately.

Cross-compilation

When using cmake/arm64_debian.cmake or cmake/armhf_debian.cmake, CPACK_DEBIAN_PACKAGE_ARCHITECTURE is preset for the target. Align CMAKE_INSTALL_PREFIX and sysroot with your cross environment.

macOS

CPack Debian packaging is not enabled on Apple hosts (CMakeLists.txt gates the CPack include). Do not run cpack --preset release there; build the package on Linux or in CI.

CI

Debian packaging runs in GitHub Actions on native Linux runners via .github/workflows/zpc-build-linux.yaml. Pull requests run full CI in .github/workflows/zpc-ci.yaml, which calls the Linux build workflow after lint checks. Pushes to main trigger the Linux build workflow directly. Tagged releases (zpc-v*) run .github/workflows/zpc-release.yaml, which calls the Linux build workflow and publishes .deb assets to GitHub Releases. CI produces amd64 and arm64 packages only. Jobs configure with CMAKE_INSTALL_PREFIX=/usr. amd64-gcc builds debug then release; arm64-gcc and amd64-clang build release only. gcc rows then run cpack --preset release and upload .deb files with actions/upload-artifact (1-day retention). Download packages from the workflow run’s Artifacts panel. Configure needs a repository state where git describe succeeds (see cmake/include/version.cmake).