Reference

Makefile Targets

Miscellaneous Targets

Target

Level

Description

update

repo/root

Update Pakste to latest version

help

package & repo/root

Display available targets and their descriptions

clean

package & repo/root

Remove all build artifacts and directories

vulncheck

package & repo/root

Check NVD public vulnerabilities

github_matrix

repo/root

Output the Github Action Matrix (json)

Variable

Default

Description

KEEP_CACHE (clean target only)

false

When set to true, keeps downloaded sources during clean

Package Building Targets

Target

Level

Description

manifest

package

Create or update the MANIFEST file with source archive checksums

deb

package

Build DEB package locally (requires build dependencies)

rpm

package

Build RPM package locally (requires build dependencies)

deb_chroot

package & repo/root

Build DEB package in a clean chroot environment

rpm_chroot

package & repo/root

Build RPM package in a clean chroot environment

deb_shell_chroot

package

Debug, try to build DEB package and spawn a shell if error

rpm_shell_chroot

package

Debug, try to build RPM package and spawn a shell if error

Variable

Default

Description

DIST

none

Target distribution codename (e.g., bullseye, el9)

ARCH

host architecture

Target Architecture (e.g., arm64, riscv64, amd64)

Repository Targets

Target

Level

Description

deb_repo

repo/root

Build .deb repository for a specific distribution & architecture

rpm_repo

repo/root

Build .rpm repository for a specific distribution & architecture

rpm_all_repos

repo/root

Build all .rpm repositories for all targets (see RPM_ALL_TARGETS in Makefile.config)

deb_all_repos

repo/root

Build all .deb repositories for all targets (see DEB_ALL_TARGETS in Makefile.config)

all_repos

repo/root

Build all .deb and .rpm repositories for all targets (default target)

Variable

Default

Description

DIST

none

Target distribution codename (e.g., bullseye, el9)

ARCH

host architecture

Target Architecture (e.g., arm64, riscv64, amd64)

ERROR

none

Set to skip to continue building repos despite package failures

Package Initialization Tool

Initialize a new package:

./common/init_pkg.sh -n <PKG_NAME>

Makefile Helper Variables

The following Makefile variables can be leverage for source recovery & preparation:

Variable

Description

$(WGS)

Helper command for source recovery. Wrapper for wget_sum.sh with manifest and cache paths option already set.

$(GS)

Helper command for git-based source recovery. Wrapper for git_sum.sh with manifest and cache paths option already set.

$(SOURCE_DIR)

Base directory where source files must be put. Works in conjuction with $(SOURCE_TAR_CMD)

$(SOURCE_TAR_CMD)

Helper to generate the source archive from the content in $(SOURCE_DIR)

Source Recovery Helpers Arguments

The source recovery helpers ($(WGS) and $(GS)) expose the following arguments to users:

Argument

Required

Description

-u <url>

Yes

URL of the source to download

-o <outfile>

Yes

Path to output file

-O <outfile>

Yes

Path to output file (alternative to -o, only create archive in <cache directory>)

-t <tag>

No

Git tag to check out (for GS only)

-r <revision>

No

Git revision (commit hash) to check out (for GS only)

-s

No

Initialize and update Git submodules (for GS only)

Examples

Basic HTTP Recovery:

$(SOURCE_ARCHIVE): $(CACHE) Makefile MANIFEST | $(SOURCE_DIR)
    @$(WGS) -u $(URL_SRC) -o $(BUILD_DIR)/$(NAME)-$(VERSION).tar.gz

Basic Git Recovery:

$(SOURCE_ARCHIVE): $(CACHE) Makefile MANIFEST | $(SOURCE_DIR)
    @$(GS) -u $(URL_GIT) -t "v$(VERSION)" -o $(BUILD_DIR)/$(NAME)-$(VERSION).tar.gz

Recovery + Clean-up (upstream debian/ dir removal):

$(SOURCE_ARCHIVE): $(CACHE) Makefile MANIFEST | $(SOURCE_DIR)
    @$(WGS) -u $(URL_SRC) -O $(NAME)-$(VERSION).tar.gz
    @tar -vxf $(CACHE_DIR)/$(NAME)-$(VERSION).tar.gz -C $(SOURCE_DIR) --strip-components=1
    @rm -rf -- $(SOURCE_DIR)/debian
    @$(SOURCE_TAR_CMD)

Pakste Common Commands

In a package directory:

# Build a DEB package in a chroot for Debian Trixie & arm64
make deb_chroot DIST=trixie ARCH=arm64

# Build an RPM package in a chroot for RHEL 9
make rpm_chroot DIST=el9

At the root of the repository:

# Build a complete DEB repository with parallel jobs
make deb_repo -j4 DIST=bullseye

# Build a complete RPM repository, continuing on errors
make rpm_repo DIST=el9 ERROR=skip
# Build every deb targets
make deb_all_repos -j4

# Build every rpm targets
make rpm_all_repos -j4
# Build everything
make -j4
# Clean but keep downloaded sources
make clean KEEP_CACHE=true

Internal Scripts

Version comparator utility:

# help
./common/buildenv/compare_version.sh -h
# example
./common/buildenv/compare_version.sh -v 1.0 -o '>' -V 0.9

Distribution metadata recovery utility:

# help
./common/buildenv/get_dist.sh -h
# example
./common/buildenv/get_dist.sh ubu22.04

Git Source Recovery & Manifest tool:

# help
./common/buildenv/git_sum.sh -h
# example
./common/buildenv/git_sum.sh -m ./MANIFEST \
    -C "./cache/" \
    -u https://github.com/Spotifyd/spotifyd/ \
    -t v0.4.0 \
    -o ./spotifyd_0.4.0.orig.tar.gz \
    -c # update Manifest

Wget based source recovery & manifest generation utility:

# help
./common/buildenv/wget_sum.sh -h
# example
./common/buildenv/wget_sum.sh -m ./MANIFEST \
    -C "./cache/" \
    -u https://github.com/Spotifyd/spotifyd/archive/refs/tags/v0.4.1.tar.gz \
    -o ./spotifyd_0.4.1.orig.tar.gz \
    -c # update manifest

Tool to check a given distribution against an ignore expression:

# help
./common/buildenv/skip_flag.sh -h
# example:
./common/buildenv/skip_flag.sh -i '=:el:6 <:deb:8' -d deb -v 7