2026-06-28 00:10:15 +01:00
|
|
|
# Makefile for the postit Debian package.
|
|
|
|
|
#
|
|
|
|
|
# Targets:
|
|
|
|
|
# make deb : build a .deb in the parent directory (or
|
|
|
|
|
# $POSTIT_OUT_DIR if set). Equivalent to
|
|
|
|
|
# dpkg-buildpackage -us -uc -b.
|
|
|
|
|
# make clean : rm -rf build/ and the per-package staging tree
|
|
|
|
|
# under debian/postit.
|
|
|
|
|
# make source : fetch the upstream yavsc source tree under
|
|
|
|
|
# build/yavsc-src (no packaging step). Useful for
|
|
|
|
|
# debugging the publish step.
|
|
|
|
|
#
|
|
|
|
|
# Environment overrides (or pass on the make command line):
|
2026-06-28 00:51:14 +01:00
|
|
|
# POSTIT_GIT_URL default: https://github.com/pazof/yavsc.git
|
|
|
|
|
# POSTIT_GIT_TAG default: 1.0.0
|
|
|
|
|
# POSTIT_RUNTIME default: linux-x64 (override to linux-arm64 etc.)
|
|
|
|
|
# POSTIT_OUT_DIR default: $(CURDIR)/.. (artifacts land here)
|
2026-06-28 00:10:15 +01:00
|
|
|
|
|
|
|
|
POSTIT_GIT_URL ?= https://github.com/pazof/yavsc.git
|
|
|
|
|
POSTIT_GIT_TAG ?= 1.0.0
|
2026-06-28 00:51:14 +01:00
|
|
|
POSTIT_RUNTIME ?= linux-x64
|
2026-06-28 00:10:15 +01:00
|
|
|
POSTIT_OUT_DIR ?= $(CURDIR)/..
|
|
|
|
|
|
|
|
|
|
.PHONY: deb clean source
|
|
|
|
|
|
|
|
|
|
deb:
|
2026-06-28 13:20:17 +01:00
|
|
|
@echo " POSTIT_GIT_TAG=$(POSTIT_GIT_TAG) POSTIT_RUNTIME=$(POSTIT_RUNTIME) POSTIT_GIT_URL=$(POSTIT_GIT_URL)"
|
|
|
|
|
# Render debian/changelog from debian/changelog.in so the package
|
|
|
|
|
# version follows the upstream tag, not the version pinned in the
|
|
|
|
|
# repo. dpkg-buildpackage reads debian/changelog before any rule
|
|
|
|
|
# runs (in dpkg-source --before-build), so the template must be
|
|
|
|
|
# expanded in the Makefile, not in debian/rules. Without this
|
|
|
|
|
# step the .deb always comes out as the version hardcoded in
|
|
|
|
|
# debian/changelog.in, regardless of POSTIT_GIT_TAG.
|
|
|
|
|
sed 's/@VERSION@/$(POSTIT_GIT_TAG)/g' debian/changelog.in > debian/changelog
|
2026-06-28 00:51:14 +01:00
|
|
|
POSTIT_GIT_URL=$(POSTIT_GIT_URL) POSTIT_GIT_TAG=$(POSTIT_GIT_TAG) POSTIT_RUNTIME=$(POSTIT_RUNTIME) \
|
2026-06-28 00:10:15 +01:00
|
|
|
dpkg-buildpackage -us -uc -b
|
2026-06-28 13:20:17 +01:00
|
|
|
# Move the produced .deb(s) into $POSTIT_OUT_DIR. The version
|
|
|
|
|
# segment we match against is the rendered changelog version
|
|
|
|
|
# (e.g. 1.0.1-rc01-1), not the bare tag.
|
|
|
|
|
mv ../postit_*$(POSTIT_GIT_TAG)-1*.deb $(POSTIT_OUT_DIR)/ 2>/dev/null || \
|
2026-06-28 00:10:15 +01:00
|
|
|
mv ../postit_*.deb $(POSTIT_OUT_DIR)/ || true
|
2026-06-28 13:20:17 +01:00
|
|
|
@echo " ✓ artifacts moved to $(POSTIT_OUT_DIR)"
|
2026-06-28 00:10:15 +01:00
|
|
|
|
|
|
|
|
clean:
|
|
|
|
|
rm -rf build debian/postit
|
|
|
|
|
|
|
|
|
|
source:
|
|
|
|
|
mkdir -p build
|
|
|
|
|
git clone --depth=1 --branch $(POSTIT_GIT_TAG) \
|
|
|
|
|
$(POSTIT_GIT_URL) build/yavsc-src
|