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) <noreply@anthropic.com>
This commit is contained in:
parent
8d8a03b20a
commit
ab07a7f93f
1 changed files with 10 additions and 4 deletions
14
Makefile
14
Makefile
|
|
@ -29,24 +29,30 @@ build-all: $(DIST)
|
||||||
./cmd/favoritter; \
|
./cmd/favoritter; \
|
||||||
done
|
done
|
||||||
|
|
||||||
## Build .deb packages (requires nfpm)
|
## Build .deb packages (requires nfpm and envsubst)
|
||||||
deb: build-all
|
deb: build-all
|
||||||
@for platform in $(PLATFORMS); do \
|
@for platform in $(PLATFORMS); do \
|
||||||
arch=$${platform##*/}; \
|
arch=$${platform##*/}; \
|
||||||
echo "Packaging deb for $$arch..."; \
|
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 \
|
--packager deb \
|
||||||
--target $(DIST)/favoritter_$(VERSION)_$${arch}.deb; \
|
--target $(DIST)/favoritter_$(VERSION)_$${arch}.deb; \
|
||||||
|
rm -f $(DIST)/nfpm-$$arch.yaml; \
|
||||||
done
|
done
|
||||||
|
|
||||||
## Build .rpm packages (requires nfpm)
|
## Build .rpm packages (requires nfpm and envsubst)
|
||||||
rpm: build-all
|
rpm: build-all
|
||||||
@for platform in $(PLATFORMS); do \
|
@for platform in $(PLATFORMS); do \
|
||||||
arch=$${platform##*/}; \
|
arch=$${platform##*/}; \
|
||||||
echo "Packaging rpm for $$arch..."; \
|
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 \
|
--packager rpm \
|
||||||
--target $(DIST)/favoritter_$(VERSION)_$${arch}.rpm; \
|
--target $(DIST)/favoritter_$(VERSION)_$${arch}.rpm; \
|
||||||
|
rm -f $(DIST)/nfpm-$$arch.yaml; \
|
||||||
done
|
done
|
||||||
|
|
||||||
## Build container image
|
## Build container image
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue