- Migrate from legacy shell-based build system to modern Python tooling - Update all metadata.yaml files to new schema with per-distro builds - Standardise build scripts with curl -L, envsubst, and error handling - Convert nfpm.yaml templates to use environment variable substitution - Update Dockerfile to accept all package metadata as build arguments - Modernise Makefile to use new Python build tool commands - Update CI workflow to use tools/build instead of make
50 lines
1.4 KiB
Makefile
50 lines
1.4 KiB
Makefile
# Variables
|
|
ROOT_DIR := $(PWD)
|
|
BUILD_TOOL := $(ROOT_DIR)/tools/build
|
|
DISTRO ?= almalinux/el9
|
|
|
|
# Automatically find all packages with metadata.yaml
|
|
PACKAGES := $(shell find $(ROOT_DIR)/rpms -mindepth 1 -maxdepth 1 -type d -exec test -f {}/metadata.yaml \; -print | xargs -n1 basename | sort)
|
|
|
|
# Default target to build all packages
|
|
.PHONY: all list build clean
|
|
all: build-all
|
|
|
|
# List all available packages
|
|
list:
|
|
@echo "Available packages:"
|
|
@for package in $(PACKAGES); do \
|
|
echo " $$package"; \
|
|
done
|
|
|
|
# Build all packages using Python tool
|
|
build-all:
|
|
@echo "Building all packages using Python tooling for distro $(DISTRO)..."
|
|
$(BUILD_TOOL) build-all --distro $(DISTRO)
|
|
|
|
# Build specific package using Python tool
|
|
.PHONY: $(PACKAGES)
|
|
$(PACKAGES):
|
|
@echo "Building package: $@ for distro $(DISTRO)"
|
|
$(BUILD_TOOL) build --distro $(DISTRO) $@
|
|
|
|
# Dry run - show what would be built without building
|
|
dry-run:
|
|
@echo "Dry run - showing what would be built for distro $(DISTRO):"
|
|
$(BUILD_TOOL) build-all --distro $(DISTRO) --dry-run
|
|
|
|
# Clean target
|
|
clean:
|
|
@echo "Cleaning build artifacts..."
|
|
rm -rf $(ROOT_DIR)/dist
|
|
|
|
# Update packages from GitHub releases
|
|
update:
|
|
@echo "Checking for package updates from GitHub releases..."
|
|
$(ROOT_DIR)/tools/update-gh --all
|
|
|
|
# Update specific package from GitHub
|
|
update-%:
|
|
@echo "Checking for updates for package: $*"
|
|
$(ROOT_DIR)/tools/update-gh --package $*
|