From ab07a7f93fe0edd0f11d1438799089d1a3439521 Mon Sep 17 00:00:00 2001 From: Ole-Morten Duesund Date: Sun, 29 Mar 2026 19:18:14 +0200 Subject: [PATCH] fix: use envsubst for nfpm variable expansion in Makefile nfpm v2 does not expand ${VAR} in contents.src fields. The deb/rpm targets now pipe nfpm.yaml through envsubst to resolve ARCH and VERSION before passing the config to nfpm. Co-Authored-By: Claude Opus 4.6 (1M context) --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 2c64c94..fb02f84 100644 --- a/Makefile +++ b/Makefile @@ -29,24 +29,30 @@ build-all: $(DIST) ./cmd/favoritter; \ done -## Build .deb packages (requires nfpm) +## Build .deb packages (requires nfpm and envsubst) deb: build-all @for platform in $(PLATFORMS); do \ arch=$${platform##*/}; \ echo "Packaging deb for $$arch..."; \ - ARCH=$$arch VERSION=$(VERSION) nfpm package \ + ARCH=$$arch VERSION=$(VERSION) envsubst < nfpm.yaml > $(DIST)/nfpm-$$arch.yaml; \ + nfpm package \ + --config $(DIST)/nfpm-$$arch.yaml \ --packager deb \ --target $(DIST)/favoritter_$(VERSION)_$${arch}.deb; \ + rm -f $(DIST)/nfpm-$$arch.yaml; \ done -## Build .rpm packages (requires nfpm) +## Build .rpm packages (requires nfpm and envsubst) rpm: build-all @for platform in $(PLATFORMS); do \ arch=$${platform##*/}; \ echo "Packaging rpm for $$arch..."; \ - ARCH=$$arch VERSION=$(VERSION) nfpm package \ + ARCH=$$arch VERSION=$(VERSION) envsubst < nfpm.yaml > $(DIST)/nfpm-$$arch.yaml; \ + nfpm package \ + --config $(DIST)/nfpm-$$arch.yaml \ --packager rpm \ --target $(DIST)/favoritter_$(VERSION)_$${arch}.rpm; \ + rm -f $(DIST)/nfpm-$$arch.yaml; \ done ## Build container image